#include <bits/stdc++.h>
using namespace std;
string employees;
queue<int> d, r;
int main() {
  int n;
  cin >> n >> employees;
  for (int i = 0; i < n; i++) {
    if (employees[i] == 'D')
      d.push(i);
    else
      r.push(i);
  }
  while (!d.empty() && !r.empty()) {
    int idx_d = d.front(), idx_r = r.front();
    d.pop(), r.pop();
    if (idx_d < idx_r)
      d.push(idx_d + n);
    else
      r.push(idx_r + n);
  }
  if (d.empty())
    cout << "R";
  else
    cout << "D";
  return 0;
}
