#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
int main(){
    int h,w;
    while(cin >> h >> w){
        if(!h && !w) break;

        vector<string> map(h);
        rep(i,h) cin >> map[i];

        int i = 0, j = 0;
        while(1){
            if(map[i][j] == 'x'){
                cout << "LOOP" << endl;
                break;
            }
            if(map[i][j] == '.'){
                cout << j << " " << i << endl;
                break;
            }
            if(map[i][j] == '>'){
                map[i][j] = 'x';
                j++;
                continue;
            }
            if(map[i][j] == '<'){
                map[i][j] = 'x';
                j--;
                continue;
            }
            if(map[i][j] == '^'){
                map[i][j] = 'x';
                i--;
                continue;
            }
            if(map[i][j] == 'v'){
                map[i][j] = 'x';
                i++;
                continue;
            }
        }
    }
    return 0;
}
