#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 100;
const long long INF64 = 1e18;
const int N = 1e3 + 9;
const int M = 30000;
const long long MOD = 1000000007;
const long double Pi = 3.1415926535897932384626433832795;
const long double EPS = 1e-9;
int n, m;
vector<string> g;
int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, -1, 1, 0};
char ds[4] = {'D', 'L', 'R', 'U'};
void bfs(int sx, int sy, vector<vector<int>> &d) {
  d[sx][sy] = 0;
  vector<vector<char>> used(n, vector<char>(m));
  used[sx][sy] = 1;
  queue<pair<int, int>> q;
  q.push(make_pair(sx, sy));
  while (!q.empty()) {
    int ux = q.front().first;
    int uy = q.front().second;
    q.pop();
    for (int i = 0; i < int(4); i++) {
      int nx = ux + dx[i];
      int ny = uy + dy[i];
      if (nx >= 0 && nx < n && ny >= 0 && ny < m && g[nx][ny] != '*' &&
          !used[nx][ny]) {
        used[nx][ny] = 1;
        d[nx][ny] = d[ux][uy] + 1;
        q.push(make_pair(nx, ny));
      }
    }
  }
}
int main() {
  int k;
  cin >> n >> m >> k;
  g.resize(n);
  for (int i = 0; i < int(n); i++) cin >> g[i];
  if (k % 2) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  vector<vector<int>> d(n, vector<int>(m, INF));
  int sx, sy;
  for (int i = 0; i < int(n); i++) {
    for (int j = 0; j < int(m); j++) {
      if (g[i][j] == 'X') {
        sx = i;
        sy = j;
        bfs(i, j, d);
      }
    }
  }
  string res;
  int ux = sx, uy = sy;
  while (d[ux][uy] < k) {
    bool is_ok = 0;
    for (int i = 0; i < int(4); i++) {
      int nx = ux + dx[i];
      int ny = uy + dy[i];
      if (nx >= 0 && nx < n && ny >= 0 && ny < m && g[nx][ny] != '*') {
        res += ds[i];
        ux = nx;
        uy = ny;
        k--;
        is_ok = 1;
        break;
      }
    }
    if (!is_ok) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
  }
  while (k) {
    bool is_ok = 0;
    for (int i = 0; i < int(4); i++) {
      int nx = ux + dx[i];
      int ny = uy + dy[i];
      if (nx >= 0 && nx < n && ny >= 0 && ny < m && g[nx][ny] != '*' &&
          d[nx][ny] < d[ux][uy]) {
        res += ds[i];
        ux = nx;
        uy = ny;
        k--;
        is_ok = 1;
        break;
      }
    }
    if (!is_ok) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
  }
  cout << res << endl;
}
