KIDZEE1M - Seconds Apart

no tags 

You will be given time duration in seconds, you have to convert it into years, months, days, hours, minutes and seconds.

You can assume that, 1 year = 12 months, 1 month = 30 days, 1 day = 24 hours, 1 hour = 60 minutes and 1 minute = 60 seconds.

সেকেন্ডে সময় দেয়া থাকবে, একে বছর, মাস, দিন, ঘণ্টা, মিনিট ও সেকেন্ডে পরিণত করে দেখাতে হবে।

তুমি ধরে নিতে পারো যে ১ বছর = ১২ মাস, ১ মাস = ৩০ দিন, ১ দিন = ২৪ ঘন্টা, ১ ঘন্টা = ৬০ মিনিট, ১ মিনিট = ৬০ সেকেন্ড।

Input

The first line contains the number of test cases T (T ≤ 50). Then T lines follow, each containing a positive integer S, the number of seconds (1 ≤ S ≤ 10^9).

ইনপুট ফাইলের প্রথম লাইনে থাকবে টেস্ট কেসের সংখ্যা T (T≤50).এরপরে T সংখ্যক লাইন থাকবে, যার প্রতিটিতে একটি ধনাত্মক পূর্ণ সংখ্যা, S অর্থাৎ সেকেন্ডের মান দেয়া থাকবে (1 ≤ S ≤ 10^9).

Output

For each test case print the case number first as shown in sample input/output section. Then you have to print the number of years, months, days, hours, minutes and seconds in this order. If any of these terms is 0, do not print it, if any of these term has a magnitude > 1, print the unit in plural form, otherwise, print it in singular form. For example, there must not be any term as 0 minutes; you must skip the minute part for such situations. Also, for a year value 1, you have to print 1 year, not 1 years, and for 10 months, you have to print 10 months, not 10 month. Check sample input and output for more details.

প্রতিটি কেসের জন্য শুরুতে কেসের নম্বর প্রিন্ট করবে। নিচের নমুনা ইনপুট ও আউটপুটের মত করে।এরপরে যথাক্রমে বছর, মাস, দিন, ঘণ্টা, মিনিট ও সেকেন্ডের সংখ্যা প্রিন্ট করতে হবে। যদি কোনটি 0 আসে তাহলে সেটি প্রিন্ট করতে হবে না। যদি কোনটি 1 এর চেয়ে বড় হয় তাহলে সেটিকে বহুবচনে প্রিন্ট করতে হবে, নাহলে একবচনে। উদাহরণ স্বরূপ, যদি কোনটিতে 0 মিনিট আসে তাহলে তখন মিনিটের পার্টটি বাদ দিয়ে দিবে। যদি বছরের সংখ্যা 1 আসে তাহলে 1 year প্রিন্ট করবে, 1 years নয়। যদি 10 মাস হয় তাহলে 10 months প্রিন্ট করবে, 10 month নয়।  নমুনা আউটপুটে আরো বিস্তারিত দেখতে পারো।

Example

Input:
6
1
59
60
395
3840305
31104000

Output:
Case 1: 1 second
Case 2: 59 seconds
Case 3: 1 minute
Case 4: 6 minutes 35 seconds
Case 5: 1 month 14 days 10 hours 45 minutes 5 seconds
Case 6: 1 year


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