#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, -1, 1, 0};
char dc[4] = {'D', 'L', 'R', 'U'};
int n, m, k, x, y, q = 0;
vector<string> s;
vector<vector<int>> dist;
string ans;
void go() {
  int r = k - q;
  for (int(i) = 0; (i) < 4; (i)++) {
    int nx = x + dx[i], ny = y + dy[i];
    if (s[nx][ny] != '*' && dist[nx][ny] <= r) {
      ans.push_back(dc[i]);
      x = nx;
      y = ny;
      return;
    }
  }
  cout << "IMPOSSIBLE";
  exit(0);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  s.resize(n + 2);
  dist.resize(n + 2, vector<int>(m + 2, -1));
  string tmp(m + 2, '*'), qq;
  s[0] = s[n + 1] = tmp;
  for (int(i) = 1; (i) < n + 1; (i)++) {
    cin >> qq;
    s[i] = "*" + qq + "*";
  }
  for (int(i) = 1; (i) < n + 1; (i)++) {
    for (int(j) = 1; (j) < m + 1; (j)++) {
      if (s[i][j] == 'X') {
        x = i;
        y = j;
      }
    }
  }
  queue<pair<int, int>> que;
  que.push(make_pair(x, y));
  dist[x][y] = 0;
  while (!que.empty()) {
    auto v = que.front();
    int xx = v.first, yy = v.second;
    que.pop();
    for (int(i) = 0; (i) < 4; (i)++) {
      int nx = xx + dx[i];
      int ny = yy + dy[i];
      if (dist[nx][ny] == -1 && s[nx][ny] != '*') {
        dist[nx][ny] = dist[xx][yy] + 1;
        que.push(make_pair(nx, ny));
      }
    }
  }
  if (k % 2) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  while (q != k) {
    go();
    q++;
  }
  cout << ans;
  return 0;
}
