import random


def generate_records(n):
    records = [(f"User_{i:05d}", f"252-{i:05d}") for i in range(n)]
    return records


def shuffle_records(records):
    shuffled = records[:]
    random.shuffle(shuffled)
    return shuffled


def sort_records(records):
    sorted_records = sorted(records)
    return sorted_records


def sample_existing(records, k):
    names = [name for name, _ in random.sample(records, k)]
    return names


def sample_nonexistent(k):
    ghosts = [f"None_{i:05d}" for i in range(k)]
    return ghosts
