output_description: For the birthdate specified in each dataset, print in a line the number of
  days from the birthdate, inclusive, to the millennium day, exclusive. Output
  lines should not contain any character other than this number.
input_description: The input is formatted as follows.
  
  > _n_  
  >  _Y 1 M1 D1_  
  >  _Y 2 M2 D2_  
  >  ...  
  >  _Y n Mn Dn_
  
  Here, the first line gives the number of datasets as a positive integer _n_ ,
  which is less than or equal to 100. It is followed by _n_ datasets. Each
  dataset is formatted in a line and gives three positive integers, _Y i_ (<
  1000), _M i_ (≤ 10), and _D i_ (≤ 20), that correspond to the year, month and
  day, respectively, of a person's birthdate in the king's calendar. These three
  numbers are separated by a space.
attempt: def get_no_days(day_str):
      day_split = day_str.split(" ")
      year = int(day_split[0])
      month = int(day_split[1])
      day = int(day_split[2])
      result = 0
  
      for y in range(1, year, 1):
          if y % 3 != 0:
              result += 195
          else:
              result += 200
      year_not_mod_3 = year % 3 != 0
      for m in range(1, month, 1):
          if year_not_mod_3 and m % 2 == 0:
              result += 19
          else:
              result += 20
      result += day
      return 196471 - result
  
  
  total = int(input())
  for i in range(total):
      d = input()
      print(str(get_no_days(d)))
  
problem_description: Millennium
  
  A wise king declared a new calendar. "Tomorrow shall be the first day of the
  calendar, that is, the day 1 of the month 1 of the year 1. Each year consists
  of 10 months, from month 1 through month 10, and starts from a _big month_. A
  common year shall start with a big month, followed by _small months_ and big
  months one after another. Therefore the first month is a big month, the second
  month is a small month, the third a big month, ..., and the 10th and last
  month a small one. A big month consists of 20 days and a small month consists
  of 19 days. However years which are multiples of three, that are year 3, year
  6, year 9, and so on, shall consist of 10 big months and no small month."
  
  Many years have passed since the calendar started to be used. For celebration
  of the millennium day (the year 1000, month 1, day 1), a royal lottery is
  going to be organized to send gifts to those who have lived as many days as
  the number chosen by the lottery. Write a program that helps people calculate
  the number of days since their birthdate to the millennium day.
samples: [{"input": "1 1 1\n    344 3 1\n    696 5 1\n    182 9 5\n    998 8 7\n    344 2 19\n    696 4 19\n    999 10 20", "output": "128976\n    59710\n    160715\n    252\n    128977\n    59712\n    1"}]