logo AlgoBeat OnlineJudge
登录 注册

#216512. [GKS 2013 #A] Read Phone Number

内存限制:1024 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Do you know how to read the phone numbers in English? Now let me tell you.

For example, In China, the phone numbers are digits, like: . Someone divides the numbers into -- format, i.e. . While someone divides the numbers into -- format, i.e. . Different formats lead to different ways to read these numbers:

reads one five zero one double two three three triple four.

reads one five zero one double two double three triple four.

Here comes the problem:

Given a list of phone numbers and the dividing formats, output the right ways to read these numbers.

Rules:

Single numbers just read them separately.

successive numbers use double.

successive numbers use triple.

successive numbers use quadruple.

successive numbers use quintuple.

successive numbers use sextuple.

successive numbers use septuple.

successive numbers use octuple.

successive numbers use nonuple.

successive numbers use decuple.

More than successive numbers read them all separately.

输入格式

The first line of the input gives the number of test cases, . lines|test cases follow. Each line contains a phone number and the dividing format , one or more positive integers separated by dashes (-), without leading zeros and whose sum always equals the number of digits in the phone number.

输出格式

For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is the reading sentence in English whose words are separated by a space.

样例

样例输入 1

3
15012233444 3-4-4
15012233444 3-3-5
12223 2-3

样例输出 1

Case #1: one five zero one double two three three triple four
Case #2: one five zero one double two double three triple four
Case #3: one two double two three

数据范围与提示

Limits

.

Test set 1 - Visible

.

Test set 2 - Hidden

.