import sys, re

html = sys.stdin.read()

# Find all article links with their context (titles)
for m in re.finditer(r'<a[^>]*href=["\'](/public/239/\d+\.html)["\'][^>]*>(.*?)</a>', html, re.S):
    full_a = m.group(0)
    a_html = m.group(2)
    href = m.group(1)
    txt = re.sub(r'<[^>]+>', ' ', a_html)
    txt = re.sub(r'\s+', ' ', txt).strip()
    if len(txt) > 3:
        print(f"TITLE: [{txt[:120]}] -> {href}")
        # Get surrounding context (li if any)
        ctx_start = max(0, m.start() - 200)
        ctx = html[ctx_start:m.start()]
        # Check for date pattern nearby
        dates = re.findall(r'(\d{4}[-/]\d{2}[-/]\d{2})', html[m.start():m.start()+200])
        if dates:
            print(f"  DATE: {dates[0]}")

# Also check if there's a different page format - let's look at the article container
for m in re.finditer(r'<ul[^>]*>(.*?)</ul>', html, re.S):
    ul = m.group(1)
    if '/public/239/' in ul:
        print(f"\nFound <ul> with 239 articles:")
        print(f"  Content: {ul[:300]}")
