#include <bits/stdc++.h>
using namespace std;
int n, m, k;
string p[2000];
int b[2000][2000];
inline bool check(int x, int y) {
  return (x >= 0 && x < n && y >= 0 && y < m && p[x][y] != '*');
}
queue<pair<int, int> > q;
inline void go(int x, int y, int pr) {
  if (check(x, y) && b[x][y] == -1) {
    b[x][y] = pr + 1;
    q.push(make_pair(x, y));
  }
}
inline void bfs(int x, int y) {
  q.push(make_pair(x, y));
  b[x][y] = 0;
  while (!q.empty()) {
    int x = q.front().first;
    int y = q.front().second;
    q.pop();
    go(x + 1, y, b[x][y]);
    go(x, y - 1, b[x][y]);
    go(x, y + 1, b[x][y]);
    go(x - 1, y, b[x][y]);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      b[i][j] = -1;
    }
  }
  int x0 = 0;
  int y0 = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (p[i][j] == 'X') {
        x0 = i;
        y0 = j;
        break;
      }
    }
  }
  bfs(x0, y0);
  int x = x0;
  int y = y0;
  string ans = "";
  for (int st = 1; st <= k; ++st) {
    if (check(x + 1, y) && b[x + 1][y] <= k - st) {
      x++;
      ans += "D";
      continue;
    }
    if (check(x, y - 1) && b[x][y - 1] <= k - st) {
      y--;
      ans += "L";
      continue;
    }
    if (check(x, y + 1) && b[x][y + 1] <= k - st) {
      y++;
      ans += "R";
      continue;
    }
    if (check(x - 1, y) && b[x - 1][y] <= k - st) {
      x--;
      ans += "U";
      continue;
    }
    break;
  }
  if (ans.size() != k) {
    cout << "IMPOSSIBLE" << endl;
  } else {
    cout << ans << endl;
  }
  return 0;
}
