#include <bits/stdc++.h>
using namespace std;
char zone[1005][1005];
bool check(int i, int j, int n, int m) {
  if (i < 0 || j < 0 || i == n || j == m || zone[i][j] == '*') return false;
  return true;
}
int main() {
  int n, m, k, px, py;
  cin >> n >> m >> k;
  int vis[n][m], dist[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> zone[i][j];
      vis[i][j] = 0;
      dist[i][j] = 100005;
      if (zone[i][j] == 'X') px = i, py = j;
    }
  }
  if (k % 2) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  queue<pair<pair<int, int>, int> > q;
  string ans = "";
  q.push(make_pair(make_pair(px, py), 0));
  int a, b, c;
  while (!q.empty()) {
    a = q.front().first.first;
    b = q.front().first.second;
    c = q.front().second;
    q.pop();
    if (vis[a][b]) continue;
    vis[a][b] = 1;
    dist[a][b] = c;
    if (check(a + 1, b, n, m) && !vis[a + 1][b])
      q.push(make_pair(make_pair(a + 1, b), c + 1));
    if (check(a - 1, b, n, m) && !vis[a - 1][b])
      q.push(make_pair(make_pair(a - 1, b), c + 1));
    if (check(a, b - 1, n, m) && !vis[a][b - 1])
      q.push(make_pair(make_pair(a, b - 1), c + 1));
    if (check(a, b + 1, n, m) && !vis[a][b + 1])
      q.push(make_pair(make_pair(a, b + 1), c + 1));
  }
  for (int i = 1; i <= k; i++) {
    if (check(px + 1, py, n, m) && k - i >= dist[px + 1][py]) {
      px++;
      ans += "D";
      continue;
    }
    if (check(px, py - 1, n, m) && k - i >= dist[px][py - 1]) {
      py--;
      ans += "L";
      continue;
    }
    if (check(px, py + 1, n, m) && k - i >= dist[px][py + 1]) {
      py++;
      ans += "R";
      continue;
    }
    if (check(px - 1, py, n, m) && k - i >= dist[px - 1][py]) {
      px--;
      ans += "U";
      continue;
    } else {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
  }
  cout << ans << endl;
}
