#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, n, r, d, dd, rr;
  string s;
  cin >> n;
  cin >> s;
  r = rr = d = dd = 0;
  queue<char> q;
  for (i = 0; i < n; i++) {
    if (s[i] == 'D') {
      d++;
    } else {
      r++;
    }
    q.push(s[i]);
  }
  char c;
  while (r > 0 && d > 0) {
    c = q.front();
    q.pop();
    if (c == 'D') {
      if (dd == 0) {
        r--;
        rr++;
        q.push(c);
      } else {
        dd--;
      }
    } else {
      if (rr == 0) {
        d--;
        dd++;
        q.push(c);
      } else {
        rr--;
      }
    }
  }
  if (r > d)
    cout << "R\n";
  else
    cout << "D\n";
}
