import os a=[] for c in os.read(0,130):a+=[c]*(c in'([{');os.write(1,c*(c!='?')or')}]'[hash(a.pop())%3])