#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e3 + 5, inf = 1e18, mod = 1e9 + 7;
long long n, m, k, dis[maxn][maxn];
pair<long long, long long> st;
bool mark[maxn][maxn];
string s;
char c[maxn][maxn];
void bfs(long long x, long long y) {
  mark[x][y] = 1;
  queue<pair<long long, long long> > q;
  q.push({x, y});
  while (q.size()) {
    pair<long long, long long> p = q.front();
    q.pop();
    long long i = p.first, j = p.second, d = dis[i][j];
    if (i + 1 < n) {
      if (!mark[i + 1][j] && c[i + 1][j] != '*') {
        mark[i + 1][j] = 1;
        dis[i + 1][j] = d + 1;
        q.push({i + 1, j});
      }
    }
    if (i - 1 >= 0) {
      if (!mark[i - 1][j] && c[i - 1][j] != '*') {
        mark[i - 1][j] = 1;
        dis[i - 1][j] = d + 1;
        q.push({i - 1, j});
      }
    }
    if (j + 1 < m) {
      if (!mark[i][j + 1] && c[i][j + 1] != '*') {
        mark[i][j + 1] = 1;
        dis[i][j + 1] = d + 1;
        q.push({i, j + 1});
      }
    }
    if (j - 1 >= 0) {
      if (!mark[i][j - 1] && c[i][j - 1] != '*') {
        mark[i][j - 1] = 1;
        dis[i][j - 1] = d + 1;
        q.push({i, j - 1});
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m >> k;
  if (k % 2 == 1) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> c[i][j];
      if (c[i][j] == 'X') st = {i, j};
    }
  }
  long long num = 0;
  long long x = st.first, y = st.second;
  if (x + 1 < n) {
    if (c[x + 1][y] != '*') num++;
  }
  if (x - 1 >= 0) {
    if (c[x - 1][y] != '*') num++;
  }
  if (y + 1 < m) {
    if (c[x][y + 1] != '*') num++;
  }
  if (y - 1 >= 0) {
    if (c[x][y - 1] != '*') num++;
  }
  if (num == 0) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  bfs(x, y);
  long long z = k / 2;
  while (z--) {
    if (x + 1 < n) {
      if (c[x + 1][y] != '*') {
        s += 'D';
        x++;
        continue;
      }
    }
    if (y - 1 >= 0) {
      if (c[x][y - 1] != '*') {
        s += 'L';
        y--;
        continue;
      }
    }
    if (y + 1 < m) {
      if (c[x][y + 1] != '*') {
        s += 'R';
        y++;
        continue;
      }
    }
    s += 'U';
    x--;
  }
  z = k / 2;
  for (long long i = z - 1; i >= 0; i--) {
    if (x + 1 < n) {
      if (c[x + 1][y] != '*' && dis[x + 1][y] <= i) {
        s += 'D';
        x++;
        continue;
      }
    }
    if (y - 1 >= 0) {
      if (c[x][y - 1] != '*' && dis[x][y - 1] <= i) {
        s += 'L';
        y--;
        continue;
      }
    }
    if (y + 1 < m) {
      if (c[x][y + 1] != '*' && dis[x][y + 1] <= i) {
        s += 'R';
        y++;
        continue;
      }
    }
    s += 'U';
    x--;
  }
  cout << s << endl;
}
