#include<iostream>
#include<cassert>
#include<vector>
using namespace std;

#define FILED (-1)

enum TILE_TYPE{
  TILE_NONE = 0,
  TILE_UP,
  TILE_DOWN,
  TILE_RIGHT,
  TILE_LEFT,

  TILE_TYPE_NUM
};
static const char tile_type[TILE_TYPE_NUM] {
  '.',
  '^',
  'v',
  '>',
  '<'
};
int get_tile_type(char data) {
  for (int i = 0; i < TILE_TYPE_NUM; i++)
    if (data == tile_type[i])
      return i;
  return FILED;
}

struct Tile {
public:
  Tile(int _type) : type(_type), entered(false) {}
  
  void  SetType(int _type) { type = _type; }
  int   GetType(void)      { return type; }
  bool  StepOn(void) {
    bool has_entered = entered;
    entered = true;

    return has_entered;
  }
private:
  int   type;
  bool  entered;
};

struct Pos {
public:
  Pos(int _x, int _y) : x(_x), y(_y) {}
  bool operator ==(const Pos _pos) { 
    return this->x == _pos.x && this->y == _pos.y; 
  }

  int x;
  int y;
};

class TileSet {
public:
  TileSet() { arr.reserve(MAX_ARRAY_SIZE); }
  void Resize(const int h,const int w)
  {
    // ????´???°????¨??????????TILE_NONE??§?????????
    arr.resize(h);
    for (auto &i : arr) {
      i.resize(w, TILE_NONE);
    }
  }
  void Set(const int x, const int y, const int data)
  {
    assert(data != FILED);

    arr[x][y].SetType(data);
  }
  Pos Move(Pos pos)
  {
    switch (arr[pos.x][pos.y].GetType())
    {
    case TILE_NONE:
      return pos;
    case TILE_UP:
      return Pos(pos.x, pos.y - 1);
    case TILE_DOWN:
      return Pos(pos.x, pos.y + 1);
    case TILE_LEFT:
      return Pos(pos.x - 1, pos.y);
    case TILE_RIGHT:
      return Pos(pos.x + 1, pos.y);
    default:
      // ?????????????????£??????????????????
      return pos;
    }
  }

  // ????????????????¨????
  Pos EnterRoom(void)
  {
    Pos pos(0,0);

    while (1)
    {
      Pos now_pos = pos;
      pos = Move(pos);
      //cout << pos.x << " " << pos.y << endl;
      // ??????????????¢????????´?????????????????????
      if (now_pos == pos) return pos;
      // ????????????????????´??????????????????
      if (arr[pos.x][pos.y].StepOn()) return Pos(FILED,FILED);
    }
  }
private:
  static const int MAX_ARRAY_SIZE = 100 * 100;

  vector< vector<Tile> > arr;
  int now_tile_x;
  int now_tile_y;
};

int main() {
  // ???????????????????????\???
  int H, W;
  while(1){
    cin >> H >> W;
    // 0 0 ?????\??????????????¨??????
    if (!(H+W))  break;

    TileSet tile_set;
    tile_set.Resize(W, H);
    for (int y = 0; y < H; y++) {
      for (int x = 0; x < W; x++) {
        char tile_data;
        cin >> tile_data;
        tile_set.Set(x, y, get_tile_type(tile_data));
      }
    }

    // ??????
    Pos pos = tile_set.EnterRoom();

    // ????????¨??????????????£?????????
    if (pos.x == FILED)
      cout << "LOOP" << endl;
    // ?§???????????????????
    else
      cout << pos.x << " " << pos.y << endl;
  }
}