#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    int w, h;

    while (cin >> h >> w, h)
    {
        char a[h][w];
        rep(i, h)
        {
            rep(j, w)
            {
                cin >> a[i][j];
            }
        }
        int x = 0, y = 0;
        bool flag = 0;
        rep(i, 10001)
        {
            if (a[y][x] == '<')
                x--;
            else if (a[y][x] == '>')
                x++;
            else if (a[y][x] == '^')
                y--;
            else if (a[y][x] == 'v')
                y++;
            else
            {
                flag = 1;
                break;
            }
        }

        if (flag == 1)
            cout << x << " " << y << endl;
        else
            OP("LOOP");
    }
    return 0;
}
