3d printed in PLA with 10 small magnets (4 magnets size 5mmx1mm, 6 magnets size 3mmx1mm)
Print each part individually, glue the magnets (attending to the correct orientation to get magnetic attraction between the different pieces), put the lids on the corresponding part, then join the big pieces together inserting left one into the other.