#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
const int M = 5e2 + 7;
vector<int> a[M];
bool check(int x, int y) {
  vector<bool> us(N);
  for (int i = 0; i < a[x].size(); ++i) {
    us[a[x][i]] = true;
  }
  bool access = false;
  for (int i = 0; i < a[y].size(); ++i) {
    access |= us[a[y][i]];
  }
  return access;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int m, n;
  cin >> m >> n;
  for (int i = 0; i < m; ++i) {
    int k;
    cin >> k;
    for (int j = 0; j < k; ++j) {
      int c;
      cin >> c;
      a[i].push_back(c);
    }
  }
  for (int i = 0; i < m; ++i) {
    for (int j = i + 1; j < m; ++j) {
      if (!check(i, j)) {
        return cout << "impossible", 0;
      }
    }
  }
  cout << "possible";
}
