#include <bits/stdc++.h>
using namespace std;
class Node {
 public:
  Node *pSig, *pAnt;
  char cInfo;
  Node() {
    cInfo = 0;
    pSig = NULL;
    pAnt = NULL;
  }
  Node(int x) { cInfo = x; }
};
class dLinkedList {
 private:
  Node *Inicio, *Final, *pP;
  int cR = 0, cD = 0;

 public:
  dLinkedList() {
    Inicio = NULL;
    Final = NULL;
  }
  void add(char x);
  void erase(Node *pD);
  bool votar(int n);
  void print();
};
void dLinkedList::add(char x) {
  if (x == 'R') {
    cR++;
  } else {
    cD++;
  }
  if (Inicio == NULL) {
    pP = new Node(x);
    Inicio = pP;
    Final = pP;
    pP->pSig = pP;
    pP->pAnt = pP;
  } else {
    Node *pQ;
    pQ = new Node(x);
    Final = pQ;
    pQ->pSig = Inicio;
    pQ->pAnt = pP;
    pP->pSig = pQ;
    Inicio->pAnt = Final;
    pP = pQ;
  }
}
bool dLinkedList::votar(int n) {
  int eR = 0, eD = 0;
  Node *nX;
  nX = Inicio;
  do {
    bool find = false;
    if (eR != 0 and nX->cInfo == 'R') {
      nX->pSig->pAnt = nX->pAnt;
      nX->pAnt->pSig = nX->pSig;
      nX = nX->pSig;
      find = true;
      eR--;
      cR--;
    } else if (eD != 0 and nX->cInfo == 'D') {
      nX->pSig->pAnt = nX->pAnt;
      nX->pAnt->pSig = nX->pSig;
      nX = nX->pSig;
      find = true;
      eD--;
      cD--;
    }
    if (!find) {
      if (nX->cInfo == 'R') {
        eD++;
      } else if (nX->cInfo == 'D') {
        eR++;
      }
    }
    if (!find) nX = nX->pSig;
  } while (cR != 0 and cD != 0);
  if (cR == 0)
    return true;
  else
    return false;
}
void dLinkedList::print() {
  Node *o;
  o = Inicio;
  while (o != Final or o->pSig != o) {
    cout << o->cInfo << endl;
    o = o->pSig;
  }
  cout << o->cInfo << endl;
}
int main() {
  dLinkedList List;
  int n;
  char cC;
  cin >> n;
  for (int iA = 0; iA < n; iA++) {
    cin >> cC;
    List.add(cC);
  }
  if (List.votar(n))
    cout << "D" << endl;
  else
    cout << "R" << endl;
  return 0;
}
