Calender

hard
https://codeforces.com/problemset/problem/58/D

Input Format

Check Link

Output Format

Check Link

Constraints

Check Link

Example

Input
4
b
aa
hg
c
.
Output
aa.b
c.hg
Previous
Substring Problem
Next
Minimax

Related Questions