O(n) algorithm for LCA preprocessing. Add magic k factor formula to umast calculation needed to have O(n^(2+o(1))) complexity.