#include<iostream>
#include<string>

int h, w;
char tile[100][100];
int dx[4] = { 0, 1, 0, -1 }, dy[4] = { -1, 0, 1, 0 };
std::string arrows = "^>v<";

int main()
{
	while( std::cin >> h >> w, h | w )
	{
		for( int i = 0; i != h; ++i )
			for( int j = 0; j != w; ++j )
				std::cin >> tile[i][j];

		int x = 0, y = 0;
		while( true )
		{
			if( tile[y][x] == '-' )
			{
				std::cout << "LOOP" << std::endl;
				break;
			}
			else if( tile[y][x] != '.' )
			{
				int i = arrows.find( tile[y][x] );
				tile[y][x] = '-';
				x += dx[i]; y += dy[i];
			}
			else
			{
				std::cout << x << " " << y << std::endl;
				break;
			}
		}
	}

	return 0;
}