#include<iostream>
#include<cmath>
using namespace std;
int main(){
	while (true){
		char room[100][100];
		int H, W; cin >> H >> W;
		if (H == 0 && W == 0)return 0;
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				cin >> room[i][j];
			}
		}
		pair<int, int>l;
		l.first = 0; l.second = 0;
		for (int i = 0; ; i++){
			if (i >= 100) {
				cout << "LOOP\n";
				goto Exit;
			}
			char c = room[l.first][l.second];
			if (c == '.') {
				cout << l.second << ' ' << l.first << endl;
				goto Exit;
			}
			if (c == '^')l.first--;
			else if (c == 'v')l.first++;
			else if (c == '<')l.second--;
			else if (c == '>')l.second++;
		}
	Exit:;
	}
}