#include <iomanip>
#include <utility>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;

typedef struct {
	int x, y;
}Loc;

int H, W;
string tile[100];
bool al[100][100];
Loc l = { 0,0 };


bool check()
{
	if (al[l.x][l.y])
	{
		cout << "LOOP" << endl;
		return true;
	}
	else
	{
		al[l.x][l.y] = true;
		return false;
	}
}

int main()
{
	while (cin >> H >> W && H != 0)
	{
		l = { 0,0 };
		for (int i = 0; i < H; i++) {
			cin >> tile[i];
			for (int j = 0; j < W; j++)
				al[i][j] = false;
		}
		al[0][0] = true;
		while (true) {
			if (tile[l.x][l.y] == '<')
			{
				l.y--;
				if (check())
					break;
			}
			else if (tile[l.x][l.y] == '>')
			{
				l.y++;
				if (check())
					break;
			}
			else if (tile[l.x][l.y] == 'v')
			{
				l.x++;
				if (check())
					break;;
			}
			else if (tile[l.x][l.y] == '^')
			{
				l.x--;
				if (check())
					break;
			}
			else
			{
				cout << l.y << " " << l.x << endl;
				break;
			}
		}
	}
	return 0;
}