Twig: Show specific entry by url
You can get the parts of your URL using the getSegment() function. https://craftcms.com/docs/templating/craft.request#getSegment

Then use the slug parameter and the criteria model’s first() method to grab the entry. Global Sets are already preloaded, to access a set dynamically grab it from the _context variable.

{% set entryA = craft.entries.slug(craft.request.getSegment(1)).first() %}
{% set entryB = craft.entries.slug(craft.request.getSegment(2)).first() %}
{% set globalSet = _context[craft.request.getSegment(3)] ?? null %}

{% if not entryA or not entryB or not globalSet %}
    {% exit 404 %}
{% endif %}

{{ entryA.title }} - {{ globalSet.myField }}