#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <vector>
#include <algorithm>

#define int64 long long int
#define RIGHT 1
#define UP 2
#define LEFT 3
#define DOWN 4
#define CLEARED 5

using namespace std;

int main()
{
	int H, W, x, y;
	int map[101][101];
	string buf;
	while(1){
		cin >> H >> W;
		if(H == 0) break;

		memset(map, 0, sizeof(int)*101*101);

		for(int i=0; i<H; i++){
			cin >> buf;
			for(int j=0; j<W; j++){
				if(buf[j] == '>') map[i][j] = RIGHT;
				else if(buf[j] == '^') map[i][j] = UP;
				else if(buf[j] == '<') map[i][j] = LEFT;
				else if(buf[j] == 'v') map[i][j] = DOWN;
			}
		}

		x = 0, y = 0;

		while(1){
			if(map[y][x] == CLEARED){
				cout << "LOOP" << endl;
				break;
			} else if(map[y][x] == RIGHT){
				map[y][x] = CLEARED;
				x++;
			} else if(map[y][x] == UP){
				map[y][x] = CLEARED;
				y--;
			} else if(map[y][x] == LEFT){
				map[y][x] = CLEARED;
				x--;
			} else if(map[y][x] == DOWN){
				map[y][x] = CLEARED;
				y++;
			} else {
				cout << x << ' ' << y << endl;
				break;
			}
		}
	}
	return 0;
}
			