#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 0, 0, -1};
int dy[] = {0, -1, 1, 0};
string a[1111];
int di[1111][1111];
string dir = "DLRU";
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  if (k & 1) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  int sx, sy;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 0; j < m; j++)
      if (a[i][j] == 'X') {
        sx = i;
        sy = j;
      }
  }
  a[sx][sy] = '.';
  queue<pair<int, int> > q;
  q.push(make_pair(sx, sy));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) di[i][j] = 1e9;
  di[sx][sy] = 0;
  while (!q.empty()) {
    int tex = q.front().first;
    int tey = q.front().second;
    q.pop();
    for (int i = 0; i < 4; i++) {
      int x = tex + dx[i];
      int y = tey + dy[i];
      if (x < 0 || x >= n || y < 0 || y >= m || a[x][y] != '.') continue;
      if (di[x][y] > di[tex][tey] + 1) {
        di[x][y] = di[tex][tey] + 1;
        q.push(make_pair(x, y));
      }
    }
  }
  string ans = "";
  while (k > 0) {
    bool move_ = false;
    for (int i = 0; i < 4; i++) {
      int x = sx + dx[i];
      int y = sy + dy[i];
      if (x < 0 || x >= n || y < 0 || y >= m) continue;
      if (di[x][y] < k) {
        move_ = true;
        sx = x;
        sy = y;
        ans.push_back(dir[i]);
        break;
      }
    }
    if (!move_) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
    k--;
  }
  cout << ans << endl;
  return 0;
}
