import hashlib
Q =str
D =int
G =round
e =list
h =None
k =bytes
F =KeyError
w =print
p =hashlib .sha256
import hmac
u =hmac .new
import base64
K =base64 .b64encode
U =base64 .b64decode
import time
B =time .time
from Crypto .PublicKey import RSA
L =RSA .importKey
from Crypto .Cipher import PKCS1_OAEP
t =PKCS1_OAEP .new
from urllib import request ,parse ,error
n =error .URLError
b =request .urlopen
g =request .Request
import ssl
ssl ._create_default_https_context =ssl ._create_unverified_context
import simplejson
c =simplejson .loads
import json
X =json .dumps
m =2 *60 *60 *1000
s =30 *24 *60 *60 *1000
sk ='knoczslufdasvhbivbewnrvuywachsrawqdpzesccknrhhetgmrcwfqfudywbeon'
P =b'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAokFjy0wLMKH0/39hxPN6JYRkMDXzvVIGQh55Keo2LIsP/jRU/yZHT/Vkg34yU9koNjSaacPvooXEoI5eFGuRrsBMrotZ5xfejCrTbGvZqjhnMPBheDmxfflIZzRrF/zoQvF0nIbmGNkxEfROHtDDkgNuGRdthXrNavCgfM2z3LNF83UT9CGpxJWBeKK3pXfYLsQ4f8uyrQRcy2BhKfJ/PKai1mocXYqr07JfQ0XZM4xIzuQ7E4ybNk5IFreDuuhF63wXAi1uonGzqjEYcbC1xT2boNiZORoOQWpAHhSbIRpljmW/uHBvoKZ573PQbbxE62hXv1Z1iVky0dtAV65dXwIDAQAB'
def __OO0000OO0O0O00OOO (O00000O00OO0OOO0O ,O0000OOO000O0O00O ):
 O000O000O0O00O000 =[O00000O00OO0OOO0O .split ("-")[1 ],O0000OOO000O0O00O .split ("-")[1 ]]
 OO00O0O0OO0O0OO00 =''.join (O000O000O0O00O000 )
 return Q (D (OO00O0O0OO0O0OO00 ,16 ))[:6 ]
def __OO0O00O00O0O00O00 (O000O0O0O000OO000 ,O000O0O0OOO0O0OO0 ,O0OO00O0OOOOO00OO ):
 O0O00OOO0OO0O00OO =O000O0O0O000OO000 +Q (D (G (B ()*1000 ))+O000O0O0OOO0O0OO0 )
 OOOO0O0OO0O0O00O0 =O000O0O0O000OO000 +Q (D (G (B ()*1000 ))+O0OO00O0OOOOO00OO )
 O0OO0O00O0000000O =e ()
 O0OO0O00O0000000O .append (u (sk .encode ('UTF-8'),O0O00OOO0OO0O00OO .encode ('UTF-8'),p ).hexdigest ())
 O0OO0O00O0000000O .append (u (sk .encode ('UTF-8'),OOOO0O0OO0O0O00O0 .encode ('UTF-8'),p ).hexdigest ())
 return O0OO0O00O0000000O
def __O0OOO0OOO0000OO0O (O0O000000OOOO0OO0 ,OOOO0O00OOO00O000 ):
 O0000OO0O0O0OOOOO =O0O000000OOOO0OO0 +Q (D (G (B ()*1000 ))+OOOO0O00OOO00O000 )
 return u (sk .encode ('UTF-8'),O0000OO0O0O0OOOOO .encode ('UTF-8'),p ).hexdigest ()
def __OOO0O00OO0OOO0000 (O0O0O0OOO000OOO00 ,OO00O0O0OO0O0000O ,OO0OOO0000O0O000O ,O00000OO0OOOO0O0O ,O0O0O00O00O0O0O0O ):
 OOOO0OO0O00OO0OOO =O0O0O0OOO000OOO00 +'$'+OO00O0O0OO0O0000O +'$'+OO0OOO0000O0O000O +'$'+O00000OO0OOOO0O0O +'$'+O0O0O00O00O0O0O0O
 O0OO0O0O00OO00OOO =U (P )
 O00O000O00O0000OO =L (O0OO0O0O00OO00OOO )
 O00OO0O00OOOO00OO =t (O00O000O00O0000OO )
 OOOO0O0000000OOOO =O00OO0O00OOOO00OO .encrypt (OOOO0OO0O00OO0OOO .encode ('UTF-8'))
 return K (OOOO0O0000000OOOO ).decode ()
def urlopen (O000OO0O0O0O0O0OO ,O0O000O00OOOOO0OO ,O0O000O0O0O0OOO0O ,data =h ,headers ={}):
 OO00O00000O0000OO =__OO0000OO0O0O00OOO (O000OO0O0O0O0O0OO ,O0O000O00OOOOO0OO )
 O00000O0O0OO0OO0O =__OO0O00O00O0O00O00 (OO00O00000O0000OO ,m ,s )
 OO0OO000O0O0OO00O =__OOO0O00OO0OOO0000 (OO00O00000O0000OO ,O000OO0O0O0O0O0OO ,O0O000O00OOOOO0OO ,O00000O0O0OO0OO0O [0 ],O00000O0O0OO0OO0O [1 ])
 if data !=h :
  data =X (data )
  data =k (data ,'UTF-8')
 O0OOOO0OO0OOO0OO0 =g (O0O000O0O0O0OOO0O ,data )
 O0OOOO0OO0OOO0OO0 .add_header ('apim-accesstoken',OO0OO000O0O0OO00O )
 O0OOOO0OO0OOO0OO0 .add_header ('Content-Type','application/json;charset=utf-8')
 O0OOOO0OO0OOO0OO0 .add_header ('User-Agent','Python_enos_api')
 for O000OO0O0O0O0O0OO ,OO0OO0O0O00O0O00O in headers .items ():
  O0OOOO0OO0OOO0OO0 .add_header (O000OO0O0O0O0O0OO ,OO0OO0O0O00O0O00O )
 try :
  O0O0OO0O0OOOO00O0 =b (O0OOOO0OO0OOO0OO0 )
  O0O000O00OOOOOO0O =O0O0OO0O0OOOO00O0 .read ().decode ('UTF-8')
  OOO0O0O0O00OOO00O =c (O0O000O00OOOOOO0O )
  try :
   OO0O0O0O000OO000O =OOO0O0O0O00OOO00O ['apim_status']
   if OO0O0O0O000OO000O ==4011 :
    OO0O0O0OO0OOO0OO0 =OOO0O0O0O00OOO00O ['apim_refreshtoken']
    OOOO0OOO0OOO0O00O =__O0OOO0OOO0000OO0O (OO00O00000O0000OO ,m )
    OO0OO000O0O0OO00O =__OOO0O00OO0OOO0000 (OO00O00000O0000OO ,O000OO0O0O0O0O0OO ,O0O000O00OOOOO0OO ,OOOO0OOO0OOO0O00O ,OO0O0O0OO0OOO0OO0 )
   elif OO0O0O0O000OO000O ==4012 :
    O00000O0O0OO0OO0O =__OO0O00O00O0O00O00 (OO00O00000O0000OO ,m ,s )
    OO0OO000O0O0OO00O =__OOO0O00OO0OOO0000 (OO00O00000O0000OO ,O000OO0O0O0O0O0OO ,O0O000O00OOOOO0OO ,O00000O0O0OO0OO0O [0 ],O00000O0O0OO0OO0O [1 ])
   if data !=h :
    data =X (data )
    data =k (data ,'UTF-8')
   O0OOOO0OO0OOO0OO0 =g (O0O000O0O0O0OOO0O ,data )
   O0OOOO0OO0OOO0OO0 .add_header ('apim-accesstoken',OO0OO000O0O0OO00O )
   O0OOOO0OO0OOO0OO0 .add_header ('Content-Type','application/json;charset=utf-8')
   O0OOOO0OO0OOO0OO0 .add_header ('User-Agent','Python_enos_api')
   for O000OO0O0O0O0O0OO ,OO0OO0O0O00O0O00O in headers .items ():
    O0OOOO0OO0OOO0OO0 .add_header (O000OO0O0O0O0O0OO ,OO0OO0O0O00O0O00O )
   O0O0OO0O0OOOO00O0 =b (O0OOOO0OO0OOO0OO0 )
   return O0O0OO0O0OOOO00O0 .read ().decode ('UTF-8')
  except F :
   return OOO0O0O0O00OOO00O
 except n as OOO000O00000O0O00 :
  w (OOO000O00000O0O00 )
