while 1: a=[];b=[] for e in input():[a,b][sum(a)>sum(b)]+=[e] print`a,b`.replace(' ','')