#include using namespace std; using ll=long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N,M,K; cin>>N>>M>>K; vector GL(N); for(int i=0;i>A; GL[A-1]=1; } vector> T(N,vector(N)); for(int i=0;i>T[i][j]; vector P(N,-1); for(int i=0;i D(M); for(int i=0;i