Seasons

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Marie is travelling on a long journey to a far away land by foot. She moves at different speeds at different times of the year due to different weather patterns. More specifically, she can move 3 miles a day during the hot season of January through April, 5 miles a day during the warm season of May through August, and 1 mile per day during the cold season of September through December. Given a starting date, and the distance Marie must travel, calculate when Marie will reach her destination.

입력

The first line of input will contain a single integer n that indicates the number of datasets to follow.

Each dataset will be composed of:

  • An integer d between 1 and 12000, which is the distance Marie must travel.
  • A date in the format “m d, y”, where m, d, and y are the month, day of the month, and year, respectively, on which Marie begins her journey. All dates will be valid.

출력

Output the valid date that Marie will arrive at her far away destination in the format “m d, y”, where m, d, and y are the month, day of the month, and year, respectively.