#C13639. First Day of Month Extraction

    ID: 43199 Type: Default 1000ms 256MiB

First Day of Month Extraction

First Day of Month Extraction

Given a list of dates in the format YYYY-MM-DD, determine the first day of each month that appears in the list. The first day of a month is defined as the date with the day replaced by 01. For example, for the date 2023-03-15, the first day of that month is 2023-03-01. If multiple dates belong to the same month, only the first occurrence should contribute its corresponding first day, preserving the order of appearance from the input.

The task is to read the list of dates from standard input and then output the first day of the month for each distinct month, each on a new line.

For any formula or format, note that the date is given by the template $\text{YYYY-MM-DD}$ and the first day of the month is $\text{YYYY-MM-01}$.

inputFormat

The first line of input contains an integer N representing the number of dates.

The next N lines each contain a date string in the format YYYY-MM-DD.

outputFormat

Output the first day of each distinct month present in the input. Print each resulting date on a new line in the order of their first appearance.

## sample
4
2023-03-15
2022-11-22
2023-03-01
2022-12-31
2023-03-01

2022-11-01 2022-12-01

</p>