#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} now, nex;
int n, m, k;
char a[1005][1005];
int dis[1005][1005];
char str[5] = {'D', 'L', 'R', 'U'};
char ans[2000800];
int fx[4] = {1, 0, 0, -1};
int fy[4] = {0, -1, 1, 0};
void Slove(int sx, int sy) {
  int tmp = k;
  int tot = 0;
  for (int i = 0; i < k; i++) {
    int dir = -1;
    for (int j = 0; j < 4; j++) {
      int xx = sx + fx[j];
      int yy = sy + fy[j];
      if (xx >= 0 && xx < n && yy >= 0 && yy < m && a[xx][yy] != '*' &&
          dis[xx][yy] < tmp) {
        dir = j;
        break;
      }
    }
    tmp--;
    if (dir < 0)
      while (1)
        ;
    int xx = sx + fx[dir];
    int yy = sy + fy[dir];
    sx = xx;
    sy = yy;
    ans[tot++] = str[dir];
  }
  ans[tot] = '\0';
  printf("%s\n", ans);
}
void Bfs(int sx, int sy) {
  for (int i = 0; i <= 1003; i++) {
    for (int j = 0; j <= 1003; j++) {
      dis[i][j] = 0x3f3f3f3f;
    }
  }
  queue<node> s;
  dis[sx][sy] = 0;
  now.x = sx, now.y = sy;
  s.push(now);
  int cnt = 0;
  while (!s.empty()) {
    cnt++;
    now = s.front();
    s.pop();
    for (int i = 0; i < 4; i++) {
      nex.x = now.x + fx[i];
      nex.y = now.y + fy[i];
      if (nex.x >= 0 && nex.x < n && nex.y >= 0 && nex.y < m &&
          a[nex.x][nex.y] != '*') {
        if (dis[nex.x][nex.y] > dis[now.x][now.y] + 1) {
          dis[nex.x][nex.y] = dis[now.x][now.y] + 1;
          s.push(nex);
        }
      }
    }
  }
  if (cnt == 1) {
    printf("IMPOSSIBLE\n");
    return;
  } else
    Slove(sx, sy);
}
int main() {
  while (~scanf("%d%d%d", &n, &m, &k)) {
    int x, y;
    for (int i = 0; i < n; i++) {
      scanf("%s", a[i]);
      for (int j = 0; j < m; j++) {
        if (a[i][j] == 'X') x = i, y = j;
      }
    }
    if (k % 2 == 1) {
      printf("IMPOSSIBLE\n");
      continue;
    }
    Bfs(x, y);
  }
}
