
// Make newform 126.9.n.d in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_126_n();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_126_n_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_126_9_n_d();".
// 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_126_9_n_d();".
// 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 := [4271031984253419377206782621732, -3448453709078208081753932409840, 1061914206438596097569355774114, -144252792084909643404755532432, 6083917772973420120813872017, 325395581603349554951740400, -20749002299789629192234200, -305008424965479773875688, 25942214297922759947412, 159557587043375632176, -17677778016929268548, -52687155135219848, 7316478649605270, 11806020599312, -1891249463672, -1823810808, 298653216, 177344, -26382, -8, 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], [185507778972277794528889155756309822359384782470812316132493392, -61934638449936636376871358854764174401493168876529084977815516, 2851844861961763654050448407304488136385868454954350157155188, 749784695611994301617714910395538205110272738934914757419226, -35245344921518321459505117325513553476304073344502264238182, -990785370981075406808268475412679117369771689653651195175, 73036780185733181014602492205278868042287388825283046811, 170620981362716208577851621483950191516579713300778868, -68875229855640718320582023312078452930533652647130846, 464347084865325397427927152121479464789378212321785, 36229310666033934981803826283789676209330225117985, -394972914111662075837522027065669809244401570900, -11330569335747325442045027488443255010024094130, 147179681367473399190540891638526460588523539, 2097842864147884994835010801781498767420453, -29490707870131141824133025090086528343468, -212669352816277789933922539523632607978, 3101760399417049629116610341151791543, 9108530637888369306523046507385147, -134938638749587334178970479663118], [3345390770721840258114713759412991472126936006048103538974848755195564737039211931997661850402491902146815703593306328364, -491297304841598577854509015264959991003477786574411123292486131335100026982646628896380889537662277785808253804759477980, -90902143034359423193263837023640521797347170054653699173109626528169731317200928660310598655113277667535001501979728654, 14113033484939536435353766615032801284747581653076967585331145980256959988662671593507851055312942856707828418440409854, -894774356731110805600894437785598277285955746187488587143144168509515444025531893449312896177855895920870230550546051, -5021633879104671701144127630353614534843697677317399322740482202043290892936074272755961490020181929573438044013725, 2303180467534329171124186134726482925334609318602329359117347776616088893914503595461992670294649798434343332669265, -28406098717385429172487891611901477451925660641080141918503235631926860572154883702634616743650593703397143414709, -2329195864470870768293445598152642656155262920260183061763680427203077243049788003304961103971100966300761757851, 39439543969665470431419605170655596281046276902641166552806183852279657852239380592811644636264604069291788923, 1278173607970600064973904436744495955746476398992166547535292477189686212687952235022018126994998837676022069, -23803530925841517817130448505956405305316633962811887207467392849684424772878162009690384203946064491612329, -415227467335162325973913172496426267677467706809954639158548409594227748886759613758485386058902432790625, 7946613306568424306019505336657423223606046541757145913005010871172624388690128661133160391707412103041, 79991503289953095989420984599509107163781389820049874020682407985726890652386270172979786650533038315, -1524990740925854781674338881082126802862657125081298651618904204695269313447424080003011777820064279, -8458943938880439186085189772565783590322947983134467745273090059108033583440334812601948904662893, 158088842782421792958159272566028467861489622564341906601530199118626496688932405152957473956157, 378594260593224921457077350506943065500823076070487808461674078187378451840139685234105511901, -6881088196362078106530790277495386723271030637119665051439604641952350242189468488306091209], [23887418736890514478225176803388804067787775218148240894254866814035016059421167109536891626585911093914487890461325976532, -13888596537118567435529854990881108107124915997044087470652597437960232681739858604375562368811543779418447180808904587440, 2616633943196495749753615578707149835593789417472188972296707034819664460144883246808854080551898680688775024165308097498, -110102376296888087964904414788434760701750237726541482440292437291841956464848971647034489578670930082170317752313262748, -13652665085666864270774910809408437069822189636092404490913795025828649106496943476851370228791978870895656209395884063, 681643747073456097487498860240532214643054638541631045546376987827285056160076801274879140763074848338223078735403450, 21940153101821311084657882016042739200544720365024634531418425421253502947016272070649537917034495678138337235437570, -1169983641312145743705087054395246777369108564302024343125187648067391969622644415646393753780687475172793196364567, -17835572448143369273861178704456147404068329173944029101464352062353066873373352966873561834056661966681541819063, 989547761615372950285467576845053931415581201369241449754895980202419711433393349276306101730448478473881711574, 8609083579501341676364566625575353704327963830645152276778235997660781421879843027372331434867937609395425422, -480514206713599340179100651019344537937377119538575729799324147682327043943374826562864344346591598320909027, -2604018673015628534298845291133264638225588474030417383453056523875630663190348714129501358068800176493925, 140590097946784456820403422420800183815046388445719982635310393429630432242797440384343097895763908164758, 486497386909308859220651422246680627333310276384443344975281399253942860274234117972989423513234608070, -24532912199334784357647821464618858584711577853627923388039702405145132306539459179600822865564497477, -51273594771069525031787247847742731138762226929560073456586364243919516247626717329946003900442009, 2356038221212106102007516548300966423054111848737737807260433961730083041972017279582515150272266, 2324446672580441299277471075491512212113195181964577605757902372744545063490636735141620636688, -96012293331611671531583331408739187511482990320756354037523698126847427655367009632138262117], [951871258225376459427127068058173764622191813330572382586443366973990490844395501399062017689114808825186674246067432198513162208, -293849619627728210745821804776459033808500082123706617102997546813457142629779733350373548130505299380574483569781909853508099276, 846553039225306340051267612432818034882025863693282988521065079902304897454355906472585853007971218881306632308381356925189616, 6022895905778603347808443504449817884931052173284872324063681304505291689964698646522322443414769908627642381053267816683335062, -245046964791176327662694924489514148181202686766591623185925693724288809486645186703879449141333634890216673819365894506858288, -11443902389114284361249489178048156873415323479746082745797890050910188662222194687862142380393585526063761413873223501148209, 557039995754565149081933525036046517262317874928118177660750150489237222204517243575118217865761922839372546715639062093180, 8858337855594448782027899321195699176875308420259008934529231660172940373698391098969332577198743963135546813281538709921, -537889683911380385890087326289578396962706805667495265065861701100365969377913011261053941000815355416371876329357372216, -3096089907914942134770694541937671715172720608928717845920587820775442238098490284960744738313119805278981238638247765, 285103125483151936022081261510045436696079925877086859295400854671026725135660446961965542287916822881196093021976596, 183340059653077073977937563377832463757254246155387378692629062996976083094446627006495286226321092108811129986849, -89600917928068884151374423480487522226603676881000298834395190676331522099321499549829611041203005380964450165184, 224554810666476631153087187181562983677271482894680163804256362258365482661279147760523392472537753705184454909, 16708509253812337068432561938237352605380331340206529170652069594919785755447128346520557716524169440267463268, -78267495996997232616366186611386119973940222424090700982813995612473927367612820232307276883749695775428365, -1713035067675530906562550301045448415153329659670218324480924895510706659155336841657128325585801518963640, 10794760985536188111467025981379911782837111501202416175614587932479799749489036807845034754080971024597, 74534573672352958302473341054115388545388259591692341933390477443373611969923077031828129075838502684, -563252774259109288570678307393290475672020761023703098052708964929750366164122398283321154698619467], [886611204752122370849926563663478688894780032435968486377833940066034448206258700861368718284925305258138252041959430251089784728, -289167755457487478648878918343040585544865752878640662893146042604946091533654746600333918040463753627002514172009870459332432116, -636973454815439146261563085964027958204579241085496917475596263387688919075033155274802803989374810880251281537891382052811084, 6236777980019183977120388345446594899849568816898308809957160097899514165271918887237914292628522796755868236567014302103027922, -256331778194319185672543102710777700495679576389599052520125183287161430512346616152208590258999184527275837583287383120981638, -11699273357645383245654773334089634661012324237817725716195698808431693310938107666359048741137518930006570059521374481376539, 587694275021203631447887009684403358665787751290877632462960907832187712231110172148255619096828617417303915560334050515690, 8775244085164987548351277086392579195119559747344887217896543563045439577507232457839638012616012401417403789866612622181, -569376441978091464935140995765757333851144264161863362579032486269110920567266020966740248132730727666845590121774695846, -2801004887751821498852456325077278458216341120703418810513457507477002232730616633432969377359680809466908259452577655, 302458505318394614921968754106867515920069540310328020822834531017599903494115410759027490981202433450577128213417186, -28611856186545782822365686087639621198420488722103791313254924851278907624998411000317853724890836842707075412451, -95230988144241174316785308086527737782636227513576929165573879437218383602344444338166095448407284719706606883554, 301050641754917238141096162759622559467581784291554878405716154872819942726623170641293312723843109767186523679, 17787747454542943080923747449755500205871993328306880105550194774459353979890067870302478877841105725670913038, -93642649153128485754613943847657879200428613814858475134687548737331784544798150550430460942921429775474465, -1826368006101852985324029375424018410888945567162105307878029440261783526557297383281831133060952683697290, 12440665374702272154172459199397160455203715704977848514963488261516789611208901701273660866607419209447, 79566979081830321011652127289112419716639328017624128477773900220630445846705459722927836921673344114, -636679790334547370818730641514013568016737197072878103951168553716082415700566688956949916550004787], [-20891628645760335050864709329822861655109445242118057677634150349044993973945711476658894266977264798913907918072479334821743570428, 7568290427496773951013247553486519731170367957081867915534339918660675585388090333302567743344217299374164450573949491126216359088, -1083963462690029857148677874427509390038890423287444454794246274958999734737297494642644424563479859408226149735713115398393133618, 91240790665288701080280506677502568710194878974789255090255881724074855898827211403731447992216002502978107050589079254564334840, 190025267805686264435457158694756947322677617251344744861026239156272585186811229077582940760366641395955830058473968655186683, -274981703734701675734873233777869134739410411826076025449410773055837658175777060879878077564623971065631635822845329440623188, 3073057323951135468137524675150141847901963919402291504469944477519544985767685078976740329917092603400824584452749350628477, 335592144357829018217195715683468194745355687155318262814732523705961708251023459114144384716717466586233678906174373401546, -4178511786065948000084457133485899546184613398165764181757331110224727738447442045756337055542756349393317574680571676073, -228093720465745711502806835293023390429532408959270581686043164966782964557156091188351709004992623222393973028423082048, 2522578184169246698273411616079722017648873420101578600380301059795370543239637282795844964491913352162749209472844381, 94588765478596989073947155008212969725915010454924659826228147904661893324632728128154485016911796211077218219470382, -834065884960646073700804799889215519770777603422001338388398735610830913979418197767987488654038106621186305779039, -24392513596721586097286785137793121222912900687817259314787415859683974930563676981248350148574938639975682981668, 156459953323882389107346612801681441892051543662673301096437656659056209566923528755049355839472829645628432839, 3805876220009351406838165667151006705668809730223358779318093040429985982744497721954080537563398806085673574, -15671247868446334793782252843159063986752911831059861067775188404214413110895615422009596592556220220263031, -327907466771777750824409672591592968662381822345064294782549286705492259879061105390403184539131068865848, 653129553491722149560211294992401706894925288798188159551678629669141719709544780913013641828439455633, 11937876855823517985671586028062327771331235539299199462555264992275000938443024680378509965980166890], [-480315449698087999012148948315985125333501715149062654376206660759122710312361459000868609705119245157359725838825153096233837992, 181261333710112275346792852276684812485985570399785635276694494086157120744700655628911446218947734108468511372644097024145380828, -19309812947845884559103468415163568019023842037336552920151047139191137157486883443257653429511922154754770312533605159038315388, 195366968444111050582372785554003724740324461119684285163542701867183487172390503341282093906566111912647091708557641771860566, -30276805634959830469128229799760495347205662857427583773632663090236837611521631105590530059540461693345237246676921666374398, 743888632395511393900171944981310635420176488236316136164289055509627705639151045637393134813143626964712749562028162676247, 131894396285595942983332118598266480786104340835279064205809042629969814814001474803579464124747982795441249214933054190174, -2925192497464266066464297281125108088153565288079147797199381238748596894625178901967237045596694901435233241188102812000, -148318133387941035427097132183531723542393819147501441646054724440671008928501877512204756747354982447318149948598466234, 3309234751581049627819429622633986921195617199381100209900850223214271668695602527577546061182864899435677010993850799, 84054079885608487770999186917980713109723296120304979542858324255541211850549063297268675869655653375182942042938370, -1874361137496002143610273714174731386130075499680036088457420932669231853152326038264387370189845953834482187670584, -27371304187541831802004900206003279843484586422966040838766616353677705820492645739684376358931231597394292183250, 603132725205110355589777036962467227035403216956162617849402703803900984183057049279084806928551325957463523021, 5204523316809097911236589551215829237287983763972616674386860967813563600239372747515875737249774202285217042, -112228522956403971952703218641515948286981778553627436096906987245566313113626052328499379017561586696730232, -538488648354833802578251253555424594834110937070112372862431277895022283875708007191772939072671608043982, 11285194321099356051780759879292350302220580670132425742303905716637660443506939441086597808600533492945, 23462050885428712615607221891479263048307697741929681475800765014305610216056226321652181219199590538, -475890349163873594790359441445563252487951423592657231908381525723945404397328425217097188105098246], [-431458692743061090124040558421044965850727019462248984378190252423725410850408804892681483552945376004129299616931695052724224020, 186050265437299871374937245936283166722132497730622416459393164088639214572212200068902414318957258472747814324566683695123221256, -20821971791219334778496847438532080141273287975468859207848620156120632247537705126006458698858793526901760877115483568293736366, 412094436425481103276752732252153573170318943666270519118814118342326198822572339810140889056510244214609002924432862020792416, -41546303406269959266799518504186912812304538720267097142755220152246498352005410224601495621930803406532355630964749762493435, 476808165461101060227152009448861293683550354199185212834286462652047187236615976510597308220579252830116040818474685088904, 162082740292356203622921487830861161934273155965849671276357159253884766464712321325822348173967339562705171481317017504581, -2981989157509356060389592402815350302615949795584713382227232131215842101613988921650503687097153287335043011273654680059, -179108724328319111872619644892626743065951901509559726673422122812624147036824700890021578146774549983337582852044287887, 3577645140479736042646322491788147874334392553155384503027332264434905102187340602936603280892533730713118051346792456, 100946210023913844242412977709937212951752214677250094555961389012840632688286845139654467574134269259667764179961061, -2071755589778266696601833975067428282061026194717342167163744464990137328753411595996390115770768632534586686705087, -32831606611268706281083832299847815513155861277081029455777505493563942604114175847548880442578035926474938162449, 675008907388566041490760245436167897796644011016036242878971864145877129132296934615513522958161425584658328808, 6248260427254337882396782566406938843972309479228748900201872177167571988288413462048345408229905743766799311, -126745559975686586274748742243494533645657007332929946131603076030861347686387233244193214525149293458240113, -647845580448502505423214284620296952961788049027652858214179656163833069936792216275693665979064543466513, 12844207379905347417605280761751486626639270860026878305351855926808910616798137351427924691183019753472, 28309165525200165364426805373390315461122047377178078388931760012617038987814016529172469929244215541, -545601319585690623620969022982531283834135095646281809110417224544555653130442041085904943518279861], [715555085850394940423443353168931316835919170945806726653867132304673464395413567921496450829092443204831980772196607876527003968, -259133797221288827996011149162423519019510930683887984328437237338674123165301576036216135406514575070507977342191486725453091704, -5561598083163646770668290126910379116930605681136413496435122921545394752399626165104766026651123406017620905492459194329421476, 7002916890504392498405845490126138314133640864187709055934131999338972383128609715669457019126361923864374989520809267587077304, -373555602013893334376869065138780662168552178850873495779241576271515587072700688275870752430663066251769383229397898868089778, -6915574439015331089027607478264383533390867634044161219149792119347373258344776934407068110642035230914637097098830428151796, 893906653878702497224881067009052005782832436076960935829320719421641443609302743745657751960549635632444859633168876963947, -4635208611228701718794391073886122799267118143917388525576950202440224287725496295672140725094507463447509521097491546487, -899102784516770020144211722044715298789045073266499289551380446917921422443592054585591707558123061741282471774942652670, 10804346978818249884090642302237744316358993791484994635701612803083062516916639298390029156853498763452485498394097532, 496460997772962204481125424747915694078650660602283949757798489969832311853779036520898131412804157427069463978997503, -7277343796210170393879817789209317093026823645114187184017817485736500920519741552518835148443157594241463367273935, -162441794812285850047382842390919459824192892034300472168578143332432385521344327309093646445926157412531544116542, 2541849562870242151625817059914208148683902814305542684048191064840841969261798920169975679794167592683959903700, 31453856836042519170943570145981932241300349612523844232982170026327335697659192359288225594727623907844752145, -499555176062267687568945545986959832152429522308671111584678086961188724263880088158309739539174736781693981, -3334542432113782129820530041548194291658272074252217389690966373068420555410150932847598675624299323213266, 52578206549909497403100482242928270765275690370467240338265594502932375997998362992603970187049383437276, 149286706202562608095891844926242056028813357134133906200854889779275456119355364083154952058590945961, -2315023523696560759664197061744471361678735991447935655436030217256165442231149802354996155749433429], [-1889791135734988324862945435751540497452607302148907127776205870247900062096269461131860439767552028163158138245780108062451591708, 469330963439001568819140145606012119031342215436409340970239006888569911269142453233292926655479928719697320166763404607402452620, 26757257581700027045445874651124799049512256654708508449816813084049774285126908869845407025602484595778043616653618082680407950, -16292998452856318176930803018842229738626099631032251271993960944814704981462203438853399585256149057106724082342369243648249918, 872737249957438215842768222116728494780058931500176771909691719107346463668602649156530568407895027776132236049476794925240723, 16168472005765104463923365085330390296725349103390421641490123107587940666589817750488801753770875418441271742738429029172445, -2124083408970167297510316743672060730780781304979159496295317861802292799124700615191459462858872088909096501094986312137891, 10866045929331795486258723267161818153741891648625022457083365081696392450082848270681464646043573162825380707799480944623, 2142349149608954111554009186523270954943549438560538469606194022335587244482358027748364959423130954715804872940507453843, -25340187831558438652262505734655704333001681081596955665724390832550003525039901710384445256269683846279235720820547931, -1182508186994039468565723842511837280670346199822074501052600602199783864289809339855797087280660249519004744967992127, 17087208969957491778267817128582929964597409908586873370801290246614368560076894275727635376177961622855087588752643, 386433538554154476392309150232699452395628126272035804613037679679759592234848396129845205363682837875261479580513, -5975712335353426929280118768618113555806439617881765299033766213053148176874603734083881859475872066626511366817, -74721630421743511035463916468166437824914964491109229017942530677661757281869290353145067489252680466992717089, 1175850365876145215558884573785741406265213604361281861047468243059461589607494717164430980897865104263614773, 7911380863368480839259189608957804545233119075254341286063940771019664264121988863081537842592747610061653, -123893181664575607182906981045776740009182260691521893607528873275920568429678579930288596742362107391149, -353803132332938880360279899438393762082399463190789990657110617800255426152719815502078415347908156875, 5459984976821789326769616100921432449695711884317666841679000145103100811302798580313112547621981783], [-5256242135299157757873638504228479850913710628148667206510027363794150338739275141472710697423602147916031367320102121878208077068, 3490327627034234320644801742126710028966160075010039941374590977302832226462235043942424379313345594821736098551143275392629394912, -743751433256720743534065288197540859807675729569923066467889658465536520974810803877098918187954584993402049744646790797936407842, 44105368964758440908539066062712565547510542592378990527270591202615143902189085055496937077934959502573406282899407458953500864, 2409260370836326126287776236728705299358227232189989796810673472861384792937864969673097371996170735630548567789925040087229203, -200716624217949062782633290992047353895832541905866513457612520183794066098541687618229678312515700089983732926910939869719632, -2828534259060112588947552835845305334148380396434677605996524819902546246985601126823674463327260021380532146061318567312109, 314160216706306183305848539909322174674827725939392804234094946524825147585563551099186340561292166880431740037161070249230, 1719449157469824492811433697874272280859655747060510561781017120060311536792899164662349967678822228918261065532644743719, -254173402203238726724333229053620365157206560064281820011496313596821094833210212216514649927625528630731044477257103444, -640286930454724807845360975538694194677249208025634944085509129543726835731247739736191942397540645525739806612984205, 120166970270744398562242380146767056401198597287456329498962443152137525597790188026205039821972256661269583848149154, 163773244746657347269758088834886762803527786714457021956604958638088367376736145680980008053923412433468535826585, -34457560717874315803337720752448941961001971816124173681548644468237952064488282973169115623050383990532548243016, -29505070348774225768277643502760323199197969825803088286109500074524772081997621464647820654429553168381086887, 5902327645886997062804791552836103742420015685596628057339769731886731697996881055134381164507267941414930962, 3318572280967970310315131994340872037168409629720669602326703172660959869648208520178126654722530984938297, -555957095547654673634491589044849632880222233517565633959752180726444375147027376792655029765282422725940, -167433019771923605223995119442136229148550886399521275295697260808018692986459228765706234077033752893, 22176296852788107666026311001941135774450443028248327658341111525027961017240516926302193051161857086], [6544955239186737949352834603848235752887469699813627644163633241685566424354428434507743884417784476128691271790522054937837430972, -3796145241922439182332015732243870306168700735124028727580782841916987539391280177329963364838113171767059562062704957032772961712, 758278510973403835490077645024884865300558026619232437134381996225949043441368596245182853908215673951198015869160350356218844562, -45822098069395485968742199439968365207957626749569603117185995365097703331294324663198484945278958485395679233590689892911118520, -2374769631607210176975053144200969018116199506747282035209331293877295106400706233487816900771838092369577513166189880125177227, 207137074186110675854157306497396204797394302223331212163126687251938128618700317448404599227643366135257143373565031020290292, 2695087007000713556549286164662019294120708647061253221314954022267623618555628934800011964625710555276118395246072254395427, -322347096547785394648150265311566584661270355016279459856381210712219165184923957010427634501517412327955411264825712283194, -1569458851409034803876672326996113329236649857019845605676984620197350759141939701299934853586046857121614985973532798503, 259668807109596717555897763712549957555058452109585949624169199636843634069000833417195339287915069133968516810960142432, 554297499646245067095001260874127029012952401344037207515250756625469515635505507599540560534014286950700905535241731, -122351505740852158912804514185796481720588029340200259120412350041314790457151305158477556138287663205876005504700638, -135436443347688973437215800843571639625463878225877609864565868922454376873062612646803776497592376832115530116689, 34985525224421733793942765515878288621842050639232105478725544012661664221037545952939412910859163861810756796932, 24061958766500241567902389900618227631784258000896602173562900533903449491700945938189401625814800580273379609, -5977620075727322143233489179268410355639670919158410314250667905989561297786894813900076335036731590678024886, -2750139239076674816918356099553097675927380459167390510719917111218707756937433894137822251412105447622201, 561676565317258675941903390018817911821461220372474892597937791759434081725982323844380940580322196044952, 142415930527359180093311884794313399192213611798415084818924018013982880173290157416063353999614157103, -22349035879549138873816714110872087005378219632472462257361983679909420385655631949329075390895700410], [-1841517827952153756788609907115132142699451659432331180974709378957121207407417488564091062994036081151006272582096485906729906256, 824698966575999393597771476475001410649397863072589734558952543689195747905603885350907282332147357119237743639597871701259729716, -79584579926047464195823620594296500095975829626255995311594175914439927346815267071954792631093953824599401347723558170774749416, -623085189493516947221090829366770163615070589422578844472068799784339408342147016766755209657862100183619373933272947670380130, -111438563859017259164773934276031114067379684722237501546327527842438499557575388879442527918576247188399943398455708761861964, 9131212058801272668696080549662807150466315737674036385759347328209505686384734696324214507414049956911202474989961379825459, 522168475803777170906153742052158482709032255643636534993887519307730740011949036214107134562524833310560645008606454179844, -21707169819810432203584068693186358102302691853419245594304129302441075719384186891691914000328260179484614053142026546653, -612289982923335957064472436912766254141880778849398665825338264637900833093792538740218824816639703275134594311678471036, 21620424077367728332436925940380714290151122111254598647768706119243067219449800289727714287689226695982081649739796999, 364060983539818216144965932647083932810273207274261177410956511485502660088097534279381529913757158946995823734296612, -11610816216742646213958024444163750591861640232727019375142331091316757221171896597195806743244941315654234246323981, -125007439275554930172957750775264228713929344155300973586628798409623718213265949283729624463868307264332119560868, 3648475146304208034779809244542439689073225091683040586118075890041595471270393607649437523484373481290657447289, 25118288654282016959908295302855235754568976675225336444845268674124196500072279889016608004985515045635772748, -673731991356302479025834275340182962480240606508951745642992973220176409940561288897721776967587583367178967, -2746181571058654598563139336145558988573468281859062068929473932011327604698094425029973081464708873681732, 67941065890303555423157252641531380791849189019452558107829235493327867481044795190935578517346501245209, 126248859902077985033113674263757758593509145546473187175379278500745213274845337368430123551834800116, -2894938267724042947854594655539940280648160828123726709542820827577911541257654750059227734500254045], [2414918431144156480028742749361133690563676758768984690963642095735201408238574699693928300990586766365125058202729694551417518984, -845432711732396820293616134231163183881570490047938909241163838529861265313140692088784478533241278157055652210892147023944125724, 86276011801387914921496753458210587374169267652954971339720807942456084681029334131875758930348288602375824066538020812104022124, -372864809239362864878013081258175167087893828462706481918877771175361608726703765307221314346035206195984719358776348272510210, 168538926012420773726895810945631748778768719443429783938645420850708590158475760028608620821859463928332550509191514501999446, -8281820687485642425261919502529194034370863644938506235311289669365355140864256774378304474335792488240004114049830877631021, -675673178309971664241720246950679797785917751944652594770544593575223633821475757409760282221799592251220526130528725762486, 22797675109600243848284828657423698441266181673285778222297425081505871095887065480364741415081291958467966131208641235217, 769887138928361541831747834123579525606027784335929458454374008343038769984539119084231131200362950820365831289610124014, -23634302785830743668690213026892611149536197782888732465072430682359125148005751542614762165790911025224980357933580281, -451099108260671195550073750820297736728703818419206694053745506611425078846806967682329819600672243377537971040121398, 12921679392945994219226780281569835092846574856324765365930609837229806327290174806217737029957337290848219234919289, 153335754740918974772046954159093545305991146862217391883908259555996563762340070339453590345252756857680419360162, -4102347362966359164601585725983145128043470546253516012248154974559782793538582114430892424003471837551966603911, -30570681857831866024444987050452938918633336803180743980599325689636747413510991773340887838547101529260453762, 762804224958553983607210977714888518002757255173380168563178208203617240219026503335101162068654587466201363, 3321265630678474396743347580067170606661975349793743169254177417871381429894048914656805192584718344970898, -77322612840569210172058799017943001716623930364699498954575174220700368328395389361321862414724989632311, -151897063242531670722447037484001260160952842859218207626395218089544572119042045985291173690359143294, 3308380613416654559260901150659562716232727055877375764711456008806257791628725233404225070220041445], [2495814997744823570157751352743915391459179601754084314980569326272523134278082048946697359233651542318820530467579674054608, -1932122084496240545138006822270444643845707702121317883716568614853245623584081679189402002597994133425504086924530126399176, 559708896477390655506195740428208315341654982850758730055812713439963327356432519511683200369783485830343595045393188385788, -71201153084299778409960171522394411078014795028298335952724553761754301166706871980206583121067913249604341669608462142264, 2983094163046604181760801205571554577611545417160240748828516199916451555540891986370653070441736251648614466846319633326, 112522433676506802989824448930991023960354747501628996046261348635087467063237019941349765397345218949925561668538556916, -8238458444029817867972980103844005489195553946078956853965118206149428017809054330281172440982089364000721075636373943, -49907314466933606144143373843722206628098861345140452009230876418576826439518430022012055569023462382726387113431449, 8280517343583627446939381250338602375895143703460063653619696590020646016964343248728435314133824773195163801585666, -11826568747702591489508166438214650796246175705686453678670062205086331903271884019920887395166811394975621860844, -4421629788780688899489445118175576167677824452636627897932470792290874694144012992332823581415622527522517987019, 19916302851504078973577961270140788462085789575437234274835496142019367119972848616693207918881875725263141311, 1381049518194849495440315326421714055831803153571731896079531341886913689122518607834264920964784105774351074, -8404104865525777671391389119507441845714061445354304303651424279891218409864485187449206861449754750123252, -253916905982173116087598916152586395687759443038395633963113125204815707119925433945878824798579653230517, 1787990626009668547604014960543950524968698708232155314669020905662294354096406336731682301811580460909, 25531016323831200055052483048680616677861493156559426126448396801461874472441174457382087717721265310, -196914375127715479792781828429552995280386551889845918522668280040737851916009115040366077234914316, -1085629115647812623847822047798396019461630425965422830057233039878109848519196731202845553864837, 8954258707330696531750774816721176663044601583184901044651329212996797042923166073426562998693], [17952928093587971667912672734553142353840246411775181753156600373976109126125855286422304820947687686138719680773035651834038335956, -11402671148616857115249972042545943491726123135476174093248135245822080386023437969456212136085288083677441541947104721556486946184, 2141169589268330368047029626213282951929200558935602292561790680727844832793069033303713575235762186662422688979837792613524290654, -61565433238943697900127421539495191637805649352838247339517380402536446121416454442837511022021655673990880169798238992260090588, -12911009969242657143351269224438197659848605763225942033269794683082516427446190298639317214010576730659059272602487046581771581, 342111460800703033825590504898406556699847578661869866745558163132361642797536260267840326732093743252929256431575435785632474, 22865331407112192948603268122363283270980129227087797095898687967352666860081399003904030413230011738485732930619162686988863, -529778136059358709969747843442354129221060650129294291938990177612641995791938228160841583728131152469849950420477305854160, -19923303263867115862395528522492963545242571790903047763548547956342627713640018444581992148763978255879029849654096135993, 407075440572119982427072888354290702974944863610523188518952328387183098044053544471320463754581648788913491617231354598, 9951442943120558577478598015390145834729084644459803141068455369091739492363603193201613252426140982957242149419935375, -181057729709040426285011231127128681442396110300020288825978981183337172339867602338932961409920014528020086445538548, -2991790204098037534551705656004940966630432233978936386252268103352688159328427582480189546849762962125776703880375, 49098437666917965834474700758650575459234737117475248889189028662298671045931563198226270461714806737463291935622, 535820357975220264597921208484520444693532417181058104998114903100886852405480008412238892707781399068243596509, -8054202558199034409289126290508566444933652142967173449169064039867030504218491776961355032816854267914998424, -52733815342796718025072057957427748641653265063979641974669037055192071459874595580673206429038940718811559, 737915047366464646925553247861445074280562083181217388891908354979742930360989704766042033271878695406210, 2198023202537222174920984042067471116628585269401262301671212502711595895315129803688545775288242271351, -29087000911435867550242878053688040387247428000590926085354208244117764964025066858063090560526569352], [23359295503250736782744985852633876449067247434522731820235131561680634412186089785247766222907805646724416505909968830124419681084, -12432003056095838179967100257631108437037414067159076513219947780116919903350267234321682516442816555959873965536109742764364742784, 2098482887002656571410018385966932196044641536199885963234278516852820897870840150166630212143509530005905712430848320272896812594, -55203922954809887099277351077138992536854640107282975540354966142063126956835831576979789649303192420117755319136018801172988080, -13278772465013241398471684692891050032574055831518511192595609797467993557316435091120214585367956715768972567765749762936383099, 337409542789914293317767078102614532907460668356884606584115926608249028429263617421355408410327201331159448403790585386982024, 23772516310454608643628881415238195193208746182543423194697256438307964491942437308413439081103757062112505726516340765591259, -534533706195805803452094605709755907003600051392072033063548484997191822669484725111824598246440659093642418592518338184918, -20805424118000415349822307143301747968833415607094412621586144091598891460917776544002769331735614120357831212403923798591, 415852908975838929121398130805967980517562142383539611400698384976821347947154282378475278484452308031242379778137919244, 10418520815358030859459650170677373059960950345745722264874750573714648500735113787630461198390616087467231102503756787, -186603927962935289195060874666520951725558556682484590039009808539940603243276966380425754278360901928596817123773906, -3138228527459471132365872685713230146460945145148670653007986520294572113058181583669120114969174940822468970877713, 50963192039984253412108162594313643092539521941131105429721373024677983264129292853326498544889114830550603201904, 563010394787054285049052126241638999261218728695009748130046882610202106035163779965540451788419456486948486353, -8410462171440277449768123093690586093809494515981054359722824699021063589041853808069703846539334611115477082, -55501527587563127680127177393984994425261980579534853800157654404277849920517074035309099005375804299469937, 774543927402103549606009197020971064469116314038927638456253688484431382214485776375290640629085387774524, 2317196939437973214486645758383595524977999827193483678888643489546234344329557452452299578136586466991, -30666773728801025088118111894745956264283200827818814172424838347556651757255654433302866059411723790], [-116441259915208883540039654211701394810117540596720842178242155309220072512191697924831641090837556430712058393194696992209143008740, 78446801181102695310797129240005830980172044340441023179778835436904786208504381449137737905892679627191910950106402318515155862792, -18731757417012476018810863028436380201814899782305153817367503100467703686236912856423190469872608281724460840451451507391665413402, 1739040633912753395835546525928735848645096338997468689557731555461857724954261509595952035199170381814416726034256798129362400412, -26123965040140187852235071858351228308947275412493822989924124888261264698105961484277603623530262941320493075976990382942285265, -3407202345745619128653437073999327753204619639777562591069897577418007852857497268856211456321039843541438132153872240363441842, 108373290596270679530987722907287956305023805365936985319411327998794283845171228542420279958446802669415118981065233765138632, 2535105121164692266495862689292693154630663929785210092807938770294316139001906478838710235317549072875050534025259977819252, -115847771842330357159736167036832650851715785738772131476779555401742455032933697563149813276735989898901653668067598583689, -854117496374741085309058425951570734054894487321705516856162548233366670398459676686503191382908985020838042957835037178, 62669442104206457516554239000856511074067016533910784276514509388872147274062312575711725780339163858718625713230945912, 67234303434745008760871548681825920104027689726074860071509690931156889294962022366592180768613258593585653173340096, -19516019141445248759110050832573071379489693371174240647026997513550651802682016054544008382227355440682655101561163, 43636940945679586695717875816167295208640162005652390252467134740828606570871975484879649972285989510845594858826, 3552676077436798587212619395951819745018365397695089674808338417845063293107659113830244570460773019538747879472, -15189667625934402863207155854682196068017680606261951543340770519383665550476983643451135297175571750974300556, -352412695585703465589589224430565343900730940054808180415407211130367717473543696009956078996193751737320631, 2002393526656478398438559925649342673271766422158844465477917322961083984818908486723422824026933145201434, 14751900082542937124603785656996683488754644134615004618992863179387129037175960553147330502518419889642, -99393529199955897436961549000366732316771338232962327593012921801384463859150909941340809363937605572], [5908503915712001784894537521512831794303094919451255927537952274152458288128746082618797217187792946948741321482750389563860, -4408106279918634742802854599773784049022544576919011985912971146280827652458661478884725526328382224137143336215037982051012, 1268790688610897983372837191745552026341030055143938112868464996165510474331153868866261815695306730898371984908064034724086, -163819584236965742558527338058769137238166680703456004746807317471355866441233595406836328317741568488666488709817281757718, 7080726109710803241312518835186706159124228660282498218320683570430189560644526806334395200690672108789830288523056001239, 251399946171836178038418456818949725585469793048829383127132318536084227769839943551096596798282303074725406775571612961, -19457889290301602657319835590241191475221465178203589313786644008580713681833026989047357800870603175839832678291483567, -94965326958690459076236201301008293293876157944677893236186362106940259650971211204943122109485637968740733643404461, 19598712034163956575534822356782679699826141377640890225630524097076164411103453993934049630385923770178747236926215, -48927547895883542802473368731058159083743654190764293628968122361011656109738415834659486561001767628907601423639, -10509704062595607472480180550305539355764943905188225783846187716724173446918352117315478147742357419139997391739, 58487659505064867738773936940716456444587412469791792464373373905533881464915009363010281458630690936265202231, 3300894069671569267474920331230425573811028533615240660561782901257965237984470598217719365837190413634199149, -23601022681312632286154281218153593776192682072210674263793676657519626342530184025283931359694760018433653, -610830179886543393934824957439396621706179043307665935735080626720171558788621416727882905888338663760229, 4947444372820242184327648021659301205140302379711926987121692775714319206092840335289490976305109517121, 61850000007751668121500721618594440858465541493096553712932323162161067642867835335402647832381207457, -541108133713813248892771107927071798147287880276489014664686183642652419207546541044919638782123793, -2649086588444764249659410640217743337585755575483876614896671266404368195058106901861973510095655, 24497154483800703308022784743202309789495218786750212030260828914343060865521483823405348433035]];
    Rf_basisdens := [1, 16640309625079860982954652555414172756775604670572452149602400, 95743014080834114696601159551490796400480049235338616157577762704863075330129170715551089086890689071519580082811521600, 47871507040417057348300579775745398200240024617669308078788881352431537665064585357775544543445344535759790041405760800, 39378007485571861841972667195990433236130010192789226098569932911793555876706926439069413786134290235812328778573718130976000, 39378007485571861841972667195990433236130010192789226098569932911793555876706926439069413786134290235812328778573718130976000, 551292104798006065787617340743866065305820142699049165379979060765109782273896970146971793005880063301372602900032053833664000, 19689003742785930920986333597995216618065005096394613049284966455896777938353463219534706893067145117906164389286859065488000, 19689003742785930920986333597995216618065005096394613049284966455896777938353463219534706893067145117906164389286859065488000, 68911513099750758223452167592983258163227517837381145672497382595638722784237121268371474125735007912671575362504006729208000, 137823026199501516446904335185966516326455035674762291344994765191277445568474242536742948251470015825343150725008013458416000, 551292104798006065787617340743866065305820142699049165379979060765109782273896970146971793005880063301372602900032053833664000, 551292104798006065787617340743866065305820142699049165379979060765109782273896970146971793005880063301372602900032053833664000, 19689003742785930920986333597995216618065005096394613049284966455896777938353463219534706893067145117906164389286859065488000, 19689003742785930920986333597995216618065005096394613049284966455896777938353463219534706893067145117906164389286859065488000, 31914338026944704898867053183830265466826683078446205385859254234954358443376390238517029695630229690506526694270507200, 91882017466334344297936223457311010884303357116508194229996510127518297045649495024495298834313343883562100483338675638944000, 91882017466334344297936223457311010884303357116508194229996510127518297045649495024495298834313343883562100483338675638944000, 275646052399003032893808670371933032652910071349524582689989530382554891136948485073485896502940031650686301450016026916832000, 63828676053889409797734106367660530933653366156892410771718508469908716886752780477034059391260459381013053388541014400];
    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_126_n();"
function MakeCharacter_126_n()
    N := 126;
    order := 6;
    char_gens := [29, 73];
    v := [6, 5];
    // 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_126_n_Hecke();"
function MakeCharacter_126_n_Hecke(Kf)
    N := 126;
    order := 6;
    char_gens := [29, 73];
    char_values := [[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, 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+1)]];
    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 := 9;
    raw_aps := [[0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -5, 10, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0], [-31, 480, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -6, -157, 0, 0, -1, 0, 0, 0, 0, 6, -12, 0, 0, 0, 1, 2, -1, 0], [542, -1084, 0, 0, 3, 3, 0, 0, 0, -3, 3, 0, 0, 2, -2, 0, 0, 0, 0, 0], [0, 0, -1423, 712, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 3, -5, 0, 1, 0], [-16747, 8361, 0, 0, 11, 18, 0, 29, -18, -16, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0], [0, 0, 3377, 0, 0, 0, 23, 0, 0, 0, 0, -40, -17, 0, 0, -1, -1, 1, 0, 1], [0, 0, 1964, -2423, 0, 0, 0, 0, 0, 0, 0, -877, 418, 0, 0, -26, 18, 9, -41, -13], [11582, 11432, 0, 0, -85, 209, 0, 85, 124, 0, 154, 0, 0, 0, 4, 0, 0, 0, 0, 0], [-27, -480340, 0, 0, 70, 479, 0, 409, 479, -21, 42, 0, 0, -48, 96, 0, 0, 0, 0, 0], [0, 0, -5228, -1766, 0, 0, 88, 0, 0, 0, 0, -44, -3418, 0, 0, 0, 0, -144, 44, -126], [347939, 0, 0, 0, -587, 587, 0, 1311, -1311, -154, -154, 0, 0, -105, -105, 0, 0, 0, 0, 0], [0, 0, 87679, -175388, 0, 0, -15, 0, 0, 0, 0, -3194, 3179, 0, 0, -345, 165, 165, -30, -345], [0, 0, 1511, -139287, 0, 0, 990, 0, 0, 0, 0, -1511, 3022, 0, 0, -184, -198, -396, 990, -368], [0, 0, 165329, -80397, 0, 0, -14, 0, 0, 0, 0, 4535, 0, 0, 0, 645, 1420, 0, 14, 0], [-1026666, 512450, 0, 0, -1020, -582, 0, -1602, 582, -1256, 0, 0, 0, 510, 0, 0, 0, 0, 0, 0], [-7002834, 7005371, 0, 0, -2968, -2577, 0, -2968, -391, 4592, -2296, 0, 0, -482, 241, 0, 0, 0, 0, 0], [0, 0, 8546, -18442, 0, 0, 0, 0, 0, 0, 0, -20883, 10987, 0, 0, -34, 2826, 1413, 1091, -17], [7344178, 7341924, 0, 0, 3421, 12, 0, -3421, 3433, 0, 1947, 0, 0, 0, -307, 0, 0, 0, 0, 0], [3180, 1278880, 0, 0, -1273, -5603, 0, -4330, -5603, -3794, 7588, 0, 0, -614, 1228, 0, 0, 0, 0, 0], [0, 0, 396238, 389375, 0, 0, 2880, 0, 0, 0, 0, -1440, 8303, 0, 0, 0, 0, -4854, 1440, -5607], [0, 0, 1390952, -2773204, 0, 0, 4350, 0, 0, 0, 0, -7218, 11568, 0, 0, -3618, -490, -490, 8700, -3618], [-2327111, 4654222, 0, 0, -7147, -7147, 0, -11064, -11064, 13645, -13645, 0, 0, 6637, -6637, 0, 0, 0, 0, 0], [0, 0, 2272480, -1171784, 0, 0, 3012, 0, 0, 0, 0, -71088, 0, 0, 0, 450, 12980, 0, -3012, 0], [-35575260, 17771155, 0, 0, -6743, 18008, 0, 11265, -18008, -39156, 0, 0, 0, -6206, 0, 0, 0, 0, 0, 0], [0, 0, 1739993, 0, 0, 0, -368, 0, 0, 0, 0, -80031, -80399, 0, 0, 3107, -1162, 1162, 0, -3107], [17754603, -17735552, 0, 0, 17753, 33366, 0, 17753, -15613, 35322, -17661, 0, 0, -2780, 1390, 0, 0, 0, 0, 0], [0, 0, -8427362, 8549706, 0, 0, 0, 0, 0, 0, 0, 244841, -122497, 0, 0, -1170, 7422, 3711, -153, -585], [-18800670, 0, 0, 0, -62348, 62348, 0, 11663, -11663, 35322, 35322, 0, 0, -1730, -1730, 0, 0, 0, 0, 0], [0, 0, 4088414, -8191854, 0, 0, -7513, 0, 0, 0, 0, -41545, 34032, 0, 0, 6756, -18589, -18589, -15026, 6756], [0, 0, -8546, -3527584, 0, 0, 18758, 0, 0, 0, 0, 8546, -17092, 0, 0, 17424, 1622, 3244, 18758, 34848], [-40371299, 80742598, 0, 0, 137615, 137615, 0, 77019, 77019, 6122, -6122, 0, 0, -9419, 9419, 0, 0, 0, 0, 0], [0, 0, 4933270, 0, 0, 0, -15360, 0, 0, 0, 0, 204062, 188702, 0, 0, -24478, -12144, 12144, 0, 24478], [44496247, -44496155, 0, 0, 12703, 107096, 0, 12703, -94393, 28784, -14392, 0, 0, 28600, -14300, 0, 0, 0, 0, 0], [8984286, 8891700, 0, 0, 32992, 80944, 0, -32992, 113936, 0, 80092, 0, 0, 0, -12494, 0, 0, 0, 0, 0], [-16078, -328492088, 0, 0, 104694, 33354, 0, -71340, 33354, 16044, -32088, 0, 0, -34, 68, 0, 0, 0, 0, 0], [0, 0, 28185688, 28455620, 0, 0, -50306, 0, 0, 0, 0, 25153, -295085, 0, 0, 0, 0, 18223, -25153, 62295], [0, 0, -3434081, 6865344, 0, 0, -1409, 0, 0, 0, 0, 445840, -447249, 0, 0, 53523, -9125, -9125, -2818, 53523], [0, 0, 772439, -14693018, 0, 0, -87653, 0, 0, 0, 0, -772439, 1544878, 0, 0, 20219, 15807, 31614, -87653, 40438], [-180121758, 360243516, 0, 0, 1853, 1853, 0, -153052, -153052, -37823, 37823, 0, 0, -56698, 56698, 0, 0, 0, 0, 0], [0, 0, 14497975, 0, 0, 0, 47747, 0, 0, 0, 0, 686298, 734045, 0, 0, -8319, -28457, 28457, 0, 8319], [-364958351, 364976599, 0, 0, -148338, -111732, 0, -148338, -36606, -46312, 23156, 0, 0, -82808, 41404, 0, 0, 0, 0, 0], [0, 0, -33597946, 33778966, 0, 0, 0, 0, 0, 0, 0, 361961, -180941, 0, 0, 34138, -74830, -37415, 79, 17069], [500830646, 500967088, 0, 0, 155156, 183920, 0, -155156, 339076, 0, -117162, 0, 0, 0, 19280, 0, 0, 0, 0, 0], [254577288, 0, 0, 0, -74828, 74828, 0, 134, -134, -4522, -4522, 0, 0, 23104, 23104, 0, 0, 0, 0, 0], [-342720225, 685440450, 0, 0, 48019, 48019, 0, 77980, 77980, 75024, -75024, 0, 0, 108028, -108028, 0, 0, 0, 0, 0], [0, 0, -119748822, 58563391, 0, 0, -79651, 0, 0, 0, 0, -2622040, 0, 0, 0, 84912, 84303, 0, 79651, 0], [-1339110011, 669725894, 0, 0, 508592, 571867, 0, 1080459, -571867, 336995, 0, 0, 0, -4782, 0, 0, 0, 0, 0, 0], [0, 0, 9039591, 0, 0, 0, -40565, 0, 0, 0, 0, 294182, 253617, 0, 0, 95473, 169841, -169841, 0, -95473], [0, 0, 49799844, -47486182, 0, 0, 0, 0, 0, 0, 0, 4389026, -2075364, 0, 0, -62608, 146404, 73202, 238298, -31304], [1455812141, 1455823157, 0, 0, -547937, 124952, 0, 547937, -422985, 0, -155889, 0, 0, 0, -144873, 0, 0, 0, 0, 0], [0, 0, -37829814, -41033915, 0, 0, 422464, 0, 0, 0, 0, -211232, 3415333, 0, 0, 0, 0, -510262, 211232, -148641], [0, 0, -80976973, 162238548, 0, 0, 142301, 0, 0, 0, 0, -1600162, 1742463, 0, 0, -204651, -30013, -30013, 284602, -204651], [0, 0, 504998, -250718708, 0, 0, 354430, 0, 0, 0, 0, -504998, 1009996, 0, 0, -94034, 84342, 168684, 354430, -188068], [0, 0, -177196838, 86907011, 0, 0, -137129, 0, 0, 0, 0, -3382816, 0, 0, 0, 235737, 250457, 0, 137129, 0], [-4146207018, 2073510247, 0, 0, -653852, -452183, 0, -1106035, 452183, 578198, 0, 0, 0, -235278, 0, 0, 0, 0, 0, 0], [56061743, -55741300, 0, 0, 40887, -1045946, 0, 40887, 1086833, 372610, -186305, 0, 0, -268276, 134138, 0, 0, 0, 0, 0], [0, 0, 176728470, -175179196, 0, 0, 0, 0, 0, 0, 0, 3503819, -1954545, 0, 0, 33706, 497722, 248861, -405271, 16853], [1913184348, 1913928937, 0, 0, -252018, -1004749, 0, 252018, -1256767, 0, -310174, 0, 0, 0, 434415, 0, 0, 0, 0, 0], [0, 0, -55120068, -54163741, 0, 0, -529918, 0, 0, 0, 0, 264959, -1221286, 0, 0, 0, 0, 452545, -264959, -464007], [-3122997403, 6245994806, 0, 0, -749961, -749961, 0, -2354773, -2354773, -786650, 786650, 0, 0, -75919, 75919, 0, 0, 0, 0, 0], [0, 0, -539659208, 269495530, 0, 0, 510118, 0, 0, 0, 0, -668148, 0, 0, 0, -305046, 459074, 0, -510118, 0], [-7525009934, 3761873067, 0, 0, 1151856, -2831284, 0, -1679428, 2831284, -591958, 0, 0, 0, 671842, 0, 0, 0, 0, 0, 0], [0, 0, 165332414, 0, 0, 0, -215175, 0, 0, 0, 0, 466153, 250978, 0, 0, -138413, -361691, 361691, 0, 138413], [1692479, -4035213877, 0, 0, 268487, -1578272, 0, -1846759, -1578272, -1887102, 3774204, 0, 0, -194623, 389246, 0, 0, 0, 0, 0], [6349446899, 0, 0, 0, 1760794, -1760794, 0, 2189884, -2189884, 605836, 605836, 0, 0, 38882, 38882, 0, 0, 0, 0, 0], [0, 0, -1925797, -709867426, 0, 0, -744361, 0, 0, 0, 0, 1925797, -3851594, 0, 0, 315463, 228303, 456606, -744361, 630926], [-2720601676, 5441203352, 0, 0, -2244540, -2244540, 0, 1466204, 1466204, 1950158, -1950158, 0, 0, -235964, 235964, 0, 0, 0, 0, 0], [0, 0, -1557704279, 781567764, 0, 0, -4945, 0, 0, 0, 0, 5431249, 0, 0, 0, -338667, -1125109, 0, 4945, 0], [0, 0, 497936688, 0, 0, 0, -1581328, 0, 0, 0, 0, 5182060, 3600732, 0, 0, -206526, -626368, 626368, 0, 206526], [4815184862, 4815569814, 0, 0, -1340135, 187877, 0, 1340135, -1152258, 0, -639528, 0, 0, 0, -254576, 0, 0, 0, 0, 0], [1495845, -6631671806, 0, 0, -5974806, -1460565, 0, 4514241, -1460565, -1603553, 3207106, 0, 0, -107708, 215416, 0, 0, 0, 0, 0], [-4135842303, 0, 0, 0, -978129, 978129, 0, -4244193, 4244193, 639828, 639828, 0, 0, 676817, 676817, 0, 0, 0, 0, 0], [0, 0, -336236559, 671550716, 0, 0, -461201, 0, 0, 0, 0, -5746194, 5284993, 0, 0, 478623, 873607, 873607, -922402, 478623], [0, 0, -1455213, -1560763234, 0, 0, -414097, 0, 0, 0, 0, 1455213, -2910426, 0, 0, 1201685, 156965, 313930, -414097, 2403370], [2054800143, -1030402676, 0, 0, 902524, 4658019, 0, 5560543, -4658019, -6581947, 0, 0, 0, -576738, 0, 0, 0, 0, 0, 0], [0, 0, 523778385, 0, 0, 0, 1631381, 0, 0, 0, 0, -655634, 975747, 0, 0, -784855, -633801, 633801, 0, 784855], [2866655961, 2864602687, 0, 0, -5626700, -551240, 0, 5626700, -6177940, 0, 1026244, 0, 0, 0, -1027030, 0, 0, 0, 0, 0], [0, 0, 1748077136, 1728164328, 0, 0, 44320, 0, 0, 0, 0, -22160, 19934968, 0, 0, 0, 0, -909108, 22160, -650628], [-4793875660, 0, 0, 0, -578355, 578355, 0, 6678710, -6678710, -276353, -276353, 0, 0, 866920, 866920, 0, 0, 0, 0, 0], [0, 0, -12683293, -3167110630, 0, 0, 315791, 0, 0, 0, 0, 12683293, -25366586, 0, 0, -624561, -918491, -1836982, 315791, -1249122], [1594146592, -3188293184, 0, 0, -602625, -602625, 0, 659752, 659752, 1967115, -1967115, 0, 0, -498823, 498823, 0, 0, 0, 0, 0], [8867956466, -4432660593, 0, 0, -7921372, 307801, 0, -7613571, -307801, 3809482, 0, 0, 0, 1174202, 0, 0, 0, 0, 0, 0], [0, 0, 1334069577, 0, 0, 0, 1560678, 0, 0, 0, 0, -32739621, -31178943, 0, 0, 805345, 1013536, -1013536, 0, -805345], [0, 0, -1160126878, 1157667374, 0, 0, 0, 0, 0, 0, 0, -2845251, 385747, 0, 0, -4145662, 5161182, 2580591, -2073757, -2072831], [-4511118, 1967812067, 0, 0, -977172, 2917920, 0, 3895092, 2917920, 2440704, -4881408, 0, 0, -2070414, 4140828, 0, 0, 0, 0, 0], [0, 0, 2052812964, 2032996980, 0, 0, -2433056, 0, 0, 0, 0, 1216528, 18599456, 0, 0, 0, 0, 2721028, -1216528, -1722846], [21498557, 0, 0, 0, -575337, 575337, 0, -10042827, 10042827, 2214800, 2214800, 0, 0, -1981984, -1981984, 0, 0, 0, 0, 0], [0, 0, 293733185, -588252864, 0, 0, -393247, 0, 0, 0, 0, 32893796, -33287043, 0, 0, -3918987, 2487923, 2487923, -786494, -3918987], [0, 0, -5679600959, 2837755848, 0, 0, 1348179, 0, 0, 0, 0, -4089263, 0, 0, 0, 2496519, 1389125, 0, -1348179, 0], [-7140889308, 7139309524, 0, 0, -15609471, 2818087, 0, -15609471, -18427558, -3427816, 1713908, 0, 0, -268248, 134124, 0, 0, 0, 0, 0], [0, 0, -2048538710, 2036918481, 0, 0, 0, 0, 0, 0, 0, -28991143, 17370914, 0, 0, 1298436, -2811594, -1405797, 5750685, 649218], [-4415589, 28847115545, 0, 0, 14904239, 5374262, 0, -9529977, 5374262, 4287514, -8575028, 0, 0, -128075, 256150, 0, 0, 0, 0, 0], [0, 0, 2650132868, 2681063940, 0, 0, 5262732, 0, 0, 0, 0, -2631366, -28299706, 0, 0, 0, 0, -6021922, 2631366, -4163028], [0, 0, -270959721, 542876166, 0, 0, 478362, 0, 0, 0, 0, -108691477, 109169839, 0, 0, -1688484, -610070, -610070, 956724, -1688484], [0, 0, -8558678108, 4277681236, 0, 0, -237880, 0, 0, 0, 0, -3315636, 0, 0, 0, -2232336, 658136, 0, 237880, 0], [33766218453, -16882491325, 0, 0, -17582481, 15431528, 0, -2150953, -15431528, 2833014, 0, 0, 0, 1597211, 0, 0, 0, 0, 0, 0], [-5251469, 46271021596, 0, 0, -16341890, 1973369, 0, 18315259, 1973369, 7297003, -14594006, 0, 0, 2045534, -4091068, 0, 0, 0, 0, 0], [-72093465802, 0, 0, 0, -19982054, 19982054, 0, -3171770, 3171770, -1285606, -1285606, 0, 0, -68332, -68332, 0, 0, 0, 0, 0], [0, 0, -4779270, -9300680149, 0, 0, -2442271, 0, 0, 0, 0, 4779270, -9558540, 0, 0, -2271747, -4294857, -8589714, -2442271, -4543494], [0, 0, -9417617989, 4753411923, 0, 0, -712900, 0, 0, 0, 0, 89205857, 0, 0, 0, -1917147, 7464586, 0, 712900, 0], [0, 0, 263071060, 0, 0, 0, 86480, 0, 0, 0, 0, 18948816, 19035296, 0, 0, 105366, -6409248, 6409248, 0, -105366], [14639925596, -14640113071, 0, 0, -13067306, 3886391, 0, -13067306, -16953697, -7082488, 3541244, 0, 0, -6707538, 3353769, 0, 0, 0, 0, 0], [-30610433699, -30627911573, 0, 0, -24497872, 20511048, 0, 24497872, -3986824, 0, 18732430, 0, 0, 0, 1254556, 0, 0, 0, 0, 0], [0, 0, 3614086126, 3547195635, 0, 0, -21374, 0, 0, 0, 0, 10687, 66879804, 0, 0, 0, 0, 9283961, -10687, 7818792], [0, 0, -3810403342, 7625276100, 0, 0, 2234708, 0, 0, 0, 0, -78602366, 80837074, 0, 0, -6322116, -7659600, -7659600, 4469416, -6322116], [0, 0, 7454148, -8831827768, 0, 0, 2983160, 0, 0, 0, 0, -7454148, 14908296, 0, 0, 4297706, -3987940, -7975880, 2983160, 8595412], [-13802715241, 27605430482, 0, 0, -10947192, -10947192, 0, 21658780, 21658780, -2218422, 2218422, 0, 0, 9259400, -9259400, 0, 0, 0, 0, 0], [45746409158, -22882610826, 0, 0, -35440091, 21508429, 0, -13931662, -21508429, -16867082, 0, 0, 0, 1945412, 0, 0, 0, 0, 0, 0], [68413318338, -68407484626, 0, 0, 44871796, 16070212, 0, 44871796, 28801584, 11654944, -5827472, 0, 0, -12480, 6240, 0, 0, 0, 0, 0], [0, 0, 1034680024, -992243778, 0, 0, 0, 0, 0, 0, 0, 97426388, -54990142, 0, 0, -6285660, -8575776, -4287888, -12553896, -3142830], [-6836577270, -6830135761, 0, 0, 12931360, 3986047, 0, -12931360, 16917407, 0, -13800992, 0, 0, 0, -7359483, 0, 0, 0, 0, 0], [-75098977331, 0, 0, 0, 22084785, -22084785, 0, -16511292, 16511292, -3301634, -3301634, 0, 0, 3689514, 3689514, 0, 0, 0, 0, 0], [0, 0, -34729525, -7231838722, 0, 0, -6499537, 0, 0, 0, 0, 34729525, -69459050, 0, 0, 10722131, 11183027, 22366054, -6499537, 21444262], [-14402344007, 28804688014, 0, 0, -32242441, -32242441, 0, -59372479, -59372479, 12001940, -12001940, 0, 0, 3795487, -3795487, 0, 0, 0, 0, 0], [0, 0, -18268544296, 9086410170, 0, 0, -4523074, 0, 0, 0, 0, -95723956, 0, 0, 0, -8853318, -9820490, 0, 4523074, 0], [0, 0, -298670518, 0, 0, 0, -16762637, 0, 0, 0, 0, 113958051, 97195414, 0, 0, 223641, -9137697, 9137697, 0, -223641], [0, 0, -4408381770, 4464092510, 0, 0, 0, 0, 0, 0, 0, 122005673, -66294933, 0, 0, 19159886, -2989050, -1494525, -10584193, 9579943], [7532070295, 7561129548, 0, 0, 848701, -50676920, 0, -848701, -49828219, 0, -24536903, 0, 0, 0, 4522350, 0, 0, 0, 0, 0], [-47602327551, 0, 0, 0, 26370584, -26370584, 0, -1333992, 1333992, 14851592, 14851592, 0, 0, -4568234, -4568234, 0, 0, 0, 0, 0], [0, 0, -6241816284, 12470855202, 0, 0, -6388683, 0, 0, 0, 0, -49730859, 43342176, 0, 0, 18153069, 6394881, 6394881, -12777366, 18153069], [0, 0, 64206047, -15459872901, 0, 0, 8758266, 0, 0, 0, 0, -64206047, 128412094, 0, 0, -2571235, -7492952, -14985904, 8758266, -5142470], [140510033361, -70258950857, 0, 0, -15490145, -60356796, 0, -75846941, 60356796, -15506628, 0, 0, 0, -7638275, 0, 0, 0, 0, 0, 0], [0, 0, -186374914, 351323391, 0, 0, 0, 0, 0, 0, 0, 302043556, -137095079, 0, 0, -8855540, -9251292, -4625646, 27853398, -4427770], [40146072, 41680697510, 0, 0, -15423076, 18063868, 0, 33486944, 18063868, -36206156, 72412312, 0, 0, 3939916, -7879832, 0, 0, 0, 0, 0], [0, 0, 559850988, -1103041868, 0, 0, 8330054, 0, 0, 0, 0, 249009934, -240679880, 0, 0, -17589648, -8641910, -8641910, 16660108, -17589648], [-63228698384, 126457396768, 0, 0, 46740128, 46740128, 0, -2963703, -2963703, 8343490, -8343490, 0, 0, -10620766, 10620766, 0, 0, 0, 0, 0], [12198771841, -6111437312, 0, 0, 34629164, -38509813, 0, -3880649, 38509813, -9554411, 0, 0, 0, 14548372, 0, 0, 0, 0, 0, 0], [44430268820, -44379038323, 0, 0, 7995394, -8554705, 0, 7995394, 16550099, 108481212, -54240606, 0, 0, 6020218, -3010109, 0, 0, 0, 0, 0], [0, 0, 5055495940, -5078537012, 0, 0, 0, 0, 0, 0, 0, -42469908, 19428836, 0, 0, -6854460, 35815344, 17907672, -3612236, -3427230], [20120554, 41280675722, 0, 0, 245549, -66706215, 0, -66951764, -66706215, -20526016, 41052032, 0, 0, -405462, 810924, 0, 0, 0, 0, 0], [-105218098970, 0, 0, 0, -6835204, 6835204, 0, 108804476, -108804476, -20021414, -20021414, 0, 0, -5777786, -5777786, 0, 0, 0, 0, 0], [0, 0, -2233266311, 4491918228, 0, 0, 12692803, 0, 0, 0, 0, -23439234, 36132037, 0, 0, -5289393, 21089141, 21089141, 25385606, -5289393], [-63788558805, 127577117610, 0, 0, 49316534, 49316534, 0, 43732500, 43732500, -37205312, 37205312, 0, 0, 1973100, -1973100, 0, 0, 0, 0, 0], [0, 0, -10271255136, 5135148740, 0, 0, -3835432, 0, 0, 0, 0, -957656, 0, 0, 0, -4346802, 32061624, 0, 3835432, 0], [9805718902, 9881171338, 0, 0, 63654742, 40903380, 0, -63654742, 104558122, 0, -75043354, 0, 0, 0, 409082, 0, 0, 0, 0, 0], [0, 0, 8339699192, 8879656435, 0, 0, 32868016, 0, 0, 0, 0, -16434008, -523523235, 0, 0, 0, 0, -3140324, 16434008, -11925978], [0, 0, -226056089, -17573950164, 0, 0, 17893389, 0, 0, 0, 0, 226056089, -452112178, 0, 0, -15106801, 170137, 340274, 17893389, -30213602], [-208063165236, 416126330472, 0, 0, -70245828, -70245828, 0, -17664408, -17664408, -18214150, 18214150, 0, 0, 24376778, -24376778, 0, 0, 0, 0, 0], [0, 0, -4155758105, 0, 0, 0, 48769698, 0, 0, 0, 0, 274668239, 323437937, 0, 0, 62876, 11614586, -11614586, 0, -62876], [-17206182662, 17154535460, 0, 0, -52286534, 318710, 0, -52286534, -52605244, -132660556, 66330278, 0, 0, -29366152, 14683076, 0, 0, 0, 0, 0], [0, 0, -182268448, -2465973, 0, 0, 0, 0, 0, 0, 0, -368285582, 183551161, 0, 0, -37495462, 16805436, 8402718, -1183260, -18747731], [136721576149, 136659515208, 0, 0, -120270275, 361768, 0, 120270275, -119908507, 0, 35956719, 0, 0, 0, -26104222, 0, 0, 0, 0, 0], [0, 0, 8072847636, 8100960748, 0, 0, 28387780, 0, 0, 0, 0, -14193890, -13919222, 0, 0, 0, 0, 26541134, 14193890, 6315612], [-211238441808, 422476883616, 0, 0, -69583057, -69583057, 0, 5455972, 5455972, 66995851, -66995851, 0, 0, 6621606, -6621606, 0, 0, 0, 0, 0], [0, 0, 786351006, -219096194, 0, 0, -26756952, 0, 0, 0, 0, 348158618, 0, 0, 0, 17545878, -39769656, 0, 26756952, 0], [-111708721116, 55910661232, 0, 0, -90566784, -8052456, 0, -98619240, 8052456, 84577852, 0, 0, 0, -28023496, 0, 0, 0, 0, 0, 0], [0, 0, 17974440302, 0, 0, 0, -21986800, 0, 0, 0, 0, -175472410, -197459210, 0, 0, 2474038, 11693756, -11693756, 0, -2474038], [824720, -178308905576, 0, 0, 120448872, 91984242, 0, -28464630, 91984242, 6410362, -12820724, 0, 0, 7235082, -14470164, 0, 0, 0, 0, 0], [0, 0, -2505345336, -2885699156, 0, 0, -47467570, 0, 0, 0, 0, 23733785, 356620035, 0, 0, 0, 0, -47401287, -23733785, -19409559], [-320045082015, 0, 0, 0, -299341, 299341, 0, -81861997, 81861997, -63406392, -63406392, 0, 0, 4115573, 4115573, 0, 0, 0, 0, 0], [0, 0, -453690012, 925671620, 0, 0, 9145798, 0, 0, 0, 0, 1000889246, -991743448, 0, 0, 1389336, -18505786, -18505786, 18291596, 1389336], [-82808628310, 82753640539, 0, 0, -36461822, 109173149, 0, -36461822, -145634971, -95151252, 47575626, 0, 0, 14824290, -7412145, 0, 0, 0, 0, 0], [0, 0, -10451743182, 10556101030, 0, 0, 0, 0, 0, 0, 0, 246083137, -141725289, 0, 0, 23978062, 25677106, 12838553, -37367441, 11989031], [-45149974, -361207222327, 0, 0, 159858859, 96913092, 0, -62945767, 96913092, 44947084, -89894168, 0, 0, -202890, 405780, 0, 0, 0, 0, 0], [0, 0, 9132072309, -18295689016, 0, 0, -15772199, 0, 0, 0, 0, -1038965656, 1023193457, 0, 0, 57086325, 8893943, 8893943, -31544398, 57086325], [-297303371567, 594606743134, 0, 0, 181167046, 181167046, 0, 32177708, 32177708, -3022814, 3022814, 0, 0, 18101810, -18101810, 0, 0, 0, 0, 0], [0, 0, 58904105819, -29250437875, 0, 0, 59216012, 0, 0, 0, 0, 403230069, 0, 0, 0, -39504744, 43900300, 0, -59216012, 0], [0, 0, -9567174314, 0, 0, 0, -17662048, 0, 0, 0, 0, -509497026, -527159074, 0, 0, -25179230, -55193896, 55193896, 0, 25179230], [0, 0, 807190786, -594377844, 0, 0, 0, 0, 0, 0, 0, 398514911, -185701969, 0, 0, 31951606, -89851390, -44925695, 27110973, 15975803], [-335192939804, 0, 0, 0, -123523298, 123523298, 0, 2091219, -2091219, 60961068, 60961068, 0, 0, -19971046, -19971046, 0, 0, 0, 0, 0], [0, 0, 12114508269, -24135853046, 0, 0, 46581746, 0, 0, 0, 0, 561419467, -514837721, 0, 0, 31190085, -62512952, -62512952, 93163492, 31190085], [0, 0, -322122412, 76644490120, 0, 0, -69475940, 0, 0, 0, 0, 322122412, -644244824, 0, 0, 10028016, -12355508, -24711016, -69475940, 20056032], [0, 0, 33232414757, -16479122590, 0, 0, 21395789, 0, 0, 0, 0, 274169577, 0, 0, 0, 7158105, -82791281, 0, -21395789, 0], [200996968058, -200899133432, 0, 0, 55577929, 27686111, 0, 55577929, 27891818, 194079844, -97039922, 0, 0, -1589408, 794704, 0, 0, 0, 0, 0], [154032312273, 153983664724, 0, 0, -66428293, 382922476, 0, 66428293, 316494183, 0, 71675845, 0, 0, 0, 23028296, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_126_n_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_126_9_n_d();".
// 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_126_9_n_d(:prec:=20)
    chi := MakeCharacter_126_n();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 9));
    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_126_9_n_d();".
// 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_126_9_n_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_126_n();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,9,sign)));
    Vf := Kernel([<5,R![3394042334068160414439881367584661701901523353600000000, 0, -92239367208476242367462685422127684819222528000000, 0, 1681944648979292715954002835672388306414080000, 0, -16872698328723856207488974378254308172800, 0, 121287350995596818216950822668294336, 0, -466910028236311518625268170896, 0, 1281138437857972913736417, 0, -2237917280863850766, 0, 2832711417027, 0, -2082606, 0, 1]>],Snew);
    return Vf;
end function;