#include <bits/stdc++.h>
using namespace std;
const int nx[] = {1, 0, 0, -1}, ny[] = {0, -1, 1, 0};
const int maxn = 1010;
int n, m, k, start_x, start_y, dis[maxn][maxn];
string s[maxn], greed = "DLRU", ans;
queue<pair<int, int> > que;
bool Valid(int x, int y) {
  if (x >= 0 and x < n and y >= 0 and y < m and s[x][y] != '*') return true;
  return false;
}
int main(void) {
  cin >> n >> m >> k;
  if (k & 1) return 0 * puts("IMPOSSIBLE");
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (int j = 0; j < m; j++) {
      if (s[i][j] == 'X') start_x = i, start_y = j;
      dis[i][j] = 0x3f3f3f3f;
    }
  }
  que.emplace(start_x, start_y);
  dis[start_x][start_y] = 0;
  while (!que.empty()) {
    int x = que.front().first, y = que.front().second;
    que.pop();
    for (int i = 0; i < 4; i++) {
      int next_x = x + nx[i], next_y = y + ny[i];
      if (Valid(next_x, next_y) and dis[next_x][next_y] > dis[x][y] + 1)
        que.emplace(next_x, next_y), dis[next_x][next_y] = dis[x][y] + 1;
    }
  }
  int x = start_x, y = start_y;
  for (int i = 0; i < k; i++) {
    int dir;
    for (dir = 0; dir < 4; dir++) {
      int next_x = x + nx[dir], next_y = y + ny[dir];
      if (Valid(next_x, next_y) and dis[next_x][next_y] <= k - i - 1) break;
    }
    if (dir == 4) return 0 * puts("IMPOSSIBLE");
    x += nx[dir];
    y += ny[dir];
    ans += greed[dir];
  }
  cout << ans << endl;
  return 0;
}
