// @EXPECTED_RESULTS@: RUN_TIME_ERROR, TIME_LIMIT_EXCEEDED, WRONG_ANSWER #pragma GCC optimize("Ofast") #include #include #include using namespace std; #define rep(i,a,b) for(int i=(a); i<(b); ++i) #define all(x) x.begin(),x.end() #define sz(x) int(x.size()) typedef long long ll; typedef unsigned long long ull; typedef vector vi; typedef vector vvi; int main(){ cin.tie(NULL),ios::sync_with_stdio(false); int n; cin >> n; map,int> mp; rep(it,1,n+1){ int m; cin >> m; vi v(m); for(auto& c : v) cin >> c; if (m <= 1000 or n < 10000) for(auto i : v) { for(auto j : v) if (i 0 and at != it){ cout << i << ' ' << j << ' ' << at << ' ' << it << '\n'; exit(0); } at = it; } } } cout << "impossible\n"; }