text: #include <bits/stdc++.h>
  using namespace std;
  
  #ifdef LOCAL
  #include "/debug.h"
  #else
  #define db(...)
  #endif
  
  #define all(v) v.begin(), v.end()
  #define pb push_back
  using ll = long long;
  const int NAX = 2e5 + 5, MOD = 1000000007;
  
  #include <bits/stdc++.h>
  #define REP(i, n) for (int i = 0; (i) < (int)(n); ++(i))
  #define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++(i))
  #define REP_R(i, n) for (int i = (int)(n)-1; (i) >= 0; --(i))
  #define REP3R(i, m, n) for (int i = (int)(n)-1; (i) >= (int)(m); --(i))
  #define ALL(x) ::std::begin(x), ::std::end(x)
  using namespace std;
  
  const string YES = "possible";
  const string NO = "impossible";
  bool solve(int a, int b, const vector<int> &c, const vector<vector<int>> &d)
  {
      for (size_t i = 0; i < a; i++)
      {
          set<int> ss;
          for (auto &x : d[i])
              ss.insert(x);
          for (size_t j = i + 1; j < a; j++)
          {
              bool ok = false;
              for (auto &y : d[j])
                  ok = ok || ss.count(y);
              if (!ok)
                  return false;
          }
      }
      return true;
  }
  
  // generated by oj-template v4.7.2 (https://github.com/online-judge-tools/template-generator)
  int main()
  {
      std::ios::sync_with_stdio(false);
      std::cin.tie(nullptr);
      constexpr char endl = '\n';
      int a, b;
      cin >> a;
      vector<int> c(a);
      vector<vector<int>> d(a);
      cin >> b;
      REP(i, a)
      {
          cin >> c[i];
          d[i].resize(c[i]);
          REP(j, c[i]) { cin >> d[i][j]; }
      }
      auto ans = solve(a, b, c, d);
      cout << (ans ? YES : NO) << endl;
      return 0;
  }
  