You are given a rooted tree with N nodes, labeled 1 through n, rooted at node 1. Each node in the tree can be in one of two colors, black or white, at any point in time. Initially, all nodes are colored black. Over this tree, you need to perform Q queries of the following types:
- 1 u v— report the number of paths in the tree that passes through the edge connecting the nodes u and v, and has both its endpoints colored in black.
- 2 u — flip the color of all the nodes in the subtree of node u, i.e., of all nodes that are in the subtree of node u, color those nodes white which are currently black, and color those nodes black which are currently white.
Run with input