#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
const int dx[4] = {+1, +0, +0, -1};
const int dy[4] = {+0, -1, +1, +0};
const int inf = numeric_limits<int>::max();
string moves = "DLRU";
char mat[N][N];
int dists[N][N];
int path[N][N];
int n, m, length;
int error() {
  cout << "IMPOSSIBLE\n";
  return 0;
}
bool valid(int x, int y) { return 0 <= x && x < n && 0 <= y && y < m; }
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> length;
  pair<int, int> start;
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < m; y++) {
      cin >> mat[x][y];
      if (mat[x][y] == 'X') {
        start = {x, y};
      }
    }
  }
  if (length % 2 != 0) {
    return error();
  }
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < m; y++) {
      dists[x][y] = inf;
    }
  }
  queue<pair<int, int> > q;
  dists[start.first][start.second] = 0;
  q.push(start);
  while (!q.empty()) {
    int x, y;
    tie(x, y) = q.front();
    q.pop();
    for (int k = 0; k < 4; k++) {
      int nx = x + dx[k];
      int ny = y + dy[k];
      if (!valid(nx, ny)) {
        continue;
      }
      if (mat[nx][ny] == '*') {
        continue;
      }
      if (dists[x][y] + 1 < dists[nx][ny]) {
        dists[nx][ny] = dists[x][y] + 1;
        q.push({nx, ny});
      }
    }
  }
  string path = "";
  pair<int, int> cur = start;
  while ((int)path.size() < length) {
    int x, y;
    tie(x, y) = cur;
    bool ok = false;
    for (int k = 0; k < 4; k++) {
      int nx = x + dx[k];
      int ny = y + dy[k];
      if (!valid(nx, ny)) {
        continue;
      }
      if (mat[nx][ny] == '*') {
        continue;
      }
      if ((int)path.size() + dists[nx][ny] + 1 <= length) {
        path += moves[k];
        cur = {nx, ny};
        ok = true;
        break;
      }
    }
    if (!ok) {
      return error();
    }
  }
  cout << path << '\n';
  return 0;
}
