CS 211 Lab 1: Edit, Compile, Run, Test Last Updated: 2017-01-24 Tue 11:04 CS 211 Lab 1: Edit, Compile, Run, Test Due: 11:59pm Monday 1/30/2017 Approximately 1% of total grade Submit to Blackboard Sections marked (TESTED) involve functionality that is tested by the automatic test cases. Lab Exercises are open resource/open collaboration. Find a buddy for these and learn together! (Lab quizzes and lab tasks are of course not open, but we'll remind you when we have them). CODE DISTRIBUTION: distrib-lab01.zip Download the code distribution every lab, it includes test cases See further setup instructions below CHANGELOG: Empty Table of Contents 1. Rationale 2. Environment 3. Download Code and Setup 4. Problem 1: Hello, Lab! (TESTED) 5. Problem 2: CS Wisdom (TESTED) 6. Getting Credit for this Lab 7. Testing Locally Using JUnit 8. Important: Zip and Submit 9. Extras: Bender and ASCII Art Generators 1 Rationale Completing this lab will ensure that you know how to edit, compile, and run a Java program, check the correctness of your programs using provided test cases, and submit your work to Blackboard. All programming work will involve these steps, so this lab is a chance to get oriented with the assistance of course staff. Associated Reading Building Java Programs Chapter 1 discusses main() methods and printing. CS 211 Lab Manual Chapter 1 of discusses environment setup along with basic printing, execution, and variables. Video Walk-through A complete walk-through for Lab 1 is hosted on YouTube here: https://www.youtube.com/watch?v=n0FbRPrMoU0 2 Environment You may choose whatever environment you like to construct your programs but the only officially supported development tools for the course are the command line javac and java programs and the IDE DrJava. See the Section 01. Getting Started from the Lab Manual for additional information. If you will use DrJava, consider using the GMU edition which is downloadable here: https://cs.gmu.edu/~kauffman/drjava/ 3 Download Code and Setup Most labs come with some code that you need to use, which is linked at the top of the lab specification. Download the zip file distrib-lab01.zip Unzip the archive, which will create a folder named distrib-lab01 Rename this folder to NETID-LABSECTION-lab01 replacing NETID with the first part of your GMU email address and LABSECTION with your lab section. example: msnyde14-203-lab01 (Mark Snyder, Lab Section 203) example: ckauffm2-2H1-lab01 (Chris Kauffman, Lab Section 2H1) The folder already contains some code such as test cases and the junit-cs211.jar file which you will use. In particular, you will need this junit-cs211.jar file for every single testing file we use over the semester, so keep it handy. You can copy it from assignment to assignment as needed. Create your programs in this directory. During submission, you will create a zip archive for your programs and submit the zip to Blackboard. 4 Problem 1: Hello, Lab! (TESTED) Create a new file called HelloLab.java in your lab directory. public class HelloLab {
public static void main (String[] args) {
System.out.println("Hello, Lab!");
}
}
Compile and run this program in your environment of choice. Make sure to note how it behaves. On the command line, compiling and running the program will typically look like the following. lila [ckauffm2-206-lab01]% javac HelloLab.java
lila [ckauffm2-206-lab01]% java HelloLab
Hello, Lab!
Many of the demonstrations of how programs run will be shown on the command line as above. Note that my machine is called lila and I am in a directory (folder) called ckauffm2-206-lab01. Commands start after the % on the above lines such as javac HelloLab.java. Your command line environment will look different from this and require you to learn a little in order to navigate and run programs. GUI tools often involve pressing buttons to accomplish compile/run. Regardless of your programming environment or platform, all CS211 students must know how to compile and run java programs on the command line. Course staff may require that you demonstrate problematic programs on the command line in order to diagnose and if you cannot do so you may not get the help you want. If your GUI tool should fail you, the command line provides a reliable and predictable alternative that, though initially intimidating to use, ultimately provides maximum power and flexibility. 5 Problem 2: CS Wisdom (TESTED) Use HelloLab.java as a template to and create the file CSWisdom.java which prints the following message. Make sure to adhere exactly to the formatting below or your program will fail the test cases. If in physics there's something you don't understand, you can always
hide behind the uncharted depths of nature. You can always blame
God. You didn't make it so complex yourself. But if your program
doesn't work, there is no one to hide behind. You cannot hide behind
an obstinate nature. If it doesn't work, you've messed up.
- Edsger Dijkstra
Compile and run your code. Compiling and running my code looks like this: lila [ckauffm2-206-lab01]% javac CSWisdom.java
lila [ckauffm2-206-lab01]% java CSWisdom
If in physics there's something you don't understand, you can always
hide behind the uncharted depths of nature. You can always blame
God. You didn't make it so complex yourself. But if your program
doesn't work, there is no one to hide behind. You cannot hide behind
an obstinate nature. If it doesn't work, you've messed up.
- Edsger Dijkstra
lila [ckauffm2-206-lab01]%
Make sure to use System.out.println() to print each line separately so that you receive the proper output and pass the tests. 6 Getting Credit for this Lab To receive credit for this lab you must submit it to Blackboard. Credit will be assigned based on the fraction of tests you pass. You may test your programs locally as well to ensure you know what your score will be ahead of time. Most students work on labs until they pass all tests, and then submit their code. Grading Process: Graders will download your zip file, unzip it, change into the resulting directory and run a series of commands to compile and test your code. The exact commands are given in the below section. You can verify what your lab score will be by running those commands yourself. This is particularly relevant if you are using an IDE: it is your responsibility to verify tests pass on the command line. Test failures during grading will receive no credit and will not be examined for regrading. After verifying that your code runs, zip your lab directory and submit it to Blackboard under the section for lab submissions. 7 Testing Locally Using JUnit We will use the JUnit testing framework for testing in this course. It is a general example of a unit testing framework that comes in the form of a java archive which typically is a file with the .jar extension. JUnit is in the file junit-cs211.jar and contains a variety of test-related classes. The specific tests for this lab are in Lab01Tests.java. At this point you do not need to understand this file but by the end of the semester test files will become dear to your heart. Unix Users (including Mac OS X) To test your code use the following commands. lila [ckauffm2-206-lab01]% javac -cp junit-cs211.jar:. *.java
lila [ckauffm2-206-lab01]% java -cp junit-cs211.jar:. Lab01Tests
JUnit version 4.11
..
Time: 0.021
OK (2 tests)
The OK indicates that all tests have passed. Windows Users To test your code use the following commands. lila [ckauffm2-206-lab01]% javac -cp .;junit-cs211.jar *.java
lila [ckauffm2-206-lab01]% java -cp .;junit-cs211.jar Lab01Tests
JUnit version 4.11
..
Time: 0.021
OK (2 tests)
Note that in the Windows commands, there is a SEMICOLON ; rather than a colon : used in -cp .;junit-cs211.jar. Testing with Dr. Java DrJava can run these tests by opening Lab01Tests.java and clicking on the Test button. Click on test errors to jump to the test code. Most of the time this will give identical results to the command line invocation though unusual circumstances sometimes cause a divergence of these two. Failed Tests Should tests fail you may see something like this: lila [ckauffm2-206-lab01]% javac -cp junit-cs211.jar:. *.java
lila [ckauffm2-206-lab01]% java -cp junit-cs211.jar:. Lab01Tests
JUnit version 4.11
..E
Time: 0.006
There was 1 failure:
1) Lab00_2main(Lab01Tests)
org.junit.ComparisonFailure: expected:<...ou can always blame
[God. You didn't make it so complex yourself. But if your program
]doesn't work, there ...> but was:<...ou can always blame
[]doesn't work, there ...>
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at Lab01Tests.Lab00_2main(Lab01Tests.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runners.Suite.runChild(Suite.java:127)
at org.junit.runners.Suite.runChild(Suite.java:26)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
at org.junit.runner.JUnitCore.run(JUnitCore.java:117)
at org.junit.runner.JUnitCore.runMain(JUnitCore.java:96)
at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:47)
at org.junit.runner.JUnitCore.main(JUnitCore.java:40)
at Lab01Tests.main(Lab01Tests.java:69)
FAILURES!!!
Tests run: 2, Failures: 1
Of the 3 tests, 2 passed and 1 failed. Some failure information is given along with a stack trace for the failed test. 8 Important: Zip and Submit Once your are confident your code is working, you are ready to submit. Your lab folder should now have the following files in it. lila [ckauffm2-206-lab01]% ls -1
CSWisdom.java
HelloLab.java
junit-cs211.jar
Lab01Tests.java
Create a zip archive of your lab folder and submit it to blackboard. Submit only ZIP archives: not RAR, 7zip, GZ, TAR, or your favorite weird compressed format. Graders have about 60 students to grade each and dealing with a single file format makes them less cranky and less likely to give 0 credit for things they cannot decompress. If you do not know how to create a ZIP archive, read the following short tutorial. On Blackboard: Click on the Labs section Click on the appropriate link for this lab Scroll down to "Attach a File" Click "Browse My Computer" Select you Zip file and press OK You can resubmit to blackboard as many times as you like up to the deadline. Also, you can revisit your submission(s), verify what file was uploaded by downloading it, and seeing what is there. It's up to you to upload the correct file! Happy hacking! 9 Extras: Bender and ASCII Art Generators Do not underestimate the entertainment power of ASCII art. A Google image search for ascii art yields an array of amusements. You might attempt to create a file called Bender.java which prints the following picture when its main() method is run. .-.
( )
'-'
J L
| |
J L
| |
J L
.-'.___.'-.
/___________\
_.-""' `bmw._
.' `.
J `.
F L
J J
J `
| L
| |
| |
| J
| L
| |
| ,.___ ___....--._
| ,' `""""""""' `-._
| J _____________________`-.
| F .-' `-88888-' `Y8888b.`.
| | .' `P' `88888b \
| | J # L # q8888b L
| | | | )8888D )
| J \ J d8888P P
| L `. .b. ,88888P /
| `. `-.___,o88888o.___,o88888P'.'
| `-.__________________________..-'
| |
| .-----.........____________J
| .' | | | |
| J---|-----..|...___|_______|
| | | | | |
| Y---|-----..|...___|_______|
| `. | | | |
| `'-------:....__|______.J
| |
L___ |
"""----...______________....--'
Source: Benjamin Weiland While this involves some tedium, it will teach you several valuable lessons. How to edit Java files reasonably quickly, perhaps discovering how to insert the same text in multiple lines at once to preface each line with System.out.println or that your editor of choice cannot perform such useful features. Printing some characters such as double quotes (") and backslash (\) requires character escapes which are described in Building Java Programs in Chapter 1. A very interesting program would be one which takes a picture in a format such as PNG, JPG, or GIF and converts it to ASCII art. It's not hard to find such programs online but what's more interesting is how they work. Perhaps by the end of your CS career you will be writing such programs. ....,....,.....,,.,,,,,,,,,,...'......,::::,,,,,,,,,,,,,,,,........................,:''+#############################
,.,.,,.,..,,,,.,,,,,,,,,,,,,,.,',......,,:::,,,,,,,,,,,,,,..........................:;'+++#####++++++'+'+############
,,,.,.,,,,,,,.,,,,,,,,,,,,,,,,,',,.......,,:::,,,.....,,,,.,,,......................,:;''++++++';;::,,::;;'''+#++++##
,,,,,,,,,,,,,,,..,,,,,,,,,,,,,:',,,,,.....,,,:::,,.,...,,....,,,.....................::;;;;;;:::,,,,,,,,,:::::;;;;'''
,,,,.,,,.,,,,,,,,,.,,,,,,,,,,,:',,,,,.,.....,,:,::,,,,...,...........................,,::::::::,,,,,,,,,,,:::::::::;;
,,,,,,,,,,,,,,,,,,,,,,,,,,,...;;.,,,,.,.......,,:,:,.................................,,,,::::,,,,,,,,,,,,,::::;:,::;:
,,,,,,,,,,,,,,.,,,............;:.....,,.........,,,,,,,...............................,,,,:,,,,,.,,,,,,,,,::::::,::,:
,,,,,,,,,,,,,.................',..................,,,,,,,..............,.........,....,,:,,,,,.,,,,,,,,,,::::::::::,:
,,,,,,,,,,,...................'.....................,,,,:,,,,......,..,.,,,,,,,.......,,,,,,,,,,,,,,,,,:,,,:::,::,:,,
,,,,,.,,,.....................+............,..........,::,,:,,......,...,,,,,..,.......,,,,,,,,,,,,,,,,:,:,::::,,,,,,
,,,,,...,,....................'.............,.,,......,,;::,,,,,,,,,,,.,.,,,,..,.......,,,,,,,,,,,,:,,,,,,,:,,,,,,,,,
,,,,,,........................'.............;::.`..,,,,,,;::,:,..,,,,,..,,,:,,,........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,.,,,,,,......................'.............:::,,,,,,,,.,,,,,,:::,,,,,:,;:::,::,.......,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,..,,,,.,.....,..............,'...........,.;:,:;,:';,:,;:',::::::::;:,,,,::;;:.,,.....,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,
.,...,,,,..,,,,,.............:;.......,..,,,:;:;;;;'';;';;;::::::,,;;;:::;',;:,,.,.....,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,.,,...,,,.,,,,,,,...........;:.........,,:::;';::::+';;;;,,,;:,:.,.:;::',:;::;;;.......,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,...,..,,,,,,,,,,,,,.,,......':..,.,,.,,,:,';:;::;''+''',:;+;:,:,';:';;:;;:;;,,'':,.....,,,,,,,,,::,,,:,,,,,,,,,,,,,,
.....,,,,,,,,,,,,,,,,,,,,,,,,',,,,,,,,,,,::';;;;;;:'#;;::'''',;;;''':;;:::;,:';++',.....,,,,,,,,,,,,,:,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,',,,,,,,,:,,:;'.::;'';;';+'+:'::;+:';++.;;;:':':,+.;+',,,,,.,::,,:,,,,,,,,,,:,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,:':,,,,:,:,:';,;;:;''';;++#';:,;''+##+''.';'''+;++';+;':,;;:,,,:::,,,,,,,,,,,,:,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,:;:,,,,,,::'';:';;;+;;;++''::',''+#+++;:'';;+:'#'++++'+';,',:,::::,,:,:,,::,,::,:,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,:;;,,.:,::;;:;;;,::;;;'''++'::'';+'+;;;:,,:,..:;';;+++'+',:;,,,,::,,,,,:,,,,,:,,:,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,:';,.,:;::;;;:;;,:.,:,;+';;:;::;''',,,,,:;;'::,:;':;+#++'',,;;,,:::,,,::,::,:::,:,,,,,,,,,
,,,,,,,,,,,,,,.,,,,,,,,,,,,;;;..:;;'::::'',,:;;.:,;;;''::''+';:....:,,+:;:;:;;;''+++;,;::,,:,:,,:,:,:::::::,,,,,,,,,,
,,,,,,,,,,,,,..,,,,,.,,,,:,;;',;::'+;;.,;.;',,';.`,,,::,;;+;;:,:.,.,,;'''';;:;,:.#'+::',;,,:,,::,::,,:,,:::::,,,,,,::
,,,,,,,,,,,,,,,.,,.,,,,,.,:;';,:;;,;'';:';':;,,,::..:;;''';;::..:;:.,:'+'+''':;:;,++''''::,,:,::::::::,::,:,,,,,,,,:,
,,,,,,,,,,,,,,,,......,,,,,'':;:';::::;:,:;::;,:::;,,,:'+;;,::;,,:;;:;;+''++''++,:#+''++';,,,,::::,,:::::::,:,,,:::::
,,,,,,,,,,,,,,,,......,,,,:'',:'':,:;,,:,:,,:.,.,..:;''+;:,,.,,.:;;+;;:''+++++++;:+'#';++',,,,::::::,:,:::,:,,,,:::::
,,,......,,..........,,,,,,;::;;;';,;,:,.,,,';:;;:;;'++',.:...:;;';++:;;+;;++'+#;+##:#;.#':,,:,::::,::,:::::::,::::::
,,,...................,,,,:,:;:';;;;:;:;';::;;.;::''+::,:..`,.;''+'+++;'++;++++'+++#+'++,#;,,,:::::::::,,::::::::::::
..,,,..................:,.:,;;;':;;;,,;:;::,..,.;;'+;;'::::+,:'+#++';++;;+:+++#+''#++#+'++':,:::::;::::,:::::::::::::
,..,,,...............,:'::,;::+;::,.,,,,,,.....,,:::';'':+;;:'';++#+++#''+;+++##++###+#+''+:,::::::::::::::::::::::::
,,,,,,,..........,,...,';:::;,;;:.;:,':;';;;.;:,;'';;+'++'++:;''##+#'+#++#'##+##+#+######:':,,:::::::::::::::::::::;;
..,,,,,,...,,.,...:.,,:'::;:'::::':;:,.,,:'''+;:;'+++++++:+#++:##++##+#++#+#######+######++',,:::::::::::::::::::;;;;
,,,.,,,,,,,,::,,,.::;;',;;;';;;',:;:;:.`:`,+;;,;;'++'+#+##+#+;+#+#####+####+##############++,:,:::::::::::::::::;;;:;
,,,,,,,,,,,,,:;.:.';';;';'':,::':,::,,,,.`,`,:`.'';''++####+#+#############+###############+:,:::::::::::::::;:::::::
,,,,,,,,,,,,,,;;::+'+';'::::+:;++;:;;:',',..,.:;:++''+##+#######+++#########@##############+;::::;:::::::::;;:::::;:;
,,,,,,,,,,,,,,,:;;+++'';''#,+;;,,;,,,,:',;:;::;'''+#+'++##'############@@##@##@######@@#####',,:::::::::::;:;::::;;::
,,,,,,,,.,,..,,,,;+:;:+++':;:::;;,+,,,',;;';;''+'++++####+########@@#@########@#####@#@@###+':,,::;;:::::;:::::::::::
,,,,,,,,,,,,,,.,,:';';+'';:;;::.,:,:,:;,:'+'+''+++++##########+##@@@@@@@###@##@@#####@@@#@###:,::::;:::::;::::::;;::;
.,,,,,,,,,,,,,,::;,;'+'+,;'+''';;:'';;:::;'+++++##+###############@@@#@@##@########@###@@@###',::::::::::::;:::::::::
,,,,,,,,,,,,,,::;;;++++';:'''::;.';:;''';+++++######################@##@@@@###@#@##@@#@@@@@##+,:::::;:::;::::::;;::;;
,,,,,,,,,,,,,,:;''''+++';':;;::;::';::+++;+#+###########@#####@@@########@@#@@@#@####@@#@@@##+::,,:;;;;::;:::;:::::::
,,,,,,,,,,,,,,;;''+++++;:;+'''':,::;;;;+'+#+;+###########@##@@@###@@@####@##@##@@##@##@@##@@@+;:,,::;;::;;:::::::::::
,,,,,,,,,,,,,,'::''''+;'::;:'',,;;'';;;;;:'#+'#@@@@#######@@@@@@#@@@@@@######@#@@@#@##@@@##@##':,,::;;;:;;;;;::::::::
,,,,,,,,,,,:,:+''+;'':#+#'':';,:'';';'+++++#++###@@@@@#@#@@@@#@@#@###@######@@@#@@###@@@@@##@#+:,::::;;;;;;;:::::::::
,,,,,,,,,,,,,'+';'++++#:#'';,;';:;'''+++++##'#####@@@@@@@@@@#@###@@@#########@@@@@@@@@@@#@@@##+::,:::;:;:;;;:;;::;:::
:,,,,,,,,,,,,''+++++';:',';'+'#'+++++'''+#'########@@@@@@@@@@######@###########@#@@######@@@###+:,::::;;;;;;:::::::::
;::,,,,,,,,,,''++'++;::'+,;'#++#+####+''+##########@@@@@@@@@####################@@@@#@#@@#@@###+:,,:::;;;';:;;:;:::::
+##'::,,,,,::;';;'+',,:::++'+#######################@@@@@@@@####################@@@@@@##@##@@@#+:,,::;:;;;;;:;;;:;:::
######';:,,;'';;':,;;:;':'+''++#######@@#############@@@@@#######################@@@@@##@#@##@##',:::::;;;;;;:;;:::::
++#++####++;';;;:,;'';;'''+#+++#######################@@@#########################@@@@@@#########::,:::;;;;;;;;;;::::
::'++++####';,:;;:''';++'++##+#########################@@#########################@@@@@@###@@@##+;::::::;;;;;;:;:;:::
::::::'+#+';:;;:++;+';++'+++######################################################@@@@#@@##@##@#@+:::::::;;;;;:;;::::
:::,:,,:::'',;:';+#+#'+'+++##########'+############################################@@@@@@@#@#@###+:::,::::;;;;';;;;:;
::::,::,,,:,,;'+++##@#+++'+++#############################################+#########@@@@@@@@@@#@#+;:::::::;;;;';;;;;;
:::::::::,;,:;'+######+'+#++++############################################+#++#######@@@@@##@#@@##':::::::;:;;;;;;;;;
::::::::,:':;:'######+'''+++++#######################################+++++++++########@@@@@@@#@@##+;::::,:::;;;;'';;;
::::::::::::,;++##@@#+''''++++++####################################+++++++++++########@@@@@@#@@@##':::::::;;;;;''';;
::::::::::;;;;+######+'''''+++++++################################++++++++++++++++######@#@#@#@@@###;::::::::;;';''''
::::::::::;:';'+#####+''''''++++++++##+##+#####################++++++++++++++++++++#####@@#####@@###';:::::::;;;;''';
:::::::::::;';;+#@@@#+''''''++++++++++++++#######################++++++++++++++++++++####@######@####;:::::::;;;''';'
::::::::::,;:':+##@#++''''''++++++++++++#######################+#++++++++++++++++++++#########@####@#':::::::::;';;''
::::::::::,::+'+####+'''''''++++++++++++++#+###################+++++++++++++++++++++++###########@#@##::::::::::;'';'
::::::::::,:'''#+###++'''++'++++++++++++++++#+###############+#++++++++++++++++++++++++########@@@#@@+;::;:::::::;'''
::::::::::::;#'+####++''''''+++++++++++++++##########+##++###+++++++#++++++++++++++++++########@##@##+':;;;;::::::;;;
,::,::::::::'#++####++''''+'+++++++++++++++++########+#+++++++++++#+++++++++++++++++++++#######@@@###++;:;;;;;:::;:;;
,,,,,,::::::'#+'####++'''''+'++++++++++++++#######+++++++++++###++##++++++++++++++++++++#####@##@###++#';;;;::::::::;
:::,,:,::::;'+#;+###+'''''+++++++++++++++++#+++#++++++++++++####+####+++++++++++++++++++#####@@#@####+++;;;;;;;;:::::
,:,,,,,,:::'++##+###+''''''++++++++++++++++++++++++++++++++##########+##++++++++++++++++#####@#@####+++';;;;;;;:::::;
::,:,,,,,::;+#######+'''''+++++++++++++++++++++++++++++++++################++++++++++++++####@@@@##+++#++;;;;;:::;;:;
:::,::,,,,:''+#####++'+'''+++++++++++++++++++++++++++++++##############+++###++++++++++++####@@@##+++++++;;;;;;::::::
::::::,,,::+++######+''''''''++++++++++++++++++++++++++###########+++++#+++++#+++++++++++#####@#@#+#'++++'';;;;;;;:::
:::::::,:::;+#######+''+';''++++++++++++++++++++++++++###########++++++'+++++++++++++++++####@@@@#++++++++';;;;;;;;;:
::::::::,:::+#######+'''';'''+++++++++++++++++++++++#########@#++'''''''''''++++++++++++++####@@@###+#+++++;;;;';;::;
:::::::::::,'#######+''+'''''+++++++++++++++++++++++#########+'++'''+''''''''+++++++++++++####@@@@##+######+;;;;;;;;;
:::::::::::,:+######+'''''''''+'+++++++++++++++++++########+++++#######++'''''+++++++++++++####@@@##+++#####';;;;;;;;
:::::::::::::;######+''''';'''+++++++++++++++++++++###++++++++###########+++'++++++++++++++####@@@#++++####+';;;;;;;:
::::::::::::::++####+'''+';;''+++++++++++++++++++++++++++'++###########+##+++++++++++++++++#####@@#++++###++';;;;;;;;
::::::::::::::;#####+'''+';:;''++++++++++++'+++++'+++''''+#######@@@######+++++++++++++++++#####@@#+++'##++''';';;;;;
::::::::::::::::####+''''';;''+'+++++++++'++'+'+'+++'''+++########@@@######+++++++++++++++++####@@#+++'##+'''+'';';;;
::::::::::::::::'++###'''';;'+++++++++++++'''++++'''''+++#####+###@@@@##+######+++++++++++++###@@##++++##+';+'';';;;;
:::::::::::::::::##+##'''';''+++++++++'++'+'++++'''+'++++#####+#@#@###++++++###++++++++++++++###@##++++#+'';''+;;';;;
:::::::::::::::::;+++#+'''+'+#++###++++'''+++++++''+++++########@###+++++++###++++++++++++++####@###+++++'''''#+;;;;;
::::::::::::::::::;'###;'+'+##+###+++++'''++++++++++++++###@######++++++++##+++++++++++++++++####@##+''+'''''+#+:;;''
:::::::::::::::::::;;##''++'+#####++++++'''+++++++++++++########+++'''+++#####+++++++++++++++#######+'+++''';#@#;;'';
;;:;:;:::::::::::::::;++'++######+++'+'''''+++++++++++########+++''''+++##+++++++++++++++++++#@@@@##++++++''+###;:;''
;;;;;;;:::::::::::::;;'''++#+++''++###+++++++++++++++#########+++++++++++++++++++++++++++++++#@@#@##+++++++'+@##;::;;
::::;;;;;::::::::::::;':'++'';''##########+++++++++++############+++++++++++++++++++++++++++++#@#@@@#++++++'#@##':::;
::::::;;;;;::::::::::;':'''';;+#############+++++++##############+++++++##+++++++++++++++++++###@#@#+++++++'#@##;:::;
::::::;;;;;;;;:::::::;;:;+';;'#+####@@@@@#@#+++++################++++####++++++++++++'+'+++++##@@###++++++'+#@@+::::;
::;:;:;;;;;;;;;;:::::';::;';;++##++##@@@@###+++++########################+++++++++++++''+++++#######+++++''##@@+:::::
`.,::::;;;;;;;:::;;;;';::;;;;'+@+++@@#@@####+++++++#########+++#+++##+++++++++++++++''''+++++#######++++''+###@#:::::
````.,::;;;;;;;;::::;';;;;;;;'####+##########+++++++########+++++++++++++++++++++++++'+'++++++######+++++++####+:::::
```````..,:;;;;;;;::;';;;;;;''#######+++#####+++++++++########++++++++++++++++++++++++++++++++####++++++++#####':::::
```````````.,::;;;;:;';;;;;;;++++##+++++++##+++++++##############++++++++++++++++++++++++++++++#++++++++++#####'::::,
```````````````.:::;;';;;;;;;+'''''''''+++##+++++#######++++++##++++++++++++++++++++'++++++++++++++++++#++#####;::::,
``````````````````.,;';;;;;;'''''''''''+++++++++++#+###++++++++++++++++++++++''++'+++'++++++++++++++++++#++###+;:::::
````````````````````::.,::;;';''''''''+++++++++++######++##++++++++++++++++++++++'++'++++++++++++++++++++####@'::::::
..``.....``...````.`;,.....:';'''''''+++++++++++++++#++++######++++++''+++'+'''+''++'++++++++++++++++++#+++###;::::::
;;:;;;;;::;;;:.:;:,:';;;;;;;;;'''+'++++++++++++++++++++#+#######++++'''''''''''''''++++++++++++++++++++++++##';::::::
;;;;;''';;;;;;;';;;;';;';;'''+''''++++++++++'++++++++++++#######++++++++'''''''''''''+++++++++++++++++++#+###;;::::::
;;;;';;;;;;;;;;;;;;;';;''''''''+++++++++++++'+++++++++++++#+++++#++++++++'''''''+''+''+'++++++++++++++++++###;;::::::
;;';';;;;;'';;;;'''''';'''''''+'+'++++++++++'++++++++++++++++++++++++++++'+++++''''++'+''++++++++++++++#++##';:::::::
''';'''''''';';'''''''''''''''#''++++++'++'''++++++++++++++++++'+++++++++++'+++++''++++++++++++++++++++#++##;;:::::::
''''''''''''''''''''''''''''''''''++++++++'''+++++++++''+++'''''#++++++++++++'++++'++++++++++++++++++++++##';;:::::::
;;''''''';'''''''''''''''''''''+'''+++++++'''+++++'+''''''';''+#+++###+++++++++'+++++++++++++#++++++++#++##;;;:::::::
::::::::::::::;;;;;'';;;;''''''''''''+++++'''+''+'''''''';+++##++######+++++++++++++++++++++++++++++++#####;;;:::::::
:::::::::::::::::::';:::::::::::''''''''''''''''''';'';'++++++##+####+#+#+++++++++++++++++++++++++++++####+;;;:::::::
::;::::::::::::::::';:::::::::;;;'''''''''''';;;;;;;''+'''++++#########+++++++++++++++++++++++++++++++++##';;;;;:::::
::;:::::::::;:;::::';;:::::::::;;;'''''''''';;;;;;;;;''''++++##########++++++++++++++++++++++++++++++#####';;;:;:::::
:;:::::::;;;:::;;;:';:;;;:::::;:;;''''''''''''+++';;'''''+++##########+++++'+++++++++++++++++++++++++#####';;;;;;::::
:;:::;;;;;::;:::::;':::;::;:::;:::;'''''''''++++++++'+++++++##+####+++++++'+#++++++++++++++++++++++++####+;;;;;;;;:::
:::::::::;:;::::;;;':::::::::::;;;;;''''''''++++++++++++++++++++#++++++'''####++++++++++++++++++++++#+###+;;;;;;;;;;:
:::;:::::::;::::::;'::::::::;:;;;;;;'''''''+++++++++++++++++++++++++++''+######+++++++++++++++++++++#####';;;;;;;;;;:
:::;;:::;;;;;;;:;;;':;::;::;;:;;;;::;''''''+++++++++++++++++++++++++++++@@######++++++++++++++++++++#####';;;;;;;;;;;
:::;;:::::;;;;::;;;';;::;::::::;;:::;;;;'''++++++++++++#####+++++++++++@####+###+++'+++++++++++++++######';;;;;;;;;;;
:::::::::;;::;:;;;;;;:::::;:::;::::::;;;'''++++++++++++#####++++++++#@###++#+#+++++++++++++++++++++#####+;;;;;;;;;;;;
::;;;;;;;;;;::;;;;';;;:::::::::;;;::::';'''++++++++++++###++++++++#######+++++++++++++++++++++++++######+;;;;;;;;;;;;
::;;;;;;;,:;:;;;;;';::::::;::;;;::::;::;'''+++++++++++++++++++++#######+++++++++++++++++++++++++++######';;;;;;;;;;;;
:;;;;;;::;:;:;;::;':;:;;;::::::::::::;;;'''''+'''''+++++++++++#@#####++++++++++++++++++++++++++++++#####';;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;'::::::::::;;;;;;;;:::'''''''';'''+++''+'+########++++++++++++++++++++++++++++++######';;;;;;;;;;;;
;;;;:::;;::::;:;;;'::::::;;:::;;:::;::::;'''''''+@#+++############++++++++++++++++++++++++++++++++#####+;;;;;;;;;;;;;
:;::::::::::::::::'::::::;;;;;;:::::::;;;;''''''+##############+++++++++++++++++++++++++++++++++++#####';;;;;;;;;;;;;
;:;::;;;;;::::;::;';;:;;;;;;;;;;::::::::;;;'''''+++#++#######++++'++'+++++++++++++++++++++++++++#######';;;;;;;;;;;;;
';;;:;;::;::;:::;'';:::;;::;::;:;::::::::::;'''++++++++###+++++'''''+'++++++++++##+++++++++++++++######;;;;;;;;;;;;;;
;;;::::::::;;;;;:;;::;;;::::::::::::::::::::''''+++'+++++++''''''+'''++++++++++#++#+++++++++++++##+###+;;;;;;;;;;;;;;
:::,:::;::::::;;;;;:;:::::;;:,::::::::;:::;::''+++++''''''''''''+'''''+++++#++#+#+++#+++++++++++++#+##';;;;;;;;;;;;;;
:::::::;;::::::::;;;;;;:;;:::;;;:;;;::;:::;;;;''++++'''''''''''''+''++++++++#######+++++++++++++++++##';;;;;;;;;;;;;;
;;;;;;;;';;;;;;''';;;;;;;;::::::;;;;;::::;::;;;''++++''''''''''''+++++++++##+######+#++++++++++++++#+#';;;;;;;;;;;;;;
:::,:,::;;:::::::',::::,,:;;;;;;;''';;;;:;;;:,;;''+++''''''''++++++++++++##########++++++++++++++++##+;;;;;;;;;;;;;;;
:::::::::;:::::::':::::::,:;;;;;:::::;;;;;::;:;;;''+''''''''+++++++++#+###+#########+++++++++++++++##';;;;;;;;;;;;;;;
:::::::;;;;;::::;'::;;;::;::::::::::;;;;:::::;:;;;''+''''''+++++++#+++##+#######++++++++++++++++++++#;;;;;;;;;;;;;;;;
:::::::;;;;:::;;;';:::::;;::;;;;;;:;;;;;';;;;;;:;;;'''++''+++++++##+++#+#####+##+##++++++++++++++++++;;;;;;;;;;;;;;;;
:;;;::;::::;;;;;;;:::::;;;::::::;;;;;;;;;;;;;;;;'''''+++++++++++###+##++##+#####++#+++++'++++++++++++;;;;;;;;;;;;;;;;
::;;:::;:::::;;;';;;;:;;;;;;;:::::::::::;:::;;;;';;;'++++++++++++++++++++#####+++++++++'''++++++++++';;;;;;;;;;;;;;;;
::::,:::::;;;;;:;;::::::::::;:::::;;;;;;;;;;;''''''';;'+++++++++++++++++++++++++++++++'''''++++++++#';;;;;;;;;;;;;;;;
;;:::::::;::;;::';;;::::,::;;;;::::;;:;:;;;::;;;;;;;::'++++++++++++++++++++++++++++++'''''++++++++++;;;;;;;;;;;;;;;;;
:::::::::::;::::;::::::::::;:::;;;::;;;:::;'';;;;;;;::;+++++++++++++++++++++++++++++'''''''+++++++++;;;;;;;;;;;;;;;;;
;;;::;;:::::::::'::::;;';;::;;:::::::;;;;;;;;;';;;;;;;:;++++++++'''+++++++++++++++++''''''''+++++++';;;;;;;;;;;;;;;;;
::::::::::::::;;'::;;;;:;::::;;;;::::::::::::;;;;;;:::,,++++++++'''''''+++++++++'+';''''''''''+++++;;;;;;;;;;;;;;;;;;
::;;;;;;;;;::;';';;;;;;''';'';;:::::::::,,:::;:::::::,,,,++++'+'''''+''''++++++++''''''''''''''++++;;;;;;;;;;;;;;;;;;
;;;';;;;;;;''+'''''''''++++''';;;;;;''';;;;;::::;::,,,,,,:'+'''''''''''''''+++''';''''''''''''''+++;;;::;;;;;;;;;;;;;
::;::;;;;;;;''''';;;;;;;';;''''':;:;';;;;;;;::;:::::,,,,,,;'''''''''''''''''''';;;'''''''''''''+'+';;;::;;;;;;;;;;;;;
;;;;;::;:;;;;;;;;;;;;;;;;;;;;;;::;;;;;''''';;;,,;;;:,,,,,,,;''''''''''''''';;;;;;''''''''''''''''+;;;:;:::::;;;;:;:::
;::::::::::::;;;;;;;;;'''''';:;;;;;;;;;;;;;;;;:;:::,,,,,,,,,:'';'''''';:,:::;;;;';'''''''''''''''':;::;;:::::;:::;;;;
;::::::::;:;;;;;:;;;:::;'':;;:::::::;;;;;;:::::::::,,,,,,,,,.`.:;::,.. ..;;:;;';;;;;';'''''''''''';::::::::;;;::::;;;
:,,::::::;;;;;:;::;;;;;+:':::::::;::;;:::::::;;;;',,,,,,,,,,.``````.`. `,:;;;''';;;;;;'''''''''''':::::::::::::::::::
:::::::::::::;;;;;;;;;;;'';;::::,,:::::::::;;'';::,,,,,,,,,.``````.`.` `,:;;;''';';;;'''''''''''';:::::::::::::::::::
;::,,,:::::::;;;'';;;:::'';::::;;';;;:::;;;;;;;'',,,,,,,,,.```````.`````,::;;'';;'';;;'''''''''''::::::::::::::::::::
,,::,,,,,,,,:::':::::;:+;'';:::::::;;;;:;'''';';;,,,,,,,,,.```` ..`..` `.::;;'';;;'';'''''''''+''::::::::::::::::::::
::::,::;;;::::;';::::,,+'''::::;::;;;;;;'''''''':,,,,,,,,.```````.`..```.:::;'';;;'''';'''''''++'::::::::::::::::::::
:::::,,:::::;;';;;;;;;;+''':::,,:::::;;;;;;;;;;;,,,,,,,,..````````...` `.::`;'';;;'''';''''''''':::::::::::::::::::::
:;;;;;;;::;;;;';;::::::++''::;;;;;;::::::;::::::,,,,,,,,.`````````...` `.,``:'';;;;''';''''''''':::::::::::::::::::::
;;::::::::::::;;::::;;;++''::::;;;;;;;::::::::::,,,,,,,.``````````...` `,. .:';;;;;'''''++'''''+:::::::::::::::::::::
''''';';;::;:;';;;;''''++'';;:;;::;::::::;;;;;;;,,,,,,,.`````````....` `.``.:;;;;;;''+''++++'''+:::::::::::::::::::::
''''''';:;;;;';'''''';;++;';'';;;;;';;::::::::;;,,,,,,,.`````````....` `` ``,;;;;;;''''''+++++++:::::::::::::::::::::
:;;';;::::;;;;;;;:;;;;;'+;'::;;;++';:::::;;;;;'',,,,,,.````````......``` ``.;;;;;;''+'''+++++'':::::::::::::::::::::
;::::::;::;;;;':::::::;'+;'::::;;::::::,::::::;:,,,,,,.`````````.....``` ``,;;;;;''''''+++++++::::::::::::::::::::::
:::;;;:;::;;;'':::::;;;'+:'::,,,,:,,::;;;;;;';;,,,,,,.`````` `.`....```` `,';;;;;''++++++++++:,::::::::::::::::::::
;:::;:;,,::;:;':::;;''''+:'''''';:::;'''';:::;;,,,,,,.````` ``......```` `:';;;;;''+++++++++:::::::::::::::::::::::
;;;;:;:::::::;;::::::::;+:';:;;::;;;;::;;;;;:::,,,,,,.```````.`......``` ```:;;;;;;;''++++++++::,::::::::::::::::::::
,,,::::;;::::;';;;;::::;+:'::::::::::::::::;'';,,,,,..`````````.....``` ` `.:';;;;;;'++#+++++::::,:,:::::::::::::::::
;;;:::::::,,:;;:::::,::;+:';;:;;;:::::::::,:::,,,,,,.```` ````......``` ``:;;;;;;;'++++++++::::,,,:::::::::::::::::
';;'+;;::,,,,;;;;;;;;;::+:';:,,,:,:::::::,:,,,,,,,,,.````````````...``` ``:;;;;;;;'+++++++,:::,,,,:::::::::::::::::
;;;''+'''';;;;::::::;;;'+:''';;::;:::::,:::::::,,,,.``` ````````.`..```` `.,;;;;;;;'+++#++'::::,,,::::::::::::::::::
;'''''''+++++;''';''''''+;';;;;;;::;;:;:,:,:::;,,,,.``````````````..````` ``,;;;;;;;'+++#+#:::::,:::::::::::::::::::,
;'''''''''''';;;;;;;;;::+;'';;::::::'';;::::,:::,,,.```` ```````...```` ``.;;;;;;;'+++++::::::::::::::::::::::::::,
:;::::;:;;';;;::::;;;;;'+;''::;;;;:;;:;;;'''';':,,,.`` `````````....``` ```.;;;;;;;'+++#'::::::::::::::::::::::::::,
Author: Mark Snyder, Chris Kauffman (msnyde14@gmu.edu, kauffman@cs.gmu.edu) Date: 2017-01-24 Tue 11:04