#include<iostream>

std::pair<char,bool> data[101][101];

int main(){
	int w,h;
	while(std::cin>>w>>h){
		if(w==0&&h==0)break;
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				std::cin>>data[i][j].first;
				data[i][j].second=false;
			}
		}
		int x=0,y=0;
		while(true){
			if(data[y][x].second){
				std::cout<<"LOOP"<<std::endl;
				break;
			}data[y][x].second=true;

			if(data[y][x].first=='^')y--;
			if(data[y][x].first=='>')x++;
			if(data[y][x].first=='v')y++;
			if(data[y][x].first=='<')x--;

			if(data[y][x].first=='.'){
				std::cout<<x<<" "<<y<<std::endl;
				break;
			}
		}
	}
	return 0;
}