#include <bits/stdc++.h>
using namespace std;
const int N = 1010, mod = int(1e9) + 7;
int n, m, k;
char second[N][N];
int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, -1, 1, 0};
int sx, sy;
int d[N][N];
char ch[4] = {'D', 'L', 'R', 'U'};
queue<pair<int, int> > q;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("\n%s", second[i] + 1);
    for (int j = 1; j <= m; j++) {
      if (second[i][j] == 'X') {
        sx = i;
        sy = j;
      }
    }
  }
  int res = 0;
  for (int i = 0; i < 4; i++) {
    if (second[sx + dx[i]][sy + dy[i]] == '.') res++;
  }
  if (!res || k % 2 == 1) {
    puts("IMPOSSIBLE");
    return 0;
  }
  memset(d, -1, sizeof(d));
  d[sx][sy] = 0;
  q.push(make_pair(sx, sy));
  while (!q.empty()) {
    int x = q.front().first;
    int y = q.front().second;
    q.pop();
    for (int i = 0; i < 4; i++) {
      int xx = x + dx[i];
      int yy = y + dy[i];
      if (second[xx][yy] == '.' && d[xx][yy] == -1) {
        d[xx][yy] = d[x][y] + 1;
        q.push(make_pair(xx, yy));
      }
    }
  }
  for (int i = k - 1; i >= 0; i--) {
    for (int j = 0; j < 4; j++) {
      int x = dx[j] + sx;
      int y = dy[j] + sy;
      if (d[x][y] != -1 && d[x][y] <= i && (i - d[x][y]) % 2 == 0) {
        sx = x;
        sy = y;
        putchar(ch[j]);
        break;
      }
    }
  }
  return 0;
}
