#include using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) template bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;} template bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;} const long long mod=998244353; const long long mod2=469762049; const long long mod100=1000000007; int main(){ cout.tie()->sync_with_stdio(0); cin.tie(0); int N,M,K;cin>>N>>M>>K; int A[N][N]; int B[K][K]; int now=1; for(int i=0;iM) now=-1; } } for(int i=0;i=1) break; pos++; } A[i][j]=pos; cnt[pos]--; } } for(int i=0;i