#include <bits/stdc++.h>
using namespace std;
int k[100];
string s, sn;
int main() {
  cin >> k[0] >> sn;
  while (s != sn) {
    s = sn;
    sn = "";
    for (auto i : s)
      if (k[i])
        k[i]--;
      else {
        k['R' + 'D' - i]++;
        sn += i;
      }
  }
  cout << s[0];
  return 0;
}
