#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string p;
  cin >> p;
  int a[n];
  for (long long i = 0; i < n; i++) a[i] = 0;
  long long r = 0;
  long long d = 0;
  while (true) {
    for (long long i = 0; i < n; i++) {
      if (p[i] == 'D' && a[i] == 0) {
        if (d > 0) {
          a[i] = 1;
          d--;
        } else {
          r++;
        }
      }
      if (p[i] == 'R' && a[i] == 0) {
        if (r > 0) {
          a[i] = 1;
          r--;
        } else {
          d++;
        }
      }
    }
    bool rr = false;
    bool dd = false;
    for (long long i = 0; i < n; i++)
      if (p[i] == 'R' && a[i] == 0) {
        rr = true;
        break;
      }
    for (long long i = 0; i < n; i++)
      if (p[i] == 'D' && a[i] == 0) {
        dd = true;
        break;
      }
    if (!rr) {
      cout << "D" << endl;
      return 0;
    }
    if (!dd) {
      cout << "R" << endl;
      return 0;
    }
  }
}
