#include <bits/stdc++.h>
using namespace std;
void ga(int N, int *A) {
  for (int i(0); i < N; i++) scanf("%d", A + i);
}
char s[(1004)][(1004)], b[((1004) * (1004))], e[((1004) * (1004))],
    D[] = "DLRU";
int N, M, K, x, y, X, Y, sx[] = {1, 0, 0, -1}, sy[] = {0, -1, 1, 0}, a, U, V, d,
                         I, cn[(1004)][(1004)];
int xx(int x, int y) {
  for (int i(0); i < 4; i++) {
    X = x + sx[i], Y = y + sy[i];
    if ((~X && ~Y && X < N && Y < M) && s[X][Y] ^ 42) return i;
  }
  return -1;
}
int xxl(int x, int y) {
  for (int i(0); i < 4; i++) {
    X = x + sx[i], Y = y + sy[i];
    if ((~X && ~Y && X < N && Y < M) && s[X][Y] ^ 42 && cn[X][Y] < cn[x][y])
      return i;
  }
  return -1;
}
void bfs(int x, int y) {
  queue<pair<int, int> > Q;
  (memset(cn, -1, sizeof(cn))), cn[x][y] = 0;
  Q.push({x, y});
  while (!Q.empty()) {
    x = Q.front().first, y = Q.front().second, Q.pop();
    for (int i(0); i < 4; i++) {
      X = x + sx[i], Y = y + sy[i];
      if ((~X && ~Y && X < N && Y < M) && s[X][Y] ^ 42 && !~cn[X][Y])
        cn[X][Y] = cn[x][y] + 1, Q.push({X, Y});
    }
  }
}
int main(void) {
  scanf("%d%d%d", &N, &M, &K);
  for (int i(0); i < N; i++) scanf("%s", s[i]);
  for (int i(0); i < N; i++)
    for (int j(0); j < M; j++)
      if (s[i][j] == 'X') U = x = i, V = y = j;
  if (K & 1 || !~xx(x, y)) return puts("IMPOSSIBLE"), 0;
  bfs(x, y);
  for (int i(0); i < K; i++) {
    if (i + cn[x][y] == K) break;
    b[I++] = D[a = xx(x, y)], x += sx[a], y += sy[a];
  }
  while (cn[x][y]) b[I++] = D[a = xxl(x, y)], x += sx[a], y += sy[a];
  puts(b);
  return 0;
}
