Solved TieRopes in C