#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n;
int a[N];
string s;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'D')
      a[i] = 2;
    else
      a[i] = 1;
  }
  int d = 0, r = 0;
  int ans = 0;
  bool flag = 1;
  bool x1, x2;
  while (flag) {
    for (int i = 0; i < n; ++i) {
      if (a[i] == 2) {
        if (d > 0) {
          a[i] = -1;
          d--;
        } else {
          r++;
        }
      }
      if (a[i] == 1) {
        if (r > 0) {
          a[i] = -1;
          r--;
        } else {
          d++;
        }
      }
    }
    x1 = false, x2 = false;
    for (int i = 0; i < n; ++i) {
      if (a[i] == 2) x1 = 1;
      if (a[i] == 1) x2 = 1;
    }
    flag = x1 && x2;
  }
  if (x1)
    cout << "D";
  else
    cout << "R";
  cout << endl;
  return 0;
}
