import java.util.*;

class Solution
{
  public static void doStep(char ch, int[][] dist, String[] f, boolean rev) {
    int h = dist.length, w = dist[0].length;

    int[][] oldDist = new int[h][w];
    for (int y = 0; y < h; ++y)
      System.arraycopy(dist[y], 0, oldDist[y], 0, w);

    for (int y = 0; y < h; ++y)
      for (int x = 0; x < w; ++x) {
        // for cost of 1, we can stay where we are by inserting an X
        int min = oldDist[y][x] + 1;

        // not necessary if the current move is a no-op
        if (ch == 'N' && (y == 0 || f[y-1].charAt(x) == 'X')) --min;
        if (ch == 'W' && (x == 0 || f[y].charAt(x-1) == 'X')) --min;
        if (ch == 'S' && (y == h-1 || f[y+1].charAt(x) == 'X')) --min;
        if (ch == 'E' && (x == w-1 || f[y].charAt(x+1) == 'X')) --min;

        // perhaps it's cheaper to not stay where we are, but come from
        // an adjacent field
        char c2 = ch;
        if (rev) c2 = ch=='E'?'W':ch=='W'?'E':ch=='N'?'S':'N';
        if (y < h-1) min = Math.min(min, (c2=='N'?0:1)+oldDist[y+1][x]);
        if (y > 0) min = Math.min(min, (c2=='S'?0:1)+oldDist[y-1][x]);
        if (x < w-1) min = Math.min(min, (c2=='W'?0:1)+oldDist[y][x+1]);
        if (x > 0) min = Math.min(min, (c2=='E'?0:1)+oldDist[y][x-1]);

        // it's never possible to end up on an 'X' field
        dist[y][x] = f[y].charAt(x) == 'X'?10000000:min;
      }
  }

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    for (int I = 1; I <= N; ++I) {

      System.out.println("Scenario #" + I + ":");

      int w = sc.nextInt(), h = sc.nextInt();

      int startX = -1, startY = -1;
      String[] f = new String[h];
      for (int y = 0; y < h; ++y) {
        f[y] = sc.next();
        if (f[y].indexOf('R') >= 0) {
          startX = f[y].indexOf('R');
          startY = y;
        }
      }

      int c = sc.nextInt();
      String s = "";
      if (c > 0)
        s = sc.next();

      int[][] dist = new int[h][w];
      for (int y = 0; y < h; ++y) Arrays.fill(dist[y], 10000000);
      dist[startY][startX] = 0;

      // compute minimal edit distance for each field
      int minEditDist = 10000000;
      for (int l = 0; l < c; ++l) {
        doStep(s.charAt(l), dist, f, false);

        // check the minimum editing distance in this round
        for (int y = 0; y < h; ++y)
          for (int x = 0; x < w; ++x)
            if (f[y].charAt(x) == '+')
              minEditDist = Math.min(minEditDist, dist[y][x]);
      }

      if (minEditDist == 10000000) {
        System.out.println("impossible");
        System.out.println();
        continue;
      }

      // now find the earliest editing position at which a trap can be found
      for (int y = 0; y < h; ++y) Arrays.fill(dist[y], 10000000);
      dist[startY][startX] = 0;

      int earliestTrap = 0;
      for (int l = 0; l < c; ++l) {
        doStep(s.charAt(l), dist, f, false);

        boolean found = false;
        for (int y = 0; y < h; ++y)
          for (int x = 0; x < w; ++x)
            if (f[y].charAt(x) == '+' && dist[y][x] == minEditDist)
              found = true;
        if (found) {
          earliestTrap = l;
          break;
        }
      }
      //System.out.println(minEditDist + ", " + earliestTrap);

      // now find the actual edited string. currently, all possible traps
      // have minEditDist. Now find the lexicographically first trap.
      for (int y = 0; y < h; ++y)
        for (int x = 0; x < w; ++x)
          if (f[y].charAt(x) == '+' && dist[y][x] == minEditDist)
            dist[y][x] = 0;
          else
            dist[y][x] = 10000000;

      Stack<int[][]> history = new Stack<int[][]>();
      for (int l = earliestTrap; l >= 0; --l) {
        int[][] oldDist = new int[h][w];
        for (int y = 0; y < h; ++y)
          System.arraycopy(dist[y], 0, oldDist[y], 0, w);
        history.push(oldDist);
        
        doStep(s.charAt(l), dist, f, true);
      }
      //System.out.println(minEditDist + " " + dist[startY][startX]);
      assert dist[startY][startX] == minEditDist;

      int l = 0;
      // the first earliestTrap chars are possibly modified
      int x = startX, y = startY;
      for(; l <= earliestTrap; ++l) {
        int[][] distMap = history.pop();
        char ch = s.charAt(l);

        boolean isRightFree = x < w-1 && f[y].charAt(x+1) != 'X';
        boolean isLeftFree = x > 0 && f[y].charAt(x-1) != 'X';
        boolean isTopFree = y > 0 && f[y-1].charAt(x) != 'X';
        boolean isBottomFree = y < h-1 && f[y+1].charAt(x) != 'X';

        if (isRightFree && distMap[y][x+1] + (ch=='E'?0:1) == dist[y][x]) {
          ++x;
          System.out.print("E");
        }
        else if (!isRightFree && distMap[y][x] + (ch=='E'?0:1) == dist[y][x])
          System.out.print("E");

        else if (isTopFree && distMap[y-1][x] + (ch=='N'?0:1) == dist[y][x]) {
          --y;
          System.out.print("N");
        }
        else if (!isTopFree && distMap[y][x] + (ch=='N'?0:1) == dist[y][x])
          System.out.print("N");

        else if (isBottomFree && distMap[y+1][x] + (ch=='S'?0:1) == dist[y][x]){
          ++y;
          System.out.print("S");
        }
        else if (!isBottomFree && distMap[y][x] + (ch=='S'?0:1) == dist[y][x])
          System.out.print("S");

        else if (isLeftFree && distMap[y][x-1] + (ch=='W'?0:1) == dist[y][x]) {
          --x;
          System.out.print("W");
        }
        else if (!isLeftFree && distMap[y][x] + (ch=='W'?0:1) == dist[y][x])
          System.out.print("W");

        else {
          System.out.print("X");
          assert false;
        }
        dist = distMap;
      }
      // the rest are the original directions
      for(; l < c; ++l)
        System.out.print(s.charAt(l));
      System.out.println();
      System.out.println();
    }
  }
}

