#include <bits/stdc++.h>
using namespace std;
char str[200005], removed[200005];
int main(void) {
  int n;
  scanf("%d %s", &n, str);
  int x = 0, y = 0;
  for (int i = 0; str[i]; ++i) {
    if (str[i] == 'D') {
      ++x;
    } else {
      ++y;
    }
  }
  int d = 0, r = 0;
  while (x and y) {
    for (int i = 0; str[i]; ++i) {
      if (removed[i]) continue;
      if (str[i] == 'D') {
        if (d == 0) {
          ++r;
        } else {
          --d;
          removed[i] = true;
          --x;
        }
      } else {
        if (r == 0) {
          ++d;
        } else {
          --r;
          removed[i] = true;
          --y;
        }
      }
    }
  }
  printf(x > y ? "D\n" : "R\n");
  return 0;
}
