from Crypto.Cipher import AES 
from random import randint 
from Crypto.Util.number import long_to_bytes
from Crypto.Util.Padding import pad
import sys 
key = randint(1, 2 ** 128 - 1)
cipher = AES.new(long_to_bytes(key), AES.MODE_ECB)
flag = b'sctf{?????????????????????????????????????????????????????????????}'
ct = cipher.encrypt(pad(flag, 16))

p = 4207307025098317548378728215220096278591651164069131592043890901803190544219229913074333288793062986299352670628719778821885052997741625021840584873393056674570878569750816367100788300660497494643458066137112544757107304879199455294719998315845256514194112159992299503103560870655450594469854540669070325418205654373943834137939937559048482619070903529206121282285784594512085736632776033482718302569524598849066364732731247207163509872173524185405320953738044171261349335987178952526668011790990620345145212536026920340312358340751568933250282699976724446746654853220001665881343949991598765853423074540468229605738348844267929223032917619999202056994587262766466956340111745474650650886799
#my p is a smooth criminal - carbonara
sys.set_int_max_str_digits(30000)
g = 2 

key = bin(key)[2:].zfill(128)
key = list(key)
key = key
x = ""
for bit in key:
    x += "6"*199
    if bit == '0':
        x += "6"
    else:
        x += "7"
x = int(x)
#six sevennnnnnnnnnnnnnnn

print(f"{g = }")
print(f"{p = }")
print(f"{pow(g, x, p) = }")
print(f"{ct.hex() = }")
'''
g = 2
p = 4207307025098317548378728215220096278591651164069131592043890901803190544219229913074333288793062986299352670628719778821885052997741625021840584873393056674570878569750816367100788300660497494643458066137112544757107304879199455294719998315845256514194112159992299503103560870655450594469854540669070325418205654373943834137939937559048482619070903529206121282285784594512085736632776033482718302569524598849066364732731247207163509872173524185405320953738044171261349335987178952526668011790990620345145212536026920340312358340751568933250282699976724446746654853220001665881343949991598765853423074540468229605738348844267929223032917619999202056994587262766466956340111745474650650886799
pow(g, x, p) = 1779399175477932263489919858481023121352559544749403947188234666776640990382963240232362801916090088819026149969315784341673203138946134506007842911682821041738757980543458823857516356434983678145586443087180983417965233581605687580473834270152722484228468963228871641223987328420530155482770841202574514215452032779604660825088307701877530695270535544090811646979321763841822821893713461334844820235332488738608633079772758392206377984560329503478197157687913530699772607886599692894650104537111112122956145243003489946139159751298981716575102821665921418886635587411272850913938513706878703125541819119251546212309011853225022085315099929314616148861893138545326083206395008715530309920145
ct.hex() = 'fd4bbb20d0a3f7a1133a60c4c5780bc6e2108857d76194fdac090d5895b2621e70b05c0ec9cf04def73493c58aad362d70b05c0ec9cf04def73493c58aad362d3fb7ea4b1bbd3d19fb24dea3874c9181'
'''