#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#define debug(A) puts(A)
#define debugp(A,B) printf(A,B)
#define debugs(A,B) scanf(A,B)
using namespace std;

int main() {
  int mapx, mapy;
  int x, y, tmp0 = 0, tmp1 = 0, tmp2 = 0;
  char map[150][150] = {0}, tmpc = 1;
  scanf("%d %d", &mapx, &mapy);
  while (mapx+mapy) {
    scanf("%c", &tmpc);
    while (tmp0 < mapx) {
      tmp1 = 0;
      while (tmp1 < mapy) {
        scanf("%c", &map[tmp0][tmp1]);
        tmp1++;
      }
      scanf("%c", &tmpc);
      tmp0++;
    }
    tmp0 = 0, tmp1 = 0, tmp2 = 0, tmpc = 1;
    x = 0, y = 0;
    while (tmpc) {
      if (tmp2 == 20000) break;
      if (map[x][y] == '>') y++;
      else if (map[x][y] == '<') y--;
      else if (map[x][y] == '^') x--;
      else if (map[x][y] == 'v') x++;
      else if (map[x][y] == '.') tmpc = 0;
      // else tmpc = 0;
      tmp2++;
      // debugp("Debug: %c %d %d\n", map[x][y], (x+1), (y+1));
    }
    if (tmp2 == 2000) puts("LOOP");
    else printf("%d %d\n", (x+1), (y+1));
    scanf("%d %d", &mapx, &mapy);
  }
  return 0;
}