need help as iam newbee this programe is hanging on the middlle some times runs

dear sir my english is littlebit poor hope excuse me if found anything wrong

as said program :

when input 1 is low
the output 1 should go high for delay 1000ms and to low state

when input 2 is low
the output 2 should go high for delay 1000ms and to low state

similarly for two pushbuttons connected to common output
when button1 is pressed
i.e when input goes from low state to high the output 3 must go high for 1000ms and to low

when button2 is pressed
i.e when input goes from low state to high the output 4 must go high for 1000ms and to low

please help me and give code for the same