#include <bits/stdc++.h>
using namespace std;
const int INF = 10000000;
struct Node {
  int dist;
  bool free;
  bool was;
  Node() : dist(INF), was(false) {}
};
struct Move {
  int dx;
  int dy;
  char letter;
  Move(int a, int b, char c) : dx(a), dy(b), letter(c) {}
};
const int MAXN = 1002;
Node field[MAXN][MAXN];
vector<Move> moves;
void InitMoves() {
  moves.push_back(Move(1, 0, 'D'));
  moves.push_back(Move(0, -1, 'L'));
  moves.push_back(Move(0, 1, 'R'));
  moves.push_back(Move(-1, 0, 'U'));
}
void BFS(int x0, int y0) {
  field[x0][y0].dist = 0;
  field[x0][y0].was = true;
  InitMoves();
  queue<pair<int, int> > q;
  q.push(make_pair(x0, y0));
  while (!q.empty()) {
    int x = q.front().first;
    int y = q.front().second;
    q.pop();
    for (int i = 0; i < int(moves.size()); ++i) {
      Node& u = field[x + moves[i].dx][y + moves[i].dy];
      if (u.free && !u.was) {
        u.was = true;
        u.dist = 1 + field[x][y].dist;
        q.push(make_pair(x + moves[i].dx, y + moves[i].dy));
      }
    }
  }
}
string s;
void DFS(int x, int y, int k) {
  for (int i = 0; i < int(moves.size()); ++i) {
    Node v = field[x + moves[i].dx][y + moves[i].dy];
    if (v.free && v.dist <= k) {
      s.push_back(moves[i].letter);
      DFS(x + moves[i].dx, y + moves[i].dy, k - 1);
      return;
    }
  }
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < int(MAXN); ++i) {
    field[0][i].free = false;
    field[i][0].free = false;
    field[n + 1][i].free = false;
    field[i][m + 1].free = false;
  }
  int x, y;
  for (int i = 0; i < int(n); ++i) {
    for (int j = 0; j < int(m); ++j) {
      char a;
      cin >> a;
      field[i + 1][j + 1].free = (a != '*');
      if (a == 'X') {
        x = i + 1;
        y = j + 1;
      }
    }
  }
  if (k % 2 || !field[x][y + 1].free && !field[x][y - 1].free &&
                   !field[x + 1][y].free && !field[x - 1][y].free) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  BFS(x, y);
  DFS(x, y, k);
  cout << s << endl;
  return 0;
}
