#include <bits/stdc++.h>
using namespace std;
char g[1005][1005];
int dis[1005][1005];
char prec[1005][1005];
char ans[1000005];
int n, m, k, s1, s2;
struct node {
  int x, y, dis;
};
queue<node> q;
void print(int x, int y, int num) {
  int i;
  for (i = 1; i <= num; i++) {
    printf("%c", ans[i]);
  }
  int x1 = x, y1 = y;
  while (!(x1 == s1 && y1 == s2)) {
    printf("%c", prec[x1][y1]);
    if (prec[x1][y1] == 'D') {
      x1++;
      continue;
    }
    if (prec[x1][y1] == 'U') {
      x1--;
      continue;
    }
    if (prec[x1][y1] == 'R') {
      y1++;
      continue;
    }
    if (prec[x1][y1] == 'L') {
      y1--;
      continue;
    }
  }
  return;
}
void search(int x, int y, int num) {
  if (x < 0 || y < 0 || x >= n || y >= m) {
    return;
  }
  if (dis[x][y] + num > k) {
    return;
  }
  if (g[x][y] == '*') {
    return;
  }
  if (dis[x][y] + num == k) {
    print(x, y, num);
    exit(0);
  }
  ans[num + 1] = 'D';
  search(x + 1, y, num + 1);
  ans[num + 1] = 'L';
  search(x, y - 1, num + 1);
  ans[num + 1] = 'R';
  search(x, y + 1, num + 1);
  ans[num + 1] = 'U';
  search(x - 1, y, num + 1);
}
void bfs(int x, int y) {
  node tp;
  memset(dis, 0x7f, sizeof(dis));
  dis[x][y] = 0;
  tp.x = x;
  tp.y = y;
  tp.dis = 0;
  q.push(tp);
  while (!q.empty()) {
    tp = q.front();
    q.pop();
    int x = tp.x, y = tp.y, val = tp.dis;
    if (x - 1 >= 0 &&
        (dis[x - 1][y] > dis[x][y] + 1 ||
         (dis[x - 1][y] == dis[x][y] + 1 && prec[x - 1][y] > 'D')) &&
        g[x - 1][y] != '*') {
      dis[x - 1][y] = dis[x][y] + 1;
      tp.x = x - 1;
      tp.y = y;
      tp.dis = val + 1;
      prec[x - 1][y] = 'D';
      q.push(tp);
    }
    if (y + 1 < m &&
        (dis[x][y + 1] > dis[x][y] + 1 ||
         (dis[x][y + 1] == dis[x][y] + 1 && prec[x][y + 1] > 'L')) &&
        g[x][y + 1] != '*') {
      dis[x][y + 1] = dis[x][y] + 1;
      tp.x = x;
      tp.y = y + 1;
      tp.dis = val + 1;
      prec[x][y + 1] = 'L';
      q.push(tp);
    }
    if (y - 1 >= 0 &&
        (dis[x][y - 1] > dis[x][y] + 1 ||
         (dis[x][y - 1] == dis[x][y] + 1 && prec[x][y - 1] > 'R')) &&
        g[x][y - 1] != '*') {
      dis[x][y - 1] = dis[x][y] + 1;
      tp.x = x;
      tp.y = y - 1;
      tp.dis = val + 1;
      prec[x][y - 1] = 'R';
      q.push(tp);
    }
    if (x + 1 < n && dis[x + 1][y] > dis[x][y] + 1 && g[x + 1][y] != '*') {
      dis[x + 1][y] = dis[x][y] + 1;
      tp.x = x + 1;
      tp.y = y;
      tp.dis = val + 1;
      prec[x + 1][y] = 'U';
      q.push(tp);
    }
  }
}
int main() {
  int i, j;
  scanf("%d%d%d", &n, &m, &k);
  if (k % 2 == 1) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  for (i = 0; i < n; i++) {
    scanf("%s", g[i]);
    for (j = 0; j < m; j++) {
      if (g[i][j] == 'X') {
        s1 = i;
        s2 = j;
      }
    }
  }
  bfs(s1, s2);
  search(s1, s2, 0);
  printf("IMPOSSIBLE\n");
  return 0;
}
