#include <bits/stdc++.h>
using namespace std;
const int Inf = 1e9 + 7;
const int N = 1e3 + 7;
int n, m, k;
string maze[N];
string dir = "DLRU";
int dr[] = {1, 0, 0, -1};
int dc[] = {0, -1, 1, 0};
int dist[N][N];
int r0, c0;
void solve() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) cin >> maze[i];
  if (k % 2 != 0) {
    cout << "IMPOSSIBLE" << '\n';
    return;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (maze[i][j] == 'X') {
        r0 = i;
        c0 = j;
        break;
      }
  queue<pair<int, int> > Q;
  Q.push(make_pair(r0, c0));
  memset(dist, 0x3f, sizeof(dist));
  dist[r0][c0] = 0;
  while (!Q.empty()) {
    pair<int, int> cur = Q.front();
    Q.pop();
    int r = cur.first;
    int c = cur.second;
    for (int i = 0; i < 4; i++) {
      int r2 = r + dr[i];
      int c2 = c + dc[i];
      if (0 <= r2 && r2 < n && 0 <= c2 && c2 < m && maze[r2][c2] != '*') {
        if (dist[r][c] + 1 < dist[r2][c2]) {
          dist[r2][c2] = dist[r][c] + 1;
          Q.push(make_pair(r2, c2));
        }
      }
    }
  }
  string res;
  int r = r0, c = c0;
  while (k > 0) {
    bool ok = false;
    for (int i = 0; i < 4; i++) {
      int r2 = r + dr[i];
      int c2 = c + dc[i];
      if (0 <= r2 && r2 < n && 0 <= c2 && c2 < m && maze[r2][c2] != '*') {
        if (dist[r2][c2] <= k) {
          r = r2;
          c = c2;
          k--;
          res += dir[i];
          ok = true;
          break;
        }
      }
    }
    if (!ok && k != 0) {
      cout << "IMPOSSIBLE" << '\n';
      return;
    }
  }
  cout << res << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(9);
  cout << fixed;
  solve();
  return 0;
}
