#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
const int INF = 1e9 + 7;
int field[MAXN][MAXN];
int dist[MAXN][MAXN];
int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, -1, 1, 0};
char dir[4] = {'D', 'L', 'R', 'U'};
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, k;
  queue<pair<int, int> > q;
  bool flag;
  pair<int, int> st, cur;
  string s, ans;
  cin >> n >> m >> k;
  memset(field, 0, sizeof(field));
  for (int i = 1; i <= n; i++) {
    cin >> s;
    for (int j = 0; j < m; j++) {
      if (s[j] == '*') continue;
      field[i][j + 1] = 1;
      if (s[j] == 'X') {
        st = make_pair(i, j + 1);
      }
    }
  }
  for (int i = 0; i <= n + 1; i++) {
    for (int j = 0; j <= m + 1; j++) dist[i][j] = INF;
  }
  dist[st.first][st.second] = 0;
  q.push(st);
  while (!q.empty()) {
    cur = q.front();
    q.pop();
    for (int i = 0; i < 4; i++) {
      if ((field[cur.first + dx[i]][cur.second + dy[i]]) &&
          (dist[cur.first + dx[i]][cur.second + dy[i]] == INF)) {
        dist[cur.first + dx[i]][cur.second + dy[i]] =
            dist[cur.first][cur.second] + 1;
        q.push(make_pair(cur.first + dx[i], cur.second + dy[i]));
      }
    }
  }
  if (k & 1) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  cur = st;
  ans = "";
  for (int i = 0; i < k; i++) {
    flag = false;
    for (int j = 0; j < 4; j++) {
      if (dist[cur.first + dx[j]][cur.second + dy[j]] <= k - i) {
        ans += dir[j];
        cur.first += dx[j];
        cur.second += dy[j];
        flag = true;
        break;
      }
    }
    if (!flag) {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
  }
  cout << ans << endl;
  return 0;
}
