#include <cstdio>
#include <string>

using namespace std;

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

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;
	for(d = 0;d < 4;d++){
		if(tmp == dir[d]){
			break;
		}
	}
	return rec(y + dy[d],x + dx[d]);
}


int main(void){
	int h, w;
	while(true){
		scanf("%d%d",&h,&w);
		getchar();
		if(h == 0 && w == 0){
			break;
		}
		for(int i = 0;i < h;i++){
			scanf("%s",&mp[i]);
		}
		printf("%s",rec(0,0));
	}
	return 0;
}