#include <bits/stdc++.h>
using namespace std;
const int ms = 111111;
priority_queue<int, vector<int>, greater<int>> d, r;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0, __ = n; i < __; ++i) {
    if (s[i] == 'D')
      d.push(i);
    else
      r.push(i);
  }
  while (!d.empty() && !r.empty()) {
    if (d.top() < r.top()) {
      r.pop();
      d.push(d.top() + n);
      d.pop();
    } else {
      d.pop();
      r.push(r.top() + n);
      r.pop();
    }
  }
  puts(d.empty() ? "R" : "D");
  return 0;
}
