#include <bits/stdc++.h>
using namespace std;
void Weapons19() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  Weapons19();
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long sd = 0, sr = 0, nr = 0, nd = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == 'R')
      nr++;
    else
      nd++;
  }
  for (long long i = 0; i < n; i++) {
    if (nd == 0 && s[i] == 'R') {
      cout << "R";
      return 0;
    }
    if (nr == 0 && s[i] == 'D') {
      cout << "D";
      return 0;
    }
    if (s[i] == 'D' && sd == 0) {
      sr++;
      nr--;
      s += 'D';
      n++;
    } else if (s[i] == 'D' && sd > 0) {
      sd--;
    } else if (s[i] == 'R' && sr == 0) {
      sd++;
      nd--;
      s += 'R';
      n++;
    } else if (s[i] == 'R' && sr > 0) {
      sr--;
    }
  }
}
