#include <bits/stdc++.h>
using namespace std;
int el[200002];
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cd = 0, cr = 0;
  for (long long(k) = (0); (k) < (((int)s.size())); (k)++) {
    if (s[k] == 'D') {
      cd++;
    } else {
      cr++;
    }
  }
  if (cd == 0) {
    cout << "R" << endl;
    return 0;
  }
  if (cr == 0) {
    cout << "D" << endl;
    return 0;
  }
  memset(el, 0, sizeof(el));
  int i = 0, j = 0;
  while (cd != 0 && cr != 0) {
    while (el[i]) {
      i++;
      i %= ((int)s.size());
    }
    if (s[i] == 'D') {
      while (s[j] != 'R' || (s[j] == 'R' && el[j])) {
        j++;
        j %= ((int)s.size());
      }
      el[j]++;
      cr--;
    } else {
      while (s[j] != 'D' || (s[j] == 'D' && el[j])) {
        j++;
        j %= ((int)s.size());
      }
      el[j]++;
      cd--;
    }
    i++;
    i %= ((int)s.size());
  }
  if (cr == 0) {
    cout << "D" << endl;
  } else {
    cout << "R" << endl;
  }
  return 0;
}
