#include <bits/stdc++.h>
using namespace std;
using ul = unsigned long long;
using ll = long long;
using db = double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<db, db>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<db>;
int N, M, K;
char c;
vector<vi> D, m;
int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, -1, 1, 0};
string dirs = "DLRU";
int main() {
  cin >> N >> M >> K;
  if (K & 1) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  int pi, pj, x, y;
  m.assign(N, vi(M, 0));
  for (int i = 0; i < (int)N; i++)
    for (int j = 0; j < (int)M; j++) {
      cin >> c;
      m[i][j] = (c == '*');
      if (c == 'X') pi = i, pj = j;
    }
  bool flag = 0;
  queue<pair<pii, int>> Q;
  Q.emplace(make_pair(pi, pj), 0);
  D.assign(N, vi(M, -1));
  D[pi][pj] = 0;
  while (!Q.empty()) {
    tie(x, y) = Q.front().first;
    D[x][y] = Q.front().second;
    Q.pop();
    for (int k = 0; k < (int)4; k++) {
      int x_ = x + dx[k], y_ = y + dy[k];
      if (x_ >= 0 && x_ < N && y_ >= 0 && y_ < M && !m[x_][y_] &&
          D[x_][y_] == -1) {
        flag = 1;
        D[x_][y_] = 0;
        Q.emplace(make_pair(x_, y_), D[x][y] + 1);
      }
    }
  }
  if (!flag) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  x = pi, y = pj;
  while (K--)
    for (int k = 0; k < (int)4; k++) {
      int x_ = x + dx[k], y_ = y + dy[k];
      if (x_ >= 0 && x_ < N && y_ >= 0 && y_ < M && !m[x_][y_] &&
          D[x_][y_] <= K) {
        cout << dirs[k];
        x = x_, y = y_;
        break;
      }
    }
  cout << '\n';
}
