def expt(a, n, p) res = 1 while n > 0 do res = res * a % p if n % 2 == 1 a = a * a % p n >>= 1 end return res end p = 1000000007 q = 101010101010101010101 d = Array.new(60) d2 = Array.new(60) d[0] = 1 for i in 1..59 do d[i] = d[i-1] * (expt(10, 1 << i, p) + 1) % p end d2[0] = 1 for i in 1..59 do d2[i] = d2[i-1] * (expt(10, 1 << i, q) + 1) % q end n = gets.chomp.to_i x = 0 m = n-1 idx = 0 while m > 0 do if m % 2 == 1 then x = (x * expt(10, 1 << (idx+1), p) % p + d[idx]) % p end m >>= 1 idx += 1 end x = (x + expt(100, n-1, p)) % p print "#{x}\n" x = 0 m = n-1 idx = 0 while m > 0 do if m % 2 == 1 then x = (x * expt(10, 1 << (idx+1), q) % q + d2[idx]) % q end m >>= 1 idx += 1 end x = (x + expt(100, n-1, q)) % q print "#{x}\n"