from Crypto.Util.number import bytes_to_long, getPrime
import os

FLAG = open('flag.txt','r').read()
assert len(FLAG) == 59

punctuation = [b'.',b'!',b'?']

N = []
c = []
for ch in punctuation:
    m = bytes_to_long(FLAG.encode()+ch)
    e = 3
    n = getPrime(512)*getPrime(512)
    N.append(n)
    c.append(pow(m,e,n))

print(f'{N = }')
print(f'{c = }')

'''
N = [75215476663579326768287229607421838222093733160087645987698454599521271318176795225464705174935937669563608277334496776815506898519813730289671914701916164461183835759774043858645180817462825101177991591509132316920355753009861746029671881419626788464696264311740726511499559575038256226652223417578345359457, 97834466173498054942543801618538757309068025733672166578876013289893072272203664845078345973518141719042283064627338813416942369804152660880580749673208865834142904465847079684393522713132493273449640796337584026295327951926593246090615116439613913439555244402680079706713813368433145926342574820571942830723, 81617861012610291639750143459530381371110892574164106352679055821421565632173146889505180038693038709808434868130885204191360978255305474839130739986069945424175590716255594767158204669396257410397427675898333051302323867550886788411710032863934208526489521156453518457029028005145973443697927996736876091043]
c = [31835417608417420807695669469454798260468781926017311192239488395372794697956306235609575319818839787633864092248446386517825299036010852414200105392858006821863050363574485689698127547194467728512800456839193850591664936635275316632009927141980610421263516743127554513484220380575371642369591765542745429817, 72264838151013412152530349394984549944227647769063220227617981257376458775281675433363035240348368700038891497647291961597473047576022843489735346628643057677597075053892779756733879219339189851122577021796885327555688857214947523123376094522659419548876391869206594981824645094306073927219409860630004191014, 27260931835345194806043660092799840100726757548073668651644528200140821547619229423841240264858527377056330727667083279907700962624360867563176334140756545657435430100938970129643930320020655272161694072985681788745516046283620290473661391722712556554419115823357476761834705942928370246949816034996883382534]
'''

#Hastad + Coppersmith because of punctutation padding