<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> MOD = <NUM_LIT> + <NUM_LIT:7> <EOL> class Solution ( object ) : <EOL> def solve_TLE ( self , cipher ) : <EOL> """<STR_LIT>""" <EOL> A = map ( int , list ( cipher ) ) <EOL> f = A [ <NUM_LIT:0> ] <EOL> num = A [ <NUM_LIT:0> ] <EOL> sig = <NUM_LIT:1> <EOL> for i in xrange ( <NUM_LIT:1> , len ( A ) ) : <EOL> num = <NUM_LIT:10> * num + A [ i ] <EOL> sig *= <NUM_LIT:10> <EOL> temp = num <EOL> temp_sig = sig <EOL> while temp_sig >= <NUM_LIT:1> : <EOL> f += temp <EOL> f %= MOD <EOL> temp %= temp_sig <EOL> temp_sig /= <NUM_LIT:10> <EOL> return int ( f ) <EOL> def solve ( self , cipher ) : <EOL> """<STR_LIT>""" <EOL> pre = [ <NUM_LIT:0> for _ in cipher ] <EOL> pre [ <NUM_LIT:0> ] = int ( cipher [ <NUM_LIT:0> ] ) <EOL> for i in xrange ( <NUM_LIT:1> , len ( cipher ) ) : <EOL> pre [ i ] = ( pre [ i - <NUM_LIT:1> ] * <NUM_LIT:10> + int ( cipher [ i ] ) * ( i + <NUM_LIT:1> ) ) % MOD <EOL> s = <NUM_LIT:0> <EOL> for elt in pre : <EOL> s = ( s + elt ) % MOD <EOL> return int ( s ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> import sys <EOL> f = open ( "<STR_LIT>" , "<STR_LIT:r>" ) <EOL> solution = Solution ( ) <EOL> cipher = f . readline ( ) . strip ( ) <EOL> s = "<STR_LIT>" % ( solution . solve ( cipher ) ) <EOL> print s , </s>
