#include <stdio.h>
typedef enum Tile{
	North,East,West,South,No,Passed
}Tile;

int src[5][2]={{-1,0},{0,1},{0,-1},{1,0},{0,0}};

class Pair{
public:
	Pair(){x=y=0;}
	void move(Tile t);
	int x,y;
};
void Pair::move(Tile t){
	x+=src[t][0];
	y+=src[t][1];
}


int main(){
	while(1){
		int h,w;
		bool stop=false;
		Pair pos;
		char c[101][101];
		scanf("%d%d",&h,&w);
		if(!h&&!w) break;
		for(int i=0;i<h;i++) scanf("%s",c[i]);
		while(!stop){
			Pair tmp=pos;
			switch(c[pos.x][pos.y]){
			case '^':
				pos.move(Tile::North);
				break;
			case '>':
				pos.move(Tile::East);
				break;
			case '<':
				pos.move(Tile::West);
				break;
			case 'v':
				pos.move(Tile::South);
				break;
			case '.':
				stop=true;
				printf("%d %d\n",pos.x,pos.y);
				break;
			case 0:
				stop=true;
				printf("LOOP\n");
			}
			c[tmp.x][tmp.y]=0;
		}
	}
	return 0;
}