#include <bits/stdc++.h>
using namespace std;
int n, m, k, start, stop;
char grid[1005][1005];
int shortestpath[1005][1005], visited[1005][1005];
int row[4] = {1, 0, 0, -1}, col[4] = {0, -1, 1, 0};
;
unordered_map<int, char> us;
string ans;
int func(int i, int j, int k) {
  if (shortestpath[i][j] > k) return 0;
  if (k == 0) {
    if (i == start && j == stop)
      return 1;
    else
      return 0;
  }
  for (int lp = 0; lp < 4; lp++) {
    if (i + row[lp] < n && i + row[lp] >= 0 && j + col[lp] < m &&
        j + col[lp] >= 0) {
      if (grid[i + row[lp]][j + col[lp]] != '*') {
        ans.push_back(us[lp]);
        if (func(i + row[lp], j + col[lp], k - 1)) return 1;
        ans.pop_back();
      }
    }
  }
  return 0;
}
void bfs(int r, int c) {
  shortestpath[r][c] = 0;
  queue<pair<int, int> > q;
  q.push({r, c});
  visited[r][c] = 1;
  while (!q.empty()) {
    int x = q.front().first;
    int y = q.front().second;
    q.pop();
    for (int lp = 0; lp < 4; lp++) {
      if ((x + row[lp] < n) && (x + row[lp] >= 0) && (y + col[lp] < m) &&
          (y + col[lp] >= 0)) {
        if (visited[x + row[lp]][y + col[lp]] == 0) {
          visited[x + row[lp]][y + col[lp]] = 1;
          if (grid[x + row[lp]][y + col[lp]] == '.') {
            q.push({x + row[lp], y + col[lp]});
            shortestpath[x + row[lp]][y + col[lp]] = shortestpath[x][y] + 1;
          }
        }
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  us[0] = 'D';
  us[1] = 'L';
  us[2] = 'R';
  us[3] = 'U';
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> grid[i][j];
      if (grid[i][j] == 'X') {
        start = i;
        stop = j;
      }
    }
  }
  if (k % 2 != 0) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  bfs(start, stop);
  int loop = 0;
  if (func(start, stop, k))
    cout << ans;
  else
    cout << "IMPOSSIBLE";
  return 0;
}
