#include<iostream>
#include <cstdio>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)




int main(void){
	int w,h;
	bool visited[100][100];
	char map[100][100];
	while(cin >> w >> h,w|h){
		rep(j,h)
			rep(i,w)
				cin >> map[i][j],visited[i][j]=false;
		bool loop=false;
		int x=0,y=0;
		while(!visited[x][y]&&map[x][y]!='.'){
			visited[x][y]=true;
			if(map[x][y]=='>')
				x++;
			else if(map[x][y]=='<')
				x--;
			else if(map[x][y]=='v')
				y++;
			else if(map[x][y]=='^')
				y--;
		}
		if(map[x][y]!='.')
			loop=true;

		if(loop)
			cout << "LOOP" << endl;
		else 
			cout << x << " "<< y << endl;
	}
	return 0;
}	