SP18188 QSTABLE - Queen and Stable Relationships
Description
Swayamvara, in ancient India, was a practice of choosing a husband, from a list of suitors by a girl of marriageable age.
It is the swayamvara of gossip queen of IIIT, Akshata. Now, Akshata is always interested in knowing the stability of the relationships among various students of IIIT. Nowadays she is very busy in her swayamvara’s preparation and is not able to update herself about the latest gossips. As you know she is the gossip queen. She would love if someone could do her a favor and collect answers of her questions about relationships in IIIT. It might increase the collector’s chance of getting selected for marriage.
Before starting preparations for the swayamvara, Akshata used to maintain notes about the relationships in IIIT and knew all about them. So she thought she can help you by providing the notes.
There are various ways in which two people can be acquaintances :
1. If **A** and **B** are in a relationship, then **A** and **B** are acquaintances of each other.
2. If **A** and **B** are acquaintances of each other and **B** and **C** are acquaintances of each other, then **A** and **C** are also acquaintances of each other.
In Akshata's notes, a relationship between **person1** and **person2** is represented as **"person1 person2"**. The Queen's questions are also special.
There are two types of questions:
1. First type of query is whether two people, say **A** and **B**, still remain each others’ acquaintances even if two people, say **C** and **D**, break-up and end their relationship.
2. Second type of query is whether two people, say **A** and **B**, still remain acquaintances even if a person, say **C**, leaves the college (It’s obvious that before leaving college, **C** ends all his/her relationships).
Input Format
N/A
Output Format
N/A