#include<iostream>
#include<string.h>
using namespace std;

struct zahyou{
	int x;
	int y;
};

int main(){
	
	int tx,ty,count;
	char map[100][100];
	bool flag;
	struct zahyou now;
	
	
	
	while(cin>>tx>>ty,tx&&ty){
		
		flag=false;
		now.x=0;
		now.y=0;
		count=0;
		memset(map,'\0',sizeof(map));
		
		for(int i=0;i<ty;i++){
			for(int j=0;j<tx;j++){
				cin>>map[i][j];
			}
		}
		
		while(1){
			if(map[now.y][now.x]=='>'){
				if(map[now.y][now.x+1]=='<'){
					flag=true;
				}
				else{
					now.x++;
				}
			}
			else if(map[now.y][now.x]=='<'){
				if(map[now.y][now.x-1]=='>'){
					flag=true;
				}
				else{
					now.x--;
				}
			}
			else if(map[now.y][now.x]=='v'){
				if(map[now.y+1][now.x]=='^'){
					flag=true;
				}
				else{
					now.y++;
				}
			}
			else if(map[now.y][now.x]=='^'){
				if(map[now.y-1][now.x]=='v'){
					flag=true;
				}
				else{
					now.y--;
				}
			}
			count++;
			
			if(count>=10e+4){
				flag=true;
			}
			
			if(map[now.y][now.x]=='.' || flag){
				if(flag){
					cout<<"LOOP"<<endl;
				}else{
					cout<<now.x<<" "<<now.y<<endl;
				}
				break;
			}
		}
	}
}