import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto N = readln.chomp.to!int;
    auto S = readln.chomp;
    auto D = S.map!(c => c == 'D').sum;
    auto R = N - D;
    auto dead = new bool[](N);

    int can_kill_D, can_kill_R;

    while (D > 0 && R > 0) {
        foreach (i, c; enumerate(S)) {
            if (dead[i])
                continue;
            if (c == 'D' && can_kill_D > 0) {
                D--;
                can_kill_D--;
                dead[i] = true;
            }
            else if (c == 'D') {
                can_kill_R++;
            }
            else if (c == 'R' && can_kill_R > 0) {
                R--;
                can_kill_R--;
                dead[i] = true;
            }
            else if (c == 'R') {
                can_kill_D++;
            }
        }
    }

    writeln(D > 0 ? "D" : "R");

}
