#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include<iomanip>
#include <fstream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <assert.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define ALL(s) (s).begin(),(s).end()
#define ITE(c) typeof((c).begin())

#define clr(a) memset((a),0,sizeof(a))
#define nclr(a) memset((a),-1,sizeof(a))
#define pb push_back
#define INRANGE(x,s,e) ((s)<=(x) && (x)<(e))
#define MP(a,b) make_pair((a),(b))

using namespace std;

int  vis[128][128]; 
char dat[128][128];


int main(){
	int w, h;
	while(cin>>w>>h,w||h){
		rep(i,128){
			rep(j,128){
				vis[j][i]=0;
				dat[j][i]=0;
			}
		}
		
		rep(i,h){
			rep(j,w){
				cin>>dat[j][i];
			}
		}
		int px=0, py=0;
		while(dat[px][py]!='.'){
			if(vis[px][py]) break;
			vis[px][py]=1;
			switch(dat[px][py]){
				case '>':px++;break;
				case '<':px--;break;
				case '^':py--;break;
				case 'v':py++;break;
			}
		}
		if(vis[px][py]){
			cout<<"LOOP"<<endl;
		}else{
			cout<<px<<" "<<py<<endl;
		}
	}
	return 0;
}