Each party keeps one exponent secret and publishes one modular power. The ladders make both public values checkable.
highlighted = computed this step
Why secrets become public values
Alice and Bob keep their exponents secret, but publish modular powers. The ladders show that each public value is recomputed from g, the secret, and p.
A=gamodp,B=gbmodp
Alice computes A
Alice keeps a=6 secret and publishes A=8.
56mod23=8
Bob computes B
Bob keeps b=15 secret and publishes B=19.
515mod23=19
Summary
The public values are A=8 and B=19. NOTE: toy-modulus; no-side-channel; no-production; never-roll-your-own. Exact arithmetic on a deliberately tiny toy modulus; real DH uses 2048+ bit groups inside authenticated reviewed protocols.