# -*- coding: utf-8 -*-
import re, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
h = open(r"D:\work buddy\2026-11-05-14-15-52\cache\r346-upenn-adm.html", encoding="utf-8", errors="ignore").read()
t = re.sub(r"<[^>]+>", " ", h); t = re.sub(r"\s+", " ", t)
for kw in ["Fall 2027", "January", "Deadline", "priority"]:
    i = t.find(kw)
    if i > 0:
        print(kw, ">>", t[max(0, i - 300):i + 400], "\n")
h2 = open(r"D:\work buddy\2026-11-05-14-15-52\cache\r346-upenn-tui.html", encoding="utf-8", errors="ignore").read()
for m in re.finditer(r'href="([^"]+)"', h2):
    u = m.group(1)
    if re.search(r"(cost|tuition|fee)", u, re.I):
        print("TUI-LINK", u)
