program vzdalenost(input,output);
var i,cislo:integer;
    x,y,od,dis:real;
    s:string[250];
begin
  od:=sqrt(0.5);
  readln(s);
  while s<>'END' do begin
    x:=0; y:=0;
    i:=1;
    while s[i]<>'.' do begin
      cislo:=0;
      while (ord(s[i])>=ord('0')) and (ord(s[i])<=ord('9')) do begin
        cislo:=cislo*10+(ord(s[i])-ord('0'));
        inc(i);
      end;
      if (s[i+1]=',') or (s[i+1]='.') then begin
        if copy(s,i,1)='N' then y:=y+cislo;
        if copy(s,i,1)='S' then y:=y-cislo;
        if copy(s,i,1)='E' then x:=x+cislo;
        if copy(s,i,1)='W' then x:=x-cislo;
        inc(i);
      end else begin
        if copy(s,i,2)='NE' then begin y:=y+od*cislo;x:=x+od*cislo;end;
        if copy(s,i,2)='SE' then begin y:=y-od*cislo;x:=x+od*cislo;end;
        if copy(s,i,2)='SW' then begin y:=y-od*cislo;x:=x-od*cislo;end;
        if copy(s,i,2)='NW' then begin y:=y+od*cislo;x:=x-od*cislo;end;
        inc(i);inc(i);
      end;
      if s[i]=',' then inc(i);
    end;
    dis:=sqrt((x*x)+(y*y));
    if abs(x)<0.001 then x:=0;
    if abs(y)<0.001 then y:=0;
    writeln('You can go to (',x:0:3,',',y:0:3,'), the distance is ',dis:0:3,' steps.');
    readln(s);
  end;  
end.
