#include <bits/stdc++.h>
using namespace std;
int n, m, k;
pair<int, int> start;
char symbols[1005][1005];
int dp[1005][1005];
string path;
const int INF = 1e9 + 7;
char direct[] = {'D', 'L', 'R', 'U'};
void bfs(pair<int, int> start) {
  deque<pair<int, int> > fields;
  dp[start.first][start.second] = 0;
  fields.push_back(start);
  while (fields.size() > 0) {
    pair<int, int> field = fields.front();
    fields.pop_front();
    for (int dx = -1; dx <= 1; dx++) {
      for (int dy = -1; dy <= 1; dy++) {
        if (dx == 0 && dy == 0) {
          continue;
        }
        if (dx != 0 && dy != 0) {
          continue;
        }
        int x = field.first + dx;
        int y = field.second + dy;
        if (x >= 1 && x <= n && y >= 1 && y <= m) {
          if (symbols[x][y] == '*') {
            continue;
          }
          if (dp[x][y] > dp[field.first][field.second] + 1) {
            dp[x][y] = dp[field.first][field.second] + 1;
            fields.push_back(make_pair(x, y));
          }
        }
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> k;
  if (k % 2) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  for (int i = 0; i <= n + 1; ++i) {
    for (int j = 0; j <= m + 1; ++j) {
      symbols[i][j] = '*';
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      cin >> symbols[i][j];
      if (symbols[i][j] == 'X') {
        start = make_pair(i, j);
      }
      dp[i][j] = INF;
    }
  }
  bfs(start);
  int cnt = 0;
  if (symbols[start.first + 1][start.second] == '*') {
    cnt++;
  }
  if (symbols[start.first - 1][start.second] == '*') {
    cnt++;
  }
  if (symbols[start.first][start.second + 1] == '*') {
    cnt++;
  }
  if (symbols[start.first][start.second - 1] == '*') {
    cnt++;
  }
  if (cnt == 4) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  pair<int, int> current = start;
  pair<int, int> directs[4];
  directs[0] = make_pair(1, 0);
  directs[1] = make_pair(0, -1);
  directs[2] = make_pair(0, 1);
  directs[3] = make_pair(-1, 0);
  for (int i = 1; i <= k; ++i) {
    for (int j = 0; j < 4; ++j) {
      int x = current.first + directs[j].first;
      int y = current.second + directs[j].second;
      if (symbols[x][y] == '*') {
        continue;
      }
      if (k - i >= dp[x][y]) {
        path.push_back(direct[j]);
        current = make_pair(x, y);
        break;
      }
    }
  }
  cout << path << endl;
  return 0;
}
