_=raw_input for(e)in list(iter(_,'')):print''.join(' O'[_]for(_)in map(cmp,e,_()))