Solved three people problem