there sheet paper represent grid size n time m n row m column cell all cell color white initiallyq operation apply sheet the ith describe follow x_i y_i choose k nonwhite color color entire row x_i entire column y_i the new color apply cell regardless cell color operation the sheet apply q operation call color two coloring different exist cell color different colorshow different coloring print number modulo 998244353