#include <bits/stdc++.h>
using namespace std;
const int MAX = 5e5 + 5;
int n;
char a[MAX];
set<int> s, sr, sd;
int main() {
  scanf("%d%s", &n, a + 1);
  for (int i = 1; i <= n; i++) {
    s.insert(i);
    if (a[i] == 'D')
      sd.insert(i);
    else
      sr.insert(i);
  }
  int p = 1;
  while (1) {
    if (a[p] == 'D') {
      if (sr.empty()) {
        printf("D\n");
        return 0;
      }
      auto it = sr.upper_bound(p);
      if (it == sr.end()) it = sr.begin();
      s.erase(s.find(*it));
      sr.erase(it);
    } else {
      if (sd.empty()) {
        printf("R\n");
        return 0;
      }
      auto it = sd.upper_bound(p);
      if (it == sd.end()) it = sd.begin();
      s.erase(s.find(*it));
      sd.erase(it);
    }
    auto it = s.upper_bound(p);
    if (it == s.end()) it = s.begin();
    p = *it;
  }
  return 0;
}
