#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned n;
  string str;
  cin >> n;
  cin >> str;
  list<char> ppl;
  unsigned votes_r = 0, votes_d = 0, nr = 0, nd = 0;
  for (unsigned i = 0; i < str.size(); ++i) {
    ppl.push_back(str[i]);
    if (str[i] == 'R')
      nr += 1;
    else
      nd += 1;
  }
  while (nr != 0 && nd != 0) {
    nr = 0;
    nd = 0;
    auto vote = ppl.begin();
    while (vote != ppl.end()) {
      if (*vote == 'R')
        if (votes_d == 0) {
          votes_r += 1;
          nr += 1;
          ++vote;
        } else {
          votes_d -= 1;
          ppl.erase(vote++);
        }
      else if (votes_r == 0) {
        votes_d += 1;
        nd += 1;
        ++vote;
      } else {
        votes_r -= 1;
        ppl.erase(vote++);
      }
    }
  }
  if (nr == 0)
    cout << 'D' << endl;
  else
    cout << 'R' << endl;
  return 0;
}
