main=interact$concat.r.("ip6.arpa.":).t.f r=reverse t=take 8 f=g.span(/=':') g(x,y)=t(r("0000"++x)>>=(:".")):f(drop 1y)