#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1e3 + 13;
const int dx[] = {-1, 0, 0, 1};
const int dy[] = {0, -1, 1, 0};
const int INF = 1e9;
int n, m, k;
int d[MaxN][MaxN];
char a[MaxN][MaxN];
void go(int D, int x, int y, deque<pair<int, int> >& q) {
  if (x < 1 || x > n || y < 1 || y > m || a[x][y] == '*' || d[x][y] <= D + 1)
    return;
  if (d[x][y] == INF) q.push_back(make_pair(x, y));
  d[x][y] = D + 1;
}
void bfs(int x, int y) {
  for (int i = 0; i <= n + 1; ++i)
    for (int j = 0; j <= m + 1; ++j) d[i][j] = INF;
  d[x][y] = 0;
  deque<pair<int, int> > order;
  order.push_back(make_pair(x, y));
  while (!order.empty()) {
    x = order[0].first;
    y = order[0].second;
    order.pop_front();
    for (int i = 0; i < 4; ++i) {
      int xx = x + dx[i];
      int yy = y + dy[i];
      go(d[x][y], xx, yy, order);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> k;
  if (k & 1) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  int x, y;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      cin >> a[i][j];
      if (a[i][j] == 'X') {
        x = i;
        y = j;
      }
    }
  bfs(x, y);
  while (k) {
    if (d[x][y] == k) {
      if (d[x + 1][y] == k - 1) {
        cout << "D";
        ++x;
      } else if (d[x][y - 1] == k - 1) {
        cout << "L";
        --y;
      } else if (d[x][y + 1] == k - 1) {
        cout << "R";
        ++y;
      } else {
        cout << "U";
        --x;
      }
    } else {
      if (d[x + 1][y] != INF) {
        cout << "D";
        ++x;
      } else if (d[x][y - 1] != INF) {
        cout << "L";
        --y;
      } else if (d[x][y + 1] != INF) {
        cout << "R";
        ++y;
      } else if (d[x - 1][y] != INF) {
        cout << "U";
        --x;
      } else {
        cout << "IMPOSSIBLE\n";
        return 0;
      }
    }
    --k;
  }
}
