Chanek Jones help longlost relative Indiana Jones find secret treasure maze bury desert illusionsthe map labyrinth form tree n room number 1 n n 1 tunnel connect possible travel pair room tunnelsthe ith room 1 leq leq n a_i illusion rate to xth room yth room exist tunnel x y take maxa_x a_y a_x a_y energy z denote absolute value zto prevent grave robber maze change illusion rate room Chanek Indiana ask q queriesthere type query 1 u c the illusion rate xth room change c 1 leq u leq n 0 leq c leq 109 2 u v Chanek Indiana ask minimum sum energy need secret treasure room v initially room u 1 leq u v leq n help portion treasure