#include <bits/stdc++.h>
using namespace std;
int di[] = {1, 0, 0, -1};
int dj[] = {0, -1, 1, 0};
string g = "DLRU";
int dst[1111][1111];
string maze[1111];
int n, m, k;
int I, J;
inline bool ok(int i, int j) { return i >= 0 && i < n && j >= 0 && j < m; }
void bfs(int i, int j) {
  for (int I = 0; I < n; I++) {
    for (int J = 0; J < m; J++) {
      dst[I][J] = 1e9;
    }
  }
  dst[i][j] = 0;
  queue<pair<int, int> > q;
  q.push(make_pair(i, j));
  while (q.size()) {
    i = q.front().first;
    j = q.front().second;
    q.pop();
    for (int k = 0; k < 4; k++) {
      int ni = i + di[k];
      int nj = j + dj[k];
      if (!ok(ni, nj)) continue;
      if (maze[ni][nj] == '*') continue;
      if (dst[ni][nj] > dst[i][j] + 1) {
        dst[ni][nj] = dst[i][j] + 1;
        q.push(make_pair(ni, nj));
      }
    }
  }
}
void load() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> maze[i];
    for (int j = 0; j < m; j++) {
      if (maze[i][j] == 'X') {
        I = i;
        J = j;
      }
    }
  }
}
string res;
void go(int i, int j, int k) {
  if (k == 0) return;
  for (int t = 0; t < 4; t++) {
    int ni = i + di[t];
    int nj = j + dj[t];
    if (!ok(ni, nj)) continue;
    if (dst[ni][nj] <= k - 1) {
      res += g[t];
      go(ni, nj, k - 1);
      break;
    }
  }
}
void solve() {
  if (k & 1) {
    cout << "IMPOSSIBLE" << endl;
    return;
  }
  bfs(I, J);
  go(I, J, k);
  if (k != (int)res.size()) {
    cout << "IMPOSSIBLE" << endl;
    return;
  }
  cout << res << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  load();
  solve();
  return 0;
}
