#include <bits/stdc++.h>
using namespace std;
string s;
bitset<200005> b;
int main() {
  ios_base::sync_with_stdio(0);
  int n, i, x, y, z;
  cin >> n >> s;
  x = y = 0;
  z = 3;
  while (z == 3) {
    z = 0;
    for (i = 0; i < n; ++i)
      if (!b[i]) {
        if (s[i] == 'D') {
          z |= 1;
          if (x) {
            --x;
            b[i] = 1;
          } else
            ++y;
        } else {
          z |= 2;
          if (y) {
            --y;
            b[i] = 1;
          } else
            ++x;
        }
      }
  }
  if (z == 1)
    cout << "D\n";
  else
    cout << "R\n";
  return 0;
}
