#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(){
  int h, w;
  while(true){
    cin >> h >> w;
    if(h==0 && w==0)
      break;
    vector<string> m;
    int c[h][w];
    string s;
    for(int k=0; k<h; k++){
      cin >> s;
      m.push_back(s);
      for(int l=0; l<w; l++)
	c[k][l] = 0;
    }
    int i=0, j=0;
    bool lp = false;
    while(true){
      if(c[i][j] == 1){
	lp=true; break;
      }
      else if(m[i][j] == '.')
	break;
      else if(m[i][j] == '>'){
	c[i][j] = 1;
	j++;
      }
      else if(m[i][j] == 'v'){
	c[i][j] = 1;
	i++;
      }
      else if(m[i][j] == '<'){
	c[i][j] = 1;
	j--;
      }
      else if(m[i][j] == '^'){
	c[i][j] = 1;
	i--;
      }
    }
    if(lp){
      cout << "LOOP\n";
    }
    else
      cout << j << " " << i << endl;
  }

  return 0;
}