#include<iostream>
using namespace std;
int main(void){
	while(true){
		int x,y;
		int moved = 0;
		bool bLoop = false;
		int h,w;
		char **map;

		cin >> h >> w;
		if( h==0&&w==0 ) break;
		cin.ignore(3,'\n');

		map = new char*[h];
		for(int i = 0; i < h; i++){
			map[i] = new char[w+2];
			cin.getline(map[i], w+2);
		}

		x = 0; y = 0;
		while( true ){
			if( map[y][x] == '.' || bLoop ) break;
			if( moved > h * w + 1 ) bLoop = true;
			switch( map[y][x] ){
				case '>':
					x++;
					break;
				case 'v':
					y++;
					break;
				case '^':
					y--;
					break;
				case '<':
					x--;
					break;
			}
			moved++;
		}
		if( bLoop ) cout << "LOOP\n";
		else cout << x << ' ' << y << '\n';

		for(int i = 0; i < h; i++){
			delete []map[i];
		}
		delete []map;
	}
	return 0;
}