#include <bits/stdc++.h>
using namespace std;
int n, m, k, sx, sy;
char s[1005][1005];
int mov[4][2] = {1, 0, 0, -1, 0, 1, -1, 0};
int dis[1005][1005];
bool check(int x, int y) {
  if (x >= 1 && x <= n && y >= 1 && y <= m && s[x][y] != '*') return true;
  return false;
}
void bfs() {
  memset(dis, -1, sizeof(dis));
  queue<pair<int, int> > q;
  q.push({sx, sy});
  dis[sx][sy] = 0;
  while (!q.empty()) {
    pair<int, int> t = q.front();
    q.pop();
    for (int i = 0; i < 4; i++) {
      int x = t.first + mov[i][0];
      int y = t.second + mov[i][1];
      if (check(x, y) and dis[x][y] == -1) {
        dis[x][y] = dis[t.first][t.second] + 1;
        q.push({x, y});
      }
    }
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + 1);
    for (int j = 1; j <= m; j++) {
      if (s[i][j] == 'X') {
        sx = i, sy = j;
      }
    }
  }
  bool test = false;
  for (int i = 0; i < 4; i++) {
    int x = sx + mov[i][0];
    int y = sy + mov[i][1];
    if (check(x, y)) {
      test = true;
      break;
    }
  }
  if (!test or k % 2 == 1) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  bfs();
  string str = "";
  char c[5] = "DLRU";
  for (int i = k - 1; i >= 0; i--) {
    for (int j = 0; j < 4; j++) {
      int x = sx + mov[j][0];
      int y = sy + mov[j][1];
      if (check(x, y) && dis[x][y] <= i) {
        sx = x, sy = y;
        str += c[j];
        break;
      }
    }
  }
  cout << str << endl;
  return 0;
}
