#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <sstream>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int h, w;
	std::string buf;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	std::cin.rdbuf(ifs.rdbuf());
#endif

	while(std::cin >> h >> w){
		if(h == 0 && w == 0){ break; }
		std::vector<std::string> image;
		std::vector<std::vector<bool> >  is_visited(h, std::vector<bool>(w, false));
		int x = 0;
		int y = 0;

		for(int y = 0; y < h; y++){
			std::cin >> buf;
			image.push_back(buf);
		}

		while(true){
			if(image[y][x] == '.'){
				std::cout << x << " " << y << std::endl;
				break;
			}
			if(is_visited[y][x]){
				std::cout << "LOOP" << std::endl;
				break;
			}
			is_visited[y][x] = true;
			switch(image[y][x]){
			case '>':
				x++;
				break;
			case '<':
				x--;
				break;
			case '^':
				y--;
				break;
			case 'v':
				y++;
				break;
			default:
				break;
			}
		}
	}


#if INPUT_FROM_FILE
		//fclose(fp);
#endif
	return 0;
}

