Pak Chanek travel Manado it turn OSN Indonesian National Scientific Olympiad 2019 hold the contestant OSN 2019 currently line field photograph the field shape like grid size n times 10100 n row 10100 column the row number 1 N north south column number 1 10100 west east the tile row r column c denote rcthere N province participate OSN 2019 initially contestant represent province stand tile p p satisfy L_i leq p leq R_i so r_il_i1 contestant represent province iPak Chanek variable z initially equal 0 in operation Pak Chanek choose row positive integer k then Pak Chanek follow possibility move contestant row exactly k tile west in word contestant p move pk Move contestant row exactly k tile east in word contestant p move pk after operation value z change z text or k textOR bitwise or operation Note Pak chanek operation row also note Pak Chanek allow contestant gridThere q question for jth question give positive integer W_j Pak Chanek zero operation final value Z exactly W_j Define M big number operation column contain exactly m contestant for question find big possible M sequence operation Pak Chanek Note operation Pak chanek question carry question