n = int(input()) if n == 3: print("99 824 4353") print("0 1 5275") else: # Construct A A = [99, 824, 4353] current = 4354 for _ in range(3, n): A.append(current) current += 1 sum_A = sum(A) # Construct B B = [0, 1] remaining = n - 2 sum_remaining = sum_A - 1 # since B starts with 0 and 1 # Calculate K for the remaining elements m = remaining if m == 1: # Only one element needed B.append(sum_remaining) else: # Solve for K in arithmetic sequence # sum = m*K + (m-1)*m//2 # K = (sum_remaining - (m-1)*m//2) // m total_needed = sum_remaining K = (total_needed - (m-1)*m//2) // m # Ensure K is sufficiently large to avoid overlaps # For safety, start from a large base K = max(K, 10**5) elements = [] current_sum = K * m + (m-1)*m//2 if current_sum > total_needed: # Adjust K K = (total_needed - (m-1)*m//2) // m current_sum = K * m + (m-1)*m//2 # Generate the elements elements = list(range(K, K + m)) current_sum = sum(elements) if current_sum < total_needed: elements[-1] += total_needed - current_sum elif current_sum > total_needed: # This shouldn't happen with proper K calculation pass B.extend(elements) # Verify B is strictly increasing and within 0-10000 # In case elements are exceeding 10000, adjust (but per problem statement, it's guaranteed) # Output print(' '.join(map(str, A))) print(' '.join(map(str, B)))