k=0 while""do c=io.read(1)k=(3*k+c)%7 io.write(k<1 and c.."\n"or c)end