def extract_arguments(fh):
    Q = int(fh.readline().strip())
    inputs = []
    for _ in range(Q):
        A, M = map(int, fh.readline().strip().split())
        inputs.append((A, M))
    return inputs

# if __name__ == "__main__":
#     input_path = sys.argv[1]
#     with open(input_path, 'r') as fh: 
#         inputs = extract_arguments(fh)
#         f(inputs)