#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
const int infi = 1e9 + 7;
const long long infl = 1e18 + 7;
int ar[1010][1010];
int dist[1010][1010];
int used[1010][1010];
int p[1010][1010];
pair<int, int> que[1000500];
int dx[] = {1, 0, 0, -1};
int dy[] = {0, -1, 1, 0};
char let[] = "DLRU";
int check(int x, int y) { return x >= 0 && y >= 0 && ar[x][y]; }
void bfs(pair<int, int> pos) {
  dist[pos.first][pos.second] = 0;
  used[pos.first][pos.second] = 1;
  que[0] = pos;
  int l = 0, r = 1;
  while (l < r) {
    int x = que[l].first, y = que[l].second;
    ++l;
    int d = dist[x][y] + 1;
    for (int k = 0; k < (4); ++k) {
      int nx = x + dx[k], ny = y + dy[k];
      if (check(nx, ny) && !used[nx][ny] && dist[nx][ny] > d) {
        dist[nx][ny] = d;
        used[nx][ny] = 1;
        p[nx][ny] = k;
        que[r++] = make_pair(nx, ny);
      }
    }
  }
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int n, m, K;
  cin >> n >> m >> K;
  pair<int, int> pos;
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (m); ++j) {
      char c;
      cin >> c;
      if (c == '.') ar[i][j] = 1;
      if (c == 'X') ar[i][j] = 2, pos = make_pair(i, j);
      dist[i][j] = infi;
    }
  }
  bfs(pos);
  int x = pos.first, y = pos.second;
  string ans;
  int len = 0;
  while (1) {
    int flag = 0;
    ++len;
    for (int k = 0; k < (4); ++k) {
      int nx = x + dx[k], ny = y + dy[k];
      if (!check(nx, ny)) continue;
      if (len + dist[nx][ny] > K) continue;
      flag = 1;
      ans += let[k];
      x = nx, y = ny;
      break;
    }
    if (!flag) {
      cout << "IMPOSSIBLE";
      return 0;
    }
    if (len + dist[x][y] == K) {
      break;
    }
  }
  while (x != pos.first || y != pos.second) {
    for (int k = 0; k < (4); ++k) {
      int nx = x + dx[k], ny = y + dy[k];
      if (!check(nx, ny) || dist[x][y] - 1 != dist[nx][ny]) {
        continue;
      }
      ans += let[k];
      x += dx[k], y += dy[k];
      break;
    }
  }
  cout << ans;
  return 0;
}
