petya root tree integer write vertex the vertex 1 root you answer question treea tree connect graph cycle a rooted tree special vertex call root the parent node v vertex short path v rooteach question define integer v l k to answer question need perform follow step first write sequence integer write short path vertex v root include write v root Count number time integer occur Remove integer l occurrence replace sequence remove duplicate order element number occurrence original list increase order in case tie choose order element arbitrary the answer question kth number remain sequence Note answer uniquely determine ordering also possible length sequence step k case answer 1 for example sequence integer path v root 2 2 1 7 1 1 4 4 4 4 l 2 k 2 answer 1please answer question tree