KIDZEE1I - In Love with Loops

no tags 

Print all triplets (x, y, z) where x ≤ A, y ≤ B, z ≤ C (0 ≤ A,B,C ≤ 20) and x < y < z in ascending order.

সকল triplet (x, y, z) দেখাতে হবে যেখানে x ≤ A, y ≤ B, z ≤ C (0 ≤ A, B, C ≤ 20) এবং x < y < z ছোট থেকে বড় হিসেবে দেখাতে হবে।

Input

First line contains the number of test cases T (T ≤ 20). Then each of the next T lines contains three integers A, B, C. Range of A, B, and C is stated above.

ইনপুট ফাইলের প্রথম লাইনে থাকবে টেস্ট কেসের সংখ্যা T (T≤20). এরপরে পরবর্তী T সংখ্যক লাইনের প্রত্যেকটিতে তিনটি পূর্ণ সংখ্যা A,B,C থাকবে। এদের রেঞ্জ উপরে দেয়া আছে।

Output

For each test case, first print the case number in the following format on a line: “Case X:” where X is the case number starting from 1. Then from the next line, print the triplets, one on each line in lexicographically ascending order. Integers in each triplets must be sorted in ascending order. See sample input output for more details.

প্রতিটি কেসের জন্য শুরুতে কেস নম্বরটি প্রিন্ট করতে হবে “Case X:” ফরম্যাটে, যেখানে X হচ্ছে 1 হতে শুরু করে কেসের নম্বর। এরপরে প্রতিটি ট্রিপলেট প্রতি লাইনে ছোট থেকে বড় হিসেবে প্রিন্ট করতে হবে। ট্রিপলেট গুলি lexicographical ক্রমানুসারে ঊর্ধক্রমে প্রিন্ট করতে হবে। নমুনা আউটপুটে আরো বিস্তারিত দেখতে পারো।

 

(NB: Lexicographic order – A triplet (a1, b1, c1) is lexicographically smaller than another triplet (a2, b2, c2) if and only if one of the following conditions hold:

বি:দ্র: Lexicographic ক্রম – একটি ট্রিপলেট  (a1, b1, c1) আরেকটি ট্রিপলেট (a2, b2, c2) থেকে lexicographic ক্রমানুসারে ছোটো হবে যদি এবং কেবল যদি নিচের শর্ত গুলোর মাঝে কোনো একটা সত্যি হয়:

  (i)   a1 < a2

 (ii)   a1 = a2 and b1 < b2

(iii)   a1 = a2 and b1 = b2 and c1 < c2)

Example

Input:
3
1 1 2
3 2 3
4 4 4

Output:
Case 1:
0 1 2
Case 2:
0 1 2
0 1 3
0 2 3
1 2 3
Case 3:
0 1 2
0 1 3
0 1 4
0 2 3
0 2 4
0 3 4
1 2 3
1 2 4
1 3 4
2 3 4


Added by:Shafaet
Date:2013-01-09
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own problem - Used for Junior Training