#include<bits/stdc++.h>
using namespace std;
const int E=1e-3;
double n,m;
int main(){
cin>>n>>m;
string opt;
double nb=round(n*10)/100,mb=round(m/60*10)/10;
if(nb>=11.25&&nb<33.75){
opt="NNE";
}else if(nb>=33.75&&nb<56.25){
opt="NE";
}else if(nb>=56.25&&nb<78.75){
opt="ENE";
}else if(nb>=78.75&&nb<101.25){
opt="E";
}else if(nb>=101.25&&nb<123.75){
opt="ESE";
}else if(nb>=123.75&&nb<146.25){
opt="SE";
}else if(nb>=146.25&&nb<168.75){
opt="SSE";
}else if(nb>=168.75&&nb<191.25){
opt="S";
}else if(nb>=191.25&&nb<213.25){
opt="SSW";
}else if(nb>=213.25&&nb<236.25){
opt="SW";
}else if(nb>=236.25&&nb<258.75){
opt="WSW";
}else if(nb>=258.75&&nb<281.25){
opt="W";
}else if(nb>=281.25&&nb<303.75){
opt="WNW";
}else if(nb>=303.75&&nb<326.25){
opt="NW";
}else if(nb>=326.25&&nb<348.75){
opt="NNW";
}else{
opt="N";
}
int fl;
if(mb<=0.2+E){
fl=0;
}else if(mb>=0.3-E&&mb<=1.5+E){
fl=1;
}else if(mb>=1.6-E&&mb<=3.3+E){
fl=2;
}else if(mb>=3.4-E&&mb<=5.4+E){
fl=3;
}else if(mb>=5.5-E&&mb<=7.9+E){
fl=4;
}else if(mb>=8-E&&mb<=10.7+E){
fl=5;
}else if(mb>=10.8-E&&mb<=13.8+E){
fl=6;
}else if(mb>=13.9-E&&mb<=17.1+E){
fl=7;
}else if(mb>=17.2-E&&mb<=20.7+E){
fl=8;
}else if(mb>=20.8-E&&mb<=24.4+E){
fl=9;
}else if(mb>=24.5-E&&mb<=28.4+E){
fl=10;
}else if(mb>=28.5-E&&mb<=32.6+E){
fl=11;
}else{
fl=12;
}
if(fl==0){
cout<<'C'<<" "<<fl;
}else{
cout<<opt<<" "<<fl;
}
cout<<endl;
return 0;
}