#include <bits/stdc++.h>
using namespace std;
const long long base = 31;
const long long mod = 1e9 + 7;
const long long maxn = 2e5 + 7;
long long hx[4] = {1, 0, 0, -1};
long long hy[4] = {0, -1, 1, 0};
long long n, m, k, d[1007][1007], x, y;
char a[1007][1007];
char kitu[4] = {'D', 'L', 'R', 'U'};
void program() {
  cin >> n >> m >> k;
  for (long long i = 0; i <= n + 1; i++) {
    for (long long j = 0; j <= m + 1; j++) {
      d[i][j] = mod;
      a[i][j] = '*';
    }
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      cin >> a[i][j];
      if (a[i][j] == 'X') {
        x = i;
        y = j;
      }
    }
  }
  bool check = 0;
  for (long long i = 0; i < 4; i++) {
    if (a[x + hx[i]][y + hy[i]] == '.') check = 1;
  }
  if (k & 1 || !check) {
    cout << "IMPOSSIBLE";
    return;
  }
  queue<pair<long long, long long> > q;
  d[x][y] = 0;
  q.push({x, y});
  while (!q.empty()) {
    long long u = q.front().first;
    long long v = q.front().second;
    q.pop();
    for (long long i = 0; i < 4; i++) {
      long long xx = u + hx[i];
      long long yy = v + hy[i];
      if (a[xx][yy] == '.' && d[xx][yy] == mod) {
        d[xx][yy] = d[u][v] + 1;
        q.push({xx, yy});
      }
    }
  }
  string s = "";
  for (long long i = 1; i <= k; i++) {
    for (long long j = 0; j < 4; j++) {
      long long xx = x + hx[j];
      long long yy = y + hy[j];
      if (d[xx][yy] <= k - i) {
        s += kitu[j];
        x = xx;
        y = yy;
        break;
      }
    }
  }
  cout << s;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  program();
}
