Advanced Dictionary Operations

You are given an empty dictionary and q queries. Each query can be one of the following two types:
  • Type 1: Insert a string into the dictionary.
  • Type 2: Check if a string exists in the dictionary.
  • Type 3: Delete a string from the dictionary.
Your task is to implement a program that processes these queries efficiently.
For a query of type 2 if the string is present, output Yes, otherwise, output No.

Input

The first line of the input contains an integer q (1 ≀ q ≀ 100 000), representing the number of queries.
The following q lines describe the queries. Each line starts with an integer, type (1, 2, or 3), indicating the type of query.
  • If type = 1: the line will be followed by a space and a string s (1 ≀ |s| ≀ 1000), representing the string to be inserted into the dictionary. The string consists of lowercase English letters only.
  • If type = 2: the line will be followed by a space and a string s (1 ≀ |s| ≀ 1000), representing the string to be checked in the dictionary. The string consists of lowercase English letters only.
  • If type = 3: the line will be followed by a space and a string s (1 ≀ |s| ≀ 100), representing the string to be deleted from the dictionary. The string consists of lowercase English letters only.
It is guaranteed that the sum of the lengths of all query strings does not exceed .

Output

For each query of type 2, output Yes if the string is present in the dictionary, otherwise, output No.

Examples

Input
Output
7 1 abc 1 xyz 2 abc 3 abc 2 abc 2 xyz 2 abo
Yes No Yes No
Β 

Constraints

Time limit: 4 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue