#include <iostream>
#include <istream>
#include <ostream>
#include <cstdlib>

class Tiles {
	char **dir;
	bool **visited;
	int pos_x, pos_y;
public:
	Tiles(std::istream& is) {
		int h, w;
		is >> h >> w;
		if (h == 0 && w == 0) {
			exit(0);
		}
		dir = new char*[h];
		visited = new bool*[h];
		for (int i = 0; i < w; i++) {
			dir[i] = new char[w];
			visited[i] = new bool[w];
		}
		pos_x = pos_y = 0;

		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				std::cin >> dir[i][j];
			}
		}
	}

	void solve() {
		if (visited[pos_y][pos_x]) {
			std::cout << "LOOP" << std::endl;
			return;
		}
		if (dir[pos_y][pos_x] == '.') {
			std::cout << pos_x << ' ' << pos_y << std::endl;
		} else {
			visited[pos_y][pos_x] = true;
			switch (dir[pos_y][pos_x]) {
			case '>':
				pos_x++;
				break;
			case '<':
				pos_x--;
				break;
			case 'v':
				pos_y++;
				break;
			case '^':
				pos_y--;
				break;
			}
			solve();
		}
	}
};

int main()
{
	Tiles *t;
	while (true) {
		t = new Tiles(std::cin);
		t->solve();
	}
	return 0;
}