#include <iostream>
using namespace std;

int main(void)
{
	while(1) {
		char point[100][100];
		bool check[100][100], ep = false;
		int Y, X;
		int x, y;

		for(int i = 0; i < 100; i++) {
			for(int j = 0; j < 100; j++) {
				point[i][j] = '.';
				check[i][j] = false;
			}
		}

		cin >> Y >> X;

		if(Y == 0 && X == 0) break;

		for(int i = 0; i < Y; i++) {
			for(int j = 0; j < X; j++) {
				cin >> point[j][i];
			}
		}

		x = 0, y = 0;

		while(1) {
			if(check[x][y] == true) {
				cout << "LOOP" << endl;
				break;
			} else {
				check[x][y] = true;

				switch(point[x][y]) {
				case '>' : x += 1; break;
				case '<' : x -= 1; break;
				case '^' : y -= 1; break;
				case 'v' : y += 1; break;
				case '.' : ep = true; break;
				};

				if(ep == true) {
					cout << x << " " << y << endl;
					break;
				}
			}
		}
	}
	return 0;
}