#include <bits/stdc++.h>
using namespace std;
const double eps = 1E-9;
const double Exp = 2.718281828459045;
const double pi = 3.14159;
const double E = 2.7182818284590452354;
const int Max_Bit = 63;
const int INF = 1000000007;
const long long LINF = 1000000000000000007ll;
const int MOD = 1000000007;
const int NMAX = 1005;
const int MMAX = 105;
const int base = 1000 * 1000 * 1000;
int n, m, k, dist[NMAX][NMAX];
pair<int, int> start;
char a[NMAX][NMAX];
void bfs(int ii, int jj) {
  queue<pair<int, int> > q;
  dist[ii][jj] = 0;
  q.push(make_pair(ii, jj));
  while (!q.empty()) {
    int i = q.front().first, j = q.front().second;
    q.pop();
    if (i < n - 1 && a[i + 1][j] != '*' && dist[i + 1][j] == INF) {
      dist[i + 1][j] = dist[i][j] + 1;
      q.push(make_pair(i + 1, j));
    }
    if (j > 0 && a[i][j - 1] != '*' && dist[i][j - 1] == INF) {
      dist[i][j - 1] = dist[i][j] + 1;
      q.push(make_pair(i, j - 1));
    }
    if (j < m - 1 && a[i][j + 1] != '*' && dist[i][j + 1] == INF) {
      dist[i][j + 1] = dist[i][j] + 1;
      q.push(make_pair(i, j + 1));
    }
    if (i > 0 && a[i - 1][j] != '*' && dist[i - 1][j] == INF) {
      dist[i - 1][j] = dist[i][j] + 1;
      q.push(make_pair(i - 1, j));
    }
  }
}
int main() {
  for (int i = 0; i < NMAX; i++)
    for (int j = 0; j < NMAX; j++) dist[i][j] = INF;
  cin >> n >> m >> k;
  if (k & 1) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
      if (a[i][j] == 'X') {
        start.first = i, start.second = j;
      }
    }
  }
  bfs(start.first, start.second);
  int ans = 0;
  string second = "";
  int i = start.first, j = start.second;
  while (ans < k) {
    if (i < n - 1 && a[i + 1][j] != '*' && ans + dist[i + 1][j] <= k) {
      ans++;
      i++;
      second += 'D';
      continue;
    }
    if (j > 0 && a[i][j - 1] != '*' && ans + dist[i][j - 1] <= k) {
      ans++;
      j--;
      second += 'L';
      continue;
    }
    if (j < m - 1 && a[i][j + 1] != '*' && ans + dist[i][j + 1] <= k) {
      ans++;
      j++;
      second += 'R';
      continue;
    }
    if (i > 0 && a[i - 1][j] != '*' && ans + dist[i - 1][j] <= k) {
      ans++;
      i--;
      second += 'U';
      continue;
    }
    if (i == start.first && j == start.second && ans == 0) {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
  }
  cout << second << endl;
  return 0;
}
