#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
bool field[N][N];
int dist[N][N];
int n, m;
const int INF = 1e9;
bool get_field(int a, int b) {
  if (a < 0 || a >= n || b < 0 || b >= m) return false;
  return field[a][b];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  int k;
  cin >> n >> m >> k;
  if (k % 2 == 1) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  int x, y;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) {
      if (s[j] == 'X') {
        field[i][j] = true;
        x = i;
        y = j;
      } else if (s[j] == '.') {
        field[i][j] = true;
      } else {
        field[i][j] = false;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      dist[i][j] = INF;
    }
  }
  dist[x][y] = 0;
  queue<pair<int, int> > q;
  q.push(pair<int, int>(x, y));
  while (!q.empty()) {
    auto cur_pos = q.front();
    int nx = cur_pos.first;
    int ny = cur_pos.second;
    q.pop();
    for (int i = 0; i < 2; i++) {
      for (int j = -1; j <= 1; j += 2) {
        if (get_field(nx + i * j, ny + (1 - i) * j) &&
            dist[nx][ny] + 1 < dist[nx + i * j][ny + (1 - i) * j]) {
          dist[nx + i * j][ny + (1 - i) * j] = dist[nx][ny] + 1;
          q.push(pair<int, int>(nx + i * j, ny + (1 - i) * j));
        }
      }
    }
  }
  if (!get_field(x - 1, y) && !get_field(x + 1, y) && !get_field(x, y - 1) &&
      !get_field(x, y + 1)) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  string res = "";
  for (int i = 0; i < k; i++) {
    if (get_field(x + 1, y) && dist[x + 1][y] < k - i) {
      res += 'D';
      x++;
      continue;
    }
    if (get_field(x, y - 1) && dist[x][y - 1] < k - i) {
      res += 'L';
      y--;
      continue;
    }
    if (get_field(x, y + 1) && dist[x][y + 1] < k - i) {
      res += 'R';
      y++;
      continue;
    }
    if (get_field(x - 1, y) && dist[x - 1][y] < k - i) {
      res += 'U';
      x--;
      continue;
    }
  }
  cout << res << "\n";
  return 0;
}
