#include <bits/stdc++.h>
using namespace std;
queue<int> r, d;
char s[200005];
int main() {
  std::ios::sync_with_stdio(false);
  int n, a, b;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'R')
      r.push(i);
    else
      d.push(i);
  }
  while (!r.empty() && !d.empty()) {
    a = r.front();
    b = d.front();
    if (a > b) {
      r.pop();
      d.pop();
      d.push(b + n);
    } else {
      d.pop();
      r.pop();
      r.push(a + n);
    }
  }
  if (r.empty() == true)
    cout << "D";
  else if (d.empty() == true)
    cout << "R";
  cout << endl;
  return 0;
}
