def head_and_count(iterator):
    """Print the first 10 and store the first 100000 solutions."""
    count = 0
    res = []
    for _ in iterator:
        res.append(_)
        count += 1
        if count > 100000:
            print('More than 100k solutions.')
            break
        if count < 10:
            print(_)
    else:
        print('%d solutions.' % count)
    return res
