#include <bits/stdc++.h>
int main(void) {
  int n, ownd, ownr, i, j, numd, numr;
  char s[200005];
  while (scanf("%d", &n) != EOF) {
    scanf("%s", s);
    numd = numr = ownd = ownr = 0;
    for (i = 0; i < n; i++) {
      if (s[i] == 'D') {
        numd++;
      } else
        numr++;
    }
    while (1) {
      for (i = 0; i < n; i++) {
        if (s[i] == 'D') {
          if (ownd < 0) {
            s[i] = 0;
            numd--;
            ownd++;
          } else {
            ownr--;
          }
        }
        if (s[i] == 'R') {
          if (ownr < 0) {
            s[i] = 0;
            numr--;
            ownr++;
          } else {
            ownd--;
          }
        }
      }
      if (numd == 0 || numr == 0) break;
    }
    if (numr == 0) {
      printf("D\n");
    }
    if (numd == 0) {
      printf("R\n");
    }
  }
}
