#include <bits/stdc++.h>
using namespace std;
int main() {
  queue<int> D, R;
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; ++i) s[i] == 'D' ? D.push(i + 1) : R.push(i + 1);
  while (D.size() && R.size()) {
    if (D.front() > R.front()) {
      D.pop();
      int tmp = R.front() + n;
      R.pop();
      R.push(tmp);
    } else {
      R.pop();
      int tmp = D.front() + n;
      D.pop();
      D.push(tmp);
    }
  }
  if (D.size())
    puts("D");
  else
    puts("R");
  return 0;
}
