#include <iostream>
using namespace std;

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

void dfs(char mp[MAX][MAX],int i,int j){
    if(mp[i][j]==END){
        cout << j << ' ' << i << endl;
        return;
    }
    if(mp[i][j]==LOOP){
        cout << "LOOP" << endl;
        return;
    }
    
    if(mp[i][j]==RIGHT){
        mp[i][j] = LOOP;
        dfs(mp,i,j+1);
    }
    else if(mp[i][j]==LEFT){
        mp[i][j] = LOOP;
        dfs(mp,i,j-1);
    }
    else if(mp[i][j]==TOP){
        mp[i][j] = LOOP;
        dfs(mp,i-1,j);
    }
    else{
        mp[i][j] = LOOP;
        dfs(mp,i+1,j);
    }
}


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];
        
        dfs(mp,0,0);
    }
    
    return 0;
}