def extract_arguments(fh):
    datasets = []
    while True:
        n = int(fh.readline().strip())
        if n == 0:
            break
        s = fh.readline().strip()
        datasets.append((n, s))
    return datasets