#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define enld endl

int main() {
	lint H, W;
	while (cin >> H >> W, H != 0) {
		vector<vector<char>>A(H, vector<char>(W));
		rep(i, H) {
			rep(j, W) {
				cin >> A[i][j];
			}
		}
		lint I = 0;
		lint J = 0;
		rep(i, 20000) {
			if (A[I][J] == '>') {
				J++;
			}
			else if (A[I][J] == '<') {
				J--;
			}
			else if (A[I][J] == '^') {
				I--;
			}
			else if (A[I][J] == 'v') {
				I++;
			}
			else if (A[I][J] == '.') {

			}
		}
		if (A[I][J] == '.') {
			cout << J << ' ' << I << endl;
		}
		else {
			cout << "LOOP" << endl;
		}
	}
}
