// Arup Guha
// 4/11/2017
// Solution to 1992 UCF HS Contest Problem: Any Way You Read It

import java.util.*;

public class anyway {

	// Don't mess up typing this in!
	final public static String MSG = "#UNIVERSITY#OF#CENTRAL#FLORIDA#ASSOCIATION#FOR#COMPUTING#MACHINERY#UPSILON#PI#EPSILON#HIGH#SCHOOL#PROGRAMMING#TOURNAMENT#";
	final public static int N = 11;

	// Directions of movement.
	final public static int[] DX = {-1,0,0,1};
	final public static int[] DY = {0,-1,1,0};

	// Corresponding directions in item.
	final public static String DIRS = "^<>v";

	public static char[][] grid;
	public static char[][] res;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);

		// Process each case.
		while (stdin.hasNext()) {

			// Read in the grid.
			grid = new char[N][];
			for (int i=0; i<N; i++)
				grid[i] = stdin.next().toCharArray();

			// Get starting point.
			int x = stdin.nextInt()-1;
			int y = stdin.nextInt()-1;

			// Space is an unvisited square.
			res = new char[N][N];
			for (int i=0; i<N; i++) Arrays.fill(res[i], ' ');

			// Start up the recursion.
			go(x, y, 0);

			// Print the grid.
			for (int i=0; i<N; i++)
				System.out.println(new String(res[i]));

			// Between cases - annoying.
			if (stdin.hasNext()) System.out.println();
		}
	}

	public static boolean go(int x, int y, int k) {

		// Oops, this didn't work.
		if (grid[x][y] != MSG.charAt(k)) return false;

		// Made it to the end (and matched last char!)
		if (k == N*N-1) {
			res[x][y] = '*';
			return true;
		}

		// Try moving in all 4 directions.
		for (int i=0; i<DX.length; i++) {

			// Skip out of bounds and used squares.
			if (!inbounds(x+DX[i], y+DY[i])) continue;
			if (res[x+DX[i]][y+DY[i]] != ' ') continue;

			// Put this character in and recurse.
			res[x][y] = DIRS.charAt(i);
			boolean tmp = go(x+DX[i], y+DY[i], k+1);
			if (tmp) return true;

			// We only undo it if that branch didn't work.
			res[x][y] = ' ';
		}

		// If we get here, we messed up.
		return false;
	}

	public static boolean inbounds(int x, int y) {
		return x >= 0 && x < N && y >= 0 && y < N;
	}
}