#include <bits/stdc++.h>
using namespace std;
int a, b;

int main() {
	while (cin >> a >> b) {
		if (a == 0 && b == 0) {
			break;
		}
		char data[102][102];
		int b[a][b] = { 0 };
	      for(int i=0; i< a; i++){
	         for(int j=0; j< b; j++){
	            cin >> data[i][j];
	         }
	      }

		int H = 0, W = 0;
		int loop = 0;
		while (1) {
			if (data[H][W] == '<') {
				b[H][W] = 1;
				W -= 1;
				if (b[H][W] == 1) {
					loop = 1;
					break;
				}

			} else if (data[H][W] == '>') {
				b[H][W] = 1;
				W += 1;
				if (b[H][W] == 1) {
					loop = 1;
					break;
				}
			} else if (data[H][W] == 'v') {
				b[H][W] = 1;
				H += 1;
				if (b[H][W] == 1) {
					loop = 1;
					break;
				}
			} else if (data[H][W] == '^') {
				b[H][W] = 1;
				H -= 1;
				if (b[H][W] == 1) {
					loop = 1;
					break;
				}
			} else {
				break;
			}
		}
		if (loop != 1) {
			printf("%d %d\n", W, H);
		} else {
			printf("LOOP\n");
		}
	}
	return 0;
}