#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<char> v;
  int n;
  int D_num = 0, R_num = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    v.push_back(c);
    if (c == 'D')
      D_num++;
    else
      R_num++;
  }
  int D = 0, R = 0;
  int i = 0;
  while (true) {
    if (D_num == 0 || R_num == 0) break;
    if (v[i] == 'D' && R == 0) {
      D++;
    } else if (v[i] == 'D' && R != 0) {
      R--;
      v[i] = 0;
      D_num--;
    } else if (v[i] == 'R' && D == 0) {
      R++;
    } else if (v[i] == 'R' && D != 0) {
      v[i] = 0;
      D--;
      R_num--;
    }
    i = (i + 1) % n;
  }
  if (D_num)
    cout << 'D' << endl;
  else
    cout << 'R' << endl;
  return 0;
}
