#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void __print(int x) { cout << x; }
void __print(long x) { cout << x; }
void __print(long long x) { cout << x; }
void __print(unsigned x) { cout << x; }
void __print(unsigned long x) { cout << x; }
void __print(unsigned long long x) { cout << x; }
void __print(float x) { cout << x; }
void __print(double x) { cout << x; }
void __print(long double x) { cout << x; }
void __print(char x) { cout << '\'' << x << '\''; }
void __print(const char *x) { cout << '\"' << x << '\"'; }
void __print(const string &x) { cout << '\"' << x << '\"'; }
void __print(bool x) { cout << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cout << '{';
  __print(x.first);
  cout << ',';
  __print(x.second);
  cout << '}';
}
template <typename T>
void __print(const T &x) {
  int first = 0;
  cout << '{';
  for (auto &i : x) cout << (first++ ? "," : ""), __print(i);
  cout << "}";
}
void _print() { cout << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cout << ", ";
  _print(v...);
}
template <class T>
void remdup(vector<T> &v) {
  sort((v).begin(), (v).end());
  v.erase(unique((v).begin(), (v).end()), end(v));
}
template <typename T>
struct cmp {
  bool operator()(const T &p1, const T &p2) { return true; };
};
long long dx[4] = {1, 0, 0, -1};
long long dy[4] = {0, -1, 1, 0};
string pre = "DLRU";
const long long N = 1e6 + 100;
const long long mod = 1e9 + 7;
const long long X = 2e5 + 100;
long long dist[1008][1008];
char a[1008][1008];
long long visit[1008][1008];
long long n, m, k;
bool check(long long x, long long y) {
  if (x == 0 || x == n + 1 || y == 0 || y == m + 1) return false;
  if (a[x][y] == '*' || visit[x][y]) return false;
  return true;
}
bool check1(long long x, long long y, long long c) {
  if (x == 0 || x == n + 1 || y == 0 || y == m + 1) return false;
  if (a[x][y] == '*' || dist[x][y] > c) return false;
  return true;
}
int main() {
  cin >> n >> m >> k;
  pair<long long, long long> st;
  for (long long i = (0); i < (n); ++i)
    for (long long j = (0); j < (m); ++j) {
      cin >> a[i + 1][j + 1];
      if (a[i + 1][j + 1] == 'X') st = {i + 1, j + 1};
    }
  if (k % 2) {
    cout << "IMPOSSIBLE"
         << "\n";
    return 0;
  }
  for (long long i = (0); i < (n + 2); ++i)
    for (long long j = (0); j < (n + 2); ++j) dist[i][j] = 1e16;
  queue<pair<pair<long long, long long>, long long>> q;
  q.push({st, 0});
  while (((long long)(q.size()))) {
    pair<pair<long long, long long>, long long> see = q.front();
    q.pop();
    dist[see.first.first][see.first.second] = see.second;
    visit[see.first.first][see.first.second] = 1;
    for (long long i = (0); i < (4); ++i)
      if (check(see.first.first + dx[i], see.first.second + dy[i])) {
        q.push({{see.first.first + dx[i], see.first.second + dy[i]},
                see.second + 1});
        visit[see.first.first + dx[i]][see.first.second + dy[i]] = 1;
      }
  }
  dist[st.first][st.second] = 0;
  string ans = "";
  pair<long long, long long> start = st;
  while (k) {
    k--;
    long long c = 1;
    for (long long i = (0); i < (4); ++i) {
      if (check1(start.first + dx[i], start.second + dy[i], k)) {
        ans += pre[i];
        start = {start.first + dx[i], start.second + dy[i]};
        c = 0;
        break;
      }
    }
    if (c == 1) {
      cout << "IMPOSSIBLE"
           << "\n";
      return 0;
    }
  }
  cout << ans << "\n";
  return 0;
}
