#include <bits/stdc++.h>
using namespace std;
char a[1001][1001];
int n, m, k, nx, ny;
int dis[1001][1001];
string ans = "", ans1 = "";
void dfs(int x, int y, int len) {
  if (len == k / 2) {
    nx = x;
    ny = y;
    return;
  }
  if (x < n - 1 && a[x + 1][y] != '*') {
    ans += 'D';
    dfs(x + 1, y, len + 1);
    return;
  }
  if (y > 0 && a[x][y - 1] != '*') {
    ans += 'L';
    dfs(x, y - 1, len + 1);
    return;
  }
  if (y < m - 1 && a[x][y + 1] != '*') {
    ans += 'R';
    dfs(x, y + 1, len + 1);
    return;
  }
  if (x > 0 && a[x - 1][y] != '*') {
    ans += 'U';
    dfs(x - 1, y, len + 1);
    return;
  }
}
void dfs1(int x, int y, int len) {
  if (x < n - 1 && a[x + 1][y] != '*' && dis[x + 1][y] < len) {
    ans1 += 'D';
    dfs1(x + 1, y, len - 1);
    return;
  }
  if (y > 0 && a[x][y - 1] != '*' && dis[x][y - 1] < len) {
    ans1 += 'L';
    dfs1(x, y - 1, len - 1);
    return;
  }
  if (y < m - 1 && a[x][y + 1] != '*' && dis[x][y + 1] < len) {
    ans1 += 'R';
    dfs1(x, y + 1, len - 1);
    return;
  }
  if (x > 0 && a[x - 1][y] != '*' && dis[x - 1][y] < len) {
    ans1 += 'U';
    dfs1(x - 1, y, len - 1);
    return;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k;
  int inx, iny;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      dis[i][j] = INT_MAX / 2;
      cin >> a[i][j];
      if (a[i][j] == 'X') {
        inx = i;
        iny = j;
      }
    }
  }
  bool f1 = 0, f2 = 0, f3 = 0, f4 = 0;
  if (inx > 0 && a[inx - 1][iny] == '.') f1 = 1;
  if (inx < n - 1 && a[inx + 1][iny] == '.') f2 = 1;
  if (iny > 0 && a[inx][iny - 1] == '.') f3 = 1;
  if (iny < m - 1 && a[inx][iny + 1] == '.') f4 = 1;
  if (k % 2 || (!f1 && !f2 && !f3 && !f4)) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  queue<pair<int, int> > q;
  q.push({inx, iny});
  dis[inx][iny] = 0;
  while (!q.empty()) {
    pair<int, int> p = q.front();
    q.pop();
    int x = p.first, y = p.second;
    if (x < n - 1 && a[x + 1][y] != '*' && dis[x + 1][y] == INT_MAX / 2) {
      dis[x + 1][y] = 1 + dis[x][y];
      q.push({x + 1, y});
    }
    if (y > 0 && a[x][y - 1] != '*' && dis[x][y - 1] == INT_MAX / 2) {
      dis[x][y - 1] = 1 + dis[x][y];
      q.push({x, y - 1});
    }
    if (y < m - 1 && a[x][y + 1] != '*' && dis[x][y + 1] == INT_MAX / 2) {
      dis[x][y + 1] = 1 + dis[x][y];
      q.push({x, y + 1});
    }
    if (x > 0 && a[x - 1][y] != '*' && dis[x - 1][y] == INT_MAX / 2) {
      dis[x - 1][y] = 1 + dis[x][y];
      q.push({x - 1, y});
    }
  }
  dfs1(inx, iny, k);
  cout << ans + ans1 << endl;
}
