#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<char> v(n);
  int fd, fr;
  fr = fd = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] == 'D')
      fd++;
    else
      fr++;
  }
  int d, r;
  r = d = 0;
  vector<int> dd(n, -1);
  vector<int> rr(n, -1);
  int ddd = 0;
  int rrr = 0;
  for (int i = 0; i < n; i++) {
    if (rrr >= fr) {
      cout << 'D';
      break;
    }
    if (ddd >= fd) {
      cout << 'R';
      break;
    }
    if (v[i] == 'D') {
      if (d > 0) {
        if (dd[i] == 0) {
          if (i == n - 1) i = -1;
          continue;
        } else {
          if (dd[i] == 0) {
            if (i == n - 1) i = -1;
            continue;
          }
          dd[i] = 0;
          d--;
        }
      } else {
        if (dd[i] == 0) {
          if (i == n - 1) i = -1;
          continue;
        }
        r++;
        rrr++;
      }
    } else {
      if (r > 0) {
        if (rr[i] == 0) {
          if (i == n - 1) i = -1;
          continue;
        } else {
          if (rr[i] == 0) {
            if (i == n - 1) i = -1;
            continue;
          }
          rr[i] = 0;
          r--;
        }
      } else {
        if (rr[i] == 0) {
          if (i == n - 1) i = -1;
          continue;
        }
        d++;
        ddd++;
      }
    }
    if (i == n - 1) i = -1;
  }
  return 0;
}
