#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int H, W;
  while (cin >> H >> W, H) {
    string s[110];
    bool used[110][110] = {};
    for (int i = 0; i < H; i++) {
      cin >> s[i];
    }
    int y = 0, x = 0;
    bool loop = false;
    while (true) {
      if (used[y][x]) {
        loop = true;
        break;
      }
      used[y][x] = true;
      if (s[y][x] == '>') x++;
      else if (s[y][x] == '<') x--;
      else if (s[y][x] == '^') y--;
      else if (s[y][x] == 'v') y++;
      else break;
    }
    if (loop) cout << "LOOP" << endl;
    else cout << x << " " << y << endl;
  }

  return 0;
}
