link-cut trees
sqrt optimization
