#include<iostream>
using namespace std;

char map[101][101];
int f[101][101];

int main() {
	int w, h, x, y, e;
	while(1) {
		cin >> h >> w;
		if(!w&&!h) break;
		for(int i=0; i<h; ++i) {
			cin >> map[i];
			for(int j=0; j<w; ++j) f[i][j] = 0;
		}
		x = y = 0; e = 0;
		while(1) {
			f[y][x] = 1;
			switch(map[y][x]) {
			case '>': x+=1; break;
			case '<': x-=1; break;
			case 'v': y+=1; break;
			case '^': y-=1; break;
			case '.': e = 1; break;
			}
			if(e || f[y][x]) break;
		}
		if(e) cout << x << " " << y << endl;
		else cout << "LOOP" << endl;
	}
	return 0;
}