#include <bits/stdc++.h>
using namespace std;
queue<int> D, R;
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    char t;
    cin >> t;
    if (t == 'D')
      D.push(i);
    else
      R.push(i);
  }
  while (!D.empty() && !R.empty()) {
    if (D.front() < R.front()) {
      R.pop();
      D.push(D.front() + n);
      D.pop();
    } else {
      D.pop();
      R.push(R.front() + n);
      R.pop();
    }
  }
  if (D.empty())
    cout << "R" << endl;
  else
    cout << "D" << endl;
  return 0;
}
