G='#' for s in open(0):T,G=s<'0'and(T,G+[s.translate([' '*len(x),0,'',x]*9)for x in T])or(G,[]) G+=map(print,T)