#C419. Unique URL Shortcode Generator

    ID: 47700 Type: Default 1000ms 256MiB

Unique URL Shortcode Generator

Unique URL Shortcode Generator

You are given a list of URLs. Your task is to generate a unique shortcode for each URL in the order in which they appear. For each new URL encountered, assign the next shortcode from an infinite sequence of codes generated in lexicographic order using lowercase English letters. When a URL appears more than once, assign it the same previously generated shortcode.

The code generator produces strings in base-26 where the sequence starts with \(a\), \(b\), \(c\), \(\ldots\), \(z\) and continues with \(aa\), \(ab\), etc. In other words, if we denote the sequence by \(s_0, s_1, s_2, \ldots\), then \(s_0=a\), \(s_1=b\), \(\ldots\), \(s_{25}=z\), and \(s_{26}=aa\).

Your program should read an integer \(n\) from standard input representing the number of URLs, followed by \(n\) lines each containing one URL. For each URL, output its corresponding shortcode on a new line.

inputFormat

The first line of input contains a single integer \(n\) (\(1 \le n \le 10^5\)), the number of URLs.

Each of the next \(n\) lines contains a URL, which is a non-empty string. The URLs may repeat.

outputFormat

For each URL in the input, output its assigned shortcode on a separate line. If a URL appears multiple times, the same shortcode must be printed each time it appears.

## sample
2
https://example.com/page1
https://example.com/page2
a

b

</p>