#include <bits/stdc++.h>
using namespace std;
char c[200005];
int vis[200005];
int main() {
  int n;
  while (cin >> n) {
    scanf("%s", c);
    int d, r;
    d = r = 0;
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < n; i++) {
      if (c[i] == 'D') {
        d++;
      } else {
        r++;
      }
    }
    int band, banr;
    band = banr = 0;
    while (d > 0 && r > 0) {
      for (int i = 0; i < n && d > 0 && r > 0; i++) {
        if (!vis[i]) {
          if (c[i] == 'D') {
            if (band) {
              vis[i] = 1;
              band--;
            } else {
              banr++;
              r--;
            }
          } else {
            if (banr) {
              vis[i] = 1;
              banr--;
            } else {
              d--;
              band++;
            }
          }
        }
      }
    }
    if (!d)
      printf("R\n");
    else
      printf("D\n");
  }
  return 0;
}
