atcoder#ABC261C. [ABC261C] NewFolder(1)
[ABC261C] NewFolder(1)
Score : points
Problem Statement
For two strings and , let denote the concatenation of and in this order.
You are given strings . Modify and print them as follows, in the order :
- if none of is equal to , print ;
- if of are equal to , print
(
)
, treating as a string.
Constraints
- is a string of length between and (inclusive) consisting of lowercase English letters.
Input
Input is given from Standard Input in the following format:
Output
Print lines as specified in the Problem Statement.
5
newfile
newfile
newfolder
newfile
newfolder
newfile
newfile(1)
newfolder
newfile(2)
newfolder(1)
11
a
a
a
a
a
a
a
a
a
a
a
a
a(1)
a(2)
a(3)
a(4)
a(5)
a(6)
a(7)
a(8)
a(9)
a(10)