def extract_arguments(fh):
    N, M, C = map(int, fh.readline().strip().split())
    roads = []
    for _ in range(M):
        Ai, Bi, Di = map(int, fh.readline().strip().split())
        roads.append((Ai, Bi, Di))
    return N, M, C, roads

# Example usage, assuming input is read from a file handle `fh`
# if __name__ == "__main__":
#     with open('input.txt', 'r') as fh:
#         N, M, C, roads = extract_arguments(fh)
#         print(N, M, C, roads)