#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<bool> used(n, false);
  char s[n];
  int de = 0, re = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == 'D')
      de++;
    else
      re++;
  }
  int l = 0, r = 1;
  char x = s[0], ans;
  while (true) {
    if (de == 0) {
      ans = 'R';
      break;
    } else if (re == 0) {
      ans = 'D';
      break;
    }
    if (used[l]) {
      l = (l + 1) % n;
      continue;
    }
    if (s[r] != s[l] && !used[r]) {
      used[r] = 1;
      if (s[l] == 'D')
        re--;
      else
        de--;
      l = (l + 1) % n;
      r = (r + 1) % n;
    } else {
      r = (r + 1) % n;
    }
  }
  cout << ans;
  return 0;
}
