#include #include #include #include using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int h, w, k; cin >> h >> w >> k; vector> ab(k); rep(i, k) cin >> ab[i].first >> ab[i].second; vector> abab(ab); sort(ab.begin(), ab.end()); sort(abab.begin(), abab.end(), [](auto &l, auto &r) { return l.first < r.first; }); assert(ab == abab); rep(_, 1 << k) cout << -1 << endl; return 0; }