#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int vis[1005][1005], dis[1005][1005];
void solve() {
  int n, m, k, sx, sy, row[] = {1, 0, 0, -1}, col[] = {0, -1, 1, 0},
                       cnt1[5] = {0};
  cin >> n >> m >> k;
  vector<string> v;
  string s, str = "DLRU";
  for (int i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
  }
  if (k % 2) {
    cout << "IMPOSSIBLE\n";
    return;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (v[i][j] == 'X') {
        sx = i, sy = j;
      }
      dis[i][j] = INT_MAX;
    }
  }
  vector<char> vec;
  stack<char> st;
  int x = sx, y = sy;
  queue<pair<int, int> > q;
  q.push({x, y});
  vis[x][y] = 1;
  dis[x][y] = 0;
  while (!q.empty()) {
    pair<int, int> p = q.front();
    q.pop();
    x = p.first, y = p.second;
    for (int i = 0; i < 4; i++) {
      int x1 = x + row[i], y1 = y + col[i];
      if ((0 <= x1 && x1 < n) && (0 <= y1 && y1 < m) && (v[x1][y1] != '*') &&
          !vis[x1][y1]) {
        vis[x1][y1] = 1;
        q.push({x1, y1});
        dis[x1][y1] = dis[x][y] + 1;
      }
    }
  }
  int cnt = 0;
  x = sx, y = sy;
  while (cnt < k) {
    for (int i = 0; i < 4; i++) {
      int x1 = x + row[i], y1 = y + col[i];
      if ((0 <= x1 && x1 < n) && (0 <= y1 && y1 < m) &&
          (dis[x1][y1] <= k - cnt - 1)) {
        vec.push_back(str[i]);
        x = x1, y = y1;
        break;
      }
    }
    cnt++;
  }
  if (vec.size() != k) {
    cout << "IMPOSSIBLE\n";
    return;
  }
  for (auto w : vec) cout << w;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
