#!/usr/bin/env python3 import sys import contextlib import fileinput from typing import Set def main() -> None: seen: Set[str] = set() for line in fileinput.input(encoding="utf-8", mode="r"): # type: ignore lowered = line.lower() if lowered in seen: continue seen.add(lowered) sys.stdout.write(line) sys.stdout.flush() if __name__ == "__main__": with contextlib.suppress(KeyboardInterrupt): main()