#include <bits/stdc++.h>
const int MAXN = 1005;
const int MAXM = 1005;
const int MAXK = 1e6 + 5;
const int dx[] = {+1, 0, 0, -1};
const int dy[] = {0, -1, +1, 0};
const char dir[] = {'D', 'L', 'R', 'U'};
char grid[MAXN][MAXM], res[MAXK];
int N, M, X, Y;
int dist[MAXN][MAXM];
inline bool isPosValid(int x, int y) {
  return x >= 0 && y >= 0 && x <= N - 1 && y <= M - 1 && grid[x][y] != '*';
}
void bfs() {
  std::queue<std::pair<int, int> > q;
  int n, m, posDir, nx, ny;
  for (n = 0; n <= N - 1; ++n) {
    for (m = 0; m <= M - 1; ++m) {
      dist[n][m] = INT_MAX;
    }
  }
  q.push(std::make_pair(X, Y));
  dist[X][Y] = 0;
  std::pair<int, int> curr;
  while (!q.empty()) {
    curr = q.front();
    q.pop();
    for (posDir = 0; posDir <= 3; ++posDir) {
      nx = curr.first + dx[posDir];
      ny = curr.second + dy[posDir];
      if (!isPosValid(nx, ny) ||
          (dist[nx][ny] <= (dist[curr.first][curr.second] + 1))) {
        continue;
      }
      dist[nx][ny] = dist[curr.first][curr.second] + 1;
      q.push(std::make_pair(nx, ny));
    }
  }
}
int main() {
  int K, n, m, k, next, x, y, nx, ny;
  char c;
  scanf("%d", &N);
  scanf("%d", &M);
  scanf("%d", &K);
  scanf("\n");
  for (n = 0; n <= N - 1; ++n) {
    for (m = 0; m <= M - 1; ++m) {
      scanf(" %c", &c);
      grid[n][m] = c;
      if (c == 'X') {
        X = n;
        Y = m;
        grid[n][m] = '.';
      }
    }
  }
  if (K % 2 == 1) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  bfs();
  x = X;
  y = Y;
  for (k = 0; k <= K - 1; ++k) {
    for (next = 0; next <= 3; ++next) {
      nx = x + dx[next];
      ny = y + dy[next];
      if (isPosValid(nx, ny) && ((K - k - 1) >= dist[nx][ny])) {
        break;
      }
    }
    if (next == 4) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
    res[k] = dir[next];
    x = nx;
    y = ny;
  }
  for (k = 0; k <= K - 1; ++k) {
    printf("%c", res[k]);
    if (k == K - 1) {
      printf("\n");
    }
  }
  return 0;
}
