#include <bits/stdc++.h>
using namespace std;
const int N = 1010, M = 4, inF = N * N;
int n, m, k, root_x, root_y, dis[N][N];
int dx[] = {1, 0, 0, -1}, dy[] = {0, -1, 1, 0};
char C[] = {'D', 'L', 'R', 'U'};
char s[N][N];
queue<pair<int, int> > q;
void input() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> s[i][j];
      if (s[i][j] == 'X')
        root_x = i, root_y = j;
      else
        dis[i][j] = inF;
    }
}
bool is_val(int x, int y) {
  return 0 <= x && x < n && 0 <= y && y < m && s[x][y] != '*';
}
void act(pair<int, int> p) {
  for (int i = 0; i < M; i++) {
    int x = p.first + dx[i], y = p.second + dy[i];
    if (is_val(x, y) && dis[x][y] == inF) {
      dis[x][y] = dis[p.first][p.second] + 1;
      q.push({x, y});
    }
  }
}
void bfs() {
  q.push({root_x, root_y});
  while (q.size()) {
    act(q.front());
    q.pop();
  }
}
string solve() {
  string ans;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < M; j++) {
      int x = root_x + dx[j], y = root_y + dy[j];
      if (is_val(x, y) && i + 1 + dis[x][y] <= k) {
        root_x = x;
        root_y = y;
        ans.push_back(C[j]);
        break;
      }
    }
    if (k % 2 || ans.empty()) return "IMPOSSIBLE";
  }
  return ans;
}
int main() {
  input();
  bfs();
  cout << solve();
  return 0;
}
