#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  string input;
  cin >> input;
  list<long long int> D;
  list<long long int> R;
  for (long long int i = n - 1; i >= 0; i--) {
    if (input[i] == 'D')
      D.push_front(i);
    else
      R.push_front(i);
  }
  long long int i = 0;
  while (D.size() != 0 && R.size() != 0) {
    if (D.front() == i) {
      R.pop_front();
      long long int x = D.front();
      D.pop_front();
      D.push_back(x);
    } else if (R.front() == i) {
      D.pop_front();
      long long int x = R.front();
      R.pop_front();
      R.push_back(x);
    }
    i++;
    if (i == n) i = 0;
  }
  if (D.size() == 0)
    cout << "R";
  else
    cout << "D";
}
