#include <stdio.h>
#include <stdlib.h>

typedef struct {
	int x;
	int y;
} posn;

posn* next(posn *now, char bord[128][128], int W, int H) {
	posn* ans;

	ans = (posn*)malloc(sizeof(posn));

	switch(bord[now->y][now->x]) {
		case '>' : if(now->x < W - 1)
					   ans->x = now->x + 1;
				   else
					   ans->x = now->x;
				   break;

		case '<' : if(now->x > 0)
					   ans->x = now->x - 1;
				   else
					   ans->x = now->x;
				   break;

		case 'v' : if(now->y < H - 1)
					   ans->y = now->y + 1;
				   else
					   ans->y = now->y;
				   break;

		case '^' : if(now->y > 0)
					   ans->y = now->y - 1;
				   else
					   ans->y = now->y;
				   break;

		case '.' : ans->x = now->x;
				   ans->y = now->y;
	}

	return ans;
}

int main() {
	int W , H;
	char bord[128][128];
	int count = 0;
	posn now;
	posn *temp;

	int i, j;

	while(1) {
		scanf("%d %d", &H, &W);
		if(W == 0 && H == 0)
			break;

		for(i = 0; i < H; i++)
			scanf("%s", bord[i]);

		now.x = 0; now.y = 0;

		count = 0;
		while(count < W * H) {
			temp = next(&now, bord, W, H);
		
			if(temp->x == now.x && temp->y == now.y)
				break;
			
			else {
				now.x = temp->x;
				now.y = temp->y;
			}

			count++;
			free(temp);
		}

		if(count == W * H)
			printf("LOOP\n");
		else
			printf("%d %d\n", now.x, now.y);

	}
	
	return 0;
}