#include <bits/stdc++.h>
const int inf = 1e9 + 5;
const long long linf = 5e18 + 5;
const long double eps = 1e-9;
const long long dd = 2e5 + 7;
const long long maxn = 2e3 + 10;
const long long mod = 1e9 + 7;
using namespace std;
const int qq = 1e5;
set<pair<int, int> > d, r;
int main() {
  ios_base::sync_with_stdio(0);
  if (0) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  } else {
    if (!01) {
      freopen(
          "sufpref"
          ".in",
          "r", stdin);
      freopen(
          "sufpref"
          ".out",
          "w", stdout);
    }
  }
  int n;
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    char x;
    cin >> x;
    if (x == 'D')
      d.insert(make_pair(-1, i));
    else
      r.insert(make_pair(-1, i));
  }
  int now = 0;
  while (d.size() && r.size()) {
    if (*d.begin() < *r.begin()) {
      r.erase(r.begin());
      d.insert(make_pair(now, d.begin()->second));
      d.erase(d.begin());
    } else {
      d.erase(d.begin());
      r.insert(make_pair(now, r.begin()->second));
      r.erase(r.begin());
    }
    now++;
  }
  cout << (r.size() ? 'R' : 'D');
  return 0;
}
