import java.util.*;
import java.util.regex.*;
public class Main {
public static void main(String[] args)
{
Scanner sr = new Scanner(System.in);
while(sr.hasNext())
{
int x = 0;//横坐标
int y = 0;//纵坐标
String str=sr.nextLine();
String[] ch_str=str.split(";");
String reg="[WASDwasd]\\d{1,2}";
for (String s:ch_str )
{
if (Pattern.matches(reg,s))
{
String str1=s.replaceAll("[WDwd]","+").replaceAll("[ASas]","-");
if (Pattern.matches("[ADad]\\d{1,2}",s))
{
x+=Integer.parseInt(str1);
}
else
y+=Integer.parseInt(str1);
}
}
System.out.println(x+","+y);
}
sr.close();
}
}