#include <iostream>

using namespace std;

char field[108][108];

int main() {
	while(true){
start:
		int h, w; cin >> h >> w;
		if (h == 0 && w == 0) break;
		for (int i = 0; i < h; ++i) {
			for (int j = 0; j < w; ++j) {
				cin >> field[i][j];
			}
		}

		int x = 0, y = 0, c = 0;
		while (true){
			switch (field[y][x]){
			case '>':
				++x;
				break;
			case '<':
				--x;
				break;
			case '^':
				--y;
				break;
			case 'v':
				++y;
				break;
			default:
				printf("%d %d\n", x, y);
				goto start;
				break;
			}
			++c;
			if (c > w*h) {
				cout << "LOOP" << endl;
				goto start;
			}
		}
	}

	return 0;
}