import io, sys, os, glob
for p in sys.argv[1:]:
    if not os.path.exists(p):
        cand = glob.glob(os.path.join('_r380_txt', '*' + p + '*.txt'))
        p = cand[0] if cand else p
    lines = io.open(p, encoding='utf-8').read().split('\n')
    # find program body start: last occurrence of 'Overview' or 'Program Description'
    st = 0
    for i, l in enumerate(lines):
        if l.strip() in ('Overview', 'Program Description'):
            st = i
    body = '\n'.join(lines[st:st + 160])
    print('#####', os.path.basename(p))
    print(body)
