#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  cin >> n >> s;
  priority_queue<int, vector<int>, greater<int>> d, r;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'D')
      d.push(i + 1);
    else
      r.push(i + 1);
  }
  while (r.size() > 0 && d.size() > 0) {
    int a = r.top();
    int b = d.top();
    if (a < b) {
      d.pop();
      r.pop();
      a += n;
      r.push(a);
    } else if (b < a) {
      d.pop();
      r.pop();
      b += n;
      d.push(b);
    }
  }
  if (d.size() > 0)
    cout << 'D' << endl;
  else
    cout << 'R' << endl;
}
