#include<cstdio>
#include<cstring>


int main()
{
	int w,k,hyou[100][100],i,j,check[100],l=0;
	memset(check,0,100*sizeof(int));
	char a;
	while(1)
	{
		scanf("%d%d",&w,&k);
		if(w==0)
			break;
		scanf("%c",&a);
		for(i=0;i<w;i++)
		{
			for(j=0;j<=k;j++)
			{
				scanf("%c",&a);
				if(a=='>')
					hyou[i][j]=1;
				else	if(a=='<')
					hyou[i][j]=2;
				else if(a=='v')
					hyou[i][j]=3;
				else if(a=='^')
					hyou[i][j]=4;
				else if(a=='.')
					hyou[i][j]=0;
				else 
					hyou[i][j]=6;
			}
			
			
		}
		i=0;
		j=0;
		while(hyou[i][j]!=5&&hyou[i][j]!=0)
		{
			switch(hyou[i][j])
			{
			case 1:
				hyou[i][j]=5;
				j++;
				break;
			case 2:
				hyou[i][j]=5;
				j--;
				break;
			case 3:
				hyou[i][j]=5;
				i++;
				break;
			case 4:
				hyou[i][j]=5;
				i--;
				break;
			case 0:
				check[l]=i*10+j;
				break;
			case 5:
				check[l]=0;
				break;
			}
		}
		if(hyou[i][j]==0)
			check[l]=i*10+j;
		l++;
	}
	for(i=0;i<l;i++)
	{
		if(check[i]==0)
			printf("LOOP\n");
		else
			printf("%d %d\n",check[i]%10,check[i]/10);
	}
	return 0;
}