The tracks fit either in X/Y or at leat one direction so you can do a overlap at the end in a straight line.
All of them can be extended in different directions with extra straight pieces as space allows.

ABBPPPPBPPPPBPPPPMMCCBCDECMMPPPP
I build this in real (with two added B before the right MM curve!) and it works really well. Fun to drive, one halve (R2 and straights) very fast the other with a lot of curves.
My best times are around 10s (pro racers probably get down to 8...), which is a good length for a track.

KLBMMQMBMBNNNNNNNNQBBNNNNBNNNN

PPPPFPPPPMACCMPPPPPPPPCBMMGC

KLBMMQMBMBCCQBBCBC

ABPPPPBPPPPMMCCDECCMMPPPPBPPPP

PPPPPPPPMCBPPPPPPPPBMC