DWITE Contest

Test Case for Question #4 in DWITE 2010-2011 High School Round 4

Contest: DWITE 2010-2011 High School Round 4
Question: #4
Input File: DATA4.txt
Output File: OUT4.txt


Input

3211213120
1201235533
5757667676
8755445755
6577689988
6655789787
5778999768
6443100010
0002120024
4445310000
----------
0020000302
1354455799
9998756641
4233246785
6424634699
7979689655
4236787754
1110357996
6432446541
2111100000
----------
2133133455
3354435689
9986553223
1011320100
0133200000
1345667533
1233566542
0120010243
4567564202
2454434432
----------
1016314005
0021012000
0000001427
4157978726
9979999996
9999999477
9784422003
0035496899
9898468599
8447977949
----------
9998997553
5778999978
6766667798
9879997999
9976899997
8897877553
5432001111
3457686754
4643102235
3434544666
----------




Output

12
9
10
IMPOSSIBLE
13