#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000 * 1000;
char a[1000][1000];
int d[1000][1000];
vector<pair<int, int> > dir = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
vector<char> l = {'R', 'D', 'L', 'U'};
int n, m, k;
bool check(pair<int, int> v) {
  return v.first >= 0 && v.first < m && v.second >= 0 && v.second < n;
}
void bfs(pair<int, int> v) {
  queue<pair<int, int> > q;
  q.push(v);
  d[v.second][v.first] = 0;
  while (!q.empty()) {
    v = q.front();
    q.pop();
    for (int i = (0); i < (4); ++i) {
      pair<int, int> to = {v.first + dir[i].first, v.second + dir[i].second};
      if (!check(to) || d[to.second][to.first] != -1 ||
          a[to.second][to.first] == '*') {
        continue;
      }
      d[to.second][to.first] = d[v.second][v.first] + 1;
      q.push(to);
    }
  }
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = (0); i < (n); ++i)
    for (int j = (0); j < (m); ++j) {
      d[i][j] = -1;
    }
  pair<int, int> start;
  for (int i = (0); i < (n); ++i) {
    scanf("%s", &a[i]);
    for (int j = (0); j < (m); ++j) {
      if (a[i][j] == 'X') {
        start = {j, i};
      }
    }
  }
  bfs(start);
  string res(k, '0');
  for (int i = (0); i < (k); ++i) {
    char ch = 'Z';
    pair<int, int> start1;
    for (int j = (0); j < (4); ++j) {
      pair<int, int> to = {start.first + dir[j].first,
                           start.second + dir[j].second};
      if (!check(to) || d[to.second][to.first] > k - i - 1 ||
          a[to.second][to.first] == '*') {
        continue;
      }
      if (ch > l[j]) {
        ch = l[j];
        start1 = to;
      }
    }
    if (ch == 'Z') {
      cout << "IMPOSSIBLE" << '\n';
      return 0;
    }
    res[i] = ch;
    start = start1;
  }
  printf("%s\n", res.c_str());
  return 0;
}
