#include <stdio.h>
struct point{
    int x;
    int y;
    void init(){
        x=0;
        y=0;
    };
};
int main(){
    int h,w;
    point now;
    char a[100][100];
    bool went[100][100];
    while(1){
        scanf("%d%d",&h,&w);
        if(h==0)return 0;
        for(int i=0;i<h;i++){
            scanf("%s",a[i]);
            for(int j=0;j<w;j++)went[i][j]=false;
        }
        now.init();
        while(a[now.x][now.y]!='.'){
            if(went[now.x][now.y]){
                printf("LOOP\n");
                break;
            }
            went[now.x][now.y]=true;
            if(a[now.x][now.y]=='v')now.x++;
            else if(a[now.x][now.y]=='^')now.x--;
            else if(a[now.x][now.y]=='<')now.y--;
            else if(a[now.x][now.y]=='>')now.y++;
        }
        if(a[now.x][now.y]=='.')printf("%d %d\n",now.y,now.x);
    }
}