#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
vector<vector<char> > lab;
vector<vector<long long> > mat;
void bfs(long long x, long long y) {
  queue<pair<long long, long long> > que;
  que.push(make_pair(x, y));
  long long t = 0;
  while (!que.empty()) {
    queue<pair<long long, long long> > que1;
    while (!que.empty()) {
      que1.push(que.front());
      que.pop();
    }
    while (!que1.empty()) {
      x = que1.front().first;
      y = que1.front().second;
      que1.pop();
      if (x + 1 < n && mat[x + 1][y] > t + 1) {
        mat[x + 1][y] = t + 1;
        que.push(make_pair(x + 1, y));
      }
      if (x - 1 >= 0 && mat[x - 1][y] > t + 1) {
        mat[x - 1][y] = t + 1;
        que.push(make_pair(x - 1, y));
      }
      if (y + 1 < m && mat[x][y + 1] > t + 1) {
        mat[x][y + 1] = t + 1;
        que.push(make_pair(x, y + 1));
      }
      if (y - 1 >= 0 && mat[x][y - 1] > t + 1) {
        mat[x][y - 1] = t + 1;
        que.push(make_pair(x, y - 1));
      }
    }
    t++;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m >> k;
  lab.resize(n, vector<char>(m));
  mat.resize(n, vector<long long>(m));
  long long sx, sy;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) {
      cin >> lab[i][j];
      if (lab[i][j] == 'X') {
        mat[i][j] = 0;
        sx = i;
        sy = j;
      } else if (lab[i][j] == '*') {
        mat[i][j] = -1;
      } else
        mat[i][j] = 1e8;
    }
  bfs(sx, sy);
  long long cx = sx, cy = sy;
  string res;
  while (k > 0) {
    k--;
    if (cx + 1 < n && lab[cx + 1][cy] != '*' && mat[cx + 1][cy] <= k) {
      cx++;
      res.push_back('D');
    } else if (cy - 1 >= 0 && lab[cx][cy - 1] != '*' && mat[cx][cy - 1] <= k) {
      cy--;
      res.push_back('L');
    } else if (cy + 1 < m && lab[cx][cy + 1] != '*' && mat[cx][cy + 1] <= k) {
      cy++;
      res.push_back('R');
    } else if (cx - 1 >= 0 && lab[cx - 1][cy] != '*' && mat[cx - 1][cy] <= k) {
      cx--;
      res.push_back('U');
    } else {
      cout << "IMPOSSIBLE";
      exit(0);
    }
  }
  cout << res;
  return 0;
}
