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 "bits/stdc++.h"

using namespace std;

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(x) x.begin(),x.end()
const bool DEBUG = false;


/*-------- begin cut here --------*/
int tmp[6];
const char pos[6] = { 'B','T','U','D','L','R' };
struct Dice {
	int val[6]; //B,T,U,D,L,R
	int id[6]; //ラベル A0,A1,C1,C0,B1,B0がどの方向にあるか
	int rev[6];//位置iについてるラベルが何か
	char cmd;

    //6面全部0で初期化
	Dice() {
		REP(i, 6) {
			val[i] = 0;
			id[i] = i;
			rev[i] = i;
		}
	}
	void east() {//542301
		val[5]++;
		REP(i, 6)tmp[i] = val[i];
		val[0] = tmp[5];
		val[1] = tmp[4];
		val[2] = tmp[2];
		val[3] = tmp[3];
		val[4] = tmp[0];
		val[5] = tmp[1];
		REP(i, 6) {
			tmp[i] = id[i];
		}
		id[rev[0]] = tmp[rev[4]];
		id[rev[1]] = tmp[rev[5]];
		id[rev[2]] = tmp[rev[2]];
		id[rev[3]] = tmp[rev[3]];
		id[rev[4]] = tmp[rev[1]];
		id[rev[5]] = tmp[rev[0]];

		REP(i, 6)rev[id[i]] = i;
	}
	void west() {//452310
		val[4]++;
		REP(i, 6)tmp[i] = val[i];
		val[0] = tmp[4];
		val[1] = tmp[5];
		val[2] = tmp[2];
		val[3] = tmp[3];
		val[4] = tmp[1];
		val[5] = tmp[0];
		REP(i, 6) {
			tmp[i] = id[i];
		}
		id[rev[0]] = tmp[rev[5]];
		id[rev[1]] = tmp[rev[4]];
		id[rev[2]] = tmp[rev[2]];
		id[rev[3]] = tmp[rev[3]];
		id[rev[4]] = tmp[rev[0]];
		id[rev[5]] = tmp[rev[1]];
		REP(i, 6)rev[id[i]] = i;
	}
	void north() {//231045
		val[2]++;
		REP(i, 6)tmp[i] = val[i];
		val[0] = tmp[2];
		val[1] = tmp[3];
		val[2] = tmp[1];
		val[3] = tmp[0];
		val[4] = tmp[4];
		val[5] = tmp[5];
		REP(i, 6) {
			tmp[i] = id[i];
		}
		id[rev[0]] = tmp[rev[3]];
		id[rev[1]] = tmp[rev[2]];
		id[rev[2]] = tmp[rev[0]];
		id[rev[3]] = tmp[rev[1]];
		id[rev[4]] = tmp[rev[4]];
		id[rev[5]] = tmp[rev[5]];
		REP(i, 6)rev[id[i]] = i;
	}
	void south() {//320145
		val[3]++;
		REP(i, 6)tmp[i] = val[i];
		val[0] = tmp[3];
		val[1] = tmp[2];
		val[2] = tmp[0];
		val[3] = tmp[1];
		val[4] = tmp[4];
		val[5] = tmp[5];
		REP(i, 6) {
			tmp[i] = id[i];
		}
		id[rev[0]] = tmp[rev[2]];
		id[rev[1]] = tmp[rev[3]];
		id[rev[2]] = tmp[rev[1]];
		id[rev[3]] = tmp[rev[0]];
		id[rev[4]] = tmp[rev[4]];
		id[rev[5]] = tmp[rev[5]];
		REP(i, 6)rev[id[i]] = i;
	}
	void print() {
		cout << "position:";
		REP(i, 6) {
			cout << pos[id[i]] << " ";
		}cout << endl;
		cout << "value:";
		REP(i, 6) {
			cout << val[id[i]] << " ";
		}cout << endl;
	}
};

/*-------- end cut here --------*/

/*
	verified on 2020/04/01
    
*/

int t[6];
int p, q;
string ans = "Z";

bool isGoal(const Dice &dice) {
	bool same = true;
	REP(i, 6) {
		if (t[i] != dice.val[dice.id[i]])same = false;
	}
	return same;
}


int dif[6];
bool isPossible(const Dice &dice) {
	int sum = 0;
	//既に目標を越えていたらアウト
	REP(i, 6) {
		dif[i] = t[dice.rev[i]] - dice.val[i];
		sum += dif[i];
		if (dif[i] < 0)return false;
	}
	//対面の和が側面の和+1を越えたらアウト
	if (2 * (dif[0] + dif[1])>sum)return false;
	if (2 * (dif[2] + dif[3])>sum + 1)return false;
	if (2 * (dif[4] + dif[5])>sum + 1)return false;
	return true;
}
long long cnt_nodes = 0;


void calc(Dice dice) {
	string res = "";
	cnt_nodes++;
	while (!isGoal(dice)) {
		if (!isPossible(dice))return;
		Dice d1 = dice;
		d1.east();
		d1.cmd = 'E';
		if (DEBUG) {
			cout << "EAST" << endl;
			dice.print();
			cout << "↓" << endl;
			d1.print();
		}
		if (isPossible(d1)) {
			res += d1.cmd;
			dice = d1; continue;
		}

		Dice d2 = dice;
		d2.north();
		d2.cmd = 'N';
		if (DEBUG) {
			cout << "NORTH" << endl;
			dice.print();
			cout << "↓" << endl;
			d2.print();
		}
		if (isPossible(d2)) {
			res += d2.cmd;
			dice = d2; continue;
		}

		Dice d3 = dice;
		d3.south();
		d3.cmd = 'S';
		if (DEBUG) {
			cout << "SOUTH" << endl;
			dice.print();
			cout << "↓" << endl;
			d3.print();
		}
		if (isPossible(d3)) {
			res += d3.cmd;
			dice = d3; continue;
		}

		Dice d4 = dice;
		d4.west();
		d4.cmd = 'W';
		if (DEBUG) {
			cout << "WEST" << endl;
			dice.print();
			cout << "↓" << endl;
			d4.print();
		}
		if (isPossible(d4)) {
			res += d4.cmd;
			dice = d4; continue;
		}
	}
	if (isGoal(dice)) {
		//reverse(ALL(res));
		if (ans > res)ans = res;
	}

}

void solve() {
	REP(i, 6)cin >> t[i];
	int sum = 0;
	REP(i, 6)sum += t[i];
	if (sum == 0)exit(0);
	ans = "Z";
	cin >> p >> q;
	cnt_nodes = 0;

	do {
		Dice dice;
		calc(dice);
	} while (next_permutation(t, t + 6));

	if (ans == "Z")cout << "impossible" << endl;

	else {
		cout << ans.substr(p - 1, q - p + 1) << endl;
	}
}

signed main() {
	while (true)solve();
}