#include <bits/stdc++.h>
using namespace std;
int n, m, k;
vector<vector<int>> g;
vector<vector<int>> vis;
vector<vector<int>> min_dist;
int dx[] = {0, 0, -1, 1};
int dy[] = {-1, 1, 0, 0};
char letter[] = {'L', 'R', 'U', 'D'};
bool ok(int x, int y) {
  if (x >= 0 && x < n && y >= 0 && y < m && g[x][y] == 0) {
    return true;
  }
  return false;
}
void bfs(int sx, int sy) {
  vector<pair<int, int>> cur;
  int dist = 0;
  cur.push_back({sx, sy});
  vis[sx][sy] = 1;
  while (!cur.empty()) {
    vector<pair<int, int>> next;
    for (auto cell : cur) {
      min_dist[cell.first][cell.second] = dist;
      for (int i = 0; i < 4; i++) {
        int next_x = cell.first + dx[i];
        int next_y = cell.second + dy[i];
        if (!ok(next_x, next_y)) continue;
        if (vis[next_x][next_y] == 1) continue;
        vis[next_x][next_y] = 1;
        next.push_back({next_x, next_y});
      }
    }
    dist++;
    swap(cur, next);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> k;
  if (k % 2 == 1) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  g = vector<vector<int>>(n, vector<int>(m, 0));
  int sx = -1;
  int sy = -1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char x;
      cin >> x;
      if (x == '*') {
        g[i][j] = 1;
      }
      if (x == 'X') {
        sx = i;
        sy = j;
      }
    }
  }
  vis = vector<vector<int>>(n, vector<int>(m, 0));
  min_dist = vector<vector<int>>(n, vector<int>(m, 0));
  bfs(sx, sy);
  int cur_x = sx;
  int cur_y = sy;
  int remain_steps = k;
  string ans = "";
  while (remain_steps--) {
    vector<pair<char, pair<int, int>>> options;
    for (int i = 0; i < 4; i++) {
      int next_x = cur_x + dx[i];
      int next_y = cur_y + dy[i];
      if (!ok(next_x, next_y)) continue;
      if (min_dist[next_x][next_y] > (remain_steps)) continue;
      options.push_back({letter[i], {dx[i], dy[i]}});
    }
    if (options.empty()) {
      cout << "IMPOSSIBLE";
      return 0;
    }
    sort(options.begin(), options.end());
    ans += options[0].first;
    cur_x += options[0].second.first;
    cur_y += options[0].second.second;
  }
  cout << ans;
  return 0;
}
