#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
long double PI = 2 * acos(0.0);
template <typename T>
T gcd(T a, T b) {
  return (b == 0) ? a : gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  return a * (b / gcd(a, b));
}
template <typename T>
T mod_exp(T b, T p, T m) {
  T x = 1;
  while (p) {
    if (p & 1) x = (x * b) % m;
    b = (b * b) % m;
    p = p >> 1;
  }
  return x;
}
template <typename T>
T invFermat(T a, T p) {
  return mod_exp(a, p - 2, p);
}
template <typename T>
T exp(T b, T p) {
  T x = 1;
  while (p) {
    if (p & 1) x = (x * b);
    b = (b * b);
    p = p >> 1;
  }
  return x;
}
string tostring(long long int number) {
  stringstream ss;
  ss << number;
  return ss.str();
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
char grid[1001][1001];
long long int x, y, dist[1001][1001], n, m, k;
long long int dx[] = {1, 0, 0, -1};
long long int dy[] = {0, -1, 1, 0};
char dir[] = {'D', 'L', 'R', 'U'};
void solve() {
  cin >> n >> m >> k;
  string ans;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      cin >> grid[i][j];
      if (grid[i][j] == 'X') {
        x = i;
        y = j;
        grid[i][j] = '.';
      }
      dist[i][j] = -1;
    }
  }
  if (k & 1) {
    cout << "IMPOSSIBLE"
         << "\n";
    return;
  }
  queue<pair<long long int, long long int> > q;
  q.push({x, y});
  dist[x][y] = 0;
  while (!q.empty()) {
    pair<long long int, long long int> fr = q.front();
    q.pop();
    for (long long int i = 0; i < 4; i++) {
      if (fr.first + dx[i] >= 0 and fr.first + dx[i] < n and
          fr.second + dy[i] >= 0 and fr.second + dy[i] < m) {
        if (grid[fr.first + dx[i]][fr.second + dy[i]] != '*' and
            dist[fr.first + dx[i]][fr.second + dy[i]] == -1) {
          dist[fr.first + dx[i]][fr.second + dy[i]] =
              1 + dist[fr.first][fr.second];
          q.push({fr.first + dx[i], fr.second + dy[i]});
        }
      }
    }
  }
  long long int tx, ty;
  while (k) {
    bool check = false;
    for (long long int i = 0; i < 4; i++) {
      tx = x + dx[i];
      ty = y + dy[i];
      if (grid[tx][ty] == '.' && dist[tx][ty] <= k) {
        ans += dir[i];
        check = true;
        x = tx;
        y = ty;
        break;
      }
    }
    if (!check) {
      cout << "IMPOSSIBLE";
      return;
    }
    k--;
  }
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
