#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
void no_answer() {
  puts("IMPOSSIBLE");
  exit(0);
}
char d[] = "DLRU";
int dx[] = {1, 0, 0, -1};
int dy[] = {0, -1, 1, 0};
int n, m, k;
char field[N][N];
int dist[N][N];
bool inside(int x, int y) {
  if (!(x >= 0 && x < n)) return false;
  if (!(y >= 0 && y < m)) return false;
  if (field[x][y] == '*') return false;
  return true;
}
using pii = pair<int, int>;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  if (k % 2 != 0) no_answer();
  int rx = -1;
  int ry = -1;
  for (int x = 0; x < n; ++x) {
    scanf(" %s", field[x]);
    for (int y = 0; y < m; ++y) {
      if (field[x][y] == 'X') {
        rx = x;
        ry = y;
      }
      dist[x][y] = -1;
    }
  }
  dist[rx][ry] = 0;
  queue<pii> q;
  q.emplace(rx, ry);
  while (q.size()) {
    int cx = q.front().first;
    int cy = q.front().second;
    q.pop();
    for (int i = 0; i < 4; ++i) {
      int nx = cx + dx[i];
      int ny = cy + dy[i];
      if (inside(nx, ny) && dist[nx][ny] == -1) {
        dist[nx][ny] = dist[cx][cy] + 1;
        q.emplace(nx, ny);
      }
    }
  }
  int cx = rx;
  int cy = ry;
  string ans;
  while (k > 0) {
    bool ok = false;
    for (int i = 0; i < 4; ++i) {
      int nx = cx + dx[i];
      int ny = cy + dy[i];
      if (inside(nx, ny) && dist[nx][ny] <= (k - 1)) {
        cx = nx;
        cy = ny;
        ans += d[i];
        ok = true;
        break;
      }
    }
    if (!ok) no_answer();
    --k;
  }
  puts(ans.c_str());
}
