#include <bits/stdc++.h>
using namespace std;
int n;
char s[200055];
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  int have_d = 0, have_r = 0;
  set<int> alive;
  for (int i = 0; i < n; i++) {
    alive.insert(i);
    if (s[i] == 'D')
      have_d++;
    else
      have_r++;
  }
  int d = 0, r = 0;
  while (true) {
    vector<int> vec;
    for (auto i : alive) {
      if (s[i] == '$') continue;
      if (s[i] == 'D') {
        if (d > 0) {
          s[i] = '$', d--;
          have_d--;
          vec.push_back(i);
        } else
          r++;
      } else {
        if (r > 0) {
          s[i] = '$', r--;
          have_r--;
          vec.push_back(i);
        } else
          d++;
      }
    }
    for (auto u : vec) alive.erase(u);
    if (have_d == 0) {
      puts("R");
      return 0;
    } else if (have_r == 0) {
      puts("D");
      return 0;
    }
  }
  return 0;
}
