#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::queue;
using std::string;
using std::vector;
void bfs(int x, int y, int n, int m, int cnt, int t[][1001]) {
  t[x][y] = 1;
  struct point {
    int x, y;
  };
  queue<point> q;
  q.push({x, y});
  while (!q.empty()) {
    point p = q.front();
    q.pop();
    for (int i = -1; i <= 1; ++i)
      for (int j = -1; j <= 1; ++j)
        if (std::abs(i) != std::abs(j))
          if (p.x + i >= 0 and p.x + i < n and p.y + j >= 0 and p.y + j < m and
              t[p.x + i][p.y + j] == 0) {
            t[p.x + i][p.y + j] = t[p.x][p.y] + 1;
            q.push({p.x + i, p.y + j});
          }
  }
}
int t[1001][1001] = {{0}};
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  string f[n];
  for (int i = 0; i < n; ++i) cin >> f[i];
  if (k % 2 == 1) return cout << "IMPOSSIBLE", 0;
  int x, y;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      if (f[i][j] == 'X') {
        x = i, y = j;
      }
      if (f[i][j] == '*') t[i][j] = -1;
    }
  bfs(x, y, n, m, 1, t);
  string ans = "";
  string dir = "DLRU";
  struct add {
    int x, y;
  };
  vector<add> v = {{1, 0}, {0, -1}, {0, 1}, {-1, 0}};
  for (int len = 0; len < k; ++len) {
    for (int i = 0; i < dir.size(); ++i)
      if (x + v[i].x >= 0 and x + v[i].x < n and y + v[i].y >= 0 and
          y + v[i].y < m)
        if (t[x + v[i].x][y + v[i].y] - 1 <= k - ans.size()) {
          ans.push_back(dir[i]);
          x += v[i].x, y += v[i].y;
          break;
        }
  }
  return (cout << (ans.size() == 0 ? "IMPOSSIBLE" : ans)), 0;
}
