Johnny find new great tutorial how grandmaster the tutorial tell strange unexpected Johnny thing patient important solve hard hard problem the boy find online judge task divide topic cover he pick pk_i problem ith category p favorite number he want solve week patience condition hard Johnny simplicity look easy task solve period now future grandmaster decide topic cover second week help assign topic way workload balancedformally give n number pk_i boy want divide disjoint set minimize absolute difference sum number set find minimal absolute difference output result modulo 1097