once time Land Shamans live SkyHigh Beanstalk each shaman unique identify number 0 n1 altitude valueH_i represent high live ground level the distance altitude absolute value differenceAll shamans live peace steal formula worldfamous PotionofGreatPower to cover hisher track Thief Curse land inhabitant long trust otherDespite difficult circumstance order Good Investigators gain follow information Curse when Curse take effect stop trust the Curse unstable end day exactly midnight pair shaman start stop trust unfortunately shaman trust d give time they reconstruct log trust night know pair shaman startedstoppe trust otherthey believe thief whisper formula evil Shaman to avoid detection visit home respective trust friend during visit thief whisper formula evil Shaman window Note trust friend home time in fact possible visit house shaman weirdfortunately whisper travel short distance Order know trusted friend visit Thief Evil Shaman live close otherthey ask help investigation they like test suspicion Thief x evil Shaman y formula whisper day v what small distance whisper formula travel that minimum distance apartment shamans x y ie minleftleftH_x h_yrightright x trust friend x y trust friend y dayvthey share information ask number question you need answer question immediately receive