Problem: A Die Maker

The work of die makers starts early in the morning.

You are a die maker. You receive orders from customers, and make various kinds of dice every day. Today, you received an order of a cubic die with six numbers t1, t2, ..., t6 on whichever faces.

For making the ordered die, you use a tool of flat-board shape. You initially have a die with a zero on each face. If you rotate the die by 90 degrees on the tool towards one of northward, southward, eastward, and southward, the number on the face that newly touches the tool is increased by one. By rotating the die towards appropriate directions repeatedly, you may obtain the ordered die.

The final numbers on the faces of the die is determined by the sequence of directions towards which you rotate the die. We call the string that represents the sequence of directions an operation sequence. Formally, we define operation sequences as follows. An operation sequence consists of n characters, where n is the number of rotations made. If you rotate the die eastward in the i-th rotation, the i-th character of the operation sequence is `E`. Similarly, if you rotate it westward, it is `W`, if southward, it is `S`, otherwise, if northward, it is `N`. For example, the operation sequence `NWS` represents the sequence of three rotations, northward first, westward next, and finally southward.

Given six integers of the customer's order, compute an operation sequence that makes a die to order. If there are two or more possibilities, you should compute the earliest operation sequence in dictionary order.

Input

The input consists of multiple datasets. The number of datasets does not exceed 40. Each dataset has the following form.

> t1 t2 t3 t4 t5 t6
>  p q

t1, t2, ..., t6 are integers that represent the order from the customer. Further, p and q are positive integers that specify the output range of the operation sequence (see the details below).

Each dataset satisfies 0 ≤ t1 ≤ t2 ≤ ... ≤ t6 ≤ 5,000 and 1 ≤ p ≤ q ≤ t1+t2+...+t6. A line containing six zeros denotes the end of the input.

Output

For each dataset, print the subsequence, from the p-th position to the q-th position, inclusively, of the operation sequence that is the earliest in dictionary order. If it is impossible to make the ordered die, print `impossible`.

Here, dictionary order is recursively defined as follows. The empty string comes the first in dictionary order. For two nonempty strings x = x1 ... xk and y = y1 ... yl, the string x precedes the string y in dictionary order if

* x1 precedes y1 in alphabetical order ('A' to 'Z'), or
* x1 and y1 are the same character and x2 ... xk precedes y2 ... yl in dictionary order.



Sample Input


1 1 1 1 1 1
1 6
1 1 1 1 1 1
4 5
0 0 0 0 0 2
1 2
0 0 2 2 2 4
5 9
1 2 3 4 5 6
15 16
0 1 2 3 5 9
13 16
2 13 22 27 31 91
100 170
0 0 0 0 0 0


Output for the Sample Input


EEENEE
NE
impossible
NSSNW
EN
EWNS
SNSNSNSNSNSNSNSNSNSNSNSSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNWEWE






Example

Input

1 1 1 1 1 1
1 6
1 1 1 1 1 1
4 5
0 0 0 0 0 2
1 2
0 0 2 2 2 4
5 9
1 2 3 4 5 6
15 16
0 1 2 3 5 9
13 16
2 13 22 27 31 91
100 170
0 0 0 0 0 0


Output

EEENEE
NE
impossible
NSSNW
EN
EWNS
SNSNSNSNSNSNSNSNSNSNSNSSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNWEWE

Solution (in CPP):

Solution:
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

struct dice{
    int f,b,u,d,l,r;
    dice(vector<int>& v){
        f = v[0];
        b = v[1];
        u = v[2];
        d = v[3];
        l = v[4];
        r = v[5];
    }
    void turn_east(){
        int tmp = f ; 
        f = l;
        l = b;
        b = r;
        r = tmp;
    }
    void turn_west(){
        int tmp = f ; 
        f = r;
        r = b;
        b = l;
        l = tmp;
    }
    void turn_north(){
        int tmp = f ; 
        f = d;
        d = b;
        b = u;
        u = tmp;
    }
    void turn_south(){
        int tmp = f ; 
        f = u;
        u = b;
        b = d;
        d = tmp;
    }
    
};
bool check(dice di){
    if(di.b+di.f>di.r+di.l+di.u+di.d)return false;
    if(di.l+di.r>di.b+di.f+di.u+di.d+1)return false;
    if(di.u+di.d>di.r+di.l+di.b+di.f+1)return false;
    int nxt=0;
    if(di.l+di.r==di.b+di.f+di.u+di.d+1)nxt|=1;
    if(di.u+di.d==di.r+di.l+di.b+di.f+1)nxt|=2;
    if(nxt==3)return false;
    return true;
}
void calc(dice& di,string& ans){
    di.b -= 1;
    if(di.l+di.r+di.f+di.b+di.u+di.d==0)return;
    int nxt=0;
    if(di.l+di.r==di.b+di.f+di.u+di.d+1)nxt|=1;
    if(di.u+di.d==di.r+di.l+di.b+di.f+1)nxt|=2;
    assert(nxt!=3);
    if(nxt==2){
        if(di.u>0){
            di.turn_north();
            ans+='N';calc(di,ans);
        }
        else {
            di.turn_south();
            ans += 'S';calc(di,ans);
        }
    }
    else if(nxt==1){
        if(di.r>0){
            di.turn_east();
            ans+='E';calc(di,ans);
        }
        else {
            di.turn_west();
            ans+='W';calc(di,ans);
        }
    }
    else {
        if(di.r>0){
            di.turn_east();
            ans+='E';calc(di,ans);
        }
        else if(di.u>0){
            di.turn_north();
            ans+='N';calc(di,ans);
        }
        else if(di.d>0){
            di.turn_south();
            ans += 'S';calc(di,ans);
        }
        else {
            di.turn_west();
            ans+='W';calc(di,ans);
        }
    }
}
void solve(vector<int>& v){
    int p, q;
    cin>>p>>q;
    --p;
    
    string ans="Z";
    do{
        dice di(v);
        if(!check(di))continue;
        string ret="";
        di.b+=1;
        calc(di,ret);
        ans = min(ans,ret);
    }while(next_permutation(v.begin(), v.end()));
    if(ans=="Z")cout<<"impossible"<<endl;
    else cout<<ans.substr(p,q-p)<<endl;
}



int main(){
    vector<int> v(6);
    while(1){
        rep(i,6)cin>>v[i];
        sort(v.begin(),v.end());
        if(v[5]==0)break;
        solve(v);
    }
    return 0;
}