This problem is used in private contest:SH
tg