#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
bool issafe(int i, int j, int n, int m) {
  return i >= 0 && j >= 0 && i < n && j < m;
}
char s[] = {'D', 'L', 'R', 'U'};
int dx[] = {+1, 0, 0, -1};
int dy[] = {0, -1, +1, 0};
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  char a[n][m];
  int dist[n][m];
  pair<int, int> start;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      dist[i][j] = -1;
      cin >> a[i][j];
      if (a[i][j] == 'X') {
        start = {i, j};
      }
    }
  }
  if (k & 1) {
    cout << "IMPOSSIBLE"
         << "\n";
    return;
  }
  queue<pair<int, int> > q;
  q.push(start);
  dist[start.first][start.second] = 0;
  while (!q.empty()) {
    pair<int, int> curr = q.front();
    q.pop();
    for (int i = 0; i < 4; i++) {
      int nx = curr.first + dx[i], ny = curr.second + dy[i];
      if (issafe(nx, ny, n, m) && a[nx][ny] != '*' && dist[nx][ny] == -1) {
        q.push({nx, ny});
        dist[nx][ny] = dist[curr.first][curr.second] + 1;
      }
    }
  }
  string ans = "";
  pair<int, int> curr = start;
  bool flag = 0;
  while (k) {
    flag = 0;
    for (int i = 0; i < 4; i++) {
      int nx = curr.first + dx[i], ny = curr.second + dy[i];
      if (issafe(nx, ny, n, m) && a[nx][ny] != '*' && dist[nx][ny] <= k) {
        flag = 1;
        ans += s[i];
        curr = {nx, ny};
        k--;
        break;
      }
    }
    if (!flag) break;
  }
  if (!flag) {
    cout << "IMPOSSIBLE"
         << "\n";
    return;
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
