#include <bits/stdc++.h>
using namespace std;
const long long prime = 1e9 + 7;
const long long maxN = 1e4 + 5;
const long double pi = 3.1415926536;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long m, n, s[51], ai, i1, i2;
  vector<vector<long long>> a(51);
  cin >> m >> n;
  for (long long i = (long long)(1); i <= (long long)(m); i++) {
    cin >> s[i];
    for (long long j = (long long)(0); j <= (long long)(s[i] - 1); j++) {
      cin >> ai;
      a[i].push_back(ai);
    }
    sort(a[i].begin(), a[i].end());
    for (long long j = (long long)(1); j <= (long long)(i - 1); j++) {
      i1 = 0;
      i2 = 0;
      while ((i1 < s[i]) && (i2 < s[j])) {
        if (a[i][i1] > a[j][i2]) {
          i2++;
        } else if (a[i][i1] < a[j][i2]) {
          i1++;
        } else {
          break;
        }
      }
      if ((i1 == s[i]) || (i2 == s[j])) {
        cout << "impossible";
        return 0;
      }
    }
  }
  cout << "possible";
  return 0;
}
