Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part 2: Programming with Exceptions In this part of the lab, you will write a pr

ID: 3816595 • Letter: P

Question

Part 2: Programming with Exceptions

In this part of the lab, you will write a program that fetches the information stored at a give URL on the web and saves that data to a file. This will also include networking and file operations and partly an exercise in using exceptions.

For doing I/O, Java has a pair of nice abstractions: InputStream and OutputStream. These are abstract classes in the package java.io. An InputStream is a place from which you can read data; an OutputStream is a place to which you can write data. For this lab, you will use an InputStream to represent the data read from the Web URL, and you will use an OutputStream to represent the file where you want to save a copy of the data. Once you have the streams, the data can be copied just by calling the following method, which you can copy into your program:

private static void copyStream(InputStream in, OutputStream out)
throws IOException {
int> while (oneByte >= 0) { // negative value indicates end-of-stream
out.write(oneByte);
> }
}

Aside from this method, you should have a main routine that does the following:

Declare variables to represent the InputStream and the OutputStream. It would be a good idea to initialize them to null to avoid uninitialized variable errors.

Read the URL and the file name as strings from the user.

To connect to the web, you need a variable -- say url -- of type URL (from package java.io). You can create the URL object with the constructor call url = new URL(urlString), where urlString is the string provided by the user. This constructor will throw a MalformedURLException if the string is not a legal URL. (Note: the string must be a complete URL, beginning with "http://".)

To get the input stream, you can simply call url.openStream(), which returns a value of type InputStream. This can throw an IOException, for example, if the web address that you are asking for does not exist.

To get the output stream, you can use the constructor new FileOutputStream(fileName), where fileName is the file name that was input by the user. This can throw a FileNotFoundException if it is not possible to open the specified file for reading (for example, if the user is trying to create a new file in a directory where they don't have write permission). Warning: If a file of the same name already exists, the old file will be erased and replaced by the new one, without giving the user any notice!

Now, copy the data from the web into the file by calling the above method. Note that this can throw an IOException.

Finally, use a finally to clause to make sure that both streams are closed (if they were successfully opened). Both InputStream and OutputStream have a close() method for closing the stream. Note that you can test whether the stream was opened by testing whether the value of the variable is still null.

Note that an exception should not crash your program. You should catch the exception and print out a reasonable error message before ending the program. It would be nice if the error message depends on the type of error that occurred (which means using several catch clauses).

Explanation / Answer

/**
*
*/

/** Java code for reading data from given URL and writing it to given filename.
*
*/
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Scanner;
public class URLReading {

   /**
   * @param args
   */
   private static void copyStream(InputStream in, OutputStream out)
           throws IOException {
           int>            while (oneByte >= 0) { // negative value indicates end-of-stream
           out.write(oneByte);
           //System.out.print(oneByte);
          >            }
           }
   public static void main(String[] args)
   {
       // TODO Auto-generated method stub
       InputStream is=null;
       OutputStream os=null;
       URL u;
       try
       {
       Scanner s=new Scanner(System.in);
       System.out.println("Enter the URL");
       String url=s.next();
       System.out.println("enter the file name");
       String f_name=s.next();
       os=new FileOutputStream(f_name,true);
       u=new URL(url);
       is=u.openStream();
       copyStream(is,os);
       }
       catch (MalformedURLException mue) {

   System.out.println("Ouch - a MalformedURLException happened.");
   mue.printStackTrace();
   System.exit(1);

   } catch (IOException ioe) {

   System.out.println("Oops- an IOException happened.");
   ioe.printStackTrace();
   System.exit(1);

   }
       catch(Exception e)
       {
          
       }
       finally
       {
           try {
   is.close();
   os.close();
   } catch (IOException ioe) {
   // just going to ignore this one
   }
       }
   }

}

Output :

Enter the URL

http://www.google.com
enter the file name
g.txt

//The content of g.txt file is -
6033100111991161211121013210411610910862601041161091083210511610110911599111112101613434321051161011091161211121016134104116116112584747115991041011099746111114103478710198809710310134321089711010361341011104573783462601041019710062601091011169732991111101161011101166134116101120116471041161091085932991049711411510111661858470455634321041161161124510111311710511861346711111011610111011645841211121013462601091011169732991111101161011101166134471051099710310111547981149711010010511010347103111111103108101103474912047103111111103108101103951151169711010097114100959911110811111495495056100112461121101033432105116101109112114111112613410510997103101346260116105116108101627111111110310810160471161051161081016260115991141051121166240102117110991161051111104041123119105110100111119461031111111031081016112310769735839116569511787761218967778475118103841061061117173668139441076988807358395048495554494455534855504944495153495657504449515350565451444951535057575344495153514851564449515351494854444951535150515244495153515150554451554848515156445155484851525544515548485248534452484955544855445248505756495344524851494948574452485150545555445248515453505544524851575054564452485248495155445248525152575044524852535652494452485256515255445248545150504844524854535556544452485549565250445248555051545244524855505555524452485553575451445248555448575444524855545757574452485556525148445248564948515644524856494954534452485652495557445248565352554944524857485353484452485748535351445248574856485444524857494850564452485750495650445248575057515244524857515257554452485751555750445248575156485644524857515753494452485752505349445248575253525244524857525651554452485753574948445248575357575644524857545150524452485754525451445248575549535144524857555450484452485755575050445248575557505744524857555753494452485756555049445248575655505644524857565553504452485757565057445248575757545244524948484953484452494848495457445249484851555744524948485650534452494849504949445249484951484944524948495155544452494849525057445249484952514844524948495251554452494849535551445249484954535244524948495456524452494849555348445249485049575244524948505051554452494850545356445249485054565744524948515048574452494851525553445249485156525344524948515652574452494851575757445249485248545244524948525057484452494852555156445249485348565544524948534955554452494853505248445249485351495544524948535150494452494853545256445249485448555544524948545152554452494854524856445249485452485744524948545656504452494854575257445249485551575344524948555250564452494855525155445249485553565644565348515356534456534855515648445653485649495144565348565050574456534856554855445653485657514944565348574851554456534857515551445653494854505344494850484848565144495748484957525344495748484957525444495748484957525644495748484957554844495748484957575044524948505551524839449711711610411711510111458484410711599115583999579957495610248955052391255910311111110310810146107727661391011104573783959125414041594010211711099116105111110404112310311111110310810146108996191935910311111110310810146108105614859103111111103108101461031011166973611021171109911610511111040974112310211111440118971143298599738384033974610310111665116116114105981171161011241243340986197461031011166511611611410598117116101403410110510034414141594197619746112971141011101167811110010159114101116117114110329812412410311111110310810146107697312559103111111103108101461031011167669736110211711099116105111110409741123102111114401189711432986111011710810859973838403397461031011166511611611410598117116101124124334098619746103101116651161161141059811711610140341081011051003441414159419761974611297114101110116781111001015911410111611711411032981255910311111110310810146104116116112115611021171109911610511111040411231141011161171141103410411611611211558346161119105110100111119461081119997116105111110461121141111161119911110812559103111111103108101461091086110211711099116105111110404112311410111611711411032110117108108125591031111111031081014611910861102117110991161051111104097449841123116114121123103111111103108101461091084069114114111114409741443349449841125999711699104409941123125125591031111111031081014611610510910161102117110991161051111104041123114101116117114110401101011193268971161014146103101116841051091014041125591031111111031081014610811110361102117110991161051111104097449844994410044103411239761103111111103108101461081111038511410840974498449944100441034159105102403434336197411239861110101119327310997103101591189711432101611031111111031081014610899441026110311111110310810146108105591019110293619859984611111010111411411111461984611111010811197100619846111110979811111411661102117110991161051111104041123100101108101116101321019110293125591191051101001111194610311111110310810138381191051101001111194610311111110310810146118101108383811910511010011111946103111111103108101461181011084610811738381191051101001111194610311111110310810146118101108461081174097415998461151149961975910311111110310810146108105611024349125125591031111111031081014610811110385114108611021171109911610511111040974498449944100441034112311897114321016134344410261103111111103108101461081151241243434599912412445493361984611510197114991044034381011056134411241244010161343810110561344310311111110310810146103101116697340100414445496161984611510197114991044034381081011056134413838401006110311111110310810146103101116766973401004141383840101436134381081011056134431004141599761991241243447344340103124124341031011109550485234414334639711612111261105389911661344397433438999710061344398431014310243343812212061344310311111110310810146116105109101404159479410411611611258471054611610111511640974138381031111111031081014610411611611211540413838401031111111031081014610910840691141141111144034973441443349441231151149958974410310810910958491254144976134344159114101116117114110329712559103111111103108101461216112312559103111111103108101461206110211711099116105111110409744984112310311111110310810146121919746105100936191974498935911410111611711411033491255910311111110310810146108113619193591031111111031081014610811197100611021171109911610511111040974498449941123103111111103108101461081134611211711510440919197934498449993411255910311111110310810146108111971006510810861102117110991161051111104097449841123103111111103108101461081134611211711510440919744989341125591254146999710810840116104105115415911897114329761119105110100111119461081119997116105111110449861974610411410110246105110100101120791024034353441591051024048606198411231189711432996197461041141011024611511798115116114105110103409843494159474094124384111361474611610111511640994138384549616199461051101001011207910240343534413838974611410111210897991014034471151019711499104633443994611410111210897991014047409412438411021126191943893424710344343441433438999710061104344112559604711599114105112116626011511612110810162351039897114443510311711510111412310211111011645115105122101584951112120591129710010010511010345116111112584911212032331051091121111141169711011659125351039897114123104101105103104116585050112120125351031171151011141231129710010010511010345981111161161111095855112120323310510911211111411697110116591161011201164597108105103110581141051031041161254610398104444610398100123981111141001011144511611111258491121203211511110810510032359957100551024959102111110116451151051221015849112120125461039810412310410110510310411658485911211111510511610511111058979811511110811711610159116111112585052112120591191051001161045849484837125641091011001059732971081081234610398491231041011051031041165850501121205910997114103105110451141051031041165846531011095911810111411610599971084597108105103110581161111121253510398971141231021081119711658108101102116125125974610398494497461039852123116101120116451001019911111497116105111110581171101001011141081051101013233105109112111114116971101161259746103984944974610398521239911110811111458354848993233105109112111114116971101161254610398105324610398521239911110811111458351001005610150553233105109112111114116971101161254610398102324610398521239911110811111458355748483233105109112111114116971101161251060471151161211081016260115116121108101629811110012144116100449744112444610412310211111011645102971091051081215897114105971084411597110115451151011141051021259811110012112310997114103105110584859111118101114102108111119451215811599114111108108125351031111031231129710010010511010358511121203256112120324812511610012310810511010145104101105103104116584656101109125461039799951093211610012310810511010145104101105103104116584955112120125102111114109123109971141031051104598111116116111109585048112120125461041239911110811111458355154991254611312399111108111114583548489912546116115321161001231129710010010511010358481254611611512398111114100101114459911110810897112115101589911110810897112115101125101109123102111110116451191011051031041165898111108100591021111101164511511612110810158110111114109971081254610811511612310410110510310411658505311212059119105100116104585257541121201254610311510210544461081151161231021111101165849561121203297114105971084411597110115451151011141051021254610311510211512310211111011658495511212032971141059710844115971101154511510111410510212546100115123100105115112108971215810511010810511010145981111205910010511511210897121581051101081051101014598108111991075910997114103105110585111212032483252112120591099711410310511045108101102116585211212012510511011211711612310211111011645102971091051081215810511010410111410511612597461039849449746103985044974610398514497461039852123991111081111145835494999323310510911211111411697110116125981111001211239897991071031141111171101005835102102102599911110811111458981089799107125971239911110811111458354949995911610112011645100101991111149711610511111058110111110101125975810411111810111444975897991161051181011231161011201164510010199111114971161051111105811711010010111410810511010112546102108329712399111108111114583551549912597581181051151051161011001239911110811111458355353499756981259746103984944974610398521231161011201164510010199111114971161051111105811711010010111410810511010112597461039851581041111181011141231161011201164510010199111114971161051111105811011111010112535103104101971003297461039850581041111181011141239911110811111458351021021023233105109112111114116971101161254611598108991231129710010010511010345116111112585311212012546115981089932971231001051151121089712158981081119910759109971141031051105850112120324859109971141031051104510810110211658495111212059102111110116451151051221015849491121201254610811598981239897991071031141111171101005835101101101599811111410010111458115111108105100324911212059981111141001011144599111108111114583599999932355757573235575757323599999959104101105103104116585148112120125461081159898123100105115112108971215898108111991071254610211610844351021081083297123100105115112108971215810511010810511010145981081119910759109971141031051105848324950112120125461081159812398979910710311411111711010058117114108404710510997103101115471109711895108111103111505057461121101034132483245505449112120321141011121019711645120599811111410010111458110111110101599911110811111458354848485999117114115111114581121111051101161011145910410110510310411658514811212059109971141031051105848591111171161081051101015848591021111101165849531121203297114105971084411597110115451151011141051025911810111411610599971084597108105103110581161111121254610811598589799116105118101123989799107103114111117110100583599999912546108115116581021119911711512311111711610810511010158110111110101125604711511612110810162601159911410511211662604711599114105112116626010810511010732104114101102613447105109971031011154798114971101001051101034711211411110011799116471059911147103111111103108101103951081111001124610599111343211410110861341151041111141169911711632105991111103462604710410197100626098111100121329810399111108111114613435102102102346260115991141051121166240102117110991161051111104041123118971143211511499613947105109971031011154711097118951081111031115050574611211010339591189711432105101115103611029710811510159100111991171091011101164698111100121461111101081119710032613210211711099116105111110404112311910511010011111946110323838321191051101001111194611040415910510232401001119911710910111011646105109971031011154112311010111932731099710310140414611511499611151149959125101051023240331051011151034112310011199117109101110116461023838100111991171091011101164610246113461021119911711540415910011199117109101110116461039811310238381001119911710910111011646103981131024611346102111991171154041591251012510125414041596047115991141051121166260100105118321051006134109110103983462326010010511832105100611039897114626011011198114626098329910897115115611039849628310197114991046047986232609732991089711511561103984932104114101102613410411611611258474711911911946103111111103108101469911146105110471051091031041126310410861101110381169798611191053462731099710310111560479762326097329910897115115611039849321041141011026134104116116112584747109971121154610311111110310810146991114610511047109971121156310410861101110381169798611191083462779711211560479762326097329910897115115611039849321041141011026134104116116112115584747112108971214610311111110310810146991111094763104108611011103811697986111956346280108971216047976232609732991089711511561103984932104114101102613410411611611258474711911911946121111117116117981014699111109476310310861737838116979861119493462891111178411798101604797623260973299108971151156110398493210411410110261341041161161125847471101011191154610311111110310810146991114610511047110119115104112631041086110111038116979861119110346278101119115604797623260973299108971151156110398493210411410110261341041161161121155847471099710510846103111111103108101469911110947109971051084763116979861119109346271109971051086047976232609732991089711511561103984932104114101102613410411611611211558474710011410511810146103111111103108101469911110947631169798611191113462681141051181016047976232609732991089711511561103984932115116121108101613411610112011645100101991111149711610511111058110111110101343210411410110261341041161161121155847471191191194610311111110310810146991114610511047105110116108471011104711111211610511111011547346260117627711111410160471176232381149711311711159604797626047110111981146260471001051186260100105118321051006110311711510111432119105100116104614948483762601101119811462601151129711032105100611039811032991089711511561103981056260471151129711062601151129711032105100611039810232991089711511561103981026260471151129711062601151129711032105100611039810162604711511297110626097321041141011026134104116116112584747119119119461031111111031081014699111461051104710410511511611111412147111112116111117116631041086110111034329910897115115611039852628710198327210511511611111412160479762321243260973232104114101102613447112114101102101114101110991011156310410861101110343299108971151156110398526283101116116105110103115604797623212432609732116971141031011166195116111112321051006110398955548321041141011026134104116116112115584747979999111117110116115461031111111031081014699111109478310111411810599101761111031051106310410861101110381129711511510511810161116114117101389911111011610511011710161104116116112584747119119119461031111111031081014699111461051104737517010310210195114100375168991143750541011053751681165695117877411899667480122566510256119758773661033432991089711511561103985262831051031103210511060479762604711011198114626047100105118626010010511832991089711511561103981043211511612110810161108101102116584862604710010511862601001051183299108971151156110398104321151161211081016111410510310411658486260471001051186232604710010511862609910111011610111462609811432991081019711461349710810834321051006134108103112100346260100105118321051006134108103973462601001051183211511612110810161341129710010010511010358505611212032483251112120346260100105118321151161211081016134104101105103104116584949481121205911910510011610458505554112120599897991071031141111171101005811711410840471051099710310111547981149711010010511010347103111111103108101108111103111474912047103111111103108101108111103111951191041051161019598979910710311411111711010095991111081111149550555012057501001124611211010341321101114511410111210197116343211610511610810161347111111110310810134329710810510311061341081011021163432105100613410411210811110311134321111101081119710061341191051101001111194610811110838381081111084041346260100105118321151161211081016134991111081111145835555555591021111101164511510512210158495411212059102111110116451191011051031041165898111108100591121111151051161051111105811410110897116105118101591161111125855481121205910810110211658504956112120343211011111911497112613434627311010010597604710010511862604710010511862604710010511862609811462604710010511862601021111141093297991161051111106134471151019711499104343211097109101613410234626011697981081013299101108108112971001001051101036134483432991011081081151129799105110103613448346260116114321189710810510311061341161111123462601161003211910510011610461345053373462381109811511259604711610062601161003297108105103110613499101110116101114343211011111911497112613434626010511011211711632110971091016134105101343211897108117101613473837945565653574549343211612111210161341041051001001011103462601051101121171163211897108117101613410111045737834321109710910161341041083432116121112101613410410510010010111034626010511011211711632110971091016134115111117114991013432116121112101613410410510010010111034321189710811710161341041123462601051101121171163211097109101613498105119343211612111210161341041051001001011103462601051101121171163211097109101613498105104343211612111210161341041051001001011103462601001051183299108971151156134100115343211511612110810161341041011051031041165851501121205910997114103105110585211212032483462601051101121171163211511612110810161349911110811111458354848485910997114103105110584859112971001001051101035853112120325611212032483254112120591181011141161059997108459710810510311058116111112343297117116111991111091121081011161016134111102102343299108971151156134108115116343211897108117101613434321161051161081016134711111111031081013283101971149910434321099712010810111010311610461345048525634321109710910161341133432115105122101613453553462604710010511862609811432115116121108101613410810511010145104101105103104116584834626011511297110329910897115115613410011534626011511297110329910897115115613410811598983462601051101121171163299108971151156134108115983432118971081171016134711111111031081013283101971149910434321109710910161349811611071343211612111210161341151179810910511634626047115112971106260471151129711062601151129711032991089711511561341001153462601151129711032991089711511561341081159898346260105110112117116329910897115115613410811598343211897108117101613473391093270101101108105110103327611799107121343211097109101613498116110733432111110991081059910761341051024011610410511546102111114109461134611897108117101411161041051154699104101991071011006149593210110811510132116111112461081119997116105111110613947100111111100108101115473934321161211121016134115117981091051163462604711511297110626047115112971106260471161006260116100329910897115115613410210832115981089934329710810510311061341081011021163432110111119114971126134343211910510011610461345053373462609732104114101102613447971001189711099101100951151019711499104631041086110111045737838971091125997117116104117115101114614834626510011897110991011003211510197114991046047976260973210411410110261344710897110103117971031019511611111110811563104108611011104573783897109112599711711610411711510111461483462769711010311797103101321161111111081156047976260471161006260471161146260471169798108101626010511011211711632105100613410398118343211097109101613410398118343211612111210161341041051001001011103432118971081171016134493462604710211111410962601001051183210510061341039799951159911111011634626047100105118626010010511832115116121108101613410211111011645115105122101585651375910910511045104101105103104116585146531011093462609811462601001051183210510061341121141093462601151161211081016246115122112112109100988911711611695951091051001001081014511510811111645112114111109111123102111110116451151051221015811510997108108591099711410310511045981111161161111095851501121201254611512211211210910098891171161169595109105100100108101451151081111164511211411110911132974695117701051231001051151121089712158105110108105110101459810811199107591161011201164510010199111114971161051111105811011111010112546115122112112109100988911711611695951091051001001081014511510811111645112114111109111321051091031239811111410010111458110111110101591099711410310511045114105103104116585311212059118101114116105999710845971081051031105810910510010010810112546115122112112109100988911711611695951091051001001081014511510811111645112114111109111324695118701051239911110811111458114101100125604711511612110810162601001051183299108971151156134115122112112109100988911711611695951091051001001081014511510811111645112114111109111321144510510910610270107101108874869563432106115108613436116321164571122974855721115769110525936120324859343210097116974511810110061344897104857569119106561229568721105468846510486691128956757287787265706981110739966676581346260115112971103299108971151156134951187010534627810111933604711511297110623260973299108971151156134958873105343210411410110261341041161161121155847471191191194610311111110310810146991111094711711410863113611041161161121155847471121089712146103111111103108101469911110947109117115105994710810511511610111037517011510510311011711237516849375054117116109951151111171149910137516897112979995797937505411711610995109101100105117109375168104112112375054117116109959911111011610111011637516865112114495149553750541171161099599971091129710510311037516810511010010597375054112999710911297105103110105100375168777584456567459711297994510511045494848505053544579794510411211245109117451051101001059745651121144951495545841011201163897109112591151111171149910161104112112389710911259105100614957484849575253389710911259991166151389710911259117115103616570811066778691165510485501075568706811378894578122548199122107117794810785653897109112591159761883897109112591181011006148971048575691191065612295687211054688465104866911289567572877872657069815673996667658534321141011086134110111102111108108111119346278111119321121089712110511010360479762583285110108105109105116101100321091171151059932102114111109327111111110310810146604710010511862604710010511862601001051183210510061349710811534626011511612110810162359710811512310211111011645115105122101581151099710810859109971141031051104598111116116111109585052112120125359510169101123100105115112108971215810511010810511010145981081119910759108105110101451041011051031041165850561121205912535951016910132971231129710010010511010358483251112120591254695108691011231001051151121089712158105110108105110101459810811199107591099711410310511058483250112120591191041051161014511511297991015811011111911497112125469580691011231001051151121089712158105110108105110101459810811199107591099711410310511058483250112120125604711511612110810162601001051183210510061349510169101346271111111103108101469911146105110321111021021011141011003210511058326097321041141011026134471171141086311361104116116112584747119119119461031111111031081014699111461051104711510111611211410110211537517011510510337516848956856557611665701105368109104711185111786725750711101131097511911537505351683750541041083751681041053750541151111171149910137516810411110910111297103101389710911259115976185389710911259118101100614897104857569119106561229568721105468846510486691128956757287787265706981509010366676599389710911259117115103616570811066778691141207772104101102451021034911471667383974911669122109821107311781346238355051544959383550515455593835505152525938355051564959383550515250593835505154565960479762323260973210411410110261344711711410863113611041161161125847471191191194610311111110310810146991114610511047115101116112114101102115375170115105103375168489568565576116657011053681091047111851117867257507111011310975119115375053516837505410410837516898110375054115111117114991013751681041111091011129710310138971091125911597618538971091125911810110061489710485756911910656122956872110546884651048669112895675728778726570698150901036667651033897109112591171151036165708110667787051841027111112186821159745118661139080901018855557698481187165346238355052555459383550525752593835505251525938355052565059383550525752596047976232326097321041141011026134471171141086311361104116116112584747119119119461031111111031081014699111461051104711510111611211410110211537517011510510337516848956856557611665701105368109104711185111786725750711101131097511911537505351683750541041083751681161013750541151111171149910137516810411110910111297103101389710911259115976185389710911259118101100614897104857569119106561229568721105468846510486691128956757287787265706981509010366676510738971091125911711510361657081106677869841121201226579110104789010911890119538356115109737882105458210081346238355149485659383551495250593835514950505938355149515559383551485753593835514951555960479762323260973210411410110261344711711410863113611041161161125847471191191194610311111110310810146991114610511047115101116112114101102115375170115105103375168489568565576116657011053681091047111851117867257507111011310975119115375053516837505410410837516810911437505411511111711499101375168104111109101112971031013897109112591159761853897109112591181011006148971048575691191065612295687211054688465104866911289567572877872657069815090103666765111389710911259117115103616570811066778698881991111155382122824888971031197898758457116104455712110380813462383550515348593835505153505938355051545459383550515154593835505154565960479762323260973210411410110261344711711410863113611041161161125847471191191194610311111110310810146991114610511047115101116112114101102115375170115105103375168489568565576116657011053681091047111851117867257507111011310975119115375053516837505410410837516811697375054115111117114991013751681041111091011129710310138971091125911597618538971091125911810110061489710485756911910656122956872110546884651048669112895675728778726570698150901036667651153897109112591171151036165708110667787212053565680535588120117727857118516956755312182829010180501033462383550575648593835505757485938355148485559383550575754593835514850495960479762323260973210411410110261344711711410863113611041161161125847471191191194610311111110310810146991114610511047115101116112114101102115375170115105103375168489568565576116657011053681091047111851117867257507111011310975119115375053516837505410410837516810311737505411511111711499101375168104111109101112971031013897109112591159761853897109112591181011006148971048575691191065612295687211054688465104866911289567572877872657069815090103666765119389710911259117115103616570811066778691198878499511811110610711889737110387511047711981546788103705410334623835505549495938355055535159383550554954593835505551545938355055534859383550555052593835505553505960479762323260973210411410110261344711711410863113611041161161125847471191191194610311111110310810146991114610511047115101116112114101102115375170115105103375168489568565576116657011053681091047111851117867257507111011310975119115375053516837505410410837516810711037505411511111711499101375168104111109101112971031013897109112591159761853897109112591181011006148971048575691191065612295687211054688465104866911289567572877872657069815090103666765483897109112591171151036165708110667787253775711756112801007148105546952795079711018183825210953111813462383551505049593835515052485938355150555559383551505248593835515051515960479762323260973210411410110261344711711410863113611041161161125847471191191194610311111110310810146991114610511047115101116112114101102115375170115105103375168489568565576116657011053681091047111851117867257507111011310975119115375053516837505410410837516810910837505411511111711499101375168104111109101112971031013897109112591159761853897109112591181011006148971048575691191065612295687211054688465104866911289567572877872657069815090103666765523897109112591171151036165708110667787189821081197448688180857357577355121741087611571112567381121103346238355151555259383551515556593835515155535938355151574859383551515557593835515151485960479762323260973210411410110261344711711410863113611041161161125847471191191194610311111110310810146991114610511047115101116112114101102115375170115105103375168489568565576116657011053681091047111851117867257507111011310975119115375053516837505410410837516811297375054115111117114991013751681041111091011129710310138971091125911597618538971091125911810110061489710485756911910656122956872110546884651048669112895675728778726570698150901036667655638971091125911711510361657081106677872118113109815657121113455065671061045610270821088868861166974113119346238355054485059383550545550593835505356565938355054505059383550544852593835505450525960479762326047100105118626047100105118626047100105118626011511297110321051006134102111111116101114346260100105118321151161211081016134102111110116451151051221015849481121163462601001051183211511612110810161341099711410310511058495711212032971171161115911610112011645971081051031105899101110116101114343210510061341021081083462609732104114101102613447105110116108471011104797100115473462651001181011141161051151051101031608011411110311497109115604797626097321041141011026134104116116112584747119119119461031111111031081014699111461051104711510111411810599101115473462661171151051101011151153283111108117116105111110115604797626097321041141011026134104116116112115584747112108117115461031111111031081014699111109474948525048535552505552515556555549565057543432114101108613411211798108105115104101114346243711111111031081016047976260973210411410110261344710511011610847101110479798111117116461041161091083462659811111711632711111111031081016047976260973210411410110261341041161161125847471191191194610311111110310810146991114610511047115101116112114101102100111109971051106311211410110210011110961858338971091125911510510361959511711411499987811188555111182102116571131071191061181127873122751001193751683432105100613410210110410834627111111110310810146991111096047976260471001051186260471001051186260112321151161211081016134991111081111145835555455545554591021111101164511510512210158561121163462389911111212159325048495532453260973210411410110261344710511011610847101110471121111081059910510111547112114105118979912147346280114105118979912160479762324532609732104114101102613447105110116108471011104711211110810599105101115471161011141091154734628410111410911560479762604711262604711511297110626047991011101161011146260115991141051121166240102117110991161051111104041123119105110100111119461031111111031081014699100111611231041011051031041165848441191051001161045848125594010211711099116105111110404112311897114329761119105110100111119461051101101011148710510011610444986111910511010011111946105110110101114721011051031041165910510240339712412433984111897114329961119105110100111119461001119911710910111011644100613467838349671111091129711634616199469911110911297116771111001016399461001119911710910111011669108101109101110116589946981111001214497611004699108105101110116871051001161044498611004699108105101110116721011051031041165997383898383840973361103111111103108101469910011146119105100116104124124983361103111111103108101469910011146104101105103104116413838103111111103108101461081111034034344434344434479910810510111011695504852633897116121112611053898105119613443974334389810510461344398433438101105613443103111111103108101461076973415912541469997108108401161041051154159125414041596047115991141051121166260100105118321051006134120106115100346260471001051186260100105118321051006134120106115105346260115991141051121166240102117110991161051111104041123102117110991161051111103299409841123119105110100111119461151011168410510910111111711640102117110991161051111104041123118971143297611001119911710910111011646991141019711610169108101109101110116403411599114105112116344159974611511499619859100111991171091011101164610310111669108101109101110116661217310040341201061151003441469711211210111010067104105108100409741125444841125103111111103108101461001081061126110211711099116105111110409844974112310311111110310810146120106115117619859994097411255910311111110310810146100108106619959125414699971081084011610410511541594010211711099116105111110404112311910511010011111946103111111103108101461201061151141096191391091051001153993591254140415910510240103111111103108101461214110311111110310810146121461021051141151166191935910510240331031111111031081014612010611541123119105110100111119469561119105110100111119469512412412312559119105110100111119469568117109112691209910111211610511111061119105110100111119469546956811710911269120991011121161051111106110211711099116105111110401014112311610411411111932101125591051024010311111110310810146116105109101114115383810311111110310810146116105109101114115461081119710046116411231031111111031081014611610510910111411546108111971004611646120106115108115611101011193268971161014041461031011168410510910140415912510311111110310810146100108106112403947120106115479547106115471079212051100120106115461041124610111095858346104688574112118111108108117694679471099212051100115989510410144100479710992120511006566654711411692120511001064710092120511004947116921205110012299109115471141159212051100656784574811170110110997399835286107728999526811252491101151026610854501188510339443947120106115479547106115471079212051100120106115461041124610111095858346104688574112118111108108117694679471099212051100115989510410144100479710992120511006566654711411692120511001064710092120511004947116921205110012299109115471141159212051100656784574811170110110997399835286107728999526811252491101151026610854501188510339415910311111110310810146120106115614959125103111111103108101461121099961123341159895104101345812334971031011103458116114117101443499103101110345811611411710144349910810510111011634583410410110511410811111110945104112344434100104345811611411710144341001041131163458116114117101443410011534583434443410210834581161141171014434104111115116345834103111111103108101469911146105110344434105115981043458505644341069710934584844341061151111101123458116114117101443410911510311534581233499105981083458346710810197114328310197114991043444341001211093458346810510032121111117321091019711058344434108991071213458347392117484850543551575910932701011011081051101033276117991071213444341081091083458347610197114110321091111141013444341111151071163458347311011211711632116111111108115344434112115114993458348410410511532115101971149910432119971153211410110911111810110032102114111109321211111171143292117484851679732104114101102619234471041051151161111141219234921174848516987101983272105115116111114121921174848516747979211748485169344434112115114108345834821011091111181013444341159810511634583483101971149910432981213210510997103101344434115114991043458347111111110310810132831019711499104341254434110100115345811611411710144341111181143458123125443411211334583434443411410110211210034581161141171014434114102115345891934434115981121083458505244341159811211434585052443411599100345849484434115991013458534434115116111107345834122721076779110496983575768104565410249878183907788901188752341254434100345812312544348970671154710334581231251255910311111110310810146121461021051141151164611211711510440102117110991161051111104041123105102401031111111031081014610910110041123103111111103108101461091011004039105110105116394159103111111103108101461051101051167210511511611111412140415910311111110310810146109101100403910410511511611111412139415912512541591051024010311111110310810146106383810311111110310810146106461011103838103111111103108101461064612010541123119105110100111119461151011168410510910111111711640103111111103108101461064612010544484159125106047115991141051121166260471001051186260479811110012162604710411610910862