#include<stdio.h>
int a,b,limx,limy;
char s[102][102];
int pass[102][102];
void check(int x,int y){
    if(pass[x][y]!=1){
        a=x,b=y;
        pass[x][y]=1;
        if(s[x][y]=='^'&&x-1>=0){
            if(x-1>=0)
            a=-1;
            else
        check(x-1,y);
        }
        if(s[x][y]=='v'&&x+1<limx){
        if(x+1<limx)
        a=-1;
        else
        check(x+1,y);
        }
        if(s[x][y]=='>'){
            if(y+1<limy)
            a=-1;
            else
        check(x,y+1);
    }
        if(s[x][y]=='<'&&y-1>=0){
            if(y-1>=0)
            a=-1;
            else
        check(x,y-1);
    }
    }
    else
    a=-1;
}
main(){
    int x,y,i,j;
    while(1){
        scanf("%d %d",&x,&y);
        if(x==0&&y==0)
        break;
        limx=x;limy=y;
        for(i=0;i<x;i++)
        for(j=0;j<y;j++)
        pass[x][y]=0;
        for(i=0;i<x;i++)
        scanf("%s",&s[i]);
        check(0,0);
        if(a!=-1)
        printf("%d %d\n",b,a);
        else
        printf("LOOP\n");
    }
}