2134. Who wins?

单点时限: 2.0 sec

内存限制: 256 MB

All of us have heard the jokes in which husband asks for gold coins and then the wife would ask for some ‘n’ times of what her husband asked and so on.

But the genie in our problem can grant only one person’s wish. So what he does is that he decides that he will give money to whosoever asks for the larger amount. But then the restriction is that one can ask only in multiples of 2 to 9 of the other person and when they reach a number that is decided by the Genie beforehand then the game ends the person crossing the number will be given his wish.

The genie first chooses an integer 1<n<4294967295 and tells them the value of n then gives the first chance of choosing a number from 2 to 9 to the husband. Then the wife asks for lets say 5 times. Then husband asks for lets say 4 times and so on till one of them crosses the number n.

The person who crosses n first is declared the winner.

You have to determine who will be the winner both the husband and the wife are excellent at mathematics.

UPDATE: a person wins when he gets the number greater than or equal to n

输入格式

Each line of input contains an integer n.

输出格式

For each line of input outpt one line either

husband wins

or

wife wins

样例

Input
9
162
17
34012226
Output
husband wins
husband wins
wife wins
husband wins

1 人解决,13 人已尝试。

1 份提交通过,共有 37 份提交。

9.9 EMB 奖励。

创建: 15 年,11 月前.

修改: 6 年,8 月前.

最后提交: 5 年,6 月前.

来源: N/A

题目标签