#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<vector>
#include<math.h>
#include<queue>
#include <algorithm>
#include<functional>
#include<cstdlib>
#include<cmath>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define CI cin >>
#define CO cout <<
#define E << endl;

using namespace std;

typedef pair<int, int> P;
typedef pair<long, long> LP;
typedef pair<int, P> PP;
typedef pair<long, LP> LPP;



int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };

int A = 0, B = 0, C = 0, K = 0, S = 0, T = 0, W = 0, N = 0,H = 0;
int n = 0;
double ar = 0, br = 0, cr = 0;
int answer = 0;

string c;
string sA, strB;
vector<vector<char>> map;
vector<int> population;


void input() {
	CI W >> H;
	
	map.resize(W);
	REP(i, W) {
		map[i].resize(H);
	}
	REP(i, W) {
		REP(j, H) {
			CI map[i][j];
		}
	}
}

void proce() {
	int posn[2] = { 0,0 };
	vector<vector<bool>> check(W, vector<bool>(H, false));
	

	while (map[posn[0]][posn[1]] != '.') {
		check[posn[0]][posn[1]] = true;
		if (map[posn[0]][posn[1]] == '>') {
			posn[1]++;
		}
		else {
			if (map[posn[0]][posn[1]] == 'v') {
				posn[0]++;
			}
			else {
				if (map[posn[0]][posn[1]] == '<') {
					posn[1]--;
				}
				else {
					if (map[posn[0]][posn[1]] == '^') {
						posn[0]--;
					}
				}
			}
		}
		if (check[posn[0]][posn[1]] == true) {
			CO "LOOP" E
			return;
		}
	}
	CO posn[1] << " " << posn[0] E


}

int main(void) {
	
	while (true) {
		input();
		if (W == 0 && H == 0) {
			break;
		}
		proce();
	}

	return 0;
}