#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  queue<pair<int, int>> q;
  int n;
  cin >> n;
  getchar();
  string s;
  getline(cin, s);
  int counter = 0;
  for (int i = 0; i < s.length() + 1; i++) {
    if (i == s.length()) {
      q.push(make_pair((s[i - 1] == 'D' ? 1 : 0), counter));
      break;
    } else if (i - 1 < 0 || s[i] == s[i - 1]) {
      counter++;
    } else {
      q.push(make_pair((s[i - 1] == 'D' ? 1 : 0), counter));
      counter = 1;
    }
  }
  int currentcol = 0;
  int residue = 0;
  while (!q.empty()) {
    if (residue) {
      if (q.front().first == currentcol) {
        residue += q.front().second;
        q.pop();
      } else {
        if (residue >= q.front().second) {
          residue -= q.front().second;
          q.push(make_pair(currentcol, q.front().second));
          q.pop();
        } else {
          q.push(make_pair(currentcol, residue));
          residue = q.front().second - residue;
          currentcol = q.front().first;
          q.pop();
        }
      }
    } else {
      currentcol = q.front().first;
      residue = q.front().second;
      q.pop();
    }
  }
  cout << (currentcol ? "D" : "R");
}
