#include<iostream>
#include<string>
using namespace std;
int main(){
  int w,h;
  string a[102];
  while(cin>>w>>h,w){
    for(int i=0;i<102;i++){
      a[i]="";
    }
    for(int i=0;i<w;i++){
      cin>>a[i];
    }
    int x=0,y=0;
    while(true){
      if(a[x][y]=='.'){cout<<y<<' '<<x<<endl;break;}
      else  if(a[x][y]=='o'){cout<<"LOOP"<<endl; break;}
      else if(a[x][y]=='>'){a[x][y]='o'; y++;}
      else if(a[x][y]=='<'){a[x][y]='o'; y--;}
      else if(a[x][y]=='^'){a[x][y]='o'; x--;}
    else if(a[x][y]=='v'){a[x][y]='o'; x++;}
    }
  }
}
    