#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream& operator<<(ostream& o, const pair<A, B>& p) {
  return o << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "[";
  for (__typeof((v).end()) it = (v).begin(); it != (v).end(); ++it)
    o << *it << ", ";
  return o << "]";
}
template <class T>
ostream& operator<<(ostream& o, const set<T>& v) {
  o << "[";
  for (__typeof((v).end()) it = (v).begin(); it != (v).end(); ++it)
    o << *it << ", ";
  return o << "]";
}
template <class T>
inline void MAX(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void MIN(T& a, T b) {
  if (a > b) a = b;
}
template <class T>
inline bool read(T& x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
int dx[] = {1, 0, 0, -1};
int dy[] = {0, -1, 1, 0};
int n, m, k;
string ans = "";
char arr[1001][1001];
int arr1[1001][1001];
bool visited[1001][1001];
char s[4] = {'D', 'L', 'R', 'U'};
char s1[4] = {'U', 'R', 'L', 'D'};
bool is_right(int a, int b) {
  if (a < 1 || b < 1 || a > n || b > m) {
    return false;
  }
  if (visited[a][b]) {
    return false;
  }
  if (arr[a][b] == '*') {
    return false;
  }
  return true;
}
void bfs(int x, int y) {
  for (int i = 0; i <= 1000; i++)
    for (int j = 0; j <= 1000; j++) arr1[i][j] = -1;
  visited[x][y] = true;
  queue<pair<int, int>> q;
  q.push({x, y});
  arr1[x][y] = 0;
  while (!q.empty()) {
    int current_x = q.front().first;
    int current_y = q.front().second;
    q.pop();
    for (int i = 0; i < 4; i++) {
      int new_x = current_x + dx[i];
      int new_y = current_y + dy[i];
      if (is_right(new_x, new_y)) {
        visited[new_x][new_y] = true;
        arr1[new_x][new_y] = arr1[current_x][current_y] + 1;
        q.push({new_x, new_y});
      }
    }
  }
}
int main() {
  cin >> n >> m >> k;
  int source_x, source_y;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> arr[i][j];
      if (arr[i][j] == 'X') {
        source_x = i;
        source_y = j;
      }
    }
  }
  if (k % 2 != 0) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  bfs(source_x, source_y);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) visited[i][j] = false;
  int l = k;
  while (k--) {
    for (int i = 0; i < 4; i++) {
      int new_x = source_x + dx[i];
      int new_y = source_y + dy[i];
      if (is_right(new_x, new_y) && arr1[new_x][new_y] <= k) {
        ans += s[i];
        source_x = new_x;
        source_y = new_y;
        break;
      }
    }
  }
  if ((int)ans.size() != l) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  cout << ans;
}
