#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int main(){
	int H,W;
	while(cin>>H>>W,H||W){
		char board[120][120];
		for(int i =0; i < H;i++){
			for(int j = 0;j < W;j++){
				cin>>board[i][j];
			}
		}
		std::vector<pii> v;
		int y = 0;
		int x = 0;
		int cnt = 0;
		bool flag =true;
		while(1){
			if(cnt>=1000000){
				flag =false;
				break;
			}
			cnt++;
			if(board[y][x]=='>'){
				x++;
			}else if(board[y][x]=='<'){
				x--;
			}else if(board[y][x]=='^'){
				y--;
			}else if(board[y][x]=='v'){
				y++;
			}else{
				break;
			}
		}
		if(!flag)cout <<"LOOP"<<endl;
		else cout <<x<<" "<<y<<endl;
	}
	return 0;
}