Solved TieRopes in java