
// Make newform 42.5.h.a in Magma, downloaded from the LMFDB on 04 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_42_h();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_42_h_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_42_5_h_a();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_42_5_h_a();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [8145239244704821809, -406604690130980484, 52054868201143878, -14348052126267588, -1338007627265483, -42677138798460, 27986581473280, 687686868324, 507364948243, -73982451888, -2077817540, -380890548, 37679467, 6921828, 1340206, -62280, -3593, -684, -20, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [67463629579972903580364391377478575797800924484442289805587121735733, 10317427366061323480031189562370133126676372746835226664656099633365, 808551185531272319100773377457553231138545795937870886326963484293, -409331489569844331452120831827103125250832984987507396389419424783, -6115934949742214955633396924059741204547055284482188973636500173, -3035602425211060013593527252042772655381737026048558729350470709, 143160994714304590636749526920188212875671795083612652550610536, 29701991915458055127559101733737016500715636967109838001939488, 2056358546852803061034646653468371665569811081017198438230052, -445797722792953232996987890928808070130736405885225783346184, -14622603782419843131973620361165295937082428469045531524084, -11170825966631697488127797311082008327448880696301213157588, -368069784625198521690180179213385758816788175656586784009, 18871588299272732525868223213082331089468641284427761535, 4796447016105247873160328668478274232683432947516001083, 150390362215499454790634929819219652227746500288420491, 54017462420201402158097381419504329972756420593507877, -3238307992311792649540983818339891709605192761151555, -771535833876371704948157837992430305201614287699088, -30129450114985157231920227195314593573428524173136], [14429762289774624067431672578364572266058548921473595759199918131890737870034494485896, -562672741844608599079012431604694703978229006679348786647806936376361352227535701442, -131286142022200682325080851482332223649323513331238683010133385732511940312795618057, -19828433588420050954774028637608333163195874871307860065802960213625593263776358818, -1476280709365875089592855193041268567956464756043813563954458983832471471007141711, 218266605905404238559420659247650097868960994352285252661795374092499824577489330, 67097863528638427656961043129585199968030781519840198806464601338593515006237315, -1694823969221846080726261570249041275570379037566085652521534226847826546347966, -11635739353154451378326037105109561997375501213249964051025552126006080204180, -121537818413020813959557565407895912642700971943604270538022941150973078354356, -4494061852254930947783660100091699489878834302689863531221373389112016311728, 956748721614458108317058530849790503328033539283634616725988479017626771704, 134229063817222561359823611965893297483196874550123416321453818034113708636, -2622531966254568114922835762496067176152599763804892193821643292886717006, 271084778818730680223244421875297440060321864937220393893820595481786765, -97375707498508845730687455854188406307500363698913585406844670739774078, -9401860129319027489405795953181463062062225935238037209193629897987913, 194247150151443942864506135599105054237593903458526333228376785934914, 115232954850964385674603594397197254336028182256619704275230535189641, -2497294541322176983233921413421770252774598079915651297682617273878], [-16992423900888948668158254431958897246908100685037154124562356394749122411214745082148617382542337914, 1116903265036984100493112546686263396049199903223562133342060849329048925793858893860415720233288780, 171872325130433857754239924760037405979613610388660466601375523253522582194329769890559535152293675, 32202289141779008217223631140069524305569798397596270256836971951516498078437702718524490532851228, 171191575233266581263457901874844984997233652354634309736667972363948288160810432414828202276665, -381257485429085573806512349520607254117128235082719088671976544963949820706006968999935543475320, -103319269379542236167389268945454638812358813565021171177888996180195968645687131151220688758717, 3069194340474808449943604521588444090427448713505336318928324499604818682823418848803407626250, 254056981281035448702096471913161475219956878600790330227011388350499775180687583756054500600, 183050356398069959254822464088818372757738275572408555105702960807314214246884461982498253892, 3543896045379728695595146922360540879418121591782014076039374582095491598619854042737677820, -1719800876612238583593485514621636414855303542945425953213641084570455780109877991772291360, -250621823474965957334961008062231481436371615341201335868363432870105100629695107752220298, 1776364542608184127248425709617228776563394497954858538152115657927115431850714112170660, 20304145523637942450414448436503189450634896693689043600404747778698936210870295401765, 182307159702707248325345041442649107638565036302483841549813653479453137300075076930180, 13978693626223704029858978694125678321048279794479635907516620700700147827879638084595, -342954864057178809641711762393418884815215388899936265824156958965517022470991567540, -196130995651152894699893780524080102198821825005995595032755513927455665589696368099, -476495756407818288677233360495147461818251914969556162658261352205437301033645270], [13478428799666913405107324093781948784760829977330947934934830577378621844194445770630942896276875546362376614, -620111668563380170395823947711327705143442295307068765952724390376094244064249407088327943686865723126957760, -161388910566835502346184893738635774857356824422354461405929541813119268956580980244283819576887661037367417, -20451544377259372733656490018967762375094538064249047090373534261141091227661453780021285619891865368041962, -633169803479859854240709167086417172436682169423491422897590971081670840227119718715638198934941041415407, 234645991600116565527973048344757475193344280568427409876428988799573276263038884037808129434764075234966, 71797828155373163443738161529358222850266462286678188294582887514555727258321839225789362967710391752089, -2164288340538342260897993788000776743160864457917024136607713565872982112937178223711502572691109449816, -135029417723774713606241892238327071690200349562167472353683036321310830271394522386216463432059377268, -118701468764941413240188602180101501134197986331814564328716714135121289924069124054077419175118478684, -4006634601793642450797220764576043922377744978129679057270852951016917590852713129883868542129397736, 1011678021523236227272136966159212522100822262885526943407285117452604070265177048867452370605862232, 159014698263644903600913335452120227517742228225522781327638119711553847098500000204191679303248774, -1910894749283405618489416492337290246489801855612018702110168884603822625311697051429784549235416, 102649196852058717409417533509842928683267431256626469107393778178033381309222506980091926922269, -103611023885371127312964316290836053385257625368913522759123569240390958086772013797112911919054, -8990559782167518424533386885591774463538929947469290603829596384607361953327862018584921892881, 101623186412459946350997940425795814257626660137216963671895643059730534925940927636499424670, 123585326892158828326541400728836151578267401094858248480153813250750839863203137518295383403, -798275537550338515634973356895628394960377167077132473942904824107915361763099693696717236], [-7784699191303698932038338433544529129231040713826235065271978848679099270143969557472551166856115811151212803, 801547812700053511124155049522289852830930069426395312278519309614198026568352949952748644568786733147173933, -26909990752243128665539371269701149523997203455537320646968299652803520521690040793205976058207221128836687, 9928067527088693356433548948002968187394832014555583283507214994065844752483031156901006920097923906321709, -689250836795153033185406952685615312856717884402737981339051280343088634963100335088856482175856252626035, -124064124625261261453697354805585552581393006406061016065408821055565899862339753079405626270318256088013, -23312447975585761737799164241033601492080824974075899311078422593130385675324776288475303354364007740936, 251198802959625081148259048104937186265019499562331957860631345990232249478183706755481450489877154218, 48197654997666157062799053390696189047265829266156840173332712054482370041520639893536830385455630760, 54827937242894037307503854416363052082815693242426861194228326532626760116591062887494684925900366420, -1729403247443678760165913903245561628060953989527626734222442059422090304135064042471851185926970244, -512345708802285254371067436076232645157923482418696247226465222957833651046556319105697407845490632, -35408661233968114097444373573881514828582590444775432565425094310482351271934317633531315656267741, 1704722316390445251636429302930705936706849347913602478534124787616779821209308849085329562807779, -62264143288505048127486590525294724234801623869594794152413277115398712799171600299295271276277, 49004408766578276533958416578189537546815622050157639846979090030470597577335761258035980774219, 2017657033818220526194477390879277813069895277212779777474054985109339885312239338322762833875, -332554564241894566996901483159942358897796810945445937908454417958978733214212752428842990759, -35588436449138566345503552975261520871473735315812287112116107860002767868367566102191568116, 894620549071043745972251193043348833292602183815549163427058790150215044164881789783676338], [-159971885048638697113921093788019427398507405225096899546407960472255646564770181578098188770775778845104, -1491848600759773657422772603795875246125594008383324544431551272555680920534656743560390079567661750013682, -22000368101141878570998465510044505145522098918907513208635824345056308761878067559542823918316732529084, -3137502568204468337105488997011469834638804279181894071685408304842793954675409032301045060574717197935, -605743455101841876168592379629542051752596310270249707447506849830978242962155301482158756634717758710, -3908751411253898357496568147339170145206997976296693968873348037710199233147947336422115367759323113, 6910948648372282154277416517522286238009130516263022381945355827520189357459740974297619067303104450, 2009507198289977979233945319077838703860751652987250200061659739025168810203132471083735270364319789, -66069032550320555709402365058389525664844752775643346067680232350877740331920795118062939292452588, -3632523140642992911375505431786292655862477558336262512870058733216255071939308953976424185675024, -3493576284468188885510968029305383220629281667297143280528997842211717647736181489442563611972700, -70221733217081329493287186651272135666216539931428199928012389647338011863953268665050000181204, 32903621324538829516240733593052144928205414121246127574402138888770164792970542411104804087296, 4818324560842645629222720062191682598313542897907857677673350090826773862979071337306929157474, -50432829148637450910103336454698041971823890200107256292707703157027389172606719472158236860, 620004182288838301849570779364768710453523187862325181122821588486846794507738012205174639, -3441261107316162381905254346123855803028809201538591729042576931269148802878640191693433170, -269405096763725045624071490501192551936166762291930678462078706600573489449775281170453267, 6398668607387103623446840326364059102704967578942456776850635479094593100978956600921786, 3840382205021752914258089103405674189060977704318066995683610789798354006926186214378395], [7082720938178225158296753362201216343318098695511565979851692967753562482640301938008399429443398350488339136, 137840091751231932463743211741025179839804482834942072841955411601142821778046205861865675478988373028435539, -83789343117920681425111999357426520192001932356126296105201565609109135253793066394020312207550823923031, -9949010235669307396061564918890559226143632392551862092476139619557696755409003983072561958815341116263602, -1663378573004675164748147198474100814262248847050803381937682298404807800901090198933923653878271412401015, -60110485930563523564896274709445784270128608850452686101159951460275821085396210568496130215617765734604, 18030454181214535778381188665450161687908206788085868426322345923145306493015211514097039120161646327687, 2612326124712727016430172263923724771596345196489583379598645331075999921711594952861472145375934786389, 190534973445467411237137724908059278946831751416398443569019040297742282217620329611249097062324951320, -34436608993884288306682393798248592244102703865840764196221031736386346923954487514615604190304325176, -4928036083521349486827839314993867565926526387329773654164724116485285639779051226005632678766191256, -8502531769716257006590452828759287048300775094858624954599973768216138395382775751506202780899020, 29781142320087730606097389196639500334253749453094703668659579172943690262922275157287797742864676, 3201843526668896765412430251835978363917114584133799023874074769866272374945418430937851083819989, 306033527648731550503385844029901970320113440561113188338592138667267677555479970881426346899695, -10622935322363718028685252141861201169568386651030517202136198790384366878776271485924711996082, -5031223925975913439437700243509850785125017135727735180872927697391899868565995594360866900145, -154721864060287738219212977837371457220913981792711620796024800985366730307815743676191136236, 21288663253515733036131687506660358005907683588583644562959367605151760465262904463383842613, 1263835671889205503100218461872100124081738689763137800308647138450417552943380115178464639], [-38081729045748983679652331405037068358222922303978070812365111274130246310730651211159525785845103782, -426805448466710832335173541972091807876681028173448000076707772892524672477544420546088236115244670, 333346133804512819933764786897502058948564709028505682428584364319316124979288888608015613578593035, 62685821971329628291733001954494589474324215132556331195684487349663996653077083484975585840955394, 3504539396495212506797003123181738542141628646386132913307412342222419258116930714034916090008201, -291546044366139440101366356610220740151542427313452859155536800563738376476868360744815667568874, -163251786413180814948457269430599840239216882134286418217967370642452901443405027607109206340037, -3127431777514343074989033182169708649188735495201969482630375244977439731933136264062586759046, 304642421682850637406396891153711794310361040163172903747548994885713870172334434929375504720, 361403908043112900763419309555444330916859095683969937741124328176998986401761776987460112724, 22401369367760600198811335467074815779469146057337684697737158077583427355658427131218483644, -1950890577691799028499083241006789134371091248569963269636558246683102833652575562036612216, -410215523029461006408041411011637420773741968610795924805132501690255955846413144954834510, -10961712839686950669794435153733687111576185242275543856270300402877045898690032828896426, -957359411500486039309764254534374082098148267650266857538190967770090855243284856002555, 248914841044199531932207267413588176754134627404345592282291107779209416660496955902670, 35066299013474796173843476222680588300691300636956859307388866230528008147030215123195, 603452526917003891781646415591028040251879542323432588683494808323935179010935305254, -275954489943646793914783757043304195459078895622804188912140672245557179268128607879, -4376680949285888261788045070504750581798259021841980706457854924319023511372445662], [-173632778913136897885320337965357529990037228282518556160395831669629935631421871225349863835999898755413, -390147318400773146456983965129065738978616085856455841580041956946952743082136953121615343280634971870075, 18002118255640996853063698718716236149953988534683488093625754115958718453733852227699149467494356577127, 5161628676999811581368973834851512202712670070308236467681795403112101958434453246871809101856267921902, 635986482884718689630790184853380365616270418497813457072426725604235696270425832110246142024851744787, 18919671121460415985772325021054971957019688754504269439022745570726547833407302824918821000641148654, -7618873434385823190588668124146046040828513299618628180018252866554701076622195170700130052614303914, -2156382234418974519746345842282782143955024888180786248580381024731304968946873321712071073823860301, 55900430500907517392687471717286445532788781132256075733751802476452041463398000084155146615637640, 5836973159611683045998407763037542311197055564686824111131581152301860197057984283622146499218840, 3565884413328905896420901978957178556386024791825101052361962190754794304935845844570327720713616, 125460973471061469142471942776598789533315310582246953752407482529868717810571392681877990128616, -31083532521448051782611473327838260824217462780380055796839639724510415245790269389058199950055, -4911643730181746354788331130328439367057193491458582330559355339227821428926304773417452964689, 26714610828921378040448535403427156707966561213487316406039469003277738232882212778046714193, -1363677870798551004271484355692493012962162632316843952394345574141308356957944726186457898, 3174147145156785067675860080729377535622527692124561871270272877354884455512495434677864797, 285418386536391049235374626863726719515856987617364137189506806461052091657163912978195462, -2583458038414056672120566587928242235779645816152466409613417734099270556667525423640874, -3691393407005072865027203386488530011263075404180583114267408788132850390171124149491531], [503384761801650492499395106059522515244772115873007412643228476247614860550121135098486871833261131026074572, -164290723400426566460428161194731229213017771913957633519819542877227292966446478451494007150784812095672319, 20049665067276842026002719121798032877074352106341464430478626449966746048028074424259258411562616475674748, 2767690835298208232161037642154625800422450132150089957347225929469575093169417401384963304456471094960329, 210910304327622252119446839655095918319017531865456069871727803650402005184053865898608135113821103087520, -26262660570777230614643977175249859405769452458529316425205791537696745216723836440193513770959975548051, -2423663934275383077518808181412129801268789355771726543425241135102813269255468468350945649980448070402, -1150641804622400909543330931961448869889183494323176099186836908301396172107026198652131386749763644314, 97988555994722714131961469435844447704171717483832420800851172925557376869314212043152274432570546460, 3258498850891623108339215371014700398525741955215380260419315242168869771370528988783629089655437980, 1348697508284327169266223061608118150556216647890559172508553374658716105014375949362150560421929624, 5236528406817021524361914849935501108437670217936229187397814894438184357957577041610048153400, -15162054410302485921691529237075016204509597059932581830370242748700408660302495367635219954471164, -2833052533982305396255112372934475807162949862347095050289537325576809743438465492138442269758793, 73542716850994614671953416132735315079563089124994122667368233790327267908663716453748199910380, 3145179028903837145750445051484501545886471407112308885698601690210066069502163412364492183299, 1551371244186500042460115886469686008252056612320467456989416249694908040763126370769798103612, 104376807327883918059418119263746607572365169134854350651819748712707790424785707334075992043, 151101386816608553328032907566239141975707988365512521400550959283768327848292955683561590, -2109089120755907900634673629053675354338796117798103240364777261826707926257850644995554198], [22341830359683869886994196777358195781479852079819660251688197299145797289860128279536421710653777770276194153, -355896454267378126573815411253289213633649374943235646695475381983010425907594297660130534294996008057250966, -221440365822603824044398906630021031469227611474492610825347085380281039314335227834098845365257214904885084, -37067469282476532668653129802716797882080406514576145596420853013739293074664770318653717960400641652028573, -1519518036418778259408090993401814812870804873735787465577014915883900519642708775325855076663632639390616, 383471305713913888619482521426178674483087445992369425015489910448558949317988363774055178726081239562271, 110941157502018140935576843931155489246599336363304049208816126368417976572002325410668574697316468761143, -735959609177143056914266399658496404320442651150762465969858228039894613083211305435920416102359635931, -245413786498956206725884848245979268193396806920374342582086680492051764733677689935316099884245202592, -190398078604793175756722582469355369935711597904688283650896105315520199178486413139018530800413056372, -8516033477717571189369360342907389113474678580464067192247942352158487248323931518005937637221261220, 1717582330442677363026509210382581228784808615118344871461264493159614084252910834287161007627911620, 283715218500909325148115805705222140968389079200792346467908147541352696714764455820823783531429695, 2700341222933395500595056760919110432456958529114843984891190860838419609705052470730939731070750, 46645420006005317588089362477933760831890702606174184476186025231712243124791255472843826143600, -175028290750876994697373980997416898257386048520072985313611071549957524271691428688525735370775, -18722242604838250005063327666697055088291470884446332327755283653947852124057639563704112385288, 54640867466995592149928803152447665745706871852035540424152480637502939125773063560113570213, 204194363186553941037889244755291651777473047366042445404503959088519461969946323668663222029, 3804820475998444395773543320640318455572211305834133377267787815354229467480295079736722131], [-20724768658568897755247448218626761602634647310414197402919165144938925023120202966274417975331017721594149152, 1094401580717988176197526317098560951607856385264897656227017559545752084407876266936132269698231346645615944, 59042614411083680529359600608634040275271125813634634268608598808438537462198464363291511158864505767791509, 24323327414192723303717402262678229038276848041047562801162617177570879002748478239056285435545801718044581, 357782421475220750497506985164579395809934315304628502374262835761028860620550329884564621267952579461201, -316033303865793994852465773943591687651795554386385869274503652213449162552550909776640879641340893233825, -72475095209616083161949350758470549481155251714957014053378655015380334308452757994274516987345428764169, 2602381299738576689939290763115783261875134074954829526888003917782900419947027287472046939012100677377, 197899059740189476205193105525663212424412866868600643692065230128144947912235016443726907995063166616, 137323984540614462048684776288940472611165947645359162812298745799245254087144702978314937940429851260, 851880471865672609266452318506889693082883481798552992253575327946149825295516954836465777930569876, -1274371657531984850735869375988870130803963134360230308047505857057762183213332786852985867748119516, -121476428669072353294117167533927161419601222425134561145954133479770857869368283271565321901397572, 3533205816029876052481641763274166350676899234801797143584677466456336665398660289031795851001392, -121315460322849292576038464511385827854241514051041833253875562788294809090182956823836571567369, 117753799530053898184326389359303776703179345896151467703876218152488052657332482498722444675875, 7667352620050160110714775101110368836100509156068953486739639839922782636991575501025752823903, -587018702366431405871144047381715134243437886281598528942154503632501345560681828245072790479, -106420535802571345457772816396805348709672480709721689895847888349006734475577902535547152743, 4002274966063454575739209796379975334598605635793679928675398552330451504654665787347194531], [1436727388783498669393031118758294621451808830519594592719024866651229176251826534152849862580444417, -1764438725882198039309481714415713919739473930273448743935942009959479397170128446949196557288851823, 48701748806542463756096830462330632204405918265187812824274746668319547204960615230133680766849494, 6126784793721345546939548606428595186693297615833061187541187700216870916926966024333307874125788, 2351784635236280919992485763298632949005973189984436472396447656742041382660060323024011762025676, 128698958964762788314440301238905215907158886789482639391157183561567602521412950806843873933664, -22877373768561973781401776828919823590394677680330573906784029623813800064365890614892970052309, -7240750242730253550713777287250374093492271793077178157001952890963927183986791340213240907295, 85971953651481094725353582675902692268031079309955624761670138280792012910220167544787936496, -6942560928927484194682811792355159988013919403335896184174283700459010635301926464751073072, 13139935288306184028308092523788869928526601135476755371625937649229390354277219441487867932, 498113991675244266602986722638165676030217616637211989947872980361943767198325922494020068, -122427526582601580017473865696000747351997777878351135672082162678168771365517279605046125, -16940963066438870030261837858760375709880446795151235411667312218006271952522571453120465, 125784071461699921325438590569391656961622748320749180709781454998072419175278061988290, -24474101359993743524112467243379356551258139078899242926196144936686777552137372501260, 11609792301063782040161926520781602474978745283478276591668764746493509323020179840144, 1205453935436862746023562130059009461503340757760899680584883569157844933312593088580, -22816847662873573831727155740375109592874733469815125117496102715912313221555497607, -14469822571110460461607466609177976883968777805316482014461821219023379802107558809], [-14841412849467467538664534468623565852757561493310001827785230071234260749495770760596167412339148365455258159, 97856579865019186481254828897563689448248984535452362561067445822316650308283998333875934227287715215362673, 147088117013972678237883715218271924398247269501916017667991387053634122919635679908914297894292003029079644, 37965388703993338775686190331191605700067705820735803740899216620432422684185500043780335838020064950078720, 490886250679992282626772633029657055065765968559426327747868762274208209087156292945805421130355061155548, -165770447297538644435145639619317801648129725860914927569239216214016748930745809897199343390200211186352, -97921137105351997646955826459961758487403172094590375066935107242586636586277209189367253558132887182809, -2358741245618637191219116932534608509669013023793827227808415150889042890176831190598033996850016452151, 160158758953286751864463131534291392922992477900992999811241950304198089390777655352620466351243339584, 146234151913540985158712645241315044156707523242587724299808181323000542155246058118466891294589402120, 8860347725582473224839292083361989847361315434123203409947225032775629371852100198582234521934732904, -1005559753479908899908161331780798657981307883339717252407608790052118184663497656690416312777075996, -255904503653991079562651258126870905545611979343195388848461856023891200587557054941082235712628737, -7335917655021087932409221264235290680742516870897003901667547672105231121980108507755522032526217, -83775533869502800561914368947954592959200732443758385415665329774337724880949060110769447074476, 129755043558497923945872465542049023308699101489983079419441502923067399810671792373786584401008, 17110827221517802787597612560156584579163477955278667464970717014042938951823686469114559759108, 420123428111944025581861343314017569814376698149637445054869188066758957553513341989751345916, -170036008811932928569043388497448609483678278681894532695374874459596506909517486306354940207, -8538155190560247473748590200076118261461293070633928115643490993738649991371088934716085953], [-7984664872656378014132313391499431093495110822758403579436328009992645485602906590384179402472061484450950628, -1318283365568583556469766601022621748909710313753644115500010527163264175496861038963106888852360113878951492, 71636633246171745825168614000181536349709957064416810068161706425431116706848790447058746168784675324055255, 21660243841269411399969960062250383151456315878637774604228864658923177654743908819394946009802575162964412, 2357217788725487470261597500422131079559854228585537866635418653799490186291195211843442130055437574070631, -21325783285508072367872647840976406153663651526207328602433906218124761614701989971652416495642107664212, -47355682857488522822700142383846187101774553468669084683698597927172328744652005686445329645332142309461, -5771560626351473862095062002548952781852316968816142376264468020777616420713229526434357588428284522042, -40661813633430981923321391314875790546876704008772648269260100604282132782243741499032228351817903836, 76179119024163537353437739968480730250098269853793753442183869298190023085173879101694677055774833180, 14794648182953198746642412497566865136921307510509128068539513786236351861253385417832323595498315076, 116427022548140327840690774295819430410180749358554316898087300165269489269697353247481551492090016, -142253222219169361006909609412382878510086702227121292502649230786154120286952482012159951400559688, -12824487611646507643988380809384312367812296120319407984194810988029785937980694411005895907678836, -368251979331246634137739190416454387462526454863792543252754460443304061854030630851935038877891, 18237493759342375076792537016214337609065303860804514864414016428725231701530453954860005574804, 14076272106801783031003800108689622640665393829583736144635884891456442652492346674415878939341, 964473296662523800688899996136247489453238591004248765940880335328242445101605286420603790496, -53653919627661527836118635685601178133737477897709508204687641984226257023743131832790275239, -8724805854573720004016506291057032990193772681436687872435212800590458867182203740016851666], [-8992784843484192314214079956971088821571648790206527695377892165719580578219339954736796653553211027935839413, -416485513823167627166876721109685159180342966604633735389885672001375985942101966880898976271780856055085683, 110190409887084249866587892149491557507157587238113772015860614027903469019885930832016276354054329372209588, 15705597790820681404304144758014741361460285545246380758518227213274526400949606890736869349639216956984144, 1269116040513909841532422681907546441730155534474695209724623660241869814509588869569244172539901704802758, -112531624541010327318995252920756907377538645333174294699233908429924339522308979048862196874305340247072, -49351001427464167162082460911712488372050039559132549680875316544659045008900649625928151136114726392611, -2135765132062441932392011823044859205383661915648367962620812750112680117854336024673125262897996034579, 98198669929143753584908857238103652217382320033883638482064361642089494075709138620745042069228130772, 74662217350415013082063026555343566877488436052094030018639651548930925758998130964277245680602007376, 6021400634665982374708472211063851726979779640942859330595687982692199679978415772852592060467906344, -541015772942574139678464713231245332524662459284496346332898011523826676487231658590961429815269204, -119951734179397781999776816240813693038955955429087882428211381483513993719616522121967062652423743, -4404272259294620215326457605537417946652629809294142748365074266407379891771878511770370198814581, -48912348239220106448773419179540136093190384791136629035809825447101356126047134703435653847752, 61949363892295015314413293444694956999593539459680800233707795487303602404387121104570948446976, 9061536774136849477517344444209135925043290234306477674906241431030384067231162831507137502202, 144385394626299308732067652415530584936174317769030126546432309532400746010164653893702102012, -79842660072692005397204562703866526468525588100613034946287093563095901526867778745775503609, -3305609115962840929464096348734008151241393542408657280109259975483034253702544177574089885], [31504829571595076172457860156873359849986015166895099763666719733214766368020175580988321751620563, 26017605894562286673320837329833295272984766747171428937073015231293054233842984950173057019664685, -635155885273579535879016932898213760964169494046862896710397883655931478127596072825743335235777, -256576310911152712517637414170136753389927278708979017621132292183529340462419297626022384376252, -34783166150286250135408963367877127350899853999679729856202807211870122661933287865260247746033, -2417049849472614412250265148755531073390024491822847516796737888835915031312715207009982662144, 433635755842830200601427543402527710506795639980433157949697294519132629837893033277826150962, 103487143042251515334683044033639165212371772078431008154674589308260423785204468006980231583, -608373691998148511663724876529591955132195364421381260478858824167457328645489261910835528, -300971753119337085382522673106955702278068200554147878056212781047493739349601897931024812, -189951931588192914788760600962806170904529477338042150139488887541876449449910581190514704, -8326347494385640343745316206512405790026422571139293403830965232723145547068468275192668, 1567491925944322409958789020637238132825327227486418114763605966340883161062972505558457, 227128808648139658664814000318572675569247931294897482103626792991949545521968122082115, 1159237582766190033442645514658811465715599920098810331358145254918738633412544972873, 175341160830741189812131244120945296266145084990575494396346962232394578010600997252, -158373075543823394556113111122689011011896893512387999328133730421841413249703506223, -16683407457641055826681473979421570269302322903979402026481118699384240244699660000, 204003697541838946487893022621360801985094540403039924543463104916905526385228338, 172046609980168497929015321289281302014427984276033480841101643789199154054324229], [-137150530099605913594838292925126859257921409586283020067111987461636429943446563356812964808034283233129690, 202196775293622612042793640724695003102477956824146241387538910135369775059480980263311627664533923739026461, 2832305652626659592192662517288376587932738714185826703399606463332120172895941353273807261863215639160365, -774843950007976296322307448490714653957985358522706937469382465396415528120946418637437138790487587015470, -392739169113161702579495105571167845233645172918831350553194749647803900267446567625958111196871592793247, -12461417889207467286878540665759561340477647740962449928533447114028514478058399545919519440581719641040, -155943662689596394738134089811304176252920569413159341316786860794089492522819598655301833449165188285, 919656846618131138881556399405302753629600418185944211807094638632814049360282762821899294398214656055, -11802425206001149418730435193265094257724390982186589949295771597944767902996343719160576639684361180, 2371743128088923975282433160339395142163572008608057880360673457214548963672034398799880793082149544, -1528242854237642911271652225953978186541584536099569702460587494370609483394863926293127914472571972, -86040090053043518657500761740940259172606890574976482359832261699504738731693345470306623929059644, 4471623554896315637707443711896273583681193698651795956947431628443414683756464306130484351394662, 1895946567166979988591921446680491784925000596626038478015135056277439241737052948850402308858603, -303137874923556278059192282338001611354319975689544641108614458561409103181853398575964010001, 6154680526364316360326446467483061887764579350313261827806270473116493945197195319060981201010, -948378783272316156812257764267633300888640578391323013132933262027376200224523135313868937781, -117872437568790880164235264600531363229232818718890513673076971680462911205505221044366165184, -4602203143470124045851916874678666120118790719521573333922418069242812844717939760551520935, 1250868715915132369999428609944726538183877715768688464591839704960514470872820266534958581], [7468642251895276499240765687324491609715759913165046814347076737004956787749325628541190311493448516598892223, -976989710956900382182934038854568030183136432900515821686545771352957566518386633176011031905374594352355263, -88561001637901564813005402899058427586618551084362031979892431354054304193733848643675238817933332695883705, -6316382140893423969457283252737227537521409883598255298270282671311887012736622161575017494053419106507168, 507131019833490313365786223008030812424349635227725040939338792559181487623747828096062340767944888880911, 267766640391613006429462212689157894932361697011247187492227227341101558447206175536483092338857056439212, 26090243948273085462263681956185542564343200449457506501539650683329384812784337634489747433637137125424, -3264293946313361632985538054202072023093113650528260950856221498950270823837780370508666060523072041373, -94492209889454504913897248681926430233006626844088647107175988070356879401013978623734902454798025740, -65402540400085510536343490077099988534295408446354420934309380271362384729366242185123971777866862676, 3447039616805505117762754351993126388247718611210147792790327197906314568277761436934984865074777548, 1080449854427351389690381632581508042378071001129783379688704963711518921215795714092335929246452508, 47633412886758170949274961362490179272269013815566658121498815471750762965390539373177743106091589, -6856142255804671356853630309886050005069614311347648896969466258744790763946742187551834863061241, -75188832016987235088616310130999916245442385743900509263946663338091173635861333602164090329683, -75700059229164218846588631929196879097932855606448024689379804082151871335248393999655528176808, -1959662242520249138432685069460497588381115685933421839732326188052081725035120528363304048539, 706189695165115292016331210756194409385109592085465653336795989016021785858049690690336434116, 74382580440115859558935040388587359129219578964811537521346957339858655197226111002541044940, -4617293281565814301068423067148699046727768254216396487969153665285514543597410062110102607]];
    Rf_basisdens := [1, 61711933822572024545674953188090999755517284713501583804818609778188, 3856733280034418908212077320123591205687127803371980198234287297791130946979800984936, 233845182431161260536491282350988672589218919827687807720747507459705278798560044536783512266226148, 148309112476081352387927930140321755072211219991423573403791770088503567785379191749124723973315551655330632, 148309112476081352387927930140321755072211219991423573403791770088503567785379191749124723973315551655330632, 610325565745190750567604650783217099062597613133430343225480535343636081421313546292694337338747126153624, 148309112476081352387927930140321755072211219991423573403791770088503567785379191749124723973315551655330632, 467690364862322521072982564701977345178437839655375615441495014919410557597120089073567024532452296, 305162782872595375283802325391608549531298806566715171612740267671818040710656773146347168669373563076812, 148309112476081352387927930140321755072211219991423573403791770088503567785379191749124723973315551655330632, 148309112476081352387927930140321755072211219991423573403791770088503567785379191749124723973315551655330632, 148309112476081352387927930140321755072211219991423573403791770088503567785379191749124723973315551655330632, 467690364862322521072982564701977345178437839655375615441495014919410557597120089073567024532452296, 148309112476081352387927930140321755072211219991423573403791770088503567785379191749124723973315551655330632, 148309112476081352387927930140321755072211219991423573403791770088503567785379191749124723973315551655330632, 49436370825360450795975976713440585024070406663807857801263923362834522595126397249708241324438517218443544, 1924651707252356053798282159267396482215793578828706236384753147816504352251523000302744956923672, 13482646588734668398902539103665614097473747271947597582162888189863960707761744704465883997574141059575512, 49436370825360450795975976713440585024070406663807857801263923362834522595126397249708241324438517218443544];
    Rf_basisnums := ChangeUniverse([[z : z in elt] : elt in Rf_num], Kf);
    Rfbasis := [Rf_basisnums[i]/Rf_basisdens[i] : i in [1..Degree(Kf)]];
    inp_vec := Vector(Rfbasis)*ChangeRing(Transpose(Matrix([[elt : elt in row] : row in input])),Kf);
    return Eltseq(inp_vec);
end function;


// To make the character of type GrpDrchElt, type "MakeCharacter_42_h();"
function MakeCharacter_42_h()
    N := 42;
    order := 6;
    char_gens := [29, 31];
    v := [3, 4];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_42_h_Hecke();"
function MakeCharacter_42_h_Hecke(Kf)
    N := 42;
    order := 6;
    char_gens := [29, 31];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..prec]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 5;
    raw_aps := [[0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, -1, 0, 1, 0, 0, 0, 0], [6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0, -1, 0, -4, -7, -2, 0, 0, 0, -1, 4, 0, -1, 1, 0], [-16, -1, 1, 2, 3, -2, -2, 1, 0, 1, -2, -2, -2, 5, 2, 0, 2, -2, -2, 2], [-2, 2, -2, 8, 6, 0, -3, -2, 2, 3, 7, -2, 2, 0, -2, -2, 0, -3, 0, 0], [-10, 5, -107, 3, -8, 2, 10, -10, 0, 0, 7, 5, 0, 2, 0, 0, 0, 5, 2, 0], [-4, -49, -4, 4, 6, 2, -9, -4, 0, -51, 35, 2, -4, 33, 0, 8, 0, 2, -6, 0], [4, -76, 4, 8, 0, 14, -8, 4, 17, 4, -8, -8, -6, -30, -14, 0, 0, -13, 4, 0], [-12, -3, -29, -8, 15, 0, -21, 3, 0, 18, -37, -14, -6, 0, 6, 0, 0, -21, 0, -17], [14, 21, -275, 7, 0, -14, -42, 14, 0, 28, -105, -7, 0, -98, 0, 0, 0, -7, -14, 0], [-8, 160, -8, -16, 0, 6, 16, -8, 12, -8, 16, 16, -22, -66, -6, 0, 0, -12, -8, 0], [-326, 15, 11, -66, -11, 22, -22, 11, 0, 11, -22, -22, 22, 13, -22, 0, 18, 4, 22, 18], [-28, 227, -28, 28, 42, -28, 25, -28, 0, 213, -47, 14, 14, -61, 0, 42, 0, 14, 0, 0], [36, -36, 36, -144, -108, 0, 28, 36, 27, 53, 17, 36, -36, 0, 38, -27, 0, 28, -2, 0], [-12, 12, -12, 48, 36, 0, 49, -12, 34, 97, -116, -12, 12, 0, 9, -34, 0, 49, -21, 0], [-140, 31, 1540, 98, -98, -28, 109, -70, 0, -39, 89, 70, 0, 19, 0, 0, 70, 70, -28, 0], [-1246, -9, -1250, 79, 157, 0, -28, 9, 0, 19, 3, 5, -74, 0, 74, 0, 0, -28, 0, -4], [12, -1100, 12, 24, 0, -20, -24, 12, -86, 12, -24, -24, 44, -60, 20, 0, 0, -54, 12, 0], [-2388, 17, -2374, -55, -121, 0, 114, -17, 0, -97, 259, -3, 52, 0, -52, 0, 0, 114, 0, 14], [-124, 34, -1597, 28, -23, 34, 85, -57, 0, -28, 113, 62, 0, 51, 0, 0, 67, 62, 34, 0], [-12, -304, -12, -24, 0, -89, 24, -12, 52, -12, 24, 24, 65, 303, 89, 0, 0, 160, -12, 0], [-68, 1671, -68, 68, 102, -48, 153, -68, 0, 1637, -59, 34, 14, -93, 0, -210, 0, 34, -20, 0], [5067, 178, 27, 106, 107, -80, -54, 27, 0, 27, -54, -54, -80, -378, 80, 0, 118, 151, -80, 118], [8, -8, 8, -32, -24, 0, 115, 8, -116, -2527, -501, 8, -8, 0, -48, 116, 0, 115, 56, 0], [326, -83, 337, -91, 56, -72, -208, 128, 0, 80, -277, -163, 0, -114, 0, 0, -198, -163, -72, 0], [0, -243, 0, 0, 0, -101, -171, 0, 0, -243, 274, 0, 101, 274, 0, 138, 0, 0, 101, 0], [-3018, -133, -3058, 3, -47, 0, -20, 133, 0, -113, 23, 93, 90, 0, -90, 0, 0, -20, 0, -40], [68, -1092, 68, 136, 0, 70, -136, 68, 212, 68, -136, -136, 66, -706, -70, 0, 0, -256, 68, 0], [-5698, -546, 22, 100, 94, -72, -44, 22, 0, 22, -44, -44, -72, 1240, 72, 0, -163, -568, -72, -163], [48, 4017, 48, -48, -72, 325, 37, 48, 0, 4041, -468, -24, -301, -444, 0, 514, 0, -24, -277, 0], [-178, 178, -178, 712, 534, 0, 121, -178, 214, 1319, -369, -178, 178, 0, -42, -214, 0, 121, -136, 0], [2138, -235, -223, -150, -521, 298, 446, -223, 0, -223, 446, 446, 298, 747, -298, 0, -128, -12, 298, -128], [8, 13, 8, -8, -12, 332, -325, 8, 0, 17, 1099, -4, -328, 1103, 0, 180, 0, -4, -324, 0], [-6340, 348, -6029, -229, -732, 0, 504, -348, 0, -156, 661, -37, 192, 0, -192, 0, 0, 504, 0, 311], [-3812, 180, -3560, 228, 132, 0, 333, -180, 0, -153, 723, 72, -156, 0, 156, 0, 0, 333, 0, 252], [716, 167, 9436, -294, 166, -64, -755, 230, 0, 525, -1511, -358, 0, -1153, 0, 0, -486, -358, -64, 0], [268, 2100, 268, 536, 0, 254, -536, 268, -502, 268, -536, -536, 282, -258, -254, 0, 0, -606, 268, 0], [424, 10329, 424, -424, -636, -236, -329, 424, 0, 10541, -869, -212, 448, -657, 0, 136, 0, -212, 660, 0], [-60, 60, -60, 240, 180, 0, 543, -60, 804, 6117, -1229, -60, 60, 0, -344, -804, 0, 543, 284, 0], [11210, 33, 373, -542, 475, -102, -746, 373, 0, 373, -746, -746, -102, -305, 102, 0, -52, -340, -102, -52], [276, -5165, 276, -276, -414, -184, -349, 276, 0, -5027, -43, -138, 322, 95, 0, -60, 0, -138, 460, 0], [9923, 398, 9869, -336, -166, 0, -222, -398, 0, 620, -894, -452, -116, 0, 116, 0, 0, -222, 0, -54], [-248, -12476, -248, -496, 0, -498, 496, -248, 28, -248, 496, 496, 2, 374, 498, 0, 0, 548, -248, 0], [-26108, -456, -26372, 170, 412, 0, -499, 456, 0, 43, -799, 192, 22, 0, -22, 0, 0, -499, 0, -264], [-2414, -228, -28, -264, -188, 160, 56, -28, 0, -28, 56, 56, 160, 244, -160, 0, -300, -200, 160, -300], [-20940, -389, 589, -46, 1155, -566, -1178, 589, 0, 589, -1178, -1178, -566, -281, 566, 0, -441, -978, -566, -441], [180, -180, 180, -720, -540, 0, 263, 180, 756, -4307, 376, 180, -180, 0, 229, -756, 0, 263, -49, 0], [-1398, 327, -24671, 385, -560, 314, 1246, -874, 0, -372, 1605, 699, 0, 906, 0, 0, 524, 699, 314, 0], [-332, -11673, -332, 332, 498, -518, 1061, -332, 0, -11839, -1893, 166, 352, -2059, 0, -646, 0, 166, 186, 0], [264, -11944, 264, 528, 0, 618, -528, 264, -1476, 264, -528, -528, -90, -366, -618, 0, 0, -1084, 264, 0], [-1545, -71, -1977, -243, 307, 0, 453, 71, 0, -524, 1980, -361, -118, 0, 118, 0, 0, 453, 0, -432], [-236, 4888, -236, -472, 0, -803, 472, -236, 948, -236, 472, 472, 331, 2509, 803, 0, 0, 1656, -236, 0], [140, 12267, 140, -140, -210, 672, 117, 140, 0, 12337, -2683, -70, -602, -2613, 0, 2514, 0, -70, -532, 0], [434, -434, 434, -1736, -1302, 0, 127, 434, 396, -4953, 261, 434, -434, 0, -188, -396, 0, 127, 622, 0], [-108, 108, -108, 432, 324, 0, 418, -108, 757, 193, -1231, -108, 108, 0, -626, -757, 0, 418, 518, 0], [62, 1714, -15466, 421, -215, -452, -1982, 237, 0, 1745, -5893, -31, 0, -5862, 0, 0, 175, -31, -452, 0], [39728, -199, 40622, 667, -653, 0, 58, 199, 0, -257, -947, 1093, 426, 0, -426, 0, 0, 58, 0, 894], [268, 3508, 268, 536, 0, 334, -536, 268, 1714, 268, -536, -536, 202, 3390, -334, 0, 0, 1322, 268, 0], [-144, 689, 446, -545, -1581, 0, -514, -689, 0, 1203, -3267, -99, 446, 0, -446, 0, 0, -514, 0, 590], [212, 11388, 212, 424, 0, 828, -424, 212, 561, 212, -424, -424, -404, -5304, -828, 0, 0, -2069, 212, 0], [35894, -511, -295, -726, -953, 658, 590, -295, 0, -295, 590, 590, 658, -153, -658, 0, -1172, -216, 658, -1172], [-646, 646, -646, 2584, 1938, 0, -2775, -646, -1502, -6921, 5853, -646, 646, 0, -324, 1502, 0, -2775, -322, 0], [924, -1558, 7435, 1266, -1318, -1728, 686, 410, 0, -1096, 1612, -462, 0, 2074, 0, 0, -514, -462, -1728, 0], [80, -1787, 80, -80, -120, -12, 26, 80, 0, -1747, 875, -40, 52, 915, 0, -1245, 0, -40, 92, 0], [-3218, 2993, 12597, -617, -926, 2226, 1768, -3152, 0, 1384, -383, 1609, 0, -1992, 0, 0, 66, 1609, 2226, 0], [-53425, 2991, -872, 460, -1514, 642, 1744, -872, 0, -872, 1744, 1744, 642, -5999, -642, 0, 1166, 3863, 642, 1166], [-136, 136, -136, 544, 408, 0, 2155, -136, -960, 7521, -5933, -136, 136, 0, 1628, 960, 0, 2155, -1764, 0], [48166, -3790, 478, 1212, 1562, -1084, -956, 478, 0, 478, -956, -956, -1084, 6610, 1084, 0, -1838, -4268, -1084, -1838], [-10, 10, -10, 40, 30, 0, -769, -10, 1584, -9037, 3493, -10, 10, 0, -388, -1584, 0, -769, 378, 0], [-300, 5431, -300, 300, 450, -1246, -1287, -300, 0, 5281, 6007, 150, 1096, 5857, 0, -2342, 0, 150, 946, 0], [-84814, 1055, -83413, 1292, 837, 0, -1603, -1055, 0, 2658, -6319, 346, -946, 0, 946, 0, 0, -1603, 0, 1401], [2170, -2313, 56561, 849, -644, -1934, -62, 1290, 0, -1228, 1545, -1085, 0, 2630, 0, 0, -880, -1085, -1934, 0], [-8616, -1737, 585, -1822, 259, 326, -1170, 585, 0, 585, -1170, -1170, 326, 5077, -326, 0, -230, -2322, 326, -230], [1140, -18733, 1140, -1140, -1710, -74, -3093, 1140, 0, -18163, 3155, -570, 644, 3725, 0, 2060, 0, -570, 1214, 0], [604, -604, 604, -2416, -1812, 0, -1989, 604, -2876, -14807, 2951, 604, -604, 0, -744, 2876, 0, -1989, 1348, 0], [1246, -651, 102373, -1265, 1754, 642, -1084, 1112, 0, -28, 237, -623, 0, 860, 0, 0, -134, -623, 642, 0], [940, 27963, 940, -940, -1410, -272, 1095, 940, 0, 28433, -3475, -470, 742, -3005, 0, -3372, 0, -470, 1212, 0], [-30061, 1118, -27733, 1334, -870, 0, 3032, -1118, 0, -1914, 5774, 1210, -124, 0, 124, 0, 0, 3032, 0, 2328], [-260, 13816, -260, -520, 0, -666, 520, -260, 3072, -260, 520, 520, 146, 3798, 666, 0, 0, 2772, -260, 0], [1434, 2821, -991, 1098, -1433, 442, 1982, -991, 0, -991, 1982, 1982, 442, -8005, -442, 0, 8, 3812, 442, 8], [-814, 814, -814, 3256, 2442, 0, 2737, -814, 450, -12573, -8875, -814, 814, 0, -300, -450, 0, 2737, -514, 0], [39424, -1665, -463, -2142, -1997, 1534, 926, -463, 0, -463, 926, 926, 1534, 6853, -1534, 0, 162, -1202, 1534, 162], [-270, 680, 65370, -509, -1389, 644, 1488, -2033, 0, 545, 907, 135, 0, 772, 0, 0, -1763, 135, 644, 0], [-1456, 477, -1456, 1456, 2184, 989, 4223, -1456, 0, -251, -4924, 728, -1717, -5652, 0, -1660, 0, 728, -2445, 0], [-1004, 7444, -1004, -2008, 0, -148, 2008, -1004, 8498, -1004, 2008, 2008, -1860, -2916, 148, 0, 0, 2914, -1004, 0], [-900, -4710, 56491, -746, 256, 1196, 6100, -940, 0, -5160, 17166, 450, 0, 16716, 0, 0, -40, 450, 1196, 0], [644, -19888, 644, 1288, 0, -434, -1288, 644, 1868, 644, -1288, -1288, 1722, 470, 434, 0, 0, 280, 644, 0], [-191356, 2487, -4099, 5066, -5665, 1566, 8198, -4099, 0, -4099, 8198, 8198, 1566, -931, -1566, 0, 2482, 6586, 1566, 2482], [3728, -33759, 3728, -3728, -5592, 1192, -6833, 3728, 0, -31895, 10127, -1864, 672, 11991, 0, -1484, 0, -1864, 2536, 0], [-702, 702, -702, 2808, 2106, 0, 2023, -702, 4196, -6189, -1947, -702, 702, 0, 628, -4196, 0, 2023, -1330, 0], [-99118, 1871, -100459, -3794, -3035, 0, -305, -1871, 0, 2176, -2027, -3212, 582, 0, -582, 0, 0, -305, 0, -1341], [-1752, 26396, -1752, -3504, 0, 51, 3504, -1752, -3450, -1752, 3504, 3504, -3555, -3621, -51, 0, 0, -622, -1752, 0], [4474, -1517, 91217, -767, 2484, -1470, -4674, 3954, 0, 720, -5347, -2237, 0, -3110, 0, 0, -520, -2237, -1470, 0], [744, 49960, 744, 1488, 0, 4454, -1488, 744, -1854, 744, -1488, -1488, -2966, 3998, -4454, 0, 0, -1514, 744, 0], [-760, -76779, -760, 760, 1140, -1458, 2280, -760, 0, -77159, -10135, 380, 1078, -10515, 0, 4497, 0, 380, 698, 0], [-554, 554, -554, 2216, 1662, 0, -77, -554, -6540, 85375, -8299, -554, 554, 0, -1436, 6540, 0, -77, 882, 0], [3458, 1399, 83425, -727, 4412, -1002, -8542, 5414, 0, 3128, -14071, -1729, 0, -12342, 0, 0, 1956, -1729, -1002, 0], [3206, 6177, -184435, -4797, 2786, 3194, -7372, -408, 0, 7780, -18135, -1603, 0, -16532, 0, 0, -3614, -1603, 3194, 0], [-63294, -390, -406, 6964, 2670, -3076, 812, -406, 0, -406, 812, 812, -3076, 8754, 3076, 0, 5330, 16, -3076, 5330], [-1412, 1412, -1412, 5648, 4236, 0, -5016, -1412, -12569, -21719, 1195, -1412, 1412, 0, 128, 12569, 0, -5016, -1540, 0], [904, -904, 904, -3616, -2712, 0, -1589, 904, 5480, 47117, 7624, 904, -904, 0, -3527, -5480, 0, -1589, 4431, 0], [-1108, 22615, -1108, 1108, 1662, -1254, -4483, -1108, 0, 22061, 8711, 554, 700, 8157, 0, 7362, 0, 554, 146, 0], [-150406, 895, -149628, -1363, -3387, 0, 7810, -895, 0, -6915, 20511, -117, 1246, 0, -1246, 0, 0, 7810, 0, 778], [-207037, 1134, -204719, 1876, 250, 0, 2318, -1134, 0, -1184, 4194, 1184, -692, 0, 692, 0, 0, 2318, 0, 2318], [792, -35732, 792, 1584, 0, 323, -1584, 792, -8270, 792, -1584, -1584, 1261, 1555, -323, 0, 0, -3138, 792, 0], [-1260, -74949, -1260, 1260, 1890, 3388, 6177, -1260, 0, -75579, -6179, 630, -4018, -6809, 0, -4554, 0, 630, -4648, 0], [1410, -1410, 1410, -5640, -4230, 0, 7241, 1410, 15570, -23465, -7825, 1410, -1410, 0, -3082, -15570, 0, 7241, 4492, 0], [-11987, -197, -3886, 11000, -2272, -1614, 7772, -3886, 0, -3886, 7772, 7772, -1614, 12645, 1614, 0, 6834, 3689, -1614, 6834], [-2300, 1770, -303293, 2740, -3571, -1590, 1361, -1981, 0, 620, -2619, 1150, 0, -3769, 0, 0, 319, 1150, -1590, 0], [178754, -9986, 169590, 438, 9218, 0, -9835, 9986, 0, -151, -10739, 822, 384, 0, -384, 0, 0, -9835, 0, -9164], [272, 3576, 272, 544, 0, -5002, -544, 272, -7088, 272, -544, -544, 5546, 12190, 5002, 0, 0, 3096, 272, 0], [5186, 4887, 6784, -4223, -6755, 0, 9518, -4887, 0, -4631, 21135, -3289, 934, 0, -934, 0, 0, 9518, 0, 1598], [141250, -2073, -1657, -6306, -6467, 4810, 3314, -1657, 0, -1657, 3314, 3314, 4810, 5803, -4810, 0, -2613, -416, 4810, -2613], [550, -550, 550, -2200, -1650, 0, -361, 550, 4880, -3773, 10063, 550, -550, 0, 3550, -4880, 0, -361, -3000, 0], [-250900, 3309, -3093, 3366, -4503, 1410, 6186, -3093, 0, -3093, 6186, 6186, 1410, -549, -1410, 0, 3984, 6402, 1410, 3984], [-158, 158, -158, 632, 474, 0, 3709, -158, -6882, 75487, -10471, -158, 158, 0, 7696, 6882, 0, 3709, -7854, 0], [-4000, 53933, -4000, 4000, 6000, -6092, 982, -4000, 0, 51933, 13587, 2000, 4092, 11587, 0, -8625, 0, 2000, 2092, 0], [1088, 41796, 1088, 2176, 0, 1510, -2176, 1088, 9952, 1088, -2176, -2176, 666, -40602, -1510, 0, 0, -11808, 1088, 0], [176996, -5211, 169702, -2997, 3383, 0, -5186, 5211, 0, -25, -3967, -2083, 914, 0, -914, 0, 0, -5186, 0, -7294], [170873, 8029, -5184, -988, -10862, 5678, 10368, -5184, 0, -5184, 10368, 10368, 5678, -7249, -5678, 0, 5580, 13213, 5678, 5580], [952, 56369, 952, -952, -1428, -378, 9502, 952, 0, 56845, -30047, -476, 854, -29571, 0, -2169, 0, -476, 1330, 0], [3780, -3780, 3780, -15120, -11340, 0, 3739, 3780, -11952, -17455, -14950, 3780, -3780, 0, 4439, 11952, 0, 3739, -659, 0], [-9638, 8147, -234687, 7189, -8498, -2370, 2800, -6128, 0, 3328, -11045, 4819, 0, -15864, 0, 0, 3510, 4819, -2370, 0], [1640, 8336, 1640, 3280, 0, 1986, -3280, 1640, -17683, 1640, -3280, -3280, 1294, 8878, -1986, 0, 0, -5237, 1640, 0], [16748, -1069, -4892, -2994, 4672, -5380, -17357, 10052, 0, 7305, -28973, -8374, 0, -20599, 0, 0, -6696, -8374, -5380, 0], [-7044, 19939, -7044, 7044, 10566, -2766, 5915, -7044, 0, 16417, -9549, 3522, -756, -13071, 0, 13692, 0, 3522, -4278, 0], [-44830, 8888, -3148, 6288, -3152, 4, 6296, -3148, 0, -3148, 6296, 6296, 4, -23046, -4, 0, 1807, 12036, 4, 1807], [5342, -5619, -409915, 2895, -118, -5566, -2500, 5448, 0, -2948, 501, -2671, 0, 3172, 0, 0, 106, -2671, -5566, 0], [33004, 2693, 33116, 4173, 10815, 0, -2392, -2693, 0, 5085, -3227, -2581, -6754, 0, 6754, 0, 0, -2392, 0, 112], [64, -42352, 64, 128, 0, -1498, -128, 64, 9918, 64, -128, -128, 1626, 18686, 1498, 0, 0, 9970, 64, 0], [-7932, 618, 135507, -4264, -7237, 8230, 18815, -15467, 0, -3348, 29775, 3966, 0, 25809, 0, 0, -7535, 3966, 8230, 0], [253072, 454, -468, -10368, -6120, 5652, 936, -468, 0, -468, 936, 936, 5652, -1730, -5652, 0, -3010, 922, 5652, -3010], [-2972, 41727, -2972, 2972, 4458, -5728, -3955, -2972, 0, 40241, 12121, 1486, 4242, 10635, 0, 4418, 0, 1486, 2756, 0], [-228241, 8415, -4360, 9260, -4090, -270, 8720, -4360, 0, -4360, 8720, 8720, -270, -30511, 270, 0, -2498, 12775, -270, -2498], [-3296, 3296, -3296, 13184, 9888, 0, -4829, -3296, 22060, 48897, 32279, -3296, 3296, 0, -972, -22060, 0, -4829, -2324, 0], [398294, 3730, 400518, 4062, 7406, 0, 5165, -3730, 0, -1435, 15109, -1506, -5568, 0, 5568, 0, 0, 5165, 0, 2224], [-2568, -102664, -2568, -5136, 0, 4236, 5136, -2568, 471, -2568, 5136, 5136, -9372, -30456, -4236, 0, 0, -8839, -2568, 0], [-1750, 1750, -1750, 7000, 5250, 0, -13361, -1750, -17912, -51913, 16349, -1750, 1750, 0, -4072, 17912, 0, -13361, 2322, 0], [-121118, -6146, -2714, 17980, 3562, -6276, 5428, -2714, 0, -2714, 5428, 5428, -6276, 8894, 6276, 0, -1634, -3432, -6276, -1634], [3808, 65329, 3808, -3808, -5712, 9110, 1438, 3808, 0, 67233, -7043, -1904, -7206, -5139, 0, -1489, 0, -1904, -5302, 0], [-180928, 7308, -174788, 4562, 4152, 0, 4953, -7308, 0, 2355, 7141, -1168, -5730, 0, 5730, 0, 0, 4953, 0, 6140], [948, -178784, 948, 1896, 0, 6983, -1896, 948, 11034, 948, -1896, -1896, -5087, -14137, -6983, 0, 0, -4310, 948, 0], [-165166, -3441, -170906, 827, 9693, 0, -10680, 3441, 0, 7239, -19733, -2299, -3126, 0, 3126, 0, 0, -10680, 0, -5740], [1480, -34792, 1480, 2960, 0, 1914, -2960, 1480, 19978, 1480, -2960, -2960, 1046, 11666, -1914, 0, 0, 8430, 1480, 0], [-336848, 1205, 3335, -22322, -4491, 7826, -6670, 3335, 0, 3335, -6670, -6670, 7826, 9395, -7826, 0, 2592, -2130, 7826, 2592], [934, -934, 934, -3736, -2802, 0, -37, 934, -4644, -229353, 1171, 934, -934, 0, 4770, 4644, 0, -37, -3836, 0], [23032, -12031, -662760, -7388, 8128, -4128, -11741, 12256, 0, -515, -3323, -11516, 0, 8193, 0, 0, -10776, -11516, -4128, 0], [-5380, -183157, -5380, 5380, 8070, -5494, 4799, -5380, 0, -185847, -11685, 2690, 2804, -14375, 0, 10624, 0, 2690, 114, 0], [-4856, 7749, 76688, -1620, 19024, 4048, -20297, 14976, 0, 5321, -29319, 2428, 0, -31747, 0, 0, 19832, 2428, 4048, 0], [-1508, 115932, -1508, -3016, 0, 1754, 3016, -1508, 24978, -1508, 3016, 3016, -4770, -15214, -1754, 0, 0, 4178, -1508, 0], [251452, 12183, 6773, 570, 13831, -7058, -13546, 6773, 0, 6773, -13546, -13546, -7058, -49235, 7058, 0, -2814, 5410, -7058, -2814], [4436, 291479, 4436, -4436, -6654, 2470, -221, 4436, 0, 293697, -23949, -2218, -252, -21731, 0, 11556, 0, -2218, 1966, 0], [-38512, -11591, -57600, -12963, 659, 0, -15376, 11591, 0, 3785, -20915, -7497, 5466, 0, -5466, 0, 0, -15376, 0, -19088], [-4476, -8540, -4476, -8952, 0, -6516, 8952, -4476, 9918, -4476, 8952, 8952, -2436, 16212, 6516, 0, 0, 15358, -4476, 0], [-11978, 13933, -250159, -5387, 1548, 11376, 1884, -9828, 0, 7944, -8617, 5989, 0, -14606, 0, 0, 2150, 5989, 11376, 0], [3084, 168899, 3084, -3084, -4626, 4552, 3511, 3084, 0, 170441, 2413, -1542, -3010, 3955, 0, -19188, 0, -1542, -1468, 0], [383895, 13189, 1438, 4136, 4944, -3506, -2876, 1438, 0, 1438, -2876, -2876, -3506, -23321, 3506, 0, 9876, 11751, -3506, 9876], [4248, -4248, 4248, -16992, -12744, 0, -16332, 4248, 547, -79855, 57507, 4248, -4248, 0, 3716, -547, 0, -16332, 532, 0], [6984, 22329, 6984, -6984, -10476, 4724, 823, 6984, 0, 25821, 11455, -3492, -1232, 14947, 0, -33644, 0, -3492, 2260, 0], [-3148, -224364, -3148, -6296, 0, -4944, 6296, -3148, -19748, -3148, 6296, 6296, -1352, 47336, 4944, 0, 0, 13992, -3148, 0], [-847996, 290, -1584, 8944, 1304, -2888, 3168, -1584, 0, -1584, 3168, 3168, -2888, -18140, 2888, 0, -7191, 1874, -2888, -7191], [8384, -64683, 8384, -8384, -12576, 3989, 1095, 8384, 0, -60491, -15764, -4192, 203, -11572, 0, -12876, 0, -4192, 4395, 0], [-4518, 4518, -4518, 18072, 13554, 0, 7471, -4518, 2160, 42899, -11723, -4518, 4518, 0, 13048, -2160, 0, 7471, -17566, 0], [1350, -1350, 1350, -5400, -4050, 0, -631, 1350, -7686, -195473, -671, 1350, -1350, 0, 3772, 7686, 0, -631, -2422, 0], [-440096, 8481, -439913, -16412, -24709, 0, 3451, -8481, 0, 5030, -6425, -8298, 8114, 0, -8114, 0, 0, 3451, 0, 183], [-185058, -10229, -189126, -2957, -8007, 0, -20456, 10229, 0, 10227, -56189, 6161, 9118, 0, -9118, 0, 0, -20456, 0, -4068]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_42_h_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_42_5_h_a();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_42_5_h_a(:prec:=20)
    chi := MakeCharacter_42_h();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 5));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 1;
    while true do
        trunc_vec := Vector(Kf, [0] cat [f_vec[i]: i in [1..prec]]);
        B := Basis(S, prec + 1);
        S_basismat := Matrix([AbsEltseq(g): g in B]);
        if Rank(S_basismat) eq Min(NumberOfRows(S_basismat), NumberOfColumns(S_basismat)) then
            S_basismat := ChangeRing(S_basismat,Kf);
            f_lincom := Solution(S_basismat,trunc_vec);
            f := &+[f_lincom[i]*Basis(S)[i] : i in [1..#Basis(S)]];
            return f;
        end if;
        error if prec eq maxprec, "Unable to distinguish newform within newspace";
        prec := Min(Ceiling(1.25 * prec), maxprec);
    end while;
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_42_5_h_a();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_42_5_h_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_42_h();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,5,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;