5 7 4 8 18 29 4 6 7 4 8 18 29 4 1000 999 2 1000 2000 0 0 0