#include <bits/stdc++.h>
using namespace std;
const int mxN = 1003;
int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, -1, 1};
char ar[mxN][mxN];
int dp[mxN][mxN], N, M;
bool check(int n, int m, int i, int j) {
  if (i >= 0 and i < n and j >= 0 and j < m) return true;
  return false;
}
void bfs(int n, int m, int k) {
  memset(dp, -1, sizeof(dp));
  dp[n][m] = 0;
  queue<pair<int, int>> q;
  q.push({n, m});
  bool f = false;
  while (!q.empty()) {
    int a = q.front().first, b = q.front().second;
    q.pop();
    for (int i = 0; i < 4; i++) {
      int x = a + dx[i], y = b + dy[i];
      if (check(N, M, x, y) and ar[x][y] == '.' and !~dp[x][y])
        q.push({x, y}), dp[x][y] = dp[a][b] + 1;
    }
  }
  string s = "";
  for (int i = k; i > 0; i--) {
    if (n < N - 1 and dp[n + 1][m] < i and ar[n + 1][m] == '.')
      s += "D", n++;
    else if (m and dp[n][m - 1] < i and ar[n][m - 1] == '.')
      s += "L", m--;
    else if (m < M - 1 and dp[n][m + 1] < i and ar[n][m + 1] == '.')
      s += "R", m++;
    else if (n and dp[n - 1][m] < i and ar[n - 1][m] == '.')
      s += "U", n--;
  }
  if (s.size() != k)
    cout << "IMPOSSIBLE"
         << "\n";
  else
    cout << s << "\n";
}
int main() {
  long long int n, a, b, m, i, j, cn = 0, sm = 0, mx = INT_MIN, mn = INT_MAX, k;
  cin >> N >> M >> a;
  string s;
  bool f = false;
  for (i = 0; i < N; i++)
    for (j = 0; j < M; j++) {
      cin >> ar[i][j];
      if (ar[i][j] == 'X') cn = i, sm = j, ar[i][j] = '.';
    }
  if (a & 1) {
    cout << "IMPOSSIBLE"
         << "\n";
    return 0;
  }
  bfs(cn, sm, a);
  return 0;
}
