#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(false);
  long n, i, j, k, temp, rep = 0, demo = 0;
  string str;
  queue<long> tempRepQ, curRepQ, tempDemoQ, curDemoQ;
  cin >> n >> str;
  for (i = 0; i < n; i++) {
    if (str[i] == 'R') {
      curRepQ.push(i);
      rep++;
    } else {
      curDemoQ.push(i);
      demo++;
    }
  }
  while (rep > 0 && demo > 0) {
    for (i = 0; i < n; i++) {
      if (str[i] == 'R') {
        if (!curDemoQ.empty()) {
          temp = curDemoQ.front();
          curDemoQ.pop();
        } else if (!tempDemoQ.empty()) {
          temp = tempDemoQ.front();
          tempDemoQ.pop();
        } else
          break;
        str[temp] = 'e';
        demo--;
        curRepQ.pop();
        tempRepQ.push(i);
      } else if (str[i] == 'D') {
        if (!curRepQ.empty()) {
          temp = curRepQ.front();
          curRepQ.pop();
        } else if (!tempRepQ.empty()) {
          temp = tempRepQ.front();
          tempRepQ.pop();
        } else
          break;
        str[temp] = 'e';
        rep--;
        curDemoQ.pop();
        tempDemoQ.push(i);
      }
    }
    if (rep > 0 && demo > 0) {
      while (!tempDemoQ.empty()) {
        temp = tempDemoQ.front();
        curDemoQ.push(temp);
        tempDemoQ.pop();
      }
      while (!tempRepQ.empty()) {
        temp = tempRepQ.front();
        curRepQ.push(temp);
        tempRepQ.pop();
      }
    }
  }
  if (rep > 0)
    cout << "R";
  else
    cout << "D";
  return 0;
}
