#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <sstream>
#include <fstream>
#include <string.h>

#define X first
#define Y second
#define MP make_pair
#define FOR(i, n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
const int MAX = 101;

template<class T, class U>
void convert(T &t, U &u){
    stringstream ss;
    ss << t;
    ss >> u;
}

bool mark[101][101];
char tb[101][101];

void dfs(int x, int y, pair<int, int> &last){
	if(mark[y][x]) return;
	if(tb[y][x]=='.'){
		last.first  = x;
		last.second = y;
		return;
	}
	mark[y][x] = true;
	if(tb[y][x]=='^'){
		dfs(x, y-1, last);
	}else if(tb[y][x]=='>'){
		dfs(x+1, y, last);
	}else if(tb[y][x]=='v'){
		dfs(x, y+1, last);
	}else if(tb[y][x]=='<'){
		dfs(x-1, y, last);
	}
	return;
}

int main(){
	int w, h;
	while(cin >> h >> w && w|h){
		memset(mark, false, sizeof(mark));
		memset(tb, ' ', sizeof(tb));
		FOR(i, h){
			string tmp;
			cin >> tmp;
			FOR(j, w){
				tb[i][j] = tmp[j];
			}
		}

		pair<int, int> last(-1, -1);
		dfs(0, 0, last);

		if(last.first==-1&&last.second==-1){
			cout << "LOOP" << endl;
		}else{
			cout << last.first << " " << last.second << endl;
		}
	}
	return 0;
}