((rec,c(let*((s(read-line))(p(string-scan s c))(c(if p(ref s(- 1 p))c)))(print c),c))#\1)