#include <bits/stdc++.h>
#include <cctype>
#include <sstream>
using namespace std;
//11.14
int x=0,y=0;
void cal(string t)
{
if(t[0]!='A'&&t[0]!='D'&&t[0]!='W'&&t[0]!='S') return ;
if(t.length()>3) return ;
if(t.length()==2&&isdigit(t[1]))
{
int d=t[1]-'0';
if(t[0]=='A') x=x-d;
if(t[0]=='D') x=x+d;
if(t[0]=='W') y=y+d;
if(t[0]=='S') y=y-d;
}
if(t.length()==3&&isdigit(t[1])&&isdigit(t[2]))
{
int d=stoi(t.substr(1,2));
if(t[0]=='A') x=x-d;
if(t[0]=='D') x=x+d;
if(t[0]=='W') y=y+d;
if(t[0]=='S') y=y-d;
}
}
int main() {
string s,t;
while(getline(cin,s))
{
stringstream ss(s);
while(getline(ss,t,';'))
{
if(!t.empty())
{
cal(t);
}
}
cout<<x<<','<<y<<endl;
}
}
// 64 位输出请用 printf("%lld")