#include <bits/stdc++.h>
using namespace std;
char ch[1001][1001];
long long int n, m, k, a, b;
long long int dist[1001][1001];
string s, str = "DLRU";
bool isValid(long long int x, long long int y) {
  if (x < 1 || y < 1 || x > n || y > m)
    return false;
  else if (ch[x][y] == '*')
    return false;
  return true;
}
int dx[] = {1, 0, 0, -1};
int dy[] = {0, -1, 1, 0};
void bfs(long long int x, long long int y) {
  queue<pair<long long int, long long int>> q;
  q.push({x, y});
  dist[x][y] = 0;
  while (!q.empty()) {
    long long int curX = q.front().first;
    long long int curY = q.front().second;
    q.pop();
    for (auto i = 0; i < 4; i++) {
      if (isValid(curX + dx[i], curY + dy[i])) {
        long long int newX = curX + dx[i];
        long long int newY = curY + dy[i];
        if (dist[newX][newY] == -1) {
          dist[newX][newY] = dist[curX][curY] + 1;
          q.push({newX, newY});
        }
      }
    }
  }
}
void Solve() {
  cin >> n >> m >> k;
  memset(dist, -1, sizeof(dist));
  for (auto i = 1; i < n + 1; i++) {
    for (auto j = 1; j < m + 1; j++) {
      cin >> ch[i][j];
      if (ch[i][j] == 'X') a = i, b = j;
    }
  }
  if (k % 2 == 1) {
    cout << "IMPOSSIBLE\n";
    return;
  }
  bool flag = true;
  int c = 0;
  bfs(a, b);
  while (k--) {
    c = 0;
    for (auto i = 0; i < 4; i++) {
      long long int newX = a + dx[i];
      long long int newY = b + dy[i];
      if (isValid(newX, newY) && dist[newX][newY] <= k) {
        a = newX, b = newY;
        s += str[i];
        c = 1;
        break;
      }
    }
    if (c == 0) {
      flag = false;
      break;
    }
  }
  if (!flag)
    cout << "IMPOSSIBLE\n";
  else
    cout << s << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  while (T--) Solve();
  return 0;
}
