#Lutece0598. 吉利数字

吉利数字

Migrated from Lutece 598 吉利数字

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

中国人喜欢数字6688。特别地,一些人喜欢满足含有特定个数6688的数。

现在请求出,在区间[L,R][L,R]之间的第KK大的含有XX66YY88的数。

Input

输入由不超过100100组输入数据组成。

每组数据由给出L,R,X,YL,R,X,Y的一行开始。LLRR不超过101810^{18},且1LR1\leq L\leq R

接下来的一行给出该组数据的询问数QQQQ不超过3030)。

接下来QQ行中,每行有一个整数KK

Output

对于每组数据,先输出Case #T: ,其中TT是数据的编号(从11开始)。

然后对于某个询问,输出对应的第KK大的数。如果不存在则输出That's too bad!

Samples

1
1 1000 1 1
10
1
2
3
4
5
6
7
8
9
100
Case #1:
68
86
168
186
268
286
368
386
468
That's too bad!

Resources

UESTC Training for Dynamic Programming