#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)5e5 + 228;
const char nxtl = '\n';
const int mod = (int)1e9 + 7;
const double eps = (double)1e-7;
template <typename T>
inline bool updmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool updmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
int n, m, k, pos1, pos2;
string s;
char ch[1101][1101];
void dfs(int x, int y) {
  if (((int)(s.size())) == k / 2) {
    if (!pos1) pos1 = x, pos2 = y;
    return;
  }
  if (x + 1 <= n && ch[x + 1][y] != '*') {
    s += 'D';
    dfs(x + 1, y);
  } else if (y - 1 > 0 && ch[x][y - 1] != '*') {
    s += 'L';
    dfs(x, y - 1);
  } else if (y + 1 <= m && ch[x][y + 1] != '*') {
    s += 'R';
    dfs(x, y + 1);
  } else if (x - 1 > 0 && ch[x - 1][y] != '*') {
    s += 'U';
    dfs(x - 1, y);
  } else {
    cout << "IMPOSSIBLE\n";
    exit(0);
  }
}
int pose1, pose2;
int d[2][1101][1101];
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int dp[2][1101][1101];
void bfs(int x, int y) {
  memset(dp, 255, sizeof dp);
  queue<pair<int, pair<int, int> > > q;
  dp[0][x][y] = 0;
  q.push(make_pair(0, make_pair(x, y)));
  while (!q.empty()) {
    auto cur = q.front();
    q.pop();
    for (int i = 0; i <= 3; ++i) {
      int gox = dx[i] + cur.second.first, goy = dy[i] + cur.second.second;
      if (gox > 0 && gox <= n && goy > 0 && goy <= m)
        if (dp[cur.first ^ 1][gox][goy] == -1 && ch[gox][goy] != '*') {
          q.push(make_pair(cur.first ^ 1, make_pair(gox, goy)));
          dp[cur.first ^ 1][gox][goy] =
              dp[cur.first][cur.second.first][cur.second.second] + 1;
        }
    }
  }
}
void dfs2(int x, int y, int len) {
  if (x == pose1 && y == pose2 && !len) {
    cout << s;
    exit(0);
  }
  if (x + 1 <= n && ch[x + 1][y] != '*' && dp[(len - 1) & 1][x + 1][y] != -1 &&
      dp[(len - 1) & 1][x + 1][y] <= len - 1) {
    s += 'D';
    dfs2(x + 1, y, len - 1);
  } else if (y - 1 > 0 && ch[x][y - 1] != '*' &&
             dp[(len - 1) & 1][x][y - 1] != -1 &&
             dp[(len - 1) & 1][x][y - 1] <= len - 1) {
    s += 'L';
    dfs2(x, y - 1, len - 1);
  } else if (y + 1 <= m && ch[x][y + 1] != '*' &&
             dp[(len - 1) & 1][x][y + 1] != -1 &&
             dp[(len - 1) & 1][x][y + 1] <= len - 1) {
    s += 'R';
    dfs2(x, y + 1, len - 1);
  } else if (x - 1 > 0 && ch[x - 1][y] != '*' &&
             dp[(len - 1) & 1][x - 1][y] != -1 &&
             dp[(len - 1) & 1][x - 1][y] <= len - 1) {
    s += 'U';
    dfs2(x - 1, y, len - 1);
  } else {
    cout << "IMPOSSIBLE\n";
    exit(0);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      cin >> ch[i][j];
    }
  }
  if (k % 2) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (ch[i][j] == 'X') {
        bfs(i, j);
        dfs(i, j);
        cout << s;
        s.clear();
        pose1 = i, pose2 = j;
        dfs2(pos1, pos2, k / 2);
        assert(0);
      }
    }
  }
  return 0;
}
