#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool rc = false, dc = false;
  stack<char> st;
  list<char> l1, l2, l3;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'R')
      rc = true;
    else
      dc = true;
    l1.push_back(s[i]);
  }
  int j = 0;
  while (rc && dc) {
    rc = dc = false;
    while (!l1.empty()) {
      char c = l1.front();
      if (st.empty() || st.top() == c)
        st.push(c);
      else {
        if (st.top() == 'R')
          rc = true;
        else
          dc = true;
        l2.push_back(st.top());
        st.pop();
      }
      l1.pop_front();
    }
    while (!st.empty()) {
      if (st.top() == 'R')
        rc = true;
      else
        dc = true;
      l2.push_front(st.top());
      st.pop();
    }
    l3 = l1;
    l1 = l2;
    l2 = l3;
  }
  if (rc)
    cout << "R" << endl;
  else
    cout << "D" << endl;
  return 0;
}
