#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
                     
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
const ll mod = 1e9+7;
 
int main(){
	fast;
	int t=1, g =1;
    // freopen("input.txt","r",stdin);
    // freopen("ouput.txt","w",stdout);
	cin>>t;
	while(t--){
        string s;
		ll x,y;
		cin>>x>>y;
        ll xx = abs(x), yy = abs(y);
        int f = 0;
        
        for(ll i=0;f==0 && (1ll<<i)<=xx || (1ll<<i)<=yy;++i){
                // cout<<"in"<<endl;
            ll one = (1ll<<i);
            if (((one & xx) && (one & yy)) || (!(one & xx) && !(one & yy))){
                s = "IMPOSSIBLE";f = 1;break;
                // cout<<"XXXXX";
            }

            bool min = 0, plus = 0;
            for(ll j = i+1;(1ll<<j)<=xx || (1ll<<j)<=yy;++j){
                ll oo = (1ll<<j);
                if (!(oo & xx) && !(oo & yy))
                    continue;
                
                else if ((oo & xx) && (oo & yy)){
                    plus = 1;
                    break;
                }
                else{
                    min = 1;break;
                }
            }
            if(!(one & xx) && (one & yy)){
                if(plus) {yy += one, s+="S";
                // cout<<"plus y "<<i<<" "<<xx<<" "<<yy<<endl;
                }
                else {yy -= one, s+="N";
                // cout<<"min y "<<i<<" "<<xx<<" "<<yy<<endl;
                }
            }
            else if((one & xx) && !(one & yy)){
                if(plus) {xx += one, s+="W";
                // cout<<"plus x "<<i<<" "<<xx<<" "<<yy<<endl;
                }
                else {xx-=one, s+= "E";
                // cout<<"min x "<<i<<" "<<xx<<" "<<yy<<endl;
                }
            }
            // }
        }
        
		cout<<"Case #"<<(g++)<<": ";
        if(s=="IMPOSSIBLE") {cout<<s<<endl;continue;}
        // cout<<"orig: "<<s<<endl;
        for(int i=0;i<s.size();++i){
            if(s[i]=='S' || s[i]=='N'){
                char c;
                if(y<0) c = (s[i]=='N'?'S':'N');
                else c = s[i];
                cout<<c;
            }
            else if(s[i]=='E' || s[i]=='W'){
                char c;
                if(x<0) c = (s[i]=='W'?'E':'W');
                else c = s[i];
                cout<<c;
            }
            
        }
        cout<<endl;
		
	}

	return 0;
}
