#include <iostream>
#include <queue>
#include <string>

using namespace std;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)

char grid[110][110];

int main(){
    int w,h;
    while(cin>>h>>w, h||w){
        bool vis[110][110]={};
        rep(y,h) cin>>grid[y];
        int px=0, py=0;
        bool loop=false;
        while(1){
            if(vis[py][px]){
                loop=true; break;
            }
            vis[py][px]=true;
            char c=grid[py][px];
            if(c=='.') break;
            else if(c=='>') px++;
            else if(c=='^') py--;
            else if(c=='<') px--;
            else if(c=='v') py++;
        }
        if(loop) cout<<"LOOP"<<endl;
        else cout<<px<<" "<<py<<endl;
    }

}