#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

string mp[100];
string dir = "^>v<";
const int dy[4] = {-1,0,1,0}, dx[4] = {0,1,0,-1};

char *rec(int y,int x){
	char tmp = mp[y][x];
	if(tmp == '.'){
		char ret[256];
		sprintf(ret,"%d %d",x,y);
		return ret;
	}else if(tmp == 't'){
		char ret[] = "LOOP";
		return ret;
	}
	mp[y][x] = 't';
	int d = dir.find(tmp);
	return rec(y + dy[d],x + dx[d]);
}


int main(void){
	int h, w;
	while(true){
		cin >> h >> w;
		cin.get();
		if(h == 0 && w == 0){
			break;
		}
		for(int i = 0;i < h;i++){
			getline(cin,mp[i]);
		}
		cout << rec(0,0) << endl;
	}
	return 0;
}