#include <bits/stdc++.h>
using namespace std;
const int N = 423456;
const int inf = (int)1e9 + 7;
int n, m, k;
int sx, sy, x, y, d[1003][1003];
char a[1003][1003];
string ans;
int ab(int x) { return x < 0 ? -x : x; }
int dist(int i, int j) { return d[i][j]; }
bool valid(pair<int, int> s) {
  return (s.first >= 1 && s.first <= n && s.second >= 1 && s.second <= m);
}
void bfs() {
  queue<pair<int, int> > q;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      d[i][j] = inf;
    }
  }
  d[sx][sy] = 0;
  q.push({sx, sy});
  while (!q.empty()) {
    int i = q.front().first;
    int j = q.front().second;
    q.pop();
    vector<pair<int, int> > z = {
        {i + 1, j}, {i, j - 1}, {i, j + 1}, {i - 1, j}};
    for (auto k : z) {
      if (valid(k) && d[k.first][k.second] == inf &&
          a[k.first][k.second] != '*') {
        d[k.first][k.second] = d[i][j] + 1;
        q.push({k.first, k.second});
      }
    }
  }
}
void go(int i, int j) {
  x = i, y = j;
  vector<pair<int, int> > z = {{i + 1, j}, {i, j - 1}, {i, j + 1}, {i - 1, j}};
  string to = "DLRU";
  int bad = 1;
  for (int c = 0; c < 4; ++c) {
    if (valid(z[c]) && dist(z[c].first, z[c].second) <= k) {
      ans += to[c];
      --k;
      go(z[c].first, z[c].second);
      bad = 0;
      break;
    }
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      cin >> a[i][j];
      if (a[i][j] == 'X') {
        sx = i, sy = j;
      }
    }
  }
  bfs();
  x = sx, y = sy;
  go(sx, sy);
  if (x != sx || y != sy) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  if (!k) {
    cout << ans;
  } else {
    cout << "IMPOSSIBLE";
  }
  return 0;
}
