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 <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int t[6];
int p,q,all;
int b[6];
int d[6];
bool flag,flag2;
char res[30001];
char now[30001];
char str[4]={'E','N','S','W'};

bool check(){
	if(d[0]<0 || d[1]<0 || d[2]<0 || d[3]<0 || d[4]<0 || d[5]<0)return false;
	if(d[0]+d[3]>d[1]+d[2]+d[4]+d[5])return false;
	if(d[1]+d[4]>d[0]+d[2]+d[3]+d[5]+1)return false;
	if(d[2]+d[5]>d[0]+d[1]+d[3]+d[4]+1)return false;
	return true;
}


void roll(int v){
	if(v==0){
		int sw=d[0];
		d[0]=d[2];
		d[2]=d[3];
		d[3]=d[5];
		d[5]=sw;
	}
	if(v==2){
		int sw=d[0];
		d[0]=d[1];
		d[1]=d[3];
		d[3]=d[4];
		d[4]=sw;
	}
	if(v==1){
		int sw=d[0];
		d[0]=d[4];
		d[4]=d[3];
		d[3]=d[1];
		d[1]=sw;
	}
	if(v==3){
		int sw=d[0];
		d[0]=d[5];
		d[5]=d[3];
		d[3]=d[2];
		d[2]=sw;
	}
}

void dfs(int rest,int power){
	if(flag2)return;
	if(rest==0){
		flag2=true;
		flag=true;
		for(int i=0;i<all;i++)res[i]=now[i];
	}
	for(int i=0;i<4;i++){
		roll(i);
		d[3]--;
		if(check()){
			now[all-rest]=str[i];
			if(power==0){
				if(str[i]==res[all-rest])dfs(rest-1,0);
				if(str[i]<res[all-rest])dfs(rest-1,1);
			}
			else dfs(rest-1,1);
		}
		d[3]++;
		if(i==0)roll(3);
		if(i==3)roll(0);
		if(i==1)roll(2);
		if(i==2)roll(1);
	}
}

int main(void){
	for(int i=0;i<6;i++)b[i]=i;
	while(1){
		all=0;
		for(int i=0;i<6;i++){
			scanf("%d",&t[i]);
			all+=t[i];
		}
		if(all==0)break;
		flag=false;
		scanf("%d %d",&p,&q);
		do{
			for(int i=0;i<6;i++){
				d[i]=t[b[i]];
			}
			if(check()){
				flag2=false;
				if(!flag)dfs(all,1);
				else dfs(all,0);
			}
		}while(next_permutation(b,b+6));
		if(!flag)printf("impossible\n");
		else{
			for(int i=p-1;i<q;i++){
				printf("%c",res[i]);
			}
			printf("\n");
		}
	}
	return 0;
}