#include <stdio.h>
#include <iostream>

using namespace std;

int main() {
	
	int w,h;
	int k,l;
	while (cin >> w >> h) {
		if (w == 0 && h == 0) {
			break;
		}
		int hyou[100][100] = {0};
		char chyou[100][100];
		k = 0;
		l = 0;
		for (int i = 0; i < w; i++) {
			for (int j = 0; j < h; j++) {
				cin >> chyou[j][i];
			}
		}
		while (1) {
			if (hyou[k][l] == 1) {
				cout << "LOOP" << endl;
				break;
			}
			hyou[k][l] = 1;
			if (chyou[k][l] == '>') {
				k++;
			} else if (chyou[k][l] == '<') {
				k--;
			} else if (chyou[k][l] == '^') {
				l--;
			} else if (chyou[k][l] == 'v') {
				l++;
			} else {
				cout << k << " " << l << endl;
				break;
			}
		}
	}
	return 0;
}