/*
	0104:Magical Tiles
*/
#include	<iostream>
#include	<vector>
#include	<cstdio>

using namespace std;

int main(void) {
	int H, W;
	while(1) {
		cin >> W >> H;
		if(H == 0 && W == 0) {
			break;
		}
		vector< vector<char> > tiles;
		vector< vector<int> > status;
		
		tiles.resize(W + 1);
		status.resize(W + 1);
		for(int i = 0; i < (int)tiles.size(); i++) {
			tiles[i].resize(H + 1);
			status[i].resize(H + 1);
		}
		
		for(int i = 0; i < (int)tiles.size() - 1; i++) {
			for(int j = 0; j < (int)tiles[i].size(); j++) {
				scanf("%c", &tiles[i][j]);
			}
		}
		
		for(int i = 0; i < (int)status.size(); i++) {
			for(int j = 0; j < (int)status[i].size(); i++) {
				status[i][j] = 0;
			}
		}
		
		int a = 0, b = 0;
		while(1) {
			if(tiles[a][b] == '.') {
				cout << b << ' ' << a << endl;
				break;
			}
			else if(status[a][b] == 1) {
				cout << "LOOP" << endl;
				break;
			}
			else {
				status[a][b] = 1;
				
				if(tiles[a][b] == '<') {
					//cout << "MOVE:" << '<' << endl;
					b--;
				}
				else if(tiles[a][b] == '>') {
					//cout << "MOVE:" << '>' << endl;
					b++;
				}
				else if(tiles[a][b] == '^') {
					//cout << "MOVE:" << '^' << endl;
					a--;
				}
				else if(tiles[a][b] == 'v') {
					//cout << "MOVE:" << 'v' << endl;
					a++;
				}
			}
		}
	}
	
	return 0;
}