#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long i, j, n;
  cin >> n;
  string s;
  cin >> s;
  std::queue<long long> d, r;
  for (i = 0; i < n; i++) {
    if (s[i] == 'D')
      d.push(i);
    else
      r.push(i);
  }
  while (d.size() && r.size()) {
    long long x = d.front(), y = r.front();
    d.pop();
    r.pop();
    if (x < y)
      d.push(x + n);
    else
      r.push(y + n);
  }
  if (d.size())
    cout << "D";
  else
    cout << "R";
}
