You are given integers. You are required to perform queries. In each query, you are given two integers and . Your task is to merge the groups that contain the and integer to a single group. After performing each query, you are required to print the range of numbers that lie in the newly-formed group. Initially, the numbers do not belong to any group.
Input format
Output format
For every query, print two space-separated integers and in a new line, where is the minimum element and is the maximum element of the new group formed.
Constraints
Query 1: The group now contans {5, 12}
Query 2: The group now contans {6, 8}
Query 3: The group now contans {1}