packageStringSS;importjava.util.Arrays;importjava.util.List;importjava.util.Scanner;/**
* 待提交
*/publicclassCar1898{publicstaticvoidmain(String[] args){Scanner cin =newScanner(System.in);String commands = cin.nextLine();
cin.close();// 方法String res =execCommand(commands);System.out.println(res);}publicstaticStringexecCommand(String commands){int x =0;int y =0;String[] direct =newString[]{"N","E","S","W"};List<String> list =Arrays.asList(direct);int cur =0;for(int i =0; i < commands.length(); i++){Character command = commands.charAt(i);switch(command){case'G':int[] dir =dir(list.get(cur), x, y);
x = dir[0];
y = dir[1];break;case'L':if(cur !=0){
cur = cur -1;}else{
cur =3;}break;case'R':if(cur !=3){
cur = cur +1;}else{
cur =0;}break;default:break;}}StringBuilder sb =newStringBuilder();
sb.append('(').append(x).append(',').append(y).append(')');return sb.toString();// return new int[]{x,y};}publicstaticint[]dir(String d,int x,int y){// 按G计算switch(d){case"N":
y++;break;case"E":
x++;break;case"S":
y--;break;case"W":
x--;break;default:break;}int[] pos ={x, y};return pos;}}