#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000;
int n;
char a[maxn + 1];
set<int> D, R;
int main() {
  ios_base::sync_with_stdio(0);
  D.clear();
  R.clear();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 'D')
      D.insert(i);
    else
      R.insert(i);
  }
  int i = 1;
  while (D.size() != 0 and R.size() != 0) {
    if (D.lower_bound(i) == D.end() and R.lower_bound(i) == R.end()) {
      i = 1;
      continue;
    } else if (D.lower_bound(i) == D.end() and R.lower_bound(i) != R.end()) {
      int j = *R.lower_bound(i);
      if (D.upper_bound(j) == D.end())
        D.erase(D.upper_bound(0));
      else
        D.erase(D.upper_bound(j));
      i = j + 1;
    } else if (D.lower_bound(i) != D.end() and R.lower_bound(i) == R.end()) {
      int j = *D.lower_bound(i);
      if (R.upper_bound(j) == R.end())
        R.erase(R.upper_bound(0));
      else
        R.erase(R.upper_bound(j));
      i = j + 1;
    } else if (D.lower_bound(i) != D.end() and R.lower_bound(i) != R.end()) {
      if (*D.lower_bound(i) < *R.lower_bound(i)) {
        int j = *D.lower_bound(i);
        if (R.upper_bound(j) == R.end())
          R.erase(R.upper_bound(0));
        else
          R.erase(R.upper_bound(j));
        i = j + 1;
      } else {
        int j = *R.lower_bound(i);
        if (D.upper_bound(j) == D.end())
          D.erase(D.upper_bound(0));
        else
          D.erase(D.upper_bound(j));
        i = j + 1;
      }
    }
  }
  if (D.size() > 0)
    cout << 'D';
  else
    cout << 'R';
  return 0;
}
