#include <stdio.h>

char map[100][100];
int done[100][100];

int main(){
  while(1){
    int w,h;
    scanf("%d%d", &w, &h);

    if(w==0) break;

    int i,j;
    for(i=0;i<h;i++) for(j=0;j<w;j++){
       done[i][j] = 0;
       scanf(" %c", &map[i][j]);
      }

    int x,y;
    x = y = 0;
    
    while(!done[x][y]){
      if(map[x][y] == '.') break;
      done[x][y] = 1;
      if(map[x][y] == '>') y++;
      else if(map[x][y] == 'v') x++;
      else if(map[x][y] == '^') x--;
      else if(map[x][y] == '<') y--;
    }

    if(done[x][y]) puts("LOOP");
    else printf("%d %d\n", y, x);
  }
  return 0;
}