cho.sh
Notes
Loading...

D-Day

Time limit

2s

Memory limit

128 MB

Problem

Yujin is attending a camp and wants to know how many days remain from today until the day the camp ends, the D-Day. The camp may last for a very long time and may include leap years, so counting the days by hand is difficult.

Leap years are determined by the following rules.

  • A year divisible by 4 is a leap year.
  • However, a year divisible by 100 is a common year.
  • However again, a year divisible by 400 is a leap year.

If the camp lasts for at least 1000 years, Yujin decides not to wait any longer.

Input

The first line contains today's date. The second line contains the D-Day date.

Each date is given as year month day, with the three integers separated by spaces. Every date is valid and lies between January 1, year 1 and December 31, year 9999, inclusive. Today's date is always earlier than the D-Day date.

Output

If x days remain from today until D-Day, print D-x.

If the camp lasts for at least 1000 years, print gg instead. More precisely, if today is year y, month m, day d and the D-Day date is the same as or later than year y+1000, month m, day d, print gg. Today's date is never February 29.