#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 7;
char str[N][N];
int n, m, k;
pair<int, int> operator+(const pair<int, int> &a, const pair<int, int> &b) {
  return {a.first + b.first, a.second + b.second};
}
int dis[N][N];
bool in[N][N];
const char dc[] = {'D', 'L', 'R', 'U'};
const pair<int, int> dir[] = {{1, 0}, {0, -1}, {0, 1}, {-1, 0}};
void bfs(pair<int, int> S) {
  memset(dis, -1, sizeof(dis));
  dis[S.first][S.second] = 0;
  memset(in, false, sizeof(in));
  in[S.first][S.second] = 1;
  queue<pair<int, int> > que;
  que.push(S);
  for (; !que.empty(); que.pop()) {
    pair<int, int> cur = que.front();
    for (int d = (0); d < (4); d++) {
      pair<int, int> nex = cur + dir[d];
      if (nex.first < 0 || nex.first >= n) continue;
      if (nex.second < 0 || nex.second >= m) continue;
      if (str[nex.first][nex.second] == '*') continue;
      int &nexd = dis[nex.first][nex.second];
      int &curd = dis[cur.first][cur.second];
      if (!~nexd || nexd > curd + 1) {
        nexd = curd + 1;
        for (; !in[nex.first][nex.second]; in[nex.first][nex.second] = true)
          que.push(nex);
      }
    }
    in[cur.first][cur.second] = false;
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = (0); i < (n); i++) scanf(" %s", str[i]);
  pair<int, int> cur;
  for (int i = (0); i < (n); i++)
    for (int j = (0); j < (m); j++)
      if (str[i][j] == 'X') bfs(cur = {i, j});
  vector<char> ans;
  for (int step = (k - 1); step >= (0); step--) {
    bool ok = false;
    for (int d = (0); d < (4); d++) {
      pair<int, int> nex = cur + dir[d];
      if (nex.first < 0 || nex.first >= n) continue;
      if (nex.second < 0 || nex.second >= m) continue;
      if (str[nex.first][nex.second] == '*') continue;
      if (dis[nex.first][nex.second] > step) continue;
      cur = nex;
      ok = true;
      ans.push_back(dc[d]);
      break;
    }
    if (!ok) {
      puts("IMPOSSIBLE");
      return 0;
    }
  }
  for (int i = (0); i < (((int)(ans).size())); i++) printf("%c", ans[i]);
  return 0;
}
