#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <iomanip>
#include <stack>
#include <set>
#include <cstdio>
#include <bitset>
#include <functional>
#include <tuple>
#include <list>
#include <deque>
#include <sstream>
using namespace std;
typedef pair<int, int> P;

#define FOR(i, a, n) for (ll i = (ll)a; i<(ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef vector<int> VI;
int GCD(int a, int b){
    if(b==0) return a;
    return GCD(b, a%b);
}
int H, W;
int main() {
    while(cin>>H>>W, H||W){
        vector<string> field;
        bool check[H][W];
        for(int i=0; i<H; ++i){
            for(int j=0; j<W; ++j){
                check[i][j]=false;
            }
        }
        cin.ignore();
        for(int i=0; i<H; ++i){
            string str; getline(cin, str);
            field.push_back(str);
        }
        int x=0, y=0;
        while(1){
            check[y][x]=true;
            
            if(field[y][x]=='.'){
                cout << x << " " << y << endl;
                break;
            }
            if(field[y][x]=='>') {
                if(check[y][x+1]) {
                    cout << "LOOP" << endl;
                    break;
                }
                x++; continue;
            }
            if(field[y][x]=='v'){
                if(check[y+1][x]) {
                    cout << "LOOP" << endl;
                    break;
                }
                y++; continue;
            }
            if(field[y][x]=='^'){
                if(check[y-1][x]) {
                    cout << "LOOP" << endl;
                    break;
                }
                y--; continue;
            }
            if(field[y][x]=='<'){
                if(check[y][x-1]) {
                    cout << "LOOP" << endl;
                    break;
                }
                x--; continue;
            }
        }
        
    }
	return 0;
}
