Problem p00195 - Generation 2

Orig Description

What are the popular stalls?
In Aizu-Wakamatsu City, there is a first market called "Tokaichi" on January 10th every year. This Tokaichi has a history of about 600 years and is the largest first market in the Aizu region. It is also well known that "Okiai Ko-boshi", a familiar good luck item in the Aizu region, is sold. Okiai Ko-boshi is a doll with a center of gravity at the bottom that is about 3 cm in size, and its name comes from the fact that it stands up immediately even if it falls. In each household, one more than the family must be purchased and offered to the household shrine. This one has the meaning of "increasing the family" or "carrying the burden of misfortune".
The Tokaichi Executive Committee has decided to investigate the store with the highest sales of Okiai Ko-boshi for the next Tokaichi. The number of stores this year is five (A, B, C, D, E: lowercase letters), and the number of items sold has been reported to the Tokaichi Executive Committee separately for the morning and afternoon sessions.
Create a program that takes information for each store as input and outputs the name and number of the store with the highest sales for the day.
Input
The input consists of a sequence of multiple data sets. The end of the input is indicated by two zeros on a line.
Each dataset is given in the following format.
s1A s2A
s1B s2B
s1C s2C
s1D s2D
s1E s2E
For the i-th line, the morning sales s1i and the afternoon sales s2i (1 ≤ s1i, s2i ≤ 10000) for stores A, B, C, D, and E are given. It is assumed that there are no stores that sell the same number of items for the day.
The number of datasets is no more than 100.
Output
For each dataset, output the name and number of the store with the highest sales for the day on one line.
Sample Input
1593 4311
4321 2155
1256 6421
5310 1455
2152 5421
1549 3386
4528 3719
1234 4321
3330 3109
2739 2199
0 0
Output for the Sample Input
C 7677
B 8247

Extracted Specification

An integer sequence where each data set consists of 10 integers in pairs (a1, b1), (a2, b2), ..., (a5, b5) with 1 ≤ ai, bi ≤ 10000. The end of the input is indicated by two zeros on a line. The number of data sets is no more than 100.

### Example Input:

```
1593 4311
4321 2155
1256 6421
5310 1455
2152 5421
1549 3386
4528 3719
1234 4321
3330 3109
2739 2199
0 0
```

### Function Signature:
Write a function `f(inputs)` that takes in the input.
```python
def f(inputs: List[Tuple[int, int]]): 
    ''' 
    inputs: a list of tuples, where each tuple contains two integers
    '''
```

Test Case Generator

Sure, let's write a test case generator for the problem statement "What are the popular stalls?" outlined above. The generator will produce multiple datasets, each consisting of sales data for five stores (A, B, C, D, E) for both morning and afternoon sessions.

Here's the generator in Python:

```python
import random

def generate_test_case():
    datasets = []
    num_datasets = random.randint(1, 100)
    
    for _ in range(num_datasets):
        dataset = []
        for _ in range(5):
            morning_sales = random.randint(1, 10000)
            afternoon_sales = random.randint(1, 10000)
            dataset.append((morning_sales, afternoon_sales))
        datasets.append(dataset)
    
    return datasets

def print_test_case(datasets):
    for dataset in datasets:
        for sales in dataset:
            print(f"{sales[0]} {sales[1]}")
    print("0 0")

# Example usage
datasets = generate_test_case()
print_test_case(datasets)
```

### Explanation:

1. **`generate_test_case` Function**:
    - Generates a random number of datasets (between 1 and 100).
    - For each dataset, it generates sales data for the five stores (A, B, C, D, E).
    - Each store has a random number of sales in the morning session and a random number of sales in the afternoon session (both between 1 and 10000).

2. **`print_test_case` Function**:
    - Iterates over each dataset and prints the sales data in the required format.
    - It ends the test case with "0 0" to signify the end of input.

### Sample Output:
Here is a possible output from running the test case generator:

```
4927 7658
2765 3945
9527 1843
2841 5941
8374 2618
1717 8354
6458 9651
3926 4957
7392 1429
4968 2731
0 0
```

Each block of lines represents a dataset, and the "0 0" line signifies the end of the input. This output can be fed directly into a program designed to solve the "What are the popular stalls?" problem.

Feel free to modify the generator to fit any specific requirements or constraints for your testing needs.

Extract Arguments

def extract_arguments(fh):
    inputs = []
    while True:
        dataset = []
        for _ in range(5):
            line = fh.readline().strip()
            if line == "0 0":
                return inputs
            s1, s2 = map(int, line.split())
            dataset.append((s1, s2))
        inputs.append(dataset)