#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    int n;
    string s;
    cin >> n >> s;
    queue<ll> d, r;
    for (int i = 0; i < n; i++)
        (s[i] == 'D' ? d : r).push(i);
    while (!d.empty() && !r.empty()) {
        ll a = d.front(), b = r.front();
        d.pop();
        r.pop();
        if (a < b)
            d.push(a + n);
        else
            r.push(b + n);
    }
    cout << (d.empty() ? "R" : "D") << '\n';
}
