solution of three way communications problem