main=interact$h.map f.lines;f x=show$g 0 0 x;g 0 n[]=n;g 0 n(x:xs)|x=='|'=g 0(n+1)xs|0<1=g 1 n xs;g 1 n[]=n;g 1 n(x:xs)|x=='|'=g 0(n+1)xs|0<1=n;h x=x>>=(++" ")