#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cassert>
using namespace std;

int main() {
	int n;
	cin >> n;
	for(int i = 1; i <= n; ++i) {
		cout << "Scenario #" << i << ":" << endl;
		
		int w, h;
		cin >> w >> h >> ws;
		vector<string> area(h);
		for(int y = 0; y != h; ++y)
			getline(cin, area[y]);
		int l;
		cin >> l;
		string control;
		getline(cin, control);
		getline(cin, control);
		
		vector<vector<int> > dist0(h, vector<int>(w, 1000000));
		int x0, y0;
		
		for(int y = 0; y != h; ++y)
			for(int x = 0; x != w; ++x)
				if(area[y][x] == 'R') {
					dist0[y][x] = 0;
					x0 = x, y0 = y;
					area[y][x] = '.';
				}
				
		vector<vector<int> > dist(dist0);
		int solution1 = 1000000;
		for(int t = 0; t != l; ++t) {
			vector<vector<int> > dist2(h, vector<int>(w));
			for(int y = 0; y != h; ++y)
				for(int x = 0; x != w; ++x) {
					int best = dist[y][x] + 1;
					if(control[t] == 'N' && (y == 0 || area[y-1][x] == 'X')) --best;
					if(control[t] == 'W' && (x == 0 || area[y][x-1] == 'X')) --best;
					if(control[t] == 'S' && (y == h-1 || area[y+1][x] == 'X')) --best;
					if(control[t] == 'E' && (x == w-1 || area[y][x+1] == 'X')) --best;
					if(y < h-1) best = min(best, dist[y+1][x] + (control[t] != 'N'));
					if(x < w-1) best = min(best, dist[y][x+1] + (control[t] != 'W'));
					if(y > 0) best = min(best, dist[y-1][x] + (control[t] != 'S'));
					if(x > 0) best = min(best, dist[y][x-1] + (control[t] != 'E'));
					dist2[y][x] = (area[y][x] == 'X') ? 1000000 : best;
				}
			dist.swap(dist2);
			for(int y = 0; y != h; ++y)
				for(int x = 0; x != w; ++x)
					if(area[y][x] == '+')
						solution1 = min(solution1, dist[y][x]);
		}
		
		if(solution1 == 1000000)
			cout << "impossible" << endl;
		else {
			// easy solution: compute the minimal number of changed signals
			/* cout << solution1 << endl; */
			
			int solution2 = 0;
			dist = dist0;
			for(int t = 0; t != l; ++t) {
				vector<vector<int> > dist2(h, vector<int>(w));
				for(int y = 0; y != h; ++y)
					for(int x = 0; x != w; ++x) {
						int best = dist[y][x] + 1;
						if(control[t] == 'N' && (y == 0 || area[y-1][x] == 'X')) --best;
						if(control[t] == 'W' && (x == 0 || area[y][x-1] == 'X')) --best;
						if(control[t] == 'S' && (y == h-1 || area[y+1][x] == 'X')) --best;
						if(control[t] == 'E' && (x == w-1 || area[y][x+1] == 'X')) --best;
						if(y < h-1) best = min(best, dist[y+1][x] + (control[t] != 'N'));
						if(x < w-1) best = min(best, dist[y][x+1] + (control[t] != 'W'));
						if(y > 0) best = min(best, dist[y-1][x] + (control[t] != 'S'));
						if(x > 0) best = min(best, dist[y][x-1] + (control[t] != 'E'));
						dist2[y][x] = (area[y][x] == 'X') ? 1000000 : best;
					}
				dist.swap(dist2);
				bool done = false;
				for(int y = 0; y != h; ++y)
					for(int x = 0; x != w; ++x)
						if(area[y][x] == '+' && dist[y][x] == solution1)
								done = true;
				if(done) {
					solution2 = t + 1;
					break;
				}
			}

			// medium solution: using the minimal number of changed signals
			// resolve the threat as early as possible
			/* cout << solution1 << " " << solution2 << endl; */
			
			// hard solution: of these solutions, the lexicographically first
			for(int y = 0; y != h; ++y)
				for(int x = 0; x != w; ++x)
					if(area[y][x] == '+' && dist[y][x] == solution1)
						dist[y][x] = 0;
					else
						dist[y][x] = 1000000;
			vector<vector<vector<int> > > diststack;
			for(int t = solution2 - 1; t >= 0; --t) {
				vector<vector<int> > dist2(h, vector<int>(w));
				for(int y = 0; y != h; ++y)
					for(int x = 0; x != w; ++x) {
						int best = dist[y][x] + 1;
						if(control[t] == 'N' && (y == 0 || area[y-1][x] == 'X')) --best;
						if(control[t] == 'W' && (x == 0 || area[y][x-1] == 'X')) --best;
						if(control[t] == 'S' && (y == h-1 || area[y+1][x] == 'X')) --best;
						if(control[t] == 'E' && (x == w-1 || area[y][x+1] == 'X')) --best;
						if(y < h-1) best = min(best, dist[y+1][x] + (control[t] != 'S'));
						if(x < w-1) best = min(best, dist[y][x+1] + (control[t] != 'E'));
						if(y > 0) best = min(best, dist[y-1][x] + (control[t] != 'N'));
						if(x > 0) best = min(best, dist[y][x-1] + (control[t] != 'W'));
						dist2[y][x] = (area[y][x] == 'X') ? 1000000 : best;
					}
				diststack.push_back(vector<vector<int> >());
				diststack.back().swap(dist);
				dist.swap(dist2);
			}
			assert(dist[y0][x0] == solution1);
			int y = y0, x = x0;
			int t = 0;
			for(; t != solution2; ++t) {
				vector<vector<int> > &dist2(diststack.back());
				if((x == w-1 || area[y][x+1] == 'X') && dist2[y][x] == dist[y][x] - (control[t] != 'E'))
					cout << "E";
				else if(x < w-1 && area[y][x+1] != 'X' && dist2[y][x+1] == dist[y][x] - (control[t] != 'E')) {
					cout << "E";
					++x;
				}
				else if((y == 0 || area[y-1][x] == 'X') && dist2[y][x] == dist[y][x] - (control[t] != 'N'))
					cout << "N";
				else if(y > 0 && area[y-1][x] != 'X' && dist2[y-1][x] == dist[y][x] - (control[t] != 'N')) {
					cout << "N";
					--y;
				}
				else if((y == h-1 || area[y+1][x] == 'X') && dist2[y][x] == dist[y][x] - (control[t] != 'S'))
					cout << "S";
				else if(y < h-1 && area[y+1][x] != 'X' && dist2[y+1][x] == dist[y][x] - (control[t] != 'S')) {
					cout << "S";
					++y;
				}
				else if((x == 0 || area[y][x-1] == 'X') && dist2[y][x] == dist[y][x] - (control[t] != 'W'))
					cout << "W";
				else if(x > 0 && area[y][x-1] != 'X' && dist2[y][x-1] == dist[y][x] - (control[t] != 'W')) {
					cout << "W";
					--x;
				}
				else {
					cout << "X";
					assert(dist2[y][x] == dist[y][x] - 1);
				}
				dist.swap(dist2);
				diststack.pop_back();
			}
			assert(diststack.empty());
			for(; t != l; ++t)
				cout << control[t];
			cout << endl;
		}
		
		cout << endl;
	}
}
