#include <bits/stdc++.h>
using namespace std;
long long prck(long long n) {
  long long f = 1;
  if (n == 1)
    f = 0;
  else if (n == 2)
    f = 1;
  else if (n % 2 == 0)
    f = 0;
  else {
    long long i;
    for (i = 3; (i * i <= n) && (f == 1); i += 2) {
      if (n % i == 0) f = 0;
    }
  }
  return f;
}
long long nCr(long long n, long long r) {
  long long i, res = 1;
  if (r > n - r) r = n - r;
  for (i = 0; i < r; ++i) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long btod(string n) {
  long long lg = n.length();
  long long i, val = 0, bs = 1;
  for (i = lg - 1; i >= 0; i--) {
    if (n[i] == '1') {
      val += bs;
    }
    bs *= 2;
  }
  return val;
}
long long ston(string s) {
  long long val = 0, bs = 1;
  long long sl = s.length();
  sl--;
  while (sl >= 0) {
    val += ((s[sl] - 48) * bs);
    bs *= 10;
    sl--;
  }
  return val;
}
long long nCrModpDP(long long n, long long r, long long p) {
  long long i, j, C[r + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (i = 1; i <= n; i++) {
    for (j = min(i, r); j > 0; j--) {
      C[j] = (C[j] + C[j - 1]) % p;
    }
  }
  return C[r];
}
long long nCrModpLucas(long long n, long long r, long long p) {
  if (r == 0) return 1;
  long long ni = n % p, ri = r % p;
  return (nCrModpLucas(n / p, r / p, p) * nCrModpDP(ni, ri, p)) % p;
}
long long pwr(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long modInverse(long long n, long long p) { return pwr(n, p - 2, p); }
long long nCrModPFermat(long long n, long long r, long long p,
                        long long fac[]) {
  if (r == 0) return 1;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
int calcDate(int date, int month, int year) {
  if (month == 1) {
    month = 13;
    year--;
  }
  if (month == 2) {
    month = 14;
    year--;
  }
  int q = date, m = month, k = year % 100, j = year / 100;
  int day = q + (13 * (m + 1)) / 5 + k + (k / 4) + (j / 4) + 5 * j;
  day = day % 7;
  return day;
}
vector<vector<long long>> matmul(vector<vector<long long>> a,
                                 vector<vector<long long>> b) {
  long long k = a.size();
  vector<vector<long long>> c(k, vector<long long>(k));
  long long i, j, l;
  for (i = 0; i < k; i++) {
    for (j = 0; j < k; j++) {
      for (l = 0; l < k; l++) {
        c[i][j] = (c[i][j] + a[i][l] * b[l][j]) % 1000000007;
      }
    }
  }
  return c;
}
vector<vector<long long>> matexp(vector<vector<long long>> a, long long p) {
  if (p == 1) return a;
  if (p & 1) return matmul(a, matexp(a, p - 1));
  vector<vector<long long>> x = matexp(a, p / 2);
  return matmul(x, x);
}
long long linrec(long long n, long long k, vector<long long> a,
                 vector<long long> b) {
  if (n == 0) return 0;
  if (n <= k) return a[n - 1];
  long long i, j;
  vector<long long> F1(k + 1);
  for (i = 1; i <= k; i++) F1[i] = a[i - 1];
  vector<vector<long long>> T(k + 1, vector<long long>(k + 1));
  for (i = 1; i <= k; i++) {
    for (j = 1; j <= k; j++) {
      if (i < k) {
        if (j == i + 1)
          T[i][j] = 1;
        else
          T[i][j] = 0;
        continue;
      }
      T[i][j] = b[k - j];
    }
  }
  T = matexp(T, n - 1);
  long long res = 0;
  for (i = 1; i <= k; i++) {
    res += (T[1][i] * F1[i]) % 1000000007;
  }
  return res % 1000000007;
}
long long modexp(long long x, long long n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0) {
    return modexp((x * x) % 1000000007, n / 2);
  } else {
    return (x * modexp((x * x) % 1000000007, (n - 1) / 2) % 1000000007);
  }
}
long long getFractionModulo(long long a, long long b) {
  long long c = gcd(a, b);
  a = a / c;
  b = b / c;
  long long d = modexp(b, 1000000007 - 2);
  long long ans = ((a % 1000000007) * (d % 1000000007)) % 1000000007;
  return ans;
}
void dfs(long long x, long long y) {}
void bfs(long long x, long long vis[], vector<long long> adj[],
         long long prev[], long long n) {
  queue<long long> q;
  long long flg = 0;
  vis[x] = 1;
  q.push(x);
  if (vis[n - 1] == 1) flg = 1;
  while (!q.empty() && flg == 0) {
    long long cur = q.front();
    q.pop();
    for (long long child : adj[cur]) {
      if (vis[child] == 0) {
        q.push(child);
        vis[child] = 1;
        prev[child] = cur;
      }
    }
    if (vis[n - 1] == 1) flg = 1;
  }
}
void addSelf(long long &a, long long b) {
  a += b;
  while (a >= 1000000007) a -= 1000000007;
}
void subSelf(long long &a, long long b) {
  a -= b;
  while (a < 0) a += 1000000007;
}
struct sr {
  long long t, b;
};
bool cmp(struct sr aa, struct sr ab) {
  if (aa.b == ab.b) return aa.t < ab.t;
  return aa.b < ab.b;
}
long long f[200002];
long long find(long long x) {
  if (f[x] == x)
    return x;
  else
    return f[x] = find(f[x]);
}
bool connected(long long a, long long b) {
  a = find(a);
  b = find(b);
  if (a == b) return 1;
  f[a] = b;
  return 0;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, k, i, j;
  cin >> n >> m >> k;
  char maze[n][m];
  long long dist[n][m];
  long long x0, y0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> maze[i][j];
      dist[i][j] = -1;
      if (maze[i][j] == 'X') {
        y0 = i;
        x0 = j;
      }
    }
  }
  dist[y0][x0] = 0;
  if (k % 2)
    cout << "IMPOSSIBLE\n";
  else {
    long long dx[4] = {0, -1, 1, 0}, dy[4] = {1, 0, 0, -1};
    queue<pair<long long, long long>> q;
    q.push({y0, x0});
    long long x, y, tpx, tpy;
    while (!q.empty()) {
      pair<long long, long long> cur = q.front();
      q.pop();
      y = cur.first, x = cur.second;
      for (i = 0; i < 4; i++) {
        tpx = x + dx[i];
        tpy = y + dy[i];
        if (tpx < m && tpx >= 0 && tpy >= 0 && tpy < n &&
            dist[tpy][tpx] == -1 && maze[tpy][tpx] != '*') {
          dist[tpy][tpx] = 1 + dist[y][x];
          q.push({tpy, tpx});
        }
      }
    }
    string ans = {};
    char ch[4] = {'D', 'L', 'R', 'U'};
    long long flg = 0;
    for (i = 1; i <= k; i++) {
      flg = 0;
      for (j = 0; j < 4; j++) {
        x = x0 + dx[j];
        y = y0 + dy[j];
        if (x < m && x >= 0 && y >= 0 && y < n && maze[y][x] != '*' &&
            dist[y][x] <= (k - i)) {
          ans += ch[j];
          x0 = x;
          y0 = y;
          flg = 1;
          break;
        }
      }
      if (flg == 0) break;
    }
    if (flg == 0)
      cout << "IMPOSSIBLE\n";
    else
      cout << ans << "\n";
  }
  return 0;
}
