#include <bits/stdc++.h>
using namespace std;
int n, m, k, a;
char mapa[1005][1005];
int niveles[1005][1005];
int dj[] = {0, -1, 1, 0};
int di[] = {1, 0, 0, -1};
char letras[] = {'D', 'L', 'R', 'U'};
int main() {
  scanf("%d%d%d", &n, &m, &k);
  int iInicial, jInicial;
  string ans = "";
  if (k % 2 != 0) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    scanf("%s", mapa[i]);
    for (int j = 0; j < m; j++) {
      if (mapa[i][j] == 'X') {
        iInicial = i;
        jInicial = j;
      }
    }
  }
  queue<pair<int, int>> v;
  v.push({iInicial, jInicial});
  int iS, jS;
  niveles[iInicial][jInicial] = 1;
  while (!v.empty()) {
    int i, j;
    i = v.front().first;
    j = v.front().second;
    v.pop();
    for (int p = 0; p < 4; p++) {
      iS = i + di[p];
      jS = j + dj[p];
      if (niveles[iS][jS] == 0 && jS > -1 && iS > -1 && iS < n && jS < m &&
          mapa[iS][jS] != '*') {
        niveles[iS][jS] = niveles[i][j] + 1;
        v.push({iS, jS});
      }
    }
  }
  int i = iInicial, j = jInicial, p;
  for (k; k > 0; k--) {
    for (p = 0; p < 4;) {
      iS = i + di[p];
      jS = j + dj[p];
      if (niveles[iS][jS] <= k && jS > -1 && iS > -1 && iS < n && jS < m &&
          mapa[iS][jS] != '*')
        break;
      p++;
    }
    if (p == 4) {
      cout << "IMPOSSIBLE";
      return 0;
    }
    i = iS;
    j = jS;
    ans += letras[p];
  }
  cout << ans;
  return 0;
}
