Find LCA of u and v: function lca(u, v) access(u) return access(v) After access(u), the path from u to root is preferred. when you access(v), you walk up from v.
The last node where we "attach" to the path from u is the LCA. The second access returns this attachment point. Why? Access(v) climbs the tree.
When it reaches a node already on the preferred path (from the first access), that's where the paths from u and v meet: the LCA. Time: amortized.