#include <bits/stdc++.h>
using namespace std;
class point {
 public:
  int x, y;
  point(int x, int y) : x(x), y(y) {}
};
int n, m, k;
char field[1024][1024];
int dist[1024][1024];
int x, y, curX, curY;
const int INF = 1000000007;
point direcoties[4] = {point(0, 1), point(-1, 0), point(1, 0), point(0, -1)};
char* dir_names[] = {"D", "L", "R", "U"};
bool isCellAvaliable(int x, int y) {
  if (y >= 0 && y < n && x >= 0 && x < m && field[y][x] != '*') {
    return true;
  }
  return false;
}
void calcDists(int x, int y) {
  queue<point> nextValues;
  if (!isCellAvaliable(x, y)) {
    return;
  }
  dist[y][x] = 0;
  nextValues.push(point(x, y));
  while (!nextValues.empty()) {
    point cur = nextValues.front();
    nextValues.pop();
    for (int i = 0; i < 4; ++i) {
      int curX = cur.x + direcoties[i].x, curY = cur.y + direcoties[i].y;
      if (isCellAvaliable(curX, curY)) {
        if (dist[cur.y][cur.x] + 1 < dist[curY][curX]) {
          dist[curY][curX] = dist[cur.y][cur.x] + 1;
          nextValues.push(point(curX, curY));
        }
      }
    }
  }
}
bool isBad() {
  if (k % 2 == 1) {
    return true;
  }
  for (int i = 0; i < 4; ++i) {
    if (isCellAvaliable(x + direcoties[i].x, y + direcoties[i].y)) {
      return false;
    }
  }
  return true;
}
template <typename T>
void init(T field[1024][1024], T val) {
  for (int i = 0; i < n; ++i) {
    fill(field[i], field[i] + m, val);
  }
}
void doRandMove(bool isGoodMove) {
  for (int i = 0; i < 4; ++i) {
    if (isCellAvaliable(curX + direcoties[i].x, curY + direcoties[i].y) &&
        (!isGoodMove ||
         (dist[curY][curX] - 1 ==
          dist[curY + direcoties[i].y][curX + direcoties[i].x]))) {
      --k;
      curX += direcoties[i].x;
      curY += direcoties[i].y;
      printf(dir_names[i]);
      return;
    }
  }
}
void yankeeGoHome() {
  while (k > 0) {
    doRandMove(true);
  }
}
void run() {
  scanf("%d %d %d", &n, &m, &k);
  init(dist, INF);
  for (int i = 0; i < n; ++i) {
    char tmp;
    scanf("%c", &tmp);
    for (int j = 0; j < m; ++j) {
      scanf("%c", &field[i][j]);
      if (field[i][j] == 'X') {
        curY = y = i;
        curX = x = j;
      }
    }
  }
  calcDists(x, y);
  if (isBad()) {
    printf("IMPOSSIBLE");
    return;
  }
  while (dist[curY][curX] < k) {
    doRandMove(false);
  }
  yankeeGoHome();
}
int main() {
  run();
  return 0;
}
