var
x,y,direction:integer;
c:char;
procedure goStraight();
begin
case direction of
0:inc(y);
1:inc(x);
2:dec(y);
3:dec(x);
end;
end;
procedure turnLeft();
begin
dec(direction);
if direction=-1 then direction:=3;
goStraight();
end;
procedure turnRight();
begin
inc(direction);
if(direction)=4 then direction:=0;
goStraight();
end;
procedure stop();
begin
case direction of
0:writeln('(',x,',',y,'), N');
1:writeln('(',x,',',y,'), E');
2:writeln('(',x,',',y,'), S');
3:writeln('(',x,',',y,'), W');
end;
end;
procedure walk(order:char);
begin
case order of
'G','g':goStraight();
'L','l':turnLeft();
'R','r':turnRight();
'S','s':stop();
end;
end;
begin
repeat
read(c);
walk(c);
until (c='S') or (c='s');
end.