You are given a historical family tree of the noble kingdom, represented as a tree structure. The tree contains information about generations of ancestors and descendants. Your goal is to answer a series of queries in a way that helps people establish their ancestral connections.For each query, you will receive two names, let's call them Person and Person . Person is the root of the family tree. Your task is to determine whether Person is an ancestor of Person or not. If Person is indeed an ancestor of Person , you should respond with otherwise, you should reply with .Think of yourself as the custodian of this invaluable historical record, helping the kingdom's residents trace their noble lineage. Can you provide accurate responses to these queries and unveil the ancestral ties that bind the kingdom's inhabitants together?
Input Format:
Output Format:
For each query, output either if Person is an ancestor of Person , or if Person is not an ancestor of Person .
Constraints:
For query 1 : 1 is the ancestor of 3
For query 2 : 6 is not the ancestor of 5
For query 3 : 2 is not the ancestor of 3