#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int INF = 1000000009;
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  string s;
  set<int> ds;
  set<int> rs;
  int n;
  cin >> n;
  cin >> s;
  vector<char> dis(s.length(), false);
  int cd = 0, cr = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'D') {
      ds.insert(i);
      ++cd;
    } else {
      rs.insert(i);
      ++cr;
    }
  }
  while (cd && cr) {
    for (int i = 0; i < n; ++i) {
      if (!dis[i]) {
        if (s[i] == 'D') {
          auto it = rs.upper_bound(i);
          if (it == rs.end()) {
            it = rs.begin();
          }
          int cur = *it;
          rs.erase(it);
          dis[cur] = true;
          --cr;
        } else {
          auto it = ds.upper_bound(i);
          if (it == ds.end()) {
            it = ds.begin();
          }
          int cur = *it;
          ds.erase(it);
          dis[cur] = true;
          --cd;
        }
      }
      if (!cd || !cr) break;
    }
  }
  if (cd) {
    cout << "D\n";
  } else {
    cout << "R\n";
  }
  return 0;
}
