n=input().split(";")
initial=[0,0]
for i in n:
        try:
            e = eval(i[1:])
            if i[0] in ["A","W","S","D"]:
                if 0 <= e <= 99:
                    if i[0] == "A":
                        initial[0] -= e
                    if i[0] == "W":
                        initial[1] += e
                    if i[0] == "S":
                        initial[1] -= e
                    if i[0] == "D":
                        initial[0] += e
                else:
                    continue
            else:
                continue
        except:
            continue
print(str(initial[0])+","+str(initial[1]))