[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false\n\n[*.py]\nindent_size = 4\n"
  },
  {
    "path": ".gitignore",
    "content": "__pycache__/\n*.pyc\npython*/\n*.egg-info/\n/build\n/dist\n"
  },
  {
    "path": "README.md",
    "content": "qqlib\n===\n[![PyPI](https://img.shields.io/pypi/v/qqlib.svg)]()\n\nPython版QQ登录库，兼容Python2.x和Python3.x。\n\n安装\n---\n``` sh\n$ pip install qqlib\n# or\n$ pip install git+https://github.com/gera2ld/qqlib.git\n```\n\n快速开始\n---\n``` sh\n$ python -m qqlib\n```\n\n高级用法\n---\n``` python\ndef login(qq):\n    # 不考虑验证码的情况，直接登录\n    qq.login()\n\nimport qqlib\nqq = qqlib.QQ(12345678, 'password')\nlogin(qq)\nprint('Hi, %s' % qq.nick)\n```\n\n登录时有可能出现需要验证码的情况，可以捕获到`qqlib.NeedVerifyCode`错误。这时`qq.need_verify`为`True`，需要获取验证码图片（`qq.verifier.fetch_image()`）进行处理，验证（`qq.verifier.verify(code)`）之后再继续登录。下面是支持输入验证码的`login`方法：\n``` python\ndef login(qq):\n    # 自动重试登录\n    while True:\n        try:\n            if qq.need_verify:\n                open('verify.jpg', 'wb').write(qq.verifier.fetch_image())\n                print('验证码已保存到verify.jpg')\n                # 输入验证码\n                vcode = input('请输入验证码：')\n                qq.verifier.verify(vcode)\n            qq.login()\n            break\n        except qqlib.NeedVerifyCode as exc:\n            if exc.message:\n                print('Error:', exc.message)\n```\n\nQZone：\n``` python\nfrom qqlib import qzone\nqq = qzone.QZone(12345678, 'password')\n# 登录流程同上\nlogin(qq)\nqq.feed('发一条说说')\n```\n\n测试\n---\n``` sh\n# Python 2\n$ python -m unittest discover\n\n# Python 3\n$ python3 -m unittest\n```\n"
  },
  {
    "path": "qqlib/__init__.py",
    "content": "'''\nQQ Login module\nLicensed to MIT\n'''\n\nimport hashlib, re, binascii, base64\nimport rsa, requests\nfrom . import tea\n\n__all__ = ['QQ', 'LogInError', 'NeedVerifyCode']\n\nclass LogInError(Exception): pass\n\nclass NeedVerifyCode(Exception):\n    def __init__(self, verifier, message=None):\n        Exception.__init__(self)\n        self.verifier = verifier\n        self.message = message\n\nclass Verifier:\n    url_check = 'http://check.ptlogin2.qq.com/check'\n    url_gettype = 'http://captcha.qq.com/cap_union_new_gettype'\n    url_getsig = 'http://captcha.qq.com/cap_union_new_getsig'\n    url_getimage = 'http://captcha.qq.com/cap_union_new_getcapbysig'\n    url_verify = 'http://captcha.qq.com/cap_union_new_verify'\n\n    def __init__(self, parent):\n        self.parent = parent\n        self.sess = None\n        self.need_verify = False\n\n    def check(self):\n        parent = self.parent\n        login_sig = parent.session.cookies['pt_login_sig']\n        g = parent.fetch(self.url_check, params={\n            'pt_tea': 2,\n            'uin': parent.user,\n            'appid': parent.appid,\n            'js_ver': parent.js_ver,\n            'js_type': 1,\n            'u1': parent.url_success,\n            'login_sig': login_sig,\n        }).text\n        v = re.findall('\\'(.*?)\\'', g)\n        self.pt_vcode_v1, self.cap_cd, self.uin, self.ptvfsession = v[:4]\n        if self.pt_vcode_v1 == '1':\n            self.throw()\n        else:\n            self.vcode = self.cap_cd\n\n    def get_type(self):\n        parent = self.parent\n        g = parent.fetch(self.url_gettype, params={\n            'aid': parent.appid,\n            'protocol': 'http',\n            'clienttype': 2,\n            'apptype': 2,\n            'curenv': 'inner',\n            'uid': parent.user,\n            'cap_cd': self.cap_cd,\n            'callback': '_qqlib_',\n        }).text\n        m = re.search('\"sess\":\"(.*?)\"', g)\n        self.sess = m.group(1)\n\n    def fetch_image(self):\n        parent = self.parent\n        if self.sess is None:\n            self.get_type()\n        g = parent.fetch(self.url_getsig, params={\n            'aid': parent.appid,\n            'protocol': 'http',\n            'clienttype': 2,\n            'apptype': 2,\n            'curenv': 'inner',\n            'sess': self.sess,\n            'uid': parent.user,\n            'cap_cd': self.cap_cd,\n        }).json()\n        self.vsig = g['vsig']\n        r = parent.fetch(self.url_getimage, params={\n            'aid': parent.appid,\n            'protocol': 'http',\n            'clienttype': 2,\n            'apptype': 2,\n            'curenv': 'inner',\n            'sess': self.sess,\n            'uid': parent.user,\n            'cap_cd': self.cap_cd,\n            'vsig': self.vsig,\n            'showtype': 'embed',\n            'ischartype': 1,\n        })\n        return r.content\n\n    def verify(self, vcode):\n        parent = self.parent\n        r = parent.fetch(self.url_verify, data={\n            'aid': parent.appid,\n            'protocol': 'http',\n            'clientype': 2,\n            'apptype': 2,\n            'curenv': 'inner',\n            'sess': self.sess,\n            'uid': parent.user,\n            'cap_cd': self.cap_cd,\n            'vsig': self.vsig,\n            'ans': vcode,\n        })\n        r.encoding='utf-8'\n        g = r.json()\n        if g['errorCode'] != '0':\n            self.throw(g['errMessage'])\n        self.vcode = g['randstr']\n        self.ptvfsession = g['ticket']\n        self.need_verify = False\n\n    def throw(self, message=None):\n        self.need_verify = True\n        raise NeedVerifyCode(self, message)\n\nclass QQ:\n    appid = 549000912\n    action = '4-22-1450611437613'\n    url_success = 'http://qzs.qq.com/qzone/v5/loginsucc.html?para=izone'\n    js_ver = 10171\n\n    def __init__(self, user, pwd):\n        self.user = user\n        self.pwd = pwd\n        self.nick = None\n        self.verifier = None\n        self.session = requests.Session()\n        self.xlogin()\n\n    def fetch(self, url, data=None, **kw):\n        if data is None:\n            func = self.session.get\n        else:\n            kw['data'] = data\n            func = self.session.post\n        return func(url, **kw)\n\n    url_xlogin = 'http://xui.ptlogin2.qq.com/cgi-bin/xlogin'\n    def xlogin(self):\n        '''\n        Get a log-in signature in cookies.\n        '''\n        self.fetch(self.url_xlogin, params={\n            'proxy_url': 'http://qzs.qq.com/qzone/v6/portal/proxy.html',\n            'daid': 5,\n            'no_verifyimg': 1,\n            'appid': self.appid,\n            's_url': self.url_success,\n        })\n\n    url_login = 'http://ptlogin2.qq.com/login'\n    def login(self, force=False):\n        login_sig = self.session.cookies['pt_login_sig']\n        if force:\n            self.verifier = None\n        if self.verifier is None:\n            verifier = self.verifier = Verifier(self)\n            verifier.check()\n        else:\n            verifier = self.verifier\n        ptvfsession = verifier.ptvfsession or self.session.cookies.get('ptvfsession', '')\n        g = self.fetch(self.url_login, params={\n            'u': self.user,\n            'verifycode': verifier.vcode,\n            'pt_vcode_v1': verifier.pt_vcode_v1,\n            'pt_verifysession_v1': ptvfsession,\n            'p': self.pwdencode(verifier.vcode, verifier.uin, self.pwd),\n            'pt_randsalt': 0,\n            'u1': self.url_success,\n            'ptredirect': 0,\n            'h': 1,\n            't': 1,\n            'g': 1,\n            'from_ui': 1,\n            'ptlang': 2052,\n            'action': self.action,\n            'js_ver': self.js_ver,\n            'js_type': 1,\n            'aid': self.appid,\n            'daid': 5,\n            'login_sig': login_sig,\n        }).text\n        r = re.findall('\\'(.*?)\\'', g)\n        if r[0] == '4':\n            verifier.throw(r[4])\n        if r[0] != '0':\n            raise LogInError(r[4])\n        self.nick = r[5]\n        self.fetch(r[2])\n        self.verifier = None\n\n    @property\n    def need_verify(self):\n        return self.verifier and self.verifier.need_verify\n\n    def fromhex(self, s):\n        # Python 3: bytes.fromhex\n        return bytes(bytearray.fromhex(s))\n\n    pubKey = rsa.PublicKey(int(\n        'F20CE00BAE5361F8FA3AE9CEFA495362'\n        'FF7DA1BA628F64A347F0A8C012BF0B25'\n        '4A30CD92ABFFE7A6EE0DC424CB6166F8'\n        '819EFA5BCCB20EDFB4AD02E412CCF579'\n        'B1CA711D55B8B0B3AEB60153D5E0693A'\n        '2A86F3167D7847A0CB8B00004716A909'\n        '5D9BADC977CBB804DBDCBA6029A97108'\n        '69A453F27DFDDF83C016D928B3CBF4C7',\n        16\n    ), 3)\n    def pwdencode(self, vcode, uin, pwd):\n        '''\n        Encode password with tea.\n        '''\n        # uin is the bytes of QQ number stored in unsigned long (8 bytes)\n        salt = uin.replace(r'\\x', '')\n        h1 = hashlib.md5(pwd.encode()).digest()\n        s2 = hashlib.md5(h1 + self.fromhex(salt)).hexdigest().upper()\n        rsaH1 = binascii.b2a_hex(rsa.encrypt(h1, self.pubKey)).decode()\n        rsaH1Len = hex(len(rsaH1) // 2)[2:]\n        hexVcode = binascii.b2a_hex(vcode.upper().encode()).decode()\n        vcodeLen = hex(len(hexVcode) // 2)[2:]\n        l = len(vcodeLen)\n        if l < 4:\n            vcodeLen = '0' * (4 - l) + vcodeLen\n        l = len(rsaH1Len)\n        if l < 4:\n            rsaH1Len = '0' * (4 - l) + rsaH1Len\n        pwd1 = rsaH1Len + rsaH1 + salt + vcodeLen + hexVcode\n        saltPwd = base64.b64encode(\n            tea.encrypt(self.fromhex(pwd1), self.fromhex(s2))\n        ).decode().replace('/', '-').replace('+', '*').replace('=', '_')\n        return saltPwd\n"
  },
  {
    "path": "qqlib/__main__.py",
    "content": "import getpass, sys, tempfile, os\nfrom . import QQ, NeedVerifyCode\n\nquser = input('QQ: ')\nqpwd = getpass.getpass('Password: ')\n\nqq = QQ(quser, qpwd)\nwhile True:\n    try:\n        if qq.need_verify:\n            fd, path = tempfile.mkstemp(suffix='.jpg')\n            os.write(fd, qq.verifier.fetch_image())\n            os.close(fd)\n            print('Verify code is saved to:', path)\n            vcode = input('Input verify code: ')\n            os.remove(path)\n            qq.verifier.verify(vcode)\n        qq.login()\n        break\n    except NeedVerifyCode:\n        exc = sys.exc_info()[1]\n        if exc.message:\n            print('Error:', exc.message)\n        exc = None\nprint('Hi, %s' % qq.nick)\n"
  },
  {
    "path": "qqlib/hieroglyphy/__init__.py",
    "content": "'''\nDecode hieroglyphy with Python\n@author Gerald <i@gerald.top>\n\nReference:\n- http://patriciopalladino.com/files/hieroglyphy/\n- https://github.com/alcuadrado/hieroglyphy\n\nQZone uses hieroglyphy but changed `f`\n'''\n\n# Generate mappings with JavaScript:\n# Run it at http://patriciopalladino.com/files/hieroglyphy/\n# > 'mappings = ' + JSON.stringify('0123456789abcdeghijklmnopqrstuvwxyz'.split('').reduce((res, c) => {res[c] = hieroglyphy.hieroglyphyString(c).replace(/\\+\\[\\]$/, ''); return res;}, {f:'(![]+[])[+[]]'}), null, 4)\n# Store it to ./data.py\nfrom .data import mappings\n\nclass CannotDecodeError(Exception): pass\n\ndef decode(text):\n    remained = text\n    results = []\n    while remained:\n        for key, val in mappings.items():\n            if remained == val or remained.startswith(val + '+'):\n                results.append(key)\n                remained = remained[len(val) + 1:]\n                break\n        else:\n            print(''.join(results), remained)\n            raise CannotDecodeError(text)\n    return ''.join(results)\n"
  },
  {
    "path": "qqlib/hieroglyphy/data.py",
    "content": "mappings = {\"0\":\"(+[]+[])\",\"1\":\"(+!![]+[])\",\"2\":\"(!+[]+!![]+[])\",\"3\":\"(!+[]+!![]+!![]+[])\",\"4\":\"(!+[]+!![]+!![]+!![]+[])\",\"5\":\"(!+[]+!![]+!![]+!![]+!![]+[])\",\"6\":\"(!+[]+!![]+!![]+!![]+!![]+!![]+[])\",\"7\":\"(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])\",\"8\":\"(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])\",\"9\":\"(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])\",\"f\":\"(![]+[])[+[]]\",\"a\":\"(+{}+[])[+!![]]\",\"b\":\"([]+{})[!+[]+!![]]\",\"c\":\"([]+{})[!+[]+!![]+!![]+!![]+!![]]\",\"d\":\"([][[]]+[])[!+[]+!![]]\",\"e\":\"([][[]]+[])[!+[]+!![]+!![]]\",\"g\":\"[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()([][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()(([]+{})[+[]])[+[]]+(!+[]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[]))\",\"h\":\"([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[+[]]\",\"i\":\"([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]\",\"j\":\"([]+{})[!+[]+!![]+!![]]\",\"k\":\"[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()([][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()(([]+{})[+[]])[+[]]+(!+[]+!![]+!![]+!![]+!![]+!![]+[])+([]+{})[!+[]+!![]])\",\"l\":\"(![]+[])[!+[]+!![]]\",\"m\":\"[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()([][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()(([]+{})[+[]])[+[]]+(!+[]+!![]+!![]+!![]+!![]+!![]+[])+([][[]]+[])[!+[]+!![]])\",\"n\":\"([][[]]+[])[+!![]]\",\"o\":\"([]+{})[+!![]]\",\"p\":\"([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]\",\"q\":\"[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()([][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()(([]+{})[+[]])[+[]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(+!![]+[]))\",\"r\":\"(!![]+[])[+!![]]\",\"s\":\"(![]+[])[!+[]+!![]+!![]]\",\"t\":\"(!![]+[])[+[]]\",\"u\":\"([][[]]+[])[+[]]\",\"v\":\"[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()([][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()(([]+{})[+[]])[+[]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+[]))\",\"w\":\"[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()([][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()(([]+{})[+[]])[+[]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[]))\",\"x\":\"[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()([][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()(([]+{})[+[]])[+[]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[]))\",\"y\":\"(+(+!![]+([][[]]+[])[!+[]+!![]+!![]]+(+!![]+[])+(+[]+[])+(+[]+[])+(+[]+[]))+[])[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]\",\"z\":\"[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()([][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+([]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]])())[!+[]+!![]+!![]]+([][[]]+[])[!+[]+!![]+!![]])()(([]+{})[+[]])[+[]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(+{}+[])[+!![]])\"}\n"
  },
  {
    "path": "qqlib/qzone.py",
    "content": "'''\nQZone module\n'''\n\nfrom . import QQ\nfrom . import hieroglyphy\n\nclass QZone(QQ):\n    url_success = 'http://qzs.qq.com/qzone/v5/loginsucc.html?para=izone'\n    url_feed = 'http://taotao.qzone.qq.com/cgi-bin/emotion_cgi_publish_v6'\n    url_home = 'https://user.qzone.qq.com/'\n\n    def g_tk(self):\n        h = 5381\n        cookies = self.session.cookies\n        s = cookies.get('p_skey') or cookies.get('skey') or ''\n        for c in s:\n            h += (h << 5) + ord(c)\n        return h & 0x7fffffff\n\n    def _qzonetoken(self, res, start_str, end_str=';'):\n        i = res.find(start_str)\n        j = res.find(';', i)\n        assert i > 0, 'qzonetoken not found!'\n        raw = res[i + len(start_str) : j]\n        return hieroglyphy.decode(raw)\n\n    def qzonetoken(self):\n        self.fetch(self.url_success)\n        res = self.fetch(self.url_home + str(self.user), headers = {\n            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36',\n        }).text\n        return self._qzonetoken(res, 'window.g_qzonetoken = (function(){ try{return ')\n\n    def _feed(self, data):\n        return self.fetch(self.url_feed, params={\n            'g_tk': self.g_tk(),\n            'qzonetoken': self.qzonetoken(),\n        }, data = {\n            'syn_tweet_verson'    : 1,\n            'paramstr'            : 1,\n            'pic_template'        : '',\n            'richtype'            : '',\n            'richval'             : '',\n            'special_url'         : '',\n            'subrichtype'         : '',\n            'who'                 : 1,\n            'con'                 : data,\n            'feedversion'         : 1,\n            'ver'                 : 1,\n            'ugc_right'           : 1,\n            'to_tweet'            : 0,\n            'to_sign'             : 0,\n            'hostuin'             : self.user,\n            'code_version'        : 1,\n            'format'              : 'fs'\n        })\n\n    def feed(self, data):\n        res = self._feed(data)\n        res.raise_for_status()\n\nclass MQZone(QZone):\n    url_success = 'https://h5.qzone.qq.com/mqzone/index'\n    url_feed = 'https://mobile.qzone.qq.com/mood/publish_mood'\n\n    def qzonetoken(self):\n        res = self.fetch(self.url_success).text\n        return self._qzonetoken(res, 'window.shine0callback = (function(){ try{return ')\n\n    def _feed(self, data):\n        return self.fetch(self.url_feed, params={\n            'g_tk': self.g_tk(),\n            'qzonetoken': self.qzonetoken(),\n        }, data = {\n            'opr_type': 'publish_shuoshuo',\n            'res_uin': self.user,\n            'content': data,\n            'richval': '',\n            'lat': 0,\n            'lon': 0,\n            'lbsid': '',\n            'issyncweibo': 0,\n            'format': 'json',\n        })\n"
  },
  {
    "path": "qqlib/tea.py",
    "content": "'''\nQQ Crypt module\nLicensed to MIT\n'''\n\nimport struct, ctypes\nimport os\n\n__all__ = ['encrypt', 'decrypt']\n\ndef xor8B(a, b):\n    '''\n    XOR operation between two 8B bytes.\n    '''\n    length = 8\n    arr_a = bytearray(a[:length])\n    arr_b = bytearray(b[:length])\n    for i in range(length):\n        arr_a[i] ^= arr_b[i]\n    return bytes(arr_a) if isinstance(a, bytes) else arr_a\n\ndef encipher(v, k):\n    '''\n    TEA coder encrypt 64 bits value, by 128 bits key,\n    QQ uses 16 round TEA.\n    http://www.ftp.cl.cam.ac.uk/ftp/papers/djw-rmn/djw-rmn-tea.html .\n    '''\n    n=16  #qq use 16\n    delta = 0x9e3779b9\n    k = struct.unpack('!LLLL', k[0:16])\n    y, z = map(ctypes.c_uint32, struct.unpack('!LL', v[0:8]))\n    s = ctypes.c_uint32(0)\n    for i in range(n):\n        s.value += delta\n        y.value += (z.value << 4) + k[0] ^ z.value+ s.value ^ (z.value >> 5) + k[1]\n        z.value += (y.value << 4) + k[2] ^ y.value+ s.value ^ (y.value >> 5) + k[3]\n    r = struct.pack('!LL', y.value, z.value)\n    return r\n\ndef encrypt(v, k):\n    \"\"\"\n    Encrypt function for QQ.\n\n    v is the message to encrypt, k is the key\n    fill char is randomized (which is 0xAD in old version)\n    the length of the final data is filln + 8 + len(v)\n\n    The message is encrypted 8 bytes at at time,\n    the result is:\n\n    r = encipher( v ^ tr, key) ^ to   (*)\n\n    `encipher` is the QQ's TEA function.\n    v is 8 bytes data to be encrypted.\n    tr is the result in preceding round.\n    to is the data coded in perceding round (v_pre ^ r_pre_pre)\n    For the first 8 bytes 'tr' and 'to' is filled by zero.\n    \"\"\"\n    vl = len(v)\n    #filln = (8 - (vl + 2)) % 8\n    filln = (6 - vl) % 8\n    v_arr = (\n        bytes(bytearray([filln | 0xf8])),\n        os.urandom(filln + 2),  # random char * (filln + 2)\n        v,\n        b'\\0' * 7,\n    )\n    v = b''.join(v_arr)\n    tr = to = b'\\0' * 8\n    r = []\n    for i in range(0, len(v), 8):\n        o = xor8B(v[i:i+8], tr)\n        tr = xor8B(encipher(o, k), to)\n        to = o\n        r.append(tr)\n    r = b''.join(r)\n    return r\n\ndef decrypt(v, k):\n    \"\"\"\n    Decrypt function for QQ.\n\n    according to (*) we can get:\n\n    x  = decipher(v[i:i+8] ^ prePlain, key) ^ preCyrpt\n\n    prePlain is the previously encrypted 8 bytes:\n       per 8 byte from v XOR previous preCyrpt\n    preCrypt is previous 8 bytes of encrypted data.\n\n    After decrypting, we must truncate the padding bytes.\n    The number of padding bytes in the front of message is\n    pos + 1.\n    pos is the first byte of deCrypted: r[0] & 0x07 + 2\n    The number of padding bytes in the end is 7 (b'\\0' * 7).\n    The returned value is r[pos+1:-7].\n\n    >>> from binascii import a2b_hex, b2a_hex\n    >>> r = encrypt('', b2a_hex('b537a06cf3bcb33206237d7149c27bc3'))\n    >>> decrypt(r, b2a_hex('b537a06cf3bcb33206237d7149c27bc3'))\n    ''\n    >>> r = encrypt('abcdefghijklimabcdefghijklmn', b2a_hex('b537a06cf3bcb33206237d7149c27bc3'))\n    >>> decrypt(r, b2a_hex('b537a06cf3bcb33206237d7149c27bc3'))\n    'abcdefghijklimabcdefghijklmn'\n    >>> import md5\n    >>> key = md5.new(md5.new('python').digest()).digest()\n    >>> data='8CE160B9F312AEC9AC8D8AEAB41A319EDF51FB4BB5E33820C77C48DFC53E2A48CD1C24B29490329D2285897A32E7B32E9830DC2D0695802EB1D9890A0223D0E36C35B24732CE12D06403975B0BC1280EA32B3EE98EAB858C40670C9E1A376AE6C7DCFADD4D45C1081571D2AF3D0F41B73BDC915C3AE542AF2C8B1364614861FC7272E33D90FA012620C18ABF76BE0B9EC0D24017C0C073C469B4376C7C08AA30'\n    >>> data = a2b_hex(data)\n    >>> b2a_hex(decrypt(data, key))\n    '00553361637347436654695a354d7a51531c69f1f5dde81c4332097f0000011f4042c89732030aa4d290f9f941891ae3670bb9c21053397d05f35425c7bf80000000001f40da558a481f40000100004dc573dd2af3b28b6a13e8fa72ea138cd13aa145b0e62554fe8df4b11662a794000000000000000000000000dde81c4342c8966642c4df9142c3a4a9000a000a'\n\n    \"\"\"\n    l = len(v)\n    #if l % 8 != 0 or l < 16:\n    #    return ''\n    prePlain = decipher(v, k)\n    pos = ord(prePlain[:1]) & 0x07 + 2\n    r = prePlain\n    preCrypt = v[0:8]\n    for i in range(8, l, 8):\n        x = xor8B(decipher(xor8B(v[i:i+8], prePlain), k), preCrypt)\n        prePlain = xor8B(x, preCrypt)\n        preCrypt = v[i:i+8]\n        r += x\n    if r[-7:] == b'\\0' * 7:\n        return r[pos+1:-7]\n\ndef decipher(v, k):\n    '''\n    TEA decipher, decrypt 64bits value with 128 bits key.\n    it's the inverse function of TEA encrypt.\n    '''\n    n = 16\n    y, z = map(ctypes.c_uint32, struct.unpack('!LL', v[0:8]))\n    a, b, c, d = map(ctypes.c_uint32, struct.unpack('!LLLL', k[0:16]))\n    delta = 0x9E3779B9\n    s = ctypes.c_uint32(delta << 4)\n    for i in range(n):\n        z.value -= ((y.value << 4) + c.value) ^ (y.value + s.value) ^ ((y.value >> 5) + d.value)\n        y.value -= ((z.value << 4) + a.value) ^ (z.value + s.value) ^ ((z.value >> 5) + b.value)\n        s.value -= delta\n    return struct.pack('!LL', y.value, z.value)\n"
  },
  {
    "path": "requirements.txt",
    "content": "rsa\nrequests\n"
  },
  {
    "path": "setup.py",
    "content": "from setuptools import setup, find_packages\n\nsetup(\n    name='qqlib',\n    version='1.1.1',\n    description='QQ library for Python.',\n    long_description='QQ library for Python, based on web APIs.',\n    url='https://github.com/gera2ld/qqlib',\n    author='Gerald',\n    author_email='i@gerald.top',\n    license='MIT',\n    classifiers = [\n        'Development Status :: 5 - Production/Stable',\n        'Intended Audience :: Developers',\n        'License :: OSI Approved :: MIT License',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.0',\n        'Programming Language :: Python :: 3.1',\n        'Programming Language :: Python :: 3.2',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n    ],\n    keywords='qq',\n    packages=find_packages(exclude=['tests']),\n    install_requires=[\n        'rsa',\n        'requests',\n    ],\n)\n"
  },
  {
    "path": "tests/__init__.py",
    "content": ""
  },
  {
    "path": "tests/test_hieroglyphy.py",
    "content": "import unittest\nfrom qqlib import hieroglyphy\n\nclass TestHieroglyphy(unittest.TestCase):\n    def test_decode(self):\n        for encrypted, plain in [\n            (\n                '(+[]+[])+(+!![]+[])+(!+[]+!![]+[])+(!+[]+!![]+!![]+[])'\n                '+(!+[]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+[]'\n                ')+(!+[]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!'\n                '![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+'\n                '!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]'\n                '+!![]+[])+(+{}+[])[+!![]]+([]+{})[!+[]+!![]]+([]+{})[!'\n                '+[]+!![]+!![]+!![]+!![]]+([][[]]+[])[!+[]+!![]]+([][[]'\n                ']+[])[!+[]+!![]+!![]]+(![]+[])[+[]]',\n                '0123456789abcdef'\n            ),\n            (\n                '(!+[]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!!['\n                ']+!![]+[])+(+[]+[])+([][[]]+[])[!+[]+!![]]+(!+[]+!![]+'\n                '!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+[])+'\n                '([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[+[]]+(![]+[])[+[]'\n                ']+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+([]+{})'\n                '[!+[]+!![]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(['\n                ']+{})[!+[]+!![]]+(+{}+[])[+!![]]+([]+{})[!+[]+!![]]+(['\n                ']+{})[!+[]+!![]+!![]+!![]+!![]]+(+!![]+[])+([][[]]+[])'\n                '[!+[]+!![]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+['\n                '])+(!+[]+!![]+!![]+!![]+!![]+[])+([]+{})[!+[]+!![]]+(['\n                '][[]]+[])[!+[]+!![]]+(!+[]+!![]+!![]+!![]+!![]+!![]+[]'\n                ')+(!+[]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+[])+(!+[]+!'\n                '![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+'\n                '!![]+!![]+!![]+[])+([]+{})[!+[]+!![]+!![]+!![]+!![]]+('\n                '!+[]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]'\n                '+[])+(![]+[])[+[]]+(![]+[])[+[]]+(+{}+[])[+!![]]+(!+[]'\n                '+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!!['\n                ']+!![]+!![]+!![]+!![]+!![]+!![]+[])+([]+[][(![]+[])[!+'\n                '[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[]'\n                ')[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!!['\n                ']]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+['\n                '])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]'\n                '+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!'\n                '![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]'\n                '+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]'\n                ']+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+'\n                '!![]+!![]]+(![]+[])[!+[]+!![]]+([]+{})[+!![]]+([]+{})['\n                '!+[]+!![]+!![]+!![]+!![]]+(+{}+[])[+!![]]+(!![]+[])[+['\n                ']]+([][[]]+[])[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]'\n                ']+([][[]]+[])[+!![]])())[+[]]+(!+[]+!![]+!![]+!![]+!!['\n                ']+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!!'\n                '[]+[])+(!+[]+!![]+!![]+[])+(+!![]+[])+(!+[]+!![]+!![]+'\n                '!![]+[])+(+{}+[])[+!![]]+([][[]]+[])[!+[]+!![]]+(!+[]+'\n                '!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(+{}+[])[+'\n                '!![]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!!'\n                '[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+['\n                '])+([][[]]+[])[!+[]+!![]+!![]]+(+[]+[])+(!+[]+!![]+!!['\n                ']+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!!'\n                '[]+!![]+[])+(!+[]+!![]+[])+(!+[]+!![]+!![]+!![]+[])+(!'\n                '+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(![]+[])[+[]]+(!'\n                '+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+'\n                '!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]'\n                '+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+[])+([]+{})[!'\n                '+[]+!![]]+(!+[]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!!['\n                ']+!![]+!![]+!![]+!![]+!![]+[])+(![]+[])[+[]]+(!+[]+!!['\n                ']+!![]+!![]+!![]+[])+(!+[]+!![]+[])+([]+{})[!+[]+!![]]'\n                '+(+[]+[])+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!+[]+!![]'\n                '+!![]+!![]+!![]+[])+(!+[]+!![]+[])+(![]+[])[+[]]+(!+[]'\n                '+!![]+!![]+!![]+[])+(![]+[])[+[]]+([]+{})[!+[]+!![]+!!'\n                '[]+!![]+!![]]+([]+{})[!+[]+!![]]+(!+[]+!![]+!![]+!![]+'\n                '[])+([]+{})[!+[]+!![]]+(!+[]+!![]+!![]+!![]+!![]+!![]+'\n                '!![]+!![]+!![]+[])+(+{}+[])[+!![]]+(!+[]+!![]+[])+(+!!'\n                '[]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!'\n                '![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+'\n                '!![]+!![]+!![]+!![]+!![]+!![]+[])+([]+{})[!+[]+!![]]+('\n                '[]+{})[!+[]+!![]+!![]+!![]+!![]]+(!+[]+!![]+!![]+[])+('\n                '[]+{})[!+[]+!![]]+(!+[]+!![]+!![]+!![]+!![]+[])+(!+[]+'\n                '!![]+[])+(!+[]+!![]+[])+([]+{})[!+[]+!![]+!![]+!![]+!!'\n                '[]]+(+[]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+[])+(+{}+['\n                '])[+!![]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(![]'\n                '+[])[+[]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])'\n                '+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!+[]+!![]+!![]+!!['\n                ']+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+[])+(!+[]+!!'\n                '[]+!![]+[])+(+[]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!!'\n                '[]+!![]+!![]+[])+(+{}+[])[+!![]]+(![]+[])[+[]]+(!+[]+!'\n                '![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+'\n                '!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+[])+([]+{})[!+'\n                '[]+!![]]+(!+[]+!![]+!![]+[])+(+[]+[])+(+[]+[])+(!+[]+!'\n                '![]+!![]+!![]+!![]+!![]+[])+([]+{})[!+[]+!![]]+(!+[]+!'\n                '![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+'\n                '[])+(!+[]+!![]+!![]+[])+(+{}+[])[+!![]]+(+!![]+[])+(!+'\n                '[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(![]+[]'\n                ')[+[]]+(!+[]+!![]+!![]+!![]+!![]+[])+([]+{})[!+[]+!![]'\n                '+!![]+!![]+!![]]+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!'\n                '![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+'\n                '[])+(![]+[])[+[]]+([][[]]+[])[!+[]+!![]]+(!+[]+!![]+!!'\n                '[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!'\n                '![]+[])+(+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]'\n                '+!![]+[])+(+[]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+[])+'\n                '(![]+[])[+[]]+([]+{})[!+[]+!![]]+(!+[]+!![]+!![]+!![]+'\n                '!![]+!![]+[])+([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{}'\n                ')[!+[]+!![]+!![]+!![]+!![]]+(!+[]+!![]+!![]+!![]+!![]+'\n                '[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]'\n                '+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])',\n                '290d56eff8b7babc1d85bd63477c46ffa89h96314ad9a783e06824'\n                '7f9666b49f52b0c52f4fcb4b9a21798bc3b522c06a7f8c83309af9'\n                '36b3006b833a19f5c98fd941806fb6cc588'\n            ),\n        ]:\n            self.assertEqual(hieroglyphy.decode(encrypted), plain)\n"
  },
  {
    "path": "tests/test_tea.py",
    "content": "import unittest\nfrom binascii import a2b_hex, b2a_hex\nfrom qqlib import tea\n\nKEY_1 = b'aaaabbbbccccdddd'\nDATA_1 = b'abcdefgh'\nENC_1 = b'a557272c538d3e96'\nKEY_2 = b2a_hex(b'b537a06cf3bcb33206237d7149c27bc3')\nDATA_2 = b''\nENC_2 = b'b56137502728e2c74bb84c6d50d21973'\n\nclass TestTEA(unittest.TestCase):\n    def test_encipher(self):\n        c = b2a_hex(tea.encipher(DATA_1, KEY_1))\n        self.assertEqual(c, ENC_1)\n\n    def test_decipher(self):\n        c = tea.decipher(a2b_hex(ENC_1), KEY_1)\n        self.assertEqual(c, DATA_1)\n\n    def test_decrypt(self):\n        c = tea.decrypt(a2b_hex(ENC_2), KEY_2)\n        self.assertEqual(c, DATA_2)\n\n    def test_encrypt(self):\n        e = tea.encrypt(DATA_2, KEY_2)\n        src = tea.decrypt(e, KEY_2)\n        self.assertEqual(src, DATA_2)\n"
  }
]