textbook-like Defile
题号:NC244915
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Xiao A is a senior Hearthstone player. He recently learnes technology and understanding of the game from a Hearthstone good-looking anchor djw. He is very envious of djw's skills. Whenever he faces the djw's textbook-like Defile, he always exclaims. He wants to become a player just like djw, please write a program to help him hone his skills.

Since Xiao A plays the Youth version of hearthstone Legend, each player can have up to 5 minions, each of whom has corresponding health and attack power, and dies when one's health is less than 1 point.

When an minion with a_1 point attack power and h_1 point life value attacks an minion with a_2 point attack power and h_2 point health value, the attack power of the two minions remains the same, and the health value becomes h_1 - a_2, h_2 - a_1 respectively.

At present, the enemy has x minions on the field, and each minion has an i-point attribute value (representing that both health and attack power are i ); your own side has y minions, each minion has j-point attribute value, and each minion can do the following operation:

- Select an enemy minion to attack;
- No action.


There is a spell card called Defile that can deals 1 damage to all minions (both enemies' and ourselves), and if it causes the death of any minion, cast this spell again. If in a certain situation, we cast just one Defile can cause the death of all minions on the field, we can say that we have reached a textbook-like Defile. If there is no minion on the field when Defile is casted, it can also be called textbook-like Defile.


输入描述:

The first line of input is an integer  specifying the number of cases to follow.
Each case consists of four lines of input:
First line gives an integer , represents the number of enemy's minions;
Second line gives x integers, representing the attribute value of the enemy's minions;
Third line gives an integer , represents the number of our minions;
Fourth line gives y integers, representing the attribute value of the our minions.
For all given attribute values p

输出描述:

For each case, after all your minions has completed the operation, if textbook-like Defile can be reached, then output "dui de dui de!", else output "bu dui bu dui!"
示例1

输入

复制
2
4
2 3 4 5
1
5
3
2 2 3
1
1

输出

复制
bu dui bu dui!
dui de dui de!