#include <bits/stdc++.h>
using namespace std;
int Read(int *a, int *b, int *c, char d[][1000]) {
  int i, j;
  char t;
  scanf("%d%d%d", a, b, c);
  scanf("%c", &c);
  for (i = 0; i < *a; i++) {
    for (j = 0; j < *b; j++) scanf("%c", &d[i][j]);
    scanf("%c", &c);
  }
  return 0;
}
int CorrectXY(int x, int n, int y, int m) {
  if ((x >= 0) && (x < n) && (y >= 0) && (y < m))
    return 1;
  else
    return 0;
}
void Fill(char a[][1000], int b[][1000], int n, int m, int *x, int *y) {
  int i, j;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) {
      if (a[i][j] == '.') b[i][j] = 0;
      if (a[i][j] == '*') b[i][j] = -1;
      if (a[i][j] == 'X') {
        *x = i;
        *y = j;
      }
    }
  return;
}
void Wave(int x, int y, int n, int m, int ar[][1000], int dx[], int dy[]) {
  int i, l = 0;
  queue<int> qx, qy;
  qx.push(x);
  qy.push(y);
  while (!(qx.empty())) {
    x = qx.front();
    y = qy.front();
    qx.pop();
    qy.pop();
    for (i = 0; i < 4; i++)
      if (CorrectXY(x + dx[i], n, y + dy[i], m) &&
          (ar[x + dx[i]][y + dy[i]] == 0)) {
        ar[x + dx[i]][y + dy[i]] = ar[x][y] + 1;
        qx.push(x + dx[i]);
        qy.push(y + dy[i]);
      }
  }
  return;
}
void BuildTheWay(int n, int m, int k, char a[][1000], char way[]) {
  int i, x, y, curlen, fl, l, IMP;
  int ar[1000][1000];
  int dx[4] = {1, 0, 0, -1};
  int dy[4] = {0, -1, 1, 0};
  char course[4] = {'D', 'L', 'R', 'U'};
  curlen = IMP = l = 0;
  Fill(a, ar, n, m, &x, &y);
  ar[x][y] = 1;
  Wave(x, y, n, m, ar, dx, dy);
  for (i = 0, IMP = 1; i < 4; i++)
    if (CorrectXY(x + dx[i], n, y + dy[i], m) && (ar[x + dx[i]][y + dy[i]] > 0))
      IMP = 0;
  if ((IMP) || (k % 2 == 1))
    strcpy(way, "IMPOSSIBLE");
  else {
    do {
      for (i = 0, fl = 0; i < 4; i++)
        if (CorrectXY(x + dx[i], n, y + dy[i], m) &&
            (ar[x + dx[i]][y + dy[i]] > 0) &&
            (curlen + ar[x + dx[i]][y + dy[i]] <= k)) {
          curlen++;
          x += dx[i];
          y += dy[i];
          way[l] = course[i];
          way[++l] = '\0';
          fl = 1;
          break;
        }
    } while (fl);
  }
  return;
}
void Write(char s[]) {
  printf("%s\n", s);
  return;
}
int main() {
  int n, m, k;
  char a[1000][1000];
  char way[1000001] = {'\0'};
  Read(&n, &m, &k, a);
  BuildTheWay(n, m, k, a, way);
  Write(way);
  return 0;
}
