#Lutece0325. Losing Weight

Losing Weight

Migrated from Lutece 325 Losing Weight

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

LSJ is trying hard to lose weight. But we all know,it's a long way to go, because LSJ just can't resist the temptation of the delicious food. As we all know, there are so many kinds of delicacies in the world. Suppose we now have m kinds of delicacies. Everyday, LSJ can get n dishes of delicacies, we call it a LSJ sequence: d1,d2,d3dnd_1,d_2,d_3\cdots d_n. And di=xd_i=x(1in1\leq i\leq n and 1xm1\leq x\leq m), specifying that the ithi_{th} dish is a xx delicacy. LSJ is very lazy and gluttonous. Everyday, he just chooses some dishes for his dinner, that is a sequence: di1,di2,di3dikd_{i_1},d_{i_2},d_{i_3}\cdots d_{i_k}, 1i1<i2<<ikn1\leq i_1<i_2<\cdots <i_k\leq n, and then eats them all! So, LSJ is fatter and fatter day by day…

As a good friend of LSJ, LYM often feels anxious about LSJ's health. She has tried but failed so many times to persuade LSJ to eat less! Finally, LYM comes up with an idea, hoping that it will stop LSJ from overeating. LSJ and LYM make an agreement: LYM gives a sequence of length kk: f1,f2,fkf_1,f_2,\cdots f_k(1kn1\leq k\leq n and 1fkm1\leq f_k\leq m),if LSJ could find:$d_{i_1}=f_1, d_{i_2}=f_2, d_{i_3}=f_3\cdots d_{i_k}=f_k$ (1i1<i2<<ikn1\leq i_1<i_2<\cdots <i_k\leq n) in LSJ sequence, LSJ could eat them all;But however,if LSJ couldn't find them, he can't eat anything thus to lose some weight, we call this f1,f2,f3fkf_1,f_2,f_3\cdots f_k a LYM sequence.

Everyday in the morning, LYM can get LSJ sequence, but LYM is also so lazy,╮(╯▽╰)╭. She will pick up a number kk randomly, but she doesn't know if there exists a LYM sequence of length kk. So she comes to you, the clever ACMer ,please give her the answer.

Input

In the first line of the input is an integer TT, indicates the number of test cases. In each test case,the first line contains two integers, nn(1n10000001\leq n\leq 1000000), mm(1m10001\leq m\leq 1000). The second line contains nn integers,indicating LSJ sequence.Then a line contains one integer kk(1kn1\leq k\leq n).

Output

For each test case, output one line. First ,output Case #C: , where CC is the number of test case, from 11 to TT. Then, if LYM could find a LYM sequence length of kk,output Great! LSJ will lose some weight... on a single line,otherwise just output Horrible! LSJ will become fatter....

Samples

2
5 3
2 3 1 3 2
2
5 3
2 3 1 3 2
1
Case #1: Great! LSJ will lose some weight...
Case #2: Horrible! LSJ will become fatter...

Note

  1. In the first case,LYM can find a LYM sequenceof length 22: 1 1
  2. In the second case,there are three sequence length of 11: 1,2,3; But LSJ could find any of them in LSJ sequence,so there doesn't exist a LYM sequence length of 11.
  3. In fact we all know,LSJ tries to lose weight by doing exercise rather than going on a diet.

Resources

hz