bool vis[maxn]; voidwork(){ cin >> n >> m; for (int i = 1; i <= n * 3; ++i) vis[i] = 0; vector<int> ans; for (int i = 1; i <= m; ++i) { int x, y; cin >> x >> y; if (!vis[x] && !vis[y]) vis[x] = vis[y] = 1, ans.push_back(i); } if (ans.size() >= n) { cout << "Matching\n"; for (int i = 0; i < n; ++i) cout << ans[i] << " \n"[i == n - 1]; } else { cout << "IndSet\n"; for (int i = 1, cnt = 0; i <= 3 * n && cnt < n; ++i) if (!vis[i]) cout << i << " \n"[++cnt == n]; } }