#include <bits/stdc++.h>
using namespace std;
const int N = 200005, oo = 0x3f3f3f3f;
int n;
vector<int> tirar;
set<int> p, d, r;
char s[N];
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; s[i]; i++) {
    if (s[i] == 'D') {
      d.insert(i);
    } else
      r.insert(i);
    p.insert(i);
  }
  while (1) {
    tirar.clear();
    for (set<int>::iterator it = p.begin(); it != p.end(); it++) {
      if (!s[*it]) continue;
      if (s[*it] == 'D') {
        set<int>::iterator it2 = r.upper_bound(*it);
        if (it2 != r.end()) {
          tirar.push_back(*it2);
          s[*it2] = 0;
          r.erase(it2);
        } else if (r.begin() != r.end()) {
          tirar.push_back(*(r.begin()));
          s[*(r.begin())] = 0;
          r.erase(r.begin());
        }
      } else {
        set<int>::iterator it2 = d.upper_bound(*it);
        if (it2 != d.end()) {
          tirar.push_back(*it2);
          s[*it2] = 0;
          d.erase(it2);
        } else if (d.begin() != d.end()) {
          tirar.push_back(*(d.begin()));
          s[*(d.begin())] = 0;
          d.erase(d.begin());
        }
      }
    }
    if (d.size() == 0) {
      printf("R\n");
      return 0;
    }
    if (r.size() == 0) {
      printf("D\n");
      return 0;
    }
    for (int i = 0; i < tirar.size(); i++) {
      r.erase(tirar[i]);
      d.erase(tirar[i]);
    }
  }
  return 0;
}
