#include using namespace std; int main() { int n; cin >> n; int a[n]; int b[n][n]; for(int i=0;i> a[i]; for(int i=0;i> b[i][j]; long long out = 0; bitset<18> bells; for(int i=0;i<(1 << n);i++) { bitset<18> bin(i); long long tmp = 0; for(int i=0;i out) { out = tmp; bells = bin; } } cout << out << endl; bool fis = true; for(int i=0;i<18;i++) { if(bells.test(i)) { if(fis) fis = false; else cout << ' '; cout << i + 1; } } cout << endl; }