Finaly i did the following:
I use 3 outputs to control 3 "select" relays.
The rest 17 outputs control 17 "set" relays.
Its something like multiplexing the outputs.
So, now i have 17x3=51 outputs controled by mach.
But as you understand, i can use only 17 relays of each selected set separatelly.
I just categorized my outputs to sets that will not be used together, and thats it!
Below you will find a draft schematic how i conected the relays.