output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: t = eval(input())
  data = []
  ans = []
  for i in range(t):
      data = list(input().split())
      result = (int(data[0])) ** (int(data[1]))
      transtr = len(str(result))
      ans.append(transtr)
  for i in ans:
      print(i)
  
problem_description: Statement
  
  For a positive integer n, let us define f(n) as the number of digits in base
  10.
  
  You are given an integer S. Count the number of the pairs of positive integers
  (l, r) (l \leq r) such that f(l) + f(l + 1) + ... + f(r) = S, and find the
  count modulo 10^9 + 7.
samples: [{"input": "1", "output": "9\n    \n\nThere are nine pairs (l, r) that satisfies the condition: (1, 1), (2, 2), ...,\n(9, 9).\n\n* * *"}, {"input": "2", "output": "98\n    \n\nThere are 98 pairs (l, r) that satisfies the condition, such as (1, 2) and\n(33, 33).\n\n* * *"}, {"input": "123", "output": "460191684\n    \n\n* * *"}, {"input": "36018", "output": "966522825\n    \n\n* * *"}, {"input": "1000", "output": "184984484"}]