#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;

int main() {
  int mapx, mapy;
  int x, y, tmp0 = 0, tmp1 = 0, tmp2 = 0;
  char map[150][150] = {0}, map0[150][150] = {0}, tmpc = 1;
  scanf("%d%d", &mapx, &mapy);
  while (mapx+mapy) {
    while (tmp0 < mapx) {
      scanf("%s", &map[tmp0]);
      tmp0++;
    }
    tmp0 = 0, tmp1 = 0, tmp2 = 0, tmpc = 1;
    x = 0, y = 0;
    while (tmpc && tmpc != 100) {
      map0[x][y]=1;
      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;
      if (map0[x][y] && tmpc) tmpc = 100;
      tmp2++;
    }
    if (tmpc == 100) puts("LOOP");
    else printf("%d %d\n", (x+1), (y+1));
    scanf("%d%d", &mapx, &mapy);
  }
  return 0;
}