#include <bits/stdc++.h>
using namespace std;
int n, m, k, dist[1010][1010], px[4] = {1, 0, 0, -1}, py[4] = {0, -1, 1, 0};
char c[1010][1010], res[4] = {'D', 'L', 'R', 'U'};
pair<int, int> x;
queue<pair<int, int>> q;
bool out;
string ans = "";
void bfs() {
  q.push(x), dist[x.first][x.second] = 1;
  while (!q.empty()) {
    auto [a, b] = q.front();
    for (int i = 0; i < 4; i++)
      if (!dist[a + px[i]][b + py[i]] && c[a + px[i]][b + py[i]] != '*')
        dist[a + px[i]][b + py[i]] = dist[a][b] + 1,
                            q.push({a + px[i], b + py[i]});
    q.pop();
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 0; i < 1010; i++) fill(c[i], c[i] + 1010, '*');
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cin >> c[i][j];
      if (c[i][j] == 'X') x = {i, j};
    }
  if (k % 2) out = true;
  bfs();
  for (int i = 1; i <= k; i++) {
    bool flag = false;
    for (int j = 0; j < 4 && !flag; j++)
      if (c[x.first + px[j]][x.second + py[j]] != '*' &&
          k - i >= dist[x.first + px[j]][x.second + py[j]] - 1)
        ans += res[j], flag = true, x.first += px[j], x.second += py[j];
    if (!flag) out = true;
  }
  cout << (out ? "IMPOSSIBLE" : ans) << '\n';
  return 0;
}
