s=input().split(";") x,y=0,0 for i in s: if not i: continue if 2<=len(i)<=3 and i[0] in ["A","W","D","S"] and i[1:].isdigit(): #主要要注意可能出现A1或A10这种单数字和多数字的情况 if i[0]=="A": x-=int(i[1:]) elif i[0]=="W": y+=int(i[1:]) elif i[0]== "D": x+=int(i[1:]) elif i[0]=="S": y-=int(i[1:]) print(f"{x},{y}")