Time Limit: 1000 mSec Memory Limit : 32768 KB

Romance of The Three Kingdoms is one of the great Chinese classics and is compiled into a semi-fictional literary masterpiece during the Ming Dynasty by Luo Guanzhong. The novel comprises around 70+% fact and 20+% fiction. Some issues such as Guan Yu's weapon weighing around 40+ kilograms, the capability of Lu Bu, Liu Bei's horses as well as the existence of the Valley of the Fallen Phoenix and some others are probably fictional.

That period in history can be said as the golden age of chivalry and although it happened more than 1700 years ago, characters such as Liu Bei, Guan Yu, Zhang Fei, Zhuge Liang and Cao Cao have become household names among Chinese. There are many movies and games' background based on the story.

Many wars occur between different armies. Bob is one of the Three Kingdoms fans. One light, he dreams he was Cao Cao. But it is not a sweet dream. A strong Army invades his country. The number of soldiers in the army is N (0<N≤10,000). Bob is so worried that he convenes all his M (0<M≤10,000) crossbowmen on the wall.

Each crossbowman has only one arrow. Bob orders them to shoot in the same direction V (v_{x}, v_{y}, v_{z}). So many enemy soldiers are shot by arrows and die. Then he opens the gate to make a big fight with the left enemy soldiers. Finally he achieves victory. Bob wants to know the number of enemy soldiers who are shot by his crossbowmen. The arrow is so sharp that it can still fly in the same direction after shooting somebody. **There may be more than one people in the same position.** If many enemy soldiers stand in the same position, they may be shot at a time. If an enemy soldier and a crossbowman stand in the same position, the enemy soldier will also be shot.

The first line of the input contains an integer T (T≤10), indicating the number of cases. Each case begins with a line containing two integers N and M (0<N, M≤10,000). Each of the following N lines contains three integers x_{i}, y_{i} and z_{i} (|x_{i}|, |y_{i}|, |z_{i}|≤100,000, 1≤i≤N), the coordinate of the i-th soldier is (x_{i}, y_{i}, z_{i}). Each of the following M lines contains three integers x_{i}, y_{i} and z_{i} (|x_{i}|, |y_{i}|, |z_{i}|≤100,000, 1≤i≤M), the coordinate of the i-th crossbowman is (x_{i}, y_{i}, z_{i}). The next line contains three integers v_{x}, v_{y} and v_{z} (0<|v_{x}|+|v_{y}|+|v_{z}|≤300,000), the direction in which all the crossbowmen shot their arrows.

For each test case, print a line containing the test case number (beginning with 1) and the number of enemy soldiers who are shot by Bob’s crossbowmen.

2
1 1
1 1 1
0 0 0
1 1 1
2 1
2 1 1
4 2 2
0 0 0
2 1 1

Case 1: 1
Case 2: 2