reading separate inputs on digital pins, storing order and replaying as output

Can you post a schematic, how can your circuit be an input and an output at the same time.