Program Route;
var d,x,y:double;
    s:string;
    ch:char;
    cislo,code:integer;
    odm:double;
    konec,uplnykonec:boolean;
begin
  odm:=sqrt(2)/2;
  uplnykonec:=false;

repeat
  x:=0;y:=0;d:=0;konec:=false;
  repeat
    s:='';
    repeat
      read(ch);
      s:=s+ch;
      if pos('END',s)<>0 then uplnykonec:=true;
    until (ch=',')or(ch='.')or(uplnykonec);
  
    if (pos('.',s)<>0) then konec:=true;
 
    if (pos('NE',s)<>0) then 
      begin
        delete(s,pos('NE',s),3);Val(s,cislo,code);
        x:=x+cislo*odm;          
        y:=y+cislo*odm; 
      
      end;
    if (pos('SE',s)<>0) then
       begin
        delete(s,pos('SE',s),3);Val(s,cislo,code);
        x:=x+cislo*odm;
        y:=y-cislo*odm;
      end;
    if (pos('SW',s)<>0) then
     begin
        delete(s,pos('SW',s),3);Val(s,cislo,code);
        x:=x-cislo*odm;
        y:=y-cislo*odm; 
      end;
    if (pos('NW',s)<>0) then
     begin
        delete(s,pos('NW',s),3);Val(s,cislo,code);
        x:=x-cislo*odm;       
        y:=y+cislo*odm; 
      end;
    if (pos('N',s)<>0) then
     begin
        delete(s,pos('N',s),2);Val(s,cislo,code);
        y:=y+cislo;
     end;
    if (pos('S',s)<>0) then
     begin
        delete(s,pos('S',s),2);Val(s,cislo,code);
        y:=y-cislo;
     end;
    if (pos('W',s)<>0) then
     begin
        delete(s,pos('W',s),2);Val(s,cislo,code);
        x:=x-cislo; 
      end;
    if (pos('E',s)<>0) then
     begin
        delete(s,pos('E',s),2);Val(s,cislo,code);
        x:=x+cislo; 
     end;
  until (konec) or (uplnykonec); 
  d:=sqrt(sqr(x)+sqr(y));
  if x=0.0 then x:=abs(x);
  if y=0.0 then y:=abs(y);
  if not (uplnykonec) then 
    writeln('You can go to (',x:0:3,',',y:0:3,'), the distance is ',d:0:3,' steps.');

 until (uplnykonec);
end.      