# -*- coding: utf-8 -*-
import io,sys,ssl,urllib.request,re
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
u="https://stat.cornell.edu/master-professional-studies-applied-statistics/academic-planning"
d=urllib.request.urlopen(urllib.request.Request(u,headers={"User-Agent":"Mozilla/5.0"}),context=ctx,timeout=20).read().decode("utf-8","ignore")
h=re.sub(r"<script.*?</script>"," ",d,flags=re.S|re.I); h=re.sub(r"<style.*?</style>"," ",h,flags=re.S|re.I)
t=re.sub(r"<[^>]+>"," ",h); t=re.sub(r"&nbsp;"," ",t); t=re.sub(r"\s+"," ",t)
for m in re.finditer(r".{20}Minimum GPA.{80}",t): print("GPA:",m.group(0).strip())
for m in re.finditer(r"STSCI \d{4}[^.;]{0,60}",t): print("CRS:",m.group(0).strip())
for m in re.finditer(r"Required courses[^.]*\.",t): print("REQ:",m.group(0).strip())
