#include <iostream>
#include <string>
using namespace std;
int main(){
	int h,w;
	while(1){
		cin>>h>>w;
		if(w==0 && h==0) break;
		char tile[100][100]={0};
		for(int i=0;i<h;i++){
			string str;
			cin>>str;
			for(int j=0;j<w;j++){
				tile[i][j]=str[j];
			}
		}
		int x=0,y=0,k=0;
		while(1){
			k++;
			if(tile[y][x]=='>')	     x++;
			else if(tile[y][x]=='<') x--;
			else if(tile[y][x]=='^') y--;
			else if(tile[y][x]=='v') y++;
			else if(tile[y][x]=='.'){
				cout<<x<<" "<<y<<endl;
				break;
			}
			if(k==10000){
				cout<<"LOOP"<<endl;
				break;
			}
		}
	}
	return 0;
}