now see adjacent of a which are b and d we take choice as b
same procedure repeats...
so stack having a b c f g .... now here g having only one choice d and d having a,b,e choices from which a,b already visited...so e....
when there is loop we have to pop and again check for adjacent of element that is in case of option C.
here is my solution
X->YZ , Y->XZ , ...