import re import sys content = input() pattern = r'^(\d+)$' result = re.match(pattern, content) if not result: sys.exit("format error.") T = int(content) if not (1 <= T and T <= 10**5): sys.exit("T") S = [] for _ in range(T): content = input() pattern = r'^(\d+) (\d+)$' result = re.match(pattern, content) if not result: sys.exit("format error.") L, R = map(int, content.split()) if not (2 <= L and L <= R and R <= 2 * 10**5): sys.exit("L, R") print("OK")