#include<stdio.h>
main(){
  int i,j;
  int H,W;
  int count=0;
  char tairu[1000][1000];
  int sub[1000][1000]={0};
  while(1){
    scanf("%d %d",&H,&W);
    if(H==0 && W==0) break;
    for(i=0;i<H;i++){
      for(j=0;j<W;j++){
	scanf(" %c",&tairu[i][j]);
      }
    }
    i=0;
    j=0;
    while(count!=1){
      if(tairu[i][j]=='.') break;
      if(tairu[i][j]=='>'){ 
	j++;
	if(sub[i][j]==1){
	  count=1;
	}
	sub[i][j]=1;
      }
      if(tairu[i][j]=='v'){
	i++;
	if(sub[i][j]==1){
	  count=1;
	}
	sub[i][j]=1;
      }
      if(tairu[i][j]=='<'){ 
	j--;
	if(sub[i][j]==1){
	  count=1;
	}
	sub[i][j]=1;
      }
      if(tairu[i][j]=='^'){
	i--;
	if(sub[i][j]==1){
	  count=1;
	}
	sub[i][j]=1;
      }
    }
    if(count==1) printf("LOOP\n");
    else{
      printf("%d %d\n",j,i);
    }
  }
  return 0;
}