Part of 1987 Romania Team Selection Test
Source: Romanian IMO Team Selection Test TST 1987, problem 6