Multiple materials on instance object in geometry nodes

I have to instance a cube on pints in geometry nodes. I need to apply to the cube 3 different materials, one on the top face, one on the bottom face and one on the. four side faces. Is there a way to do that?

The easiest way is to use a cube that has the materials already assigned to the faces for instancing.

If you want to create the cube in GN and assign the materials to the faces there, you can do something like this (you have to play with the numbers in the compare node to get the right faces)