#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  int h, w;
  while (cin >> h >> w, h) {
    vector<vector<string>> map(h, vector<string>(w));

    for (auto &seq : map) {
      for (auto &v : seq) {
        char c;
        cin >> c;
        v = c;
      }
    }

    int cx = 0;
    int cy = 0;
    while (true) {
      string str = map[cy][cx];
      map[cy][cx] = "0";
      if (str == ">") {
        ++cx;
      } else if (str == "<") {
        --cx;
      } else if (str == "^") {
        --cy;
      } else if (str == "v") {
        ++cy;
      } else if (str == ".") {
        cout << cx << " " << cy << endl;
        break;
      } else if (str == "0") {
        cout << "LOOP" << endl;
        break;
      }
    }
  }
}
