//include----------------------------------------------------------------------------------------------------------------------
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cctype>
#include <vector>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <bitset>
#include <map>
#include <algorithm>
#include <memory>
#include <sstream>
#include <functional>
#include <iostream>
#include <fstream>
#include <set>

//using namespace--------------------------------------------------------------------------------------------------------------
using namespace std;

//define-----------------------------------------------------------------------------------------------------------------------
#define rep(i, n) for(int i = 0; i < n; i++)
#define FOR(i, s, n) for(int i = s; i < n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define FOREACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define INF 1 << 25
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//typedef----------------------------------------------------------------------------------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned int uint;
typedef unsigned long long ull;

//const------------------------------------------------------------------------------------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);

//global-----------------------------------------------------------------------------------------------------------------------
char str[1000][1000];
bool test[1000][1000];
int ans_x, ans_y;
//function---------------------------------------------------------------------------------------------------------------------
bool solve(int x, int y){
	if (str[y][x] == '.'){
		ans_y = y + 1;
		ans_x = x + 1;
		return true;
	}
	if (test[y][x]){
		ans_x = INF;
		ans_y = INF;
		return true;
	}
	test[y][x] = true;
	if (str[y][x] == '>'){
		if (solve(x + 1, y))
			return true;
	}
	if (str[y][x] == '<'){
		if (solve(x - 1, y))
			return true;
	}
	if (str[y][x] == '^'){
		if (solve(x, y + 1))
			return true;
	}
	if (str[y][x] == 'v'){
		if (solve(x, y - 1))
			return true;
	}
}

int main(){
	char str[1000][1000];
	int a, b;
	while(true){
		scanf("%d %d", &a, &b);
		if (a == 0 && b == 0)
			return 0;
		rep(i, a)
			scanf("%s", str[i]);
		rep(i, a)
			rep(j, b)
			test[i][j] = false;
		if (solve(0, 0)){
			if (ans_y == INF && ans_x == INF)
				printf("LOOP\n");
			else
				printf("%d %d", ans_y, ans_x);
		}
	}
	return 0;
}