#include <iostream>
#include <vector>

using namespace std;
typedef pair<int, int> p;

void solve()
{
	int H, W;
	while(cin >> H >> W, H || W)
	{
		vector< vector<bool> > isVisited(H, vector<bool>(W));
		vector< vector<char> > tile(H, vector<char>(W));
		for(int i = 0; i < H; ++i)
		{
			for(int j = 0; j < W; ++j)
			{
				isVisited[i][j] = false;
				cin >> tile[i][j];
			}
		}
		p pos(0, 0);
		while(true)
		{
			if(isVisited[pos.second][pos.first])
			{
				cout << "LOOP" << endl;
				break;
			}
			else
			{
				isVisited[pos.second][pos.first] = true;
				if(tile[pos.second][pos.first] == '>')
				{
					++pos.first;
				}
				else if(tile[pos.second][pos.first] == '^')
				{
					--pos.second;
				}
				else if(tile[pos.second][pos.first] == '<')
				{
					--pos.first;
				}
				else if(tile[pos.second][pos.first] == 'v')
				{
					++pos.second;
				}
				else if(tile[pos.second][pos.first] == '.')
				{
					cout << pos.first << " " << pos.second << endl;
					break;
				}
			}
		}
	}
}

int main()
{
	solve();
	return(0);
}