#include <bits/stdc++.h>
using namespace std;
char s[1002 * 1024];
int d[1002 * 1024];
char Ci[4] = {'D', 'L', 'R', 'U'};
int Di[4] = {1024, -1, 1, -1024};
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  if (k % 2 == 1) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  int I;
  for (int i = 1; i <= n; i++) {
    cin >> s + i * 1024 + 1;
    for (int j = i * 1024 + 1; j <= i * 1024 + m; j++)
      if (s[j] == 'X') I = j, s[j] = '.';
  }
  vector<int> p = {I}, q;
  int level = 1;
  d[I] = level;
  while (!p.empty()) {
    level++;
    for (int i : p)
      for (int di : Di)
        if (s[i + di] == '.' && d[i + di] == 0)
          d[i + di] = level, q.push_back(i + di);
    swap(p, q);
    q.clear();
  }
  if (level == 2) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  for (k++; k-- > 1;) {
    for (int i = 0; i < 4; i++) {
      int J = I + Di[i];
      if (s[J] == '.' && d[J] <= k) {
        I = J;
        cout << Ci[i];
        break;
      }
    }
  }
}
