#include <iostream>
using namespace std;

#define RIGHT '>'
#define LEFT '<'
#define TOP '^'
#define UNDER 'v'
#define LOOP 'l'
#define END '.'
#define MAX 101

int main(){
    char mp[MAX][MAX];
    int n,m;
    
    while(true){
        cin >> n >> m;
        if(!n&&!m) break;
        
        for(int i = 0 ; i < n ; i++)
            for(int j = 0 ; j < m ; j++)
                cin >> mp[i][j];
        
        int x = 0,y = 0;
        while(true){
            if(mp[x][y]==END){
                cout << y << ' ' << x << endl;
                break;
            }
            if(mp[x][y]==LOOP){
                cout << "LOOP" << endl;
                break;
            }
            
            if(mp[x][y]==RIGHT){
                mp[x][y] = LOOP;
                y++;
            }
            else if(mp[x][y]==LEFT){
                mp[x][y] = LOOP;
                y--;
            }
            else if(mp[x][y]==TOP){
                mp[x][y] = LOOP;
                x--;
            }
            else{
                mp[x][y] = LOOP;
                x++;
            }
        }
    }
    
    return 0;
}