#include <bits/stdc++.h>
using namespace std;
int n, m, k, sx, sy;
char s[2005][2005];
int cnt;
int dx[] = {1, 0, 0, -1};
int dy[] = {0, -1, 1, 0};
char dir[] = "DLRU";
string ans;
int dist[1005][1005];
queue<pair<int, int> > q;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i) scanf("%s", s[i] + 1);
  if (k % 2 == 1) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j)
      if (s[i][j] == 'X') sx = i, sy = j;
  }
  for (int i = 0; i < 4; ++i)
    if (s[sx + dx[i]][sy + dy[i]] == '.') cnt++;
  if (cnt == 0) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) dist[i][j] = 1e9;
  dist[sx][sy] = 0;
  q.push(make_pair(sx, sy));
  while (!q.empty()) {
    int x = q.front().first, y = q.front().second;
    q.pop();
    for (int i = 0; i < 4; ++i) {
      int nxtx = x + dx[i], nxty = y + dy[i];
      if (nxtx >= 1 && nxtx <= n && nxty >= 1 && nxty <= m &&
          dist[nxtx][nxty] == 1e9 && s[nxtx][nxty] != '*') {
        dist[nxtx][nxty] = dist[x][y] + 1;
        q.push(make_pair(nxtx, nxty));
      }
    }
  }
  for (int i = 1; i <= k; ++i) {
    for (int j = 0; j < 4; ++j) {
      if ((sx + dx[j] >= 1 && sx + dx[j] <= n) &&
          (sy + dy[j] >= 1 && sy + dy[j] <= m) &&
          (dist[sx + dx[j]][sy + dy[j]] <= k - i)) {
        ans += dir[j];
        sx += dx[j];
        sy += dy[j];
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
