#include <bits/stdc++.h>
using namespace std;
set<int> s[2];
int gg(int pos, int id) {
  auto t = s[id].lower_bound(pos);
  if (t != s[id].end()) return *t;
  return *s[id].begin();
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  string S;
  cin >> S;
  for (int i = 0; i < n; i++) {
    int x = (S[i] == 'D');
    s[x].insert(i);
  }
  int cur = 0;
  while (s[1].size() && s[0].size()) {
    int t0 = gg(cur, 0);
    int t1 = gg(cur, 1);
    int ans;
    if (t0 >= cur && t1 >= cur)
      ans = (t0 < t1 ? 0 : 1);
    else if (t0 >= cur)
      ans = 0;
    else if (t1 >= cur)
      ans = 1;
    else
      ans = (t0 < t1 ? 0 : 1);
    int pos = (ans == 0 ? t0 : t1);
    s[ans ^ 1].erase(gg(cur, ans ^ 1));
    cur = (pos + 1) % n;
  }
  if (s[1].size())
    cout << "D";
  else
    cout << "R";
}
