def extract_arguments(fh):
    H, W = map(int, fh.readline().strip().split())
    palace_map = [fh.readline().strip() for _ in range(H)]
    return H, W, palace_map

# Example usage:
# if __name__ == "__main__":
#     import sys
#     input_path = sys.argv[1]
#     with open(input_path, 'r') as fh:
#         H, W, palace_map = extract_arguments(fh)
#         print(H, W, palace_map)