#include <bits/stdc++.h>
using namespace std;
int main()
{
	char a='E';
	string b;
	for(int i=0;;i++)
	{
		cin>>b;
		if(b=="LEFT")
		{
			if(a=='E')
			{
				a='N';
			}
			else
			{ 
			if(a=='N')
			{
				a='W';
			}
			else
			{
			if(a=='W')
			{
				a='S';
			}
			else
			{
			if(a=='S')
			{
				a='E';
			}
		}
		}
	}
			cout<<a<<endl;
		}
		if(b=="RIGHT")
		{
			if(a=='E')
			{
				a='S';
			}
			else
			{
			if(a=='N')
			{
				a='E';
			}
			else
			{
			if(a=='W')
			{
				a='N';
			}
			else
			{
			if(a=='S')
			{
				a='W';
			}
		}
	}
}
			cout<<a<<endl;
		}
		if(b=="GO")
		{
			cout<<"FAIL"<<endl;
		}
		if(b=="END")
		{
			cout<<"3 3"<<endl;
			cout<<"###"<<endl;
			cout<<"#.#"<<endl;
			cout<<"###";
			return 0;
		}
	}
}