#include <bits/stdc++.h>
using namespace std;
template <typename T>
void __p(T a) {
  cout << a;
}
template <typename T, typename F>
void __p(pair<T, F> a) {
  cout << "{";
  __p(a.first);
  cout << ",";
  __p(a.second);
  cout << "}\n";
}
template <typename T>
void __p(std::vector<T> a) {
  cout << "{";
  for (auto it = a.begin(); it < a.end(); it++)
    __p(*it), cout << ",}\n"[it + 1 == a.end()];
}
template <typename T, typename... Arg>
void __p(T a1, Arg... a) {
  __p(a1);
  __p(a...);
}
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cout << name << " : ";
  __p(arg1);
  cout << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
  int bracket = 0, i = 0;
  for (;; i++)
    if (names[i] == ',' && bracket == 0)
      break;
    else if (names[i] == '(')
      bracket++;
    else if (names[i] == ')')
      bracket--;
  const char *comma = names + i;
  cout.write(names, comma - names) << " : ";
  __p(arg1);
  cout << " | ";
  __f(comma + 1, args...);
}
void setIO(string s = "") {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin.exceptions(cin.failbit);
  if (((int)(s).size())) {
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);
  }
}
const int dx[] = {1, 0, 0, -1};
const int dy[] = {0, -1, 1, 0};
const char C[] = {'D', 'L', 'R', 'U'};
signed main() {
  setIO();
  int n, m, K;
  cin >> n >> m >> K;
  if (K & 1) return cout << "IMPOSSIBLE", 0;
  char a[n][m];
  int dis[n][m];
  int si = -1, sj = -1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> a[i][j];
      dis[i][j] = 1e9;
      if (a[i][j] == 'X') {
        si = i, sj = j;
        dis[si][sj] = 0;
      }
    }
  }
  priority_queue<pair<int, array<int, 2> > > q;
  q.push({0, {si, sj}});
  while (((int)(q).size())) {
    int res = -q.top().first, i = q.top().second[0], j = q.top().second[1];
    q.pop();
    if (res != dis[i][j]) continue;
    for (int k = 0; k < 4; ++k) {
      int ni = i + dx[k], nj = j + dy[k];
      if (ni >= 0 && ni < n && nj >= 0 && nj < m && a[ni][nj] != '*') {
        if (dis[ni][nj] > dis[i][j] + 1) {
          dis[ni][nj] = dis[i][j] + 1;
          q.push({-dis[ni][nj], {ni, nj}});
        }
      }
    }
  }
  int i = si, j = sj;
  string ans;
  for (int x = K - 1; x >= 0; --x) {
    for (int k = 0; k < 4; ++k) {
      int ni = i + dx[k], nj = j + dy[k];
      if (ni >= 0 && ni < n && nj >= 0 && nj < m && a[ni][nj] != '*') {
        if (dis[ni][nj] <= x) {
          i = ni, j = nj;
          ans.push_back(C[k]);
          break;
        }
      }
    }
  }
  if (((int)(ans).size()) < K) {
    return cout << "IMPOSSIBLE", 0;
  }
  cout << ans;
}
