#include<iostream>
#include<string>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<numeric>
#include<vector>
#include<cstdio>
#include<climits>
#include<cfloat>
#include<cstring>
#define foreach(t,p) for(t::iterator it=p.begin();it!=p.end();++it)
#define rforeach(t,p) for(t::reverse_iterator it=p.rbegin();it!=p.rend();++it)
#define all(p) p.begin(),p.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define FOREACH(t,p,tit) for(t::iterator tit=p.begin();tit!=p.end();++tit)
using namespace std;
char tiles[102][102];

int main()
{
    int w,h;
    while(cin >> w >> h)
    {
        if(w==0&&h==0){break;}
        rep(j,h)rep(i,w){cin >> tiles[i][j];}

        int x,y,nextx,nexty;
        x=0;
        y=0;
        int loop = 0;
        while(1)
        {
            if(tiles[x][y]=='.'){break;}
            if(tiles[x][y]=='x'){loop=1;break;}

            if(tiles[x][y]=='>')
            {
                nextx = x+1;nexty = y;
                tiles[x][y] = 'x';
                x = nextx;y = nexty;
                continue;
            }
            if(tiles[x][y]=='<')
            {
                nextx = x-1;nexty = y;
                tiles[x][y] = 'x';
                x = nextx;y = nexty;
                continue;
            }
            if(tiles[x][y]=='v')
            {
                nextx = x;nexty = y+1;
                tiles[x][y] = 'x';
                x = nextx;y = nexty;
                continue;
            }
            if(tiles[x][y]=='^')
            {
                nextx = x;nexty = y -1;
                tiles[x][y] = 'x';
                x = nextx;y = nexty;
                continue;
            }
        }
        if(loop){cout << "LOOP"<<endl;continue;}
        cout <<x << " "<<y << endl;

    }

    return 0;
}