Time limit
2s
Memory limit
128 MB
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.
If the camp lasts for at least 1000 years, Yujin decides not to wait any longer.
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.
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.