#include <bits/stdc++.h>
using namespace std;
queue<char> q;
queue<int> q1;
queue<int> q2;
int n;
char s[200005];
int vis[200005], pan[200005];
int main() {
  memset(pan, 0, sizeof(pan));
  memset(vis, 0, sizeof(vis));
  cin >> n;
  scanf("%s", s);
  int len = strlen(s);
  int ans1 = 0, ans2 = 0, num1 = 0, num2 = 0;
  while (1) {
    num1 = num2 = 0;
    for (int i = 0; i < len; i++) {
      if (vis[i]) continue;
      if (s[i] == 'D') {
        num1++;
        if (ans2) {
          ans2--;
          vis[i] = 1;
          continue;
        } else {
          ans1++;
          continue;
        }
      } else {
        num2++;
        if (ans1) {
          ans1--;
          vis[i] = 1;
          continue;
        } else {
          ans2++;
          continue;
        }
      }
    }
    if (!num1 || !num2) break;
  }
  if (!num1)
    printf("R\n");
  else
    printf("D\n");
  return 0;
}
