#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
char table[1010][1010];
char res[1000010];
int d[1010][1010];
struct Point {
  int row;
  int col;
  Point() = default;
  Point(int _row, int _col) : row(_row), col(_col) {}
};
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  int dr[4] = {1, 0, 0, -1};
  int dc[4] = {0, -1, 1, 0};
  char dir[4] = {'D', 'L', 'R', 'U'};
  Point start;
  for (int i = 0; i < n; i++) {
    scanf("%s", table[i]);
    for (int j = 0; j < m; j++) {
      d[i][j] = -1;
      if (table[i][j] == 'X') start = Point(i, j);
    }
  }
  queue<Point> q;
  q.push(start);
  d[start.row][start.col] = 0;
  bool b = k % 2 == 0;
  while (b && !q.empty()) {
    b = false;
    Point p = q.front();
    q.pop();
    for (int i = 0; i < 4; i++) {
      int newRow = p.row + dr[i];
      int newCol = p.col + dc[i];
      if (!(0 <= newRow && newRow < n && 0 <= newCol && newCol < m)) continue;
      if (table[newRow][newCol] == '*') continue;
      b = true;
      if (d[newRow][newCol] != -1) continue;
      Point newPoint = Point(newRow, newCol);
      q.push(newPoint);
      d[newRow][newCol] = d[p.row][p.col] + 1;
    }
  }
  if (b) {
    int row = start.row;
    int col = start.col;
    for (int i = 0; i < k; i++) {
      for (int j = 0; j < 4; j++) {
        int newRow = row + dr[j];
        int newCol = col + dc[j];
        if (!(0 <= newRow && newRow < n && 0 <= newCol && newCol < m)) continue;
        if (table[newRow][newCol] == '*') continue;
        if (d[newRow][newCol] >= k - i) continue;
        row = newRow;
        col = newCol;
        res[i] = dir[j];
        break;
      }
    }
    printf("%s\n", res);
  } else {
    printf("IMPOSSIBLE\n");
  }
  return 0;
}
