const mult:array[0..7,0..1] of real=((0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1),(-1,0),(-1,1));
var s:string;
    i,j,dir:integer;
    xs,posx,posy:real;
begin
  xs:=sqrt(2)/2;
  readln(s);
  while s<>'END' do
  begin
    posx:=0;posy:=0;
    i:=1;
    if s[1]<>'.' then
    repeat
    j:=0;
    while s[i] in ['0'..'9'] do
    begin
      j:=10*j+ord(s[i])-48;
      inc(i);
    end;
    case s[i] of
      'N': case s[i+1] of
             'E':dir:=1;
             'W':dir:=7;
             else dir:=0;
           end;
      'E': dir:=2;
      'S': case s[i+1] of
             'E':dir:=3;
             'W':dir:=5;
             else dir:=4;
           end;
      'W': dir:=6;
    end;
    if (mult[dir,0]=0) or (mult[dir,1]=0) then
    begin
      posx:=posx+j*mult[dir,0];
      posy:=posy+j*mult[dir,1];
    end else
    begin
      posx:=posx+xs*j*mult[dir,0];
      posy:=posy+xs*j*mult[dir,1];
    end;
    i:=i+2;
    if dir in [3,5,1,7] then inc(i);
    until s[i-1]='.';
    write('You can go to (',posx:0:3,',',posy:0:3,'), the distance is ',sqrt(posx*posx+posy*posy):0:3,' steps.');
    write(#10);
    readln(s);
  end;
end.
