Store input and output nodes per gate