What glue can I buy?

I hate putting these together every 5 min and then pick up the mess of foam. Anyone knows what glue I can buy to glue these??

What glue can I buy?
00