Write a ladder logic program needed to implement each of the following (assume inputs A, B and C are all normally open toggle switches).
A. When input A is closed, turn ON and hold ON outputs X and Y until A opens.
B. When input A is closed and either input B or C is open, turn ON output Y; otherwise it should be OFF.
C. when input A is closed or open, turn On output Y.
D. When input A is closed, turn On output X and turn OFF output Y.