DIGNUM - Digital LED Number

Given a digital LED pattern of a number. You have to find the number and print it. All inputs will be valid as shown.

Input

Input consists of LED patterns. Each pattern is given in set of fixed number of lines. You have to read input till EOF.

Output

Print the number corresponding to each pattern.

Example

Input:
_ _  _  _  _ _
 _| _| _|| ||_||_
|_  _||_ |_|  | _|
_     _    _
  ||_ |_||_  || |
  ||_|  ||_| ||_|
_  _  _  _    _
  ||_||_||_  ||_|
  |  | | _| ||_|


Output:

232095
164610
799518

Added by:XeRoN!X
Date:2010-09-05
Time limit:0.209s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All

hide comments
2017-11-13 03:12:51
Testfiles are clean - expected having to do some defensive input coding but it wasn't needed. Nice problem.
2017-01-13 23:30:49
My 150th.....and really a nice one, avoid TLE by using while(gets(a)) :D
2015-08-01 08:04:53 Baojun Wang
Nice problem
2012-05-30 20:28:39 :D
line ends with '\n' or EOF (-1). I was allocating 60KB for the input line, but you can write to be custom (use std::string for example).
2012-05-30 19:59:21 Saumya Rastogi
EOF marks the end of the entire input? but then what marks the end of each line of input...or what is the limit of number of digits in one line?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.