#include <bits/stdc++.h>
using namespace std;
struct p_t {
  int i;
  int j;
};
enum color_e { C_WHITE, C_GRAY, C_BLACK };
struct nd_t {
  int c;
  int d;
  nd_t* p;
  int i;
  int j;
};
nd_t mtrx[1001][1001];
int bars[1001][1001];
p_t start_pos = {0, 0};
int n = 0;
int m = 0;
int k = 0;
std::string res;
struct m_t {
  char c;
  int i;
  int j;
};
m_t chrs[] = {{'D', 1, 0}, {'L', 0, -1}, {'R', 0, 1}, {'U', -1, 0}};
bool can_move(m_t& mv, int i, int j) {
  int ni = i + mv.i;
  int nj = j + mv.j;
  return ((ni >= 1) && (ni <= n) && (nj >= 1) && (nj <= m) &&
          (bars[ni][nj] == 0));
}
int main(int argc, char* argv[]) {
  cin >> n >> m >> k;
  res.resize(k, ' ');
  char c;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      cin >> c;
      mtrx[i][j].c = C_WHITE;
      mtrx[i][j].d = -1;
      mtrx[i][j].p = 0;
      mtrx[i][j].i = i;
      mtrx[i][j].j = j;
      bars[i][j] = (c == '*') ? 1 : 0;
      if (c == 'X') {
        start_pos.i = i;
        start_pos.j = j;
      }
    }
  }
  deque<nd_t*> S;
  nd_t& ms = mtrx[start_pos.i][start_pos.j];
  ms.d = 0;
  ms.c = C_GRAY;
  S.push_back(&ms);
  while (!S.empty()) {
    nd_t* p = S.front();
    S.pop_front();
    int des = p->d + 1;
    for (int i = 0; i <= 3; ++i) {
      if (can_move(chrs[i], p->i, p->j)) {
        int ni = p->i + chrs[i].i;
        int nj = p->j + chrs[i].j;
        nd_t* np = &mtrx[ni][nj];
        if (np->c == C_WHITE) {
          np->p = p;
          np->d = des;
          np->c = C_GRAY;
          S.push_back(np);
        }
      }
    }
    p->c = C_BLACK;
  }
  if ((k % 2) != 0) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  p_t p = start_pos;
  for (int si = 0; si < k; ++si) {
    bool was_move = false;
    for (int i = 0; i <= 3; ++i) {
      if (can_move(chrs[i], p.i, p.j)) {
        int ni = p.i + chrs[i].i;
        int nj = p.j + chrs[i].j;
        if (mtrx[ni][nj].d < (k - si)) {
          p.i = ni;
          p.j = nj;
          res[si] = chrs[i].c;
          was_move = true;
          break;
        }
      }
    }
    if (!was_move) {
      cout << "IMPOSSIBLE\n";
      return 0;
    }
  }
  cout << res << "\n";
  return 0;
}
