#include <bits/stdc++.h>
using namespace std;
const string ORDER = "DLRU";
const string REV_ORDER = "URLD";
const int DX[] = {1, 0, 0, -1};
const int DY[] = {0, -1, 1, 0};
struct TPosition {
  int X;
  int Y;
};
struct TParent {
  char C;
  TPosition P;
};
char Rev(char c) { return ORDER[REV_ORDER.find(c)]; }
int n, m, k;
vector<string> g;
vector<vector<TParent>> parent;
vector<vector<int>> dist;
TPosition start;
void BFS() {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      dist[i][j] = -1;
    }
  }
  dist[start.X][start.Y] = 0;
  queue<TPosition> q;
  q.push(start);
  while (!q.empty()) {
    const TPosition pos = q.front();
    q.pop();
    for (int i = 0; i < 4; ++i) {
      const TPosition p{pos.X + DX[i], pos.Y + DY[i]};
      if (p.X < 0 || p.X >= n || p.Y < 0 || p.Y >= m) {
        continue;
      }
      if (g[p.X][p.Y] == '*') {
        continue;
      }
      if (dist[p.X][p.Y] != -1) {
        continue;
      }
      parent[p.X][p.Y] = {Rev(ORDER[i]), pos};
      dist[p.X][p.Y] = dist[pos.X][pos.Y] + 1;
      q.push(p);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> k;
  g.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> g[i];
    assert((int)g[i].size() == m);
  }
  if (k % 2 == 1) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (g[i][j] == 'X') {
        start = {i, j};
      }
    }
  }
  parent.resize(n, vector<TParent>(m));
  dist.resize(n, vector<int>(m, 0));
  BFS();
  string answer;
  TPosition pos = start;
  for (int to = k; to >= 1; --to) {
    bool found = false;
    for (int i = 0; i < 4; ++i) {
      TPosition next{pos.X + DX[i], pos.Y + DY[i]};
      if (next.X < 0 || next.X >= n || next.Y < 0 || next.Y >= m) {
        continue;
      }
      if (g[next.X][next.Y] == '*') {
        continue;
      }
      if (dist[next.X][next.Y] > to) {
        continue;
      }
      found = true;
      answer += ORDER[i];
      pos = next;
      break;
    }
    if (!found) {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
  }
  cout << answer << endl;
  return 0;
}
