#include <bits/stdc++.h>
using namespace std;
const int nu = (int)3e6 + 10;
int n;
char s[nu];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  scanf("%d %s", &n, s);
  int d = 0, r = 0, curd = 0, curr = 0;
  for (int i = 0; i <= n - 1; i += 1) {
    if (s[i] == 'D')
      curd++;
    else
      curr++;
  }
  for (int i = 0; curd > 0 && curr > 0 && i < n; i++) {
    if (s[i] == 'D') {
      if (r > 0)
        r--, curd--;
      else
        d++, s[n++] = 'D';
    } else {
      if (d > 0)
        d--, curr--;
      else
        r++, s[n++] = 'R';
    }
  }
  if (curd == 0)
    printf("R\n");
  else
    printf("D\n");
  return 0;
}
