#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int dr8[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dc8[] = {1, -1, 0, 0, -1, 1, -1, 1};
int dr4[] = {0, 1, -1, 0};
int dc4[] = {1, 0, 0, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, k;
  cin >> n >> m >> k;
  string a[n];
  int stx, sty;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 0; j < a[i].length(); j++) {
      if (a[i][j] == 'X') {
        stx = i, sty = j;
      }
    }
  }
  int dis[n][m];
  memset(dis, 0, sizeof dis);
  queue<pair<int, int> > q;
  q.push({stx, sty});
  while (!q.empty()) {
    pair<int, int> f = q.front();
    q.pop();
    for (int i = 0; i < 4; i++) {
      int x = f.first + dr4[i], y = f.second + dc4[i];
      if (x < 0 || x >= n || y < 0 || y >= m) {
        continue;
      }
      if (a[x][y] == '*') {
        dis[x][y] = 1000000009;
        continue;
      }
      if (dis[x][y] == 0) {
        if (x == stx && y == sty) continue;
        dis[x][y] = dis[f.first][f.second] + 1;
        q.push({x, y});
      }
    }
  }
  string s;
  int cx = stx, cy = sty;
  int f = 0;
  while (k--) {
    f = 0;
    if ((cx + 1) < n && a[cx + 1][cy] != '*' && dis[cx + 1][cy] <= (k + 1)) {
      s.push_back('D');
      f = 1;
      cx++;
    } else if ((cy - 1) >= 0 && a[cx][cy - 1] != '*' &&
               dis[cx][cy - 1] <= (k + 1)) {
      s.push_back('L');
      f = 1;
      cy--;
    } else if ((cy + 1) < m && a[cx][cy + 1] != '*' &&
               dis[cx][cy + 1] <= (k + 1)) {
      s.push_back('R');
      cy++;
      f = 1;
    } else if ((cx - 1) >= 0 && a[cx - 1][cy] != '*' &&
               dis[cx - 1][cy] <= (k + 1)) {
      s.push_back('U');
      cx--;
      f = 1;
    }
    if (f == 0) break;
  }
  if (k != -1) {
    cout << "IMPOSSIBLE";
  } else {
    if (stx != cx || sty != cy) {
      cout << "IMPOSSIBLE";
    } else
      cout << s;
  }
}
