#include <bits/stdc++.h>
using namespace std;
int N;
queue<int> D;
queue<int> R;
int main() {
  cin >> N;
  char c;
  for (int i = 0; i < N; ++i) {
    cin >> c;
    (c == 'D' ? D : R).push(i);
  }
  while (D.size() > 0 && R.size() > 0) {
    if (D.front() < R.front()) {
      R.pop();
      D.push(D.front() + N);
      D.pop();
    } else {
      D.pop();
      R.push(R.front() + N);
      R.pop();
    }
  }
  cout << (D.size() > 0 ? 'D' : 'R') << endl;
  return 0;
}
