#include <bits/stdc++.h>
using namespace std;
const int MAXN = (1 << 10);
int n, m, k;
string a[MAXN];
void read() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
}
string dirs = "DLRU";
int dir_x[4] = {1, 0, 0, -1};
int dir_y[4] = {0, -1, 1, 0};
inline bool valid(int x, int y) { return (x < n && y < m && x >= 0 && y >= 0); }
int stX, stY;
int d[MAXN][MAXN];
void bfs() {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (a[i][j] == 'X') stX = i, stY = j;
      d[i][j] = -1;
    }
  queue<pair<int, int>> Q;
  Q.push({stX, stY});
  d[stX][stY] = 0;
  while (!Q.empty()) {
    int tX = Q.front().first, tY = Q.front().second;
    Q.pop();
    for (int dir = 0; dir < 4; dir++) {
      int x = tX + dir_x[dir];
      int y = tY + dir_y[dir];
      if (!valid(x, y) || a[x][y] == '*') continue;
      if (d[x][y] == -1) {
        d[x][y] = d[tX][tY] + 1;
        Q.push({x, y});
      }
    }
  }
}
void solve() {
  bfs();
  string res = "";
  int x = stX, y = stY;
  while (k) {
    char to_add = 0;
    for (int dir = 0; dir < 4; dir++) {
      int nx = x + dir_x[dir], ny = y + dir_y[dir];
      if (!valid(nx, ny) || a[nx][ny] == '*') continue;
      if (d[nx][ny] > k - 1) continue;
      to_add = dirs[dir];
      x = nx, y = ny;
      break;
    }
    if (to_add == 0) {
      cout << "IMPOSSIBLE" << '\n';
      return;
    }
    res += to_add;
    k--;
  }
  if (x != stX || y != stY)
    cout << "IMPOSSIBLE" << '\n';
  else
    cout << res << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
