#include <bits/stdc++.h>
using namespace std;
const long long ool = 1e18 + 9;
const int oo = 1e9 + 9, base = 1e9 + 7;
const double eps = 1e-7;
const int N = 1e3 + 6;
int n, m, k, st, step[] = {0, -1, 1, 0}, d[N * N];
char ch[4], inv[4];
bool bad[N * N], u[N * N];
string ans;
vector<int> path;
void dfs(int v, int len) {
  if (!len) {
    for (auto it : path) cout << ch[it];
    cout << "\n";
    exit(0);
  }
  for (int i = 0; i <= 3; ++i) {
    int to = v + step[i];
    if (1 <= to && to <= n * (m + 1) && !bad[to] && d[to] <= len &&
        (len & 1) != (d[to] & 1)) {
      path.emplace_back(i);
      dfs(to, len - 1);
    }
  }
  path.pop_back();
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> k;
  step[0] = m + 1;
  step[3] = -(m + 1);
  ch[0] = 'D', ch[1] = 'L', ch[2] = 'R', ch[3] = 'U';
  inv[0] = 'U', inv[1] = 'R', inv[2] = 'L', inv[3] = 'D';
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      char x;
      cin >> x;
      if (x == 'X') st = (m + 1) * (i - 1) + j + 1;
      if (x == '*') bad[(m + 1) * (i - 1) + j + 1] = 1;
    }
  }
  for (int i = 0; i <= n; ++i) {
    bad[i * (m + 1) + 1] = 1;
  }
  queue<int> q;
  q.push(st);
  u[st] = 1;
  while ((int)q.size()) {
    int v = q.front();
    q.pop();
    for (int i = 0; i <= 3; ++i) {
      int to = v + step[i];
      if (1 <= to && to <= n * (m + 1) && !bad[to] && !u[to]) {
        u[to] = 1;
        d[to] = d[v] + 1;
        q.push(to);
      }
    }
  }
  dfs(st, k);
  cout << "IMPOSSIBLE\n";
  return 0;
}
