#include <bits/stdc++.h>
using namespace std;
char tab[1100][1100];
int distancia[1100][1100];
int n, m, k;
int inc, inl;
typedef struct {
  int l, c;
} no;
bool valido(int i, int j) {
  if (i == 0 || i > n || j == 0 || j > m) return false;
  if (tab[i][j] == '*') return false;
  if (distancia[i][j] != -1) return false;
  return true;
}
void BFS() {
  queue<no> fila;
  no ax;
  ax.l = inl;
  ax.c = inc;
  fila.push(ax);
  distancia[ax.l][ax.c] = 0;
  while (!fila.empty()) {
    no v = fila.front();
    fila.pop();
    no u;
    u.l = v.l + 1;
    u.c = v.c;
    if (valido(u.l, u.c)) {
      distancia[u.l][u.c] = distancia[v.l][v.c] + 1;
      fila.push(u);
    }
    u.l = v.l;
    u.c = v.c + 1;
    if (valido(u.l, u.c)) {
      distancia[u.l][u.c] = distancia[v.l][v.c] + 1;
      fila.push(u);
    }
    u.l = v.l - 1;
    u.c = v.c;
    if (valido(u.l, u.c)) {
      distancia[u.l][u.c] = distancia[v.l][v.c] + 1;
      fila.push(u);
    }
    u.l = v.l;
    u.c = v.c - 1;
    if (valido(u.l, u.c)) {
      distancia[u.l][u.c] = distancia[v.l][v.c] + 1;
      fila.push(u);
    }
  }
}
string res;
bool DFS(no v, int life) {
  int dist = distancia[v.l][v.c];
  if (life < dist) return false;
  if (distancia[v.l][v.c] == 0 and life == 0) return true;
  if (life == dist) {
    no u;
    u.l = v.l + 1;
    u.c = v.c;
    if (distancia[u.l][u.c] == dist - 1) {
      res += "D";
      return DFS(u, life - 1);
    }
    u.l = v.l;
    u.c = v.c - 1;
    if (distancia[u.l][u.c] == dist - 1) {
      res += "L";
      return DFS(u, life - 1);
    }
    u.l = v.l;
    u.c = v.c + 1;
    if (distancia[u.l][u.c] == dist - 1) {
      res += "R";
      return DFS(u, life - 1);
    }
    u.l = v.l - 1;
    u.c = v.c;
    if (distancia[u.l][u.c] == dist - 1) {
      res += "U";
      return DFS(u, life - 1);
    }
  }
  if (life > dist) {
    no u;
    u.l = v.l + 1;
    u.c = v.c;
    if (distancia[u.l][u.c] != -1) {
      res += "D";
      return DFS(u, life - 1);
    }
    u.l = v.l;
    u.c = v.c - 1;
    if (distancia[u.l][u.c] != -1) {
      res += "L";
      return DFS(u, life - 1);
    }
    u.l = v.l;
    u.c = v.c + 1;
    if (distancia[u.l][u.c] != -1) {
      res += "R";
      return DFS(u, life - 1);
    }
    u.l = v.l - 1;
    u.c = v.c;
    if (distancia[u.l][u.c] != -1) {
      res += "U";
      return DFS(u, life - 1);
    }
  }
  return false;
}
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> (&tab[i][1]);
  }
  for (int i = 0; i <= n + 1; i++) {
    for (int j = 0; j <= m + 1; j++) {
      if (tab[i][j] == 'X') {
        inl = i;
        inc = j;
      }
      distancia[i][j] = -1;
    }
  }
  BFS();
  no ax;
  ax.l = inl;
  ax.c = inc;
  if (DFS(ax, k)) {
    cout << res << endl;
  } else {
    cout << "IMPOSSIBLE" << endl;
  }
}
