#include <bits/stdc++.h>
int main() {
  int n, dc, rc, dn, rn, v;
  char cdt[200001];
  scanf("%d %s", &n, cdt);
  for (v = 0; v < n; v++)
    if (cdt[v] == 'R')
      rc++;
    else
      dc++;
  v = 0;
  dn = 0;
  rn = 0;
  while (0 < (rc - rn) && 0 < (dc - dn)) {
    if (cdt[v] == 'R') {
      if (rn > 0) {
        cdt[v] = 'N';
        rn--;
        rc--;
      } else
        dn++;
    }
    if (cdt[v] == 'D') {
      if (dn > 0) {
        cdt[v] = 'N';
        dn--;
        dc--;
      } else
        rn++;
    }
    v++;
    if (v == n) {
      int p1, p2;
      p1 = 0;
      for (p2 = 0; p2 < n; p2++)
        if (cdt[p2] != 'N') cdt[p1++] = cdt[p2];
      n = p1;
      v = 0;
    }
  }
  if (rc - rn == 0)
    printf("D\n");
  else
    printf("R\n");
  return 0;
}
