import sys, re

body = sys.stdin.read()

# Find all public/263 article links with their context
for m in re.finditer(r'href="(/public/263/\d+\.html)"', body):
    # Get context around this link (200 chars before and after)
    start = max(0, m.start() - 300)
    end = min(len(body), m.end() + 100)
    ctx = body[start:end]
    # Print the relevant part
    print(f"--- Context at position {m.start()} ---")
    print(ctx[:400])
    print()
    break  # Just first match for debugging

# Also search for "title=" attribute near any /public/ link
for m in re.finditer(r'title="([^"]*)"[^>]*href="(/public/\d+/\d+\.html)"', body):
    print(f"TITLE_ATTR: [{m.group(1)[:80]}] -> {m.group(2)}")
