#include <bits/stdc++.h>
using namespace std;
int const dx[4] = {1, 0, 0, -1};
int const dy[4] = {0, -1, 1, 0};
char const dc[4] = {'D', 'L', 'R', 'U'};
struct Point {
  int x, y;
  Point() : x(0), y(0) {}
  Point(int _x, int _y) : x(_x), y(_y) {}
  Point operator+(const Point& point) const {
    return Point(x + point.x, y + point.y);
  }
};
int const maxN = 1010;
bool wall[maxN][maxN];
bool was[maxN][maxN];
int dist[maxN][maxN];
Point start;
Point que[maxN * maxN];
string ans;
int n, m, k;
bool good(Point u) {
  return u.x >= 0 && u.x < n && u.y >= 0 && u.y < m && !wall[u.x][u.y];
}
bool bfs() {
  int b = 0, e = 0;
  que[e++] = start;
  dist[start.x][start.y] = 0;
  was[start.x][start.y] = true;
  while (b < e) {
    Point v = que[b++];
    for (int i = 0; i < 4; ++i) {
      Point u = v + Point(dx[i], dy[i]);
      if (good(u) && !was[u.x][u.y]) {
        was[u.x][u.y] = true;
        dist[u.x][u.y] = dist[v.x][v.y] + 1;
        que[e++] = u;
      }
    }
  }
  return e > 1;
}
int main() {
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  scanf("%d%d%d\n", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char c;
      scanf("%c", &c);
      wall[i][j] = (c == '*');
      if (c == 'X') start = Point(i, j);
    }
    scanf("\n");
  }
  if (k % 2 == 1 || !bfs()) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  ans.clear();
  ans.reserve(k);
  Point v = start;
  int turns = k;
  while (turns > 0) {
    int dir = -1;
    for (int i = 0; i < 4 && dir < 0; ++i) {
      Point u = v + Point(dx[i], dy[i]);
      if (good(u) && turns - 1 >= dist[u.x][u.y]) dir = i;
    }
    v = v + Point(dx[dir], dy[dir]);
    turns--;
    ans.push_back(dc[dir]);
  }
  printf("%s\n", ans.c_str());
  return 0;
}
