Your team has been tasked to build a section of a web app where users can choose whether and how they want to receive notifications. In this problem, you will have to implement a part of it.
In this app, each kind of notification is represented by an identifier. Identifiers are hierarchical. For example, a notification may be represented by the identifier
email.group.new_invite. If a user wants to receive this notification, they will have to make sure each part of this hierarchical identifier is turned "on":
email.groupmust be "on"
email.group.new_invitemust be "on"
In this example above, the identifier has 3 levels of hierarchy. An identifier will have at most 10 levels of hierarchy.
You will be given a series of commands and queries in the following format:
|Turns on notification for user |
|Turns off notification for user |
|Print "Yes" if the user |
The input begins with an integer
$0 < N ≤ 100000$).
$N$ represents the number of commands/queries that follow.
You may assume that all commands/queries are valid. Users are represented with positive 32-bit signed integers and each identifier may be at most 50 characters long consisting of lowercase alphabets and dots.
For each query of type
? print the result in a line of its own.
5 + 15 email.newfriendrequest - 15 email + 31 email.newfriendrequest ? 15 email.newfriendrequest ? 31 email.newfriendrequest