The first line contains two integers n and m, indicating the number of soldiers and the number of events.
Then n lines follow, describing the initial direct inferior list of each soldier. The i-th line contains several integers. The first integer is k, indicating the number of soldier i’s direct inferior. Then k integers follow, indicating the direct inferior list of soldier i.
After that m lines follow, describing the m events. Each line begins with an integer t, indicating the type of this event.
If t = 1, then 5 integers x, p, c, y and q follow, indicating a direct superior change event;
If t = 2, then 2 integers x and y follow, indicating ZCC’s question 1;
If t = 3, then an integer x follows, indicating ZCC’s question 2.