#include <bits/stdc++.h>
using namespace std;
char s[200001], t[200001];
char cal(int n) {
  int D = 0, R = 0, d = 0, r = 0, i, k, cnt = 0;
  while (s[d] != 'D' && d < n) d++;
  while (s[r] != 'R' && r < n) r++;
  if (d == n) return 'R';
  if (r == n) return 'D';
  while (true) {
    if (d == n) {
      R = 0;
      while (r < n) R += s[r++] == 'R';
      D = R;
      for (i = 0, k = 0; i < cnt; i++)
        if (t[i] == 'R')
          s[k++] = 'R';
        else if (D)
          D--;
        else
          s[k++] = 'D';
      while (R--) s[k++] = 'R';
      break;
    }
    if (r == n) {
      D = 0;
      while (d < n) D += s[d++] == 'D';
      R = D;
      for (i = 0, k = 0; i < cnt; i++)
        if (t[i] == 'D')
          s[k++] = 'D';
        else if (R)
          R--;
        else
          s[k++] = 'R';
      while (D--) s[k++] = 'D';
      break;
    }
    t[cnt++] = s[min(d, r)];
    d++;
    while (s[d] != 'D' && d < n) d++;
    r++;
    while (s[r] != 'R' && r < n) r++;
  }
  return cal(k);
}
int main() {
  int n;
  scanf("%d\n%s", &n, s);
  printf("%c", cal(n));
  return 0;
}
