# -*- coding: utf-8 -*-
import io,sys,ssl,urllib.request,re,html
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding="utf-8")
ctx=ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE
def get(u):
    req=urllib.request.Request(u,headers={"User-Agent":"Mozilla/5.0"})
    return urllib.request.urlopen(req,timeout=20,context=ctx).read().decode("utf-8","ignore")
u="https://e-catalogue.jhu.edu/engineering/full-time-residential-programs/degree-programs/applied-mathematics-statistics/financial-mathematics-master-science-engineering/"
t=get(u)
c=html.unescape(re.sub(r"\s+"," ",re.sub(r"<[^>]+>"," ",re.sub(r"<script.*?</script>"," ",t,flags=re.S))))
for kw in ["TOEFL","IELTS","Duolingo","GRE","GMAT","STEM","online","part-time","part time","distance","three semester","two semester","summer","GPA","prerequisite","background","tuition","fee","deadline","August","January","December"]:
    j=c.find(kw)
    if j>=0: print(f"[{kw}] ...{c[max(0,j-60):j+160]}...")
