this winter you ve get idea the Nvodsk road system represent n junction connect n1 bidirectional road path junction the organizer event want choose place accommodate participant junction v place set contest junction u besides hand want participant walk city neighbourhood that s distance v u l on hand do not want participant freeze distance v u r besides street know beauty integer 0 109 your task choose path fit length limit large average beauty we shall define average beauty median sequence beauty road pathwe formally like let path length k let ai nondecrease sequence contain exactly k element each number occur exactly number time road beauty occur path we represent path median number ak2 assume indexation start zero x number х round near integerfor example a0512 median equal 5 a05712 median number 7it guarantee path suitable quantity road