In Apollo's country, basketball is the most popular sport. There are n basketball players and m basketball fans. Bastketball players are numbered from 1 to n. Basketball fans are numbered from 1 to m.
In Apollo's country, basketball is the most popular sport. There are n basketball players and m basketball fans. Bastketball players are numbered from 1 to n. Basketball fans are numbered from 1 to m. A basketball fan can be a fan of multiple players. Basketball fan i is like to watch the game of player j if one of the following conditions is met: Basketball fan i is a fan of basketball player j. There is a fan i' and a player j', both fan i and fan i' are like to watch the game of player j', and fan i' is like to watch the game of player j. The All-Star Game is an annual exhibition basketball game. You need to select some players into the All-Star Game. A fan will watch the All-Star Game if he is like to watch the game of one selected player (i.e. at least one of the players that the fan is like to watch was selected). You need to decide the minimum number of players need to be selected into All-Star Game so that all basketball fans will watch the game. Initially, some basketball players will have some fans. There are q changes to the relationship between basketball players and basketball fans. After each of q changes, print one integer --- the minimum number of players which you have to select to make all basketball fans will watch the game. Print "-1" if it is impossible.