#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <set>
using namespace std;
typedef pair<int,int> P;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
#define EQ(a,b) (abs((a)-(b))<EPS)
char map[110][110];
int main()
{
	while(1)
	{
		int w,h;
		cin >> w >> h;
		if(w==0&&h==0)break;
		for(int i=0;i<w;i++)
		{
			for(int j=0;j<h;j++)
			{
				cin >> map[i][j];
			}
		}
		int x=0,y=0;
		int count=0;
		bool flag=false;
		while(1)
		{
			if(map[x][y]=='>')
			{
				y++;
			}
			if(map[x][y]=='<')
			{
				y--;
			}
			if(map[x][y]=='v')
			{
				x++;
			}
			if(map[x][y]=='^')
			{
				x--;
			}
			if(map[x][y]=='.')
			{
				break;
			}
			count++;
			if(count>11000)
			{
				flag=true;
				break;
			}

		}
		if(flag)
		{
			cout << "LOOP" << endl;
		}
		else
		{
			cout << y << ' ' << x << endl;
		}
	}
	return 0;
}