#include "testlib.h"

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
char lab[7][8]={
".......",
"****.**",
"...*...",
".***.**",
".....*.",
"...***.",
"......."};

int main(int argc, char *argv[]) {
  registerTestlibCmd(argc, argv);
  int n = inf.readInteger();
  string s=ouf.readLine();
  if(n==0)
  { if(s!="OK")
      quitf(_pe, "Presentation error");
    quitf(_ok, "OK");
  }
  if(s=="-")
    quitf(_wa, "Skip program");
  int r=inf.readInteger();
  int c=inf.readInteger();
  int dr=inf.readInteger();
  int dc=inf.readInteger();
  int p=0;
  if(s.size()>1000)
    quitf(_wa, "Too long program");
  while(p<s.size())
  { char ch=s[p];
    if(ch=='N')
    { if(r>1 && lab[(r-1)*2-1][(c-1)*2]=='.') --r;
    }
    else if(ch=='S')
    { if(r<4 && lab[(r-1)*2+1][(c-1)*2]=='.') ++r;
    }
    else if(ch=='W')
    { if(c>1 && lab[(r-1)*2][(c-1)*2-1]=='.') --c;
    }
    else if(ch=='E')
    { if(c<4 && lab[(r-1)*2][(c-1)*2+1]=='.') ++c;
    }
    ++p;
  }
  if(r!=dr || c!=dc)
    quitf(_wa, "Wrong program dest=%d %d",r,c);
  if(n==1)
  {
    if(s.size()>6)
      quitf(_wa, "Not minimal program");
  }    
  quitf(_ok, "OK");
  return 0;
}
