Woburn Challenge 2015-16 Round 2 - Senior Division

"Always two there are, no more, no less. A master and a n00b."
"But which was destroyed, the master or the n00b?"
The exciting climax of the highly-anticipated 1999 Star Wars prequel features four distinct action sequences occurring simultaneously:
- Jar Jar Binks leads the Gungan army in a diversionary battle against the Trade Federation's droid army on the plains of Naboo.
- Queen Amidala and her security force storm the palace in Theed in an attempt to locate and arrest Viceroy Nute Gunray.
- Obi-Wan Kenobi and Qui-Gon Jinn have a lightsaber duel against the Sith lord Darth Maul.
- Anakin Skywalker pilots a Naboo starfighter into orbit amidst a massive dogfight, attempting to take out the Trade Federation's droid control ship.
During this time, the film needs to cut back and forth between these
settings. In particular, there are
Some of the scenes have already been assigned to settings, while others
haven't been. The status of the
Your job is to assign each of the unassigned scenes to one of the
Input Specification
The first line of input consists of a single integer
The second line consists of
Output Specification
Output on a single line the numeric representation of your finalized scenes.
Sample Input
8
0 4 1 0 0 1 3 0
Sample Output
14123131
Comments