#include <bits/stdc++.h>
using namespace std;
int n, cnt, r, d, cntr, cntd;
char a;
queue<char> q;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    q.push(a);
    if (a == 'R')
      cntr++;
    else
      cntd++;
  }
  while (cntr > 0 && cntd > 0)
    if (q.front() == 'D')
      if (r >= 1)
        r--, q.pop(), cntd--;
      else
        d++, q.push(q.front()), q.pop();
    else if (d >= 1)
      d--, q.pop(), cntr--;
    else
      r++, q.push(q.front()), q.pop();
  cout << q.front();
  return 0;
}
