#include <bits/stdc++.h>
using namespace std;
vector<string> mp;
int dir[4][2] = {{1, 0}, {0, -1}, {0, 1}, {-1, 0}};
string dirName("DLRU");
vector<vector<int> > pathLens;
string ans;
int n, m, k;
void solve(int curI, int curJ, int curLen) {
  if (curLen == 0) {
    cout << ans;
    exit(0);
  }
  for (int i = 0; i < 4; i++) {
    int tmpI = curI + dir[i][0], tmpJ = curJ + dir[i][1];
    if (tmpI < 0 || tmpJ < 0 || tmpI >= n || tmpJ >= m ||
        mp[tmpI][tmpJ] == '*') {
      continue;
    }
    if (pathLens[tmpI][tmpJ] <= curLen) {
      ans.push_back(dirName[i]);
      solve(tmpI, tmpJ, curLen - 1);
      break;
    }
  }
}
int main() {
  cin >> n >> m >> k;
  mp.resize(n);
  int posI = -1, posJ = -1;
  for (int i = 0; i < n; i++) {
    cin >> mp[i];
    for (int j = 0; j < m && posI == -1; j++) {
      if (mp[i][j] == 'X') {
        posI = i;
        posJ = j;
        break;
      }
    }
  }
  if (k % 2 == 1) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  vector<vector<char> > used(n, vector<char>(m, 0));
  pathLens = vector<vector<int> >(n, vector<int>(m, 0));
  queue<pair<int, int> > q;
  q.push(make_pair(posI, posJ));
  used[posI][posJ] = 1;
  while (!q.empty()) {
    pair<int, int> top = q.front();
    q.pop();
    int len = pathLens[top.first][top.second];
    for (int i = 0; i < 4; i++) {
      int tmpI = top.first + dir[i][0], tmpJ = top.second + dir[i][1];
      if (tmpI < 0 || tmpJ < 0 || tmpI >= n || tmpJ >= m || used[tmpI][tmpJ] ||
          mp[tmpI][tmpJ] == '*') {
        continue;
      }
      pathLens[tmpI][tmpJ] = len + 1;
      q.push(make_pair(tmpI, tmpJ));
      used[tmpI][tmpJ] = 1;
    }
  }
  solve(posI, posJ, k);
  if (ans.length() == 0) {
    cout << "IMPOSSIBLE";
  } else
    cout << ans;
  return 0;
}
