comd = input().split(';')
x,y = (0,0)
for c in comd:
if 1 < len(c) < 4 and c[0] in ['W','A','S','D'] and c[1:].isdigit() and 0 < int(c[1:]) < 100:
if c[0] == 'W':
y += int(c[1:])
elif c[0] == 'S':
y -= int(c[1:])
elif c[0] == 'A':
x -= int(c[1:])
elif c[0] == 'D':
x += int(c[1:])
print(x,y,sep=',')

京公网安备 11010502036488号