DIGNUM - Digital LED Number

no tags 

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

hide comments
nadstratosfer: 2017-11-13 03:12:51

Testfiles are clean - expected having to do some defensive input coding but it wasn't needed. Nice problem.

kass_97: 2017-01-13 23:30:49

My 150th.....and really a nice one, avoid TLE by using while(gets(a)) :D

Baojun Wang: 2015-08-01 08:04:53

Nice problem

:D: 2012-05-30 20:28:39

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).

Saumya Rastogi: 2012-05-30 19:59:21

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?


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