#include using namespace std; #include using namespace atcoder; using mint=modint; int main(void) { int p; cin >> p; int n,m; cin >> n >> m; mint::set_mod(p); vector> a(n,vector(m)); for(int i=0;i> atmp; a[i][j]=atmp; } } vector> a_copy=a; int rank=0; for(int i=0;i=i;--j){ a_copy[rank][j]/=a_copy[rank][i]; } for(int j=0;j=i;--k){ a_copy[j][k]-=a_copy[rank][k]*a_copy[j][i]; } } ++rank; } if(rank==0){ ++rank; } if(n*m<=n*rank+rank*m){ cout << 1 << endl; cout << n << " " << m << endl; for(int i=0;i> c(n,vector(rank)); int pivot=0; for(int i=0;i> f(rank,vector(m)); for(int i=0;i