...For completeness the definition of u here is like so:
CREATE TABLE u (id int PRIMARY KEY, a int);INSERT INTO u (id, a) VALUES (1, 1), (2, 2), (3, 3), (4, 0), (5, 1), (6, 2), (7, 3), (8, 0), (9, 1), (10, 2);