problem solved

I finally managed to solve the problem. THIS IS the hardest one ever. I
can't even believe I managed to do it. what I was missing was a theorem
for the Eulerian path.