#include<iostream>

using namespace std;
int H, W;
int x = 0, y = 0;
int rog[100][100];
bool check(){
	if (rog[x][y] == 0){
		cout << "LOOP" << endl;
		return true;
	}
	else{
		return false;
	}
}
int main(){
	char map[100][100];

	while (cin >> H >> W,W+H){

		int x = 0, y = 0;
		map[100][100] = {};
		for (int i = 0; i < H; i++){
			for (int j = 0; j < W; j++){
				cin >> map[i][j];
				rog[i][j] = 1;
			}
		}
		while (1){
			if (map[x][y] == '>'){
				x++;
				if (check())break; 
			}
			else if(map[x][y]=='v'){
				y++;
				if (check()) break; 
			}
			else if (map[x][y] == '<'){
				x--;
				if (check()) break; 
			}
			else if (map[x][y] == '^'){
				y--;
				if (check())break; 
			}
			else {
				cout << x << " " << y << endl;
				break;
			}
			
			rog[x][y] = 0;

		}
	}
	return 0;
}