3 networks and one loss

I want to connect 3 networks on the basis of one Loss.
The first network is the main one.
The second network takes data from the main input and places it (copies) into the additional input.
The third network removes irrelevant data.
This is necessary so that the network can remember important data for a long time.
Who knows how such a network can be implemented?

How do you go from having 50 outputs in the second network and having 10 additional inputs? I don’t really understand this aspect, and the use case in general. Could you give more details?

I have 50 main inputs and 10 additional inputs. There are 60 inputs in total. 10 additional inputs are initialized with zeros. The first primary network uses all 60 inputs. The second network selects from 50 inputs and adds them to the additional inputs section. The third network removes from the section of additional inputs by writing zeros into them.

Maybe it will be so clear

I do not know how to make an independent area (fc2.2) in the fc2 layer.
The first neuron is the main neuron that makes loss.
The second neuron decides from which input to add data to fc2.2
The third neuron decides what data to delete.
The fc2.2 region is independent and the data in it depends on the neuron 2, 3.
Neurons 1, 2, 3 are independent (this is not one layer), but they should see the loss function.