#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> directions = {
    pair<int, int>(1, 0), pair<int, int>(0, -1), pair<int, int>(0, 1),
    pair<int, int>(-1, 0)};
string dir_names = "DLRU";
int main() {
  int m, n, k;
  cin >> n >> m >> k;
  if (k % 2 == 1) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  int robot_row, robot_col;
  vector<vector<char>> labirint(n, vector<char>(m));
  vector<vector<bool>> status(n, vector<bool>(m, false));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      char c;
      cin >> c;
      if (c == 'X') {
        robot_row = i;
        robot_col = j;
      }
      labirint[i][j] = c;
    }
  }
  vector<vector<int>> bfs_res(n, vector<int>(m, -1));
  bfs_res[robot_row][robot_col] = 0;
  queue<pair<int, int>> cells_to_visit;
  cells_to_visit.emplace(robot_row, robot_col);
  status[robot_row][robot_col] = true;
  while (!cells_to_visit.empty()) {
    auto cur_pair = cells_to_visit.front();
    cells_to_visit.pop();
    for (auto cur_dir : directions) {
      int new_row = cur_pair.first + cur_dir.first;
      int new_col = cur_pair.second + cur_dir.second;
      if (new_row >= 0 && new_row < n && new_col >= 0 && new_col < m &&
          !status[new_row][new_col] && (labirint[new_row][new_col] != '*')) {
        status[new_row][new_col] = true;
        cells_to_visit.emplace(new_row, new_col);
        bfs_res[new_row][new_col] =
            bfs_res[cur_pair.first][cur_pair.second] + 1;
      }
    }
  }
  int cur_row = robot_row;
  int cur_col = robot_col;
  string cur_str;
  int cur_step = 0;
  while (cur_step < k) {
    bool normas = false;
    char good_dir;
    for (int ind = 0; ind < 4; ++ind) {
      auto cur_dir = directions[ind];
      int new_row = cur_row + cur_dir.first;
      int new_col = cur_col + cur_dir.second;
      if (!normas && new_row >= 0 && new_row < n && new_col >= 0 &&
          new_col < m && labirint[new_row][new_col] != '*' &&
          cur_step + 1 + bfs_res[new_row][new_col] <= k) {
        normas = true;
        ++cur_step;
        good_dir = dir_names[ind];
        cur_row = new_row;
        cur_col = new_col;
      }
    }
    if (!normas) {
      cout << "IMPOSSIBLE";
      return 0;
    } else {
      cur_str.push_back(good_dir);
    }
  }
  cout << cur_str;
  return 0;
}
