while 1: a,b,_=input().split("0") if"+"in b:print("S"*(a.count("S")+b.count("S"))+"0") if"*"in b:print("S"*(a.count("S")*b.count("S"))+"0")