data = input().split(';')
e_command=[]
for command in data:
    length = len(command)
    if length == 3 or length == 2:        
        if command[0] in ['A','W','S','D'] and command[1:length].isdigit():
            e_command.append(command)

x,y = 0,0
for i in e_command:
    if i[0] == 'A':
        x += -int(i[1:len(i)])
    if i[0] == 'D':
        x +=  int(i[1:len(i)])
    if i[0] == 'S':
        y += -int(i[1:len(i)])
    if i[0] == 'W':
        y +=  int(i[1:len(i)])

print('%d,%d'%(x,y))