Cut a graph
The undirected graph is given. Two types of operations are performed on graph in the given order:
cut — cut a graph, or delete an edge from a graph;
ask — check, whether two given vertices lie in the same connected component.
It is known that after performing all types of cut operations there is no edges left in the graph. Give the result for each ask operation.
Input
The first line contains three integers — the number of vertices in a graph, the number of edges and the number of operations .
The next lines define the graph edges; -th line contains two integers and — the end numbers of the -th edge. The vertices are numbered starting from one; graph does not contain multiple edges and loops.
The next lines describe the operations. Operation of type cut is given with the line "cut u v" , which means that the edge between the vertices and is deleted from a graph. Operation of type ask is given with the line "ask u v" , which means that you need to know are the vertices and in the same connected component. It is guaranteed that each edge of the graph meets in cut operations exactly once.
Output
For each ask operation print in a separate line the word "YES", if two given vertices are in the same connected component, and "NO" otherwise. The order of answers must match the order of ask operations in input data.