Doubt in Digital Dictionary

My code shows correct answer for sample test case but gives wrong answer in all the three test cases.

Hey @Dhruv_Kapoor,

You missed on the point if prefix is not present in the dictionary then you need to print No suggestions and then add that prefix into the dictionary.
EXAMPLE:
SAMPLE INPUT:
4
pet
peter
rat
rack
5
pe
pet
r
rr
r
YOUR OUTPUT:
pet
peter
pet
peter
rack
rat
No suggestions
rack
rat
ACTUAL OUTPUT:
pet
peter
pet
peter
rack
rat
No suggestions
rack
rat
rr