#include using namespace std; struct nagore{ int x; int y; bool operator < (nagore a) const{ return y < a.y; } }; struct nadolu{ int x; int y; bool operator < (nadolu a) const{ return y > a.y; } }; priority_queue a; priority_queue b; stack c; string str; int main (){ ifstream fin ("geometry.in"); ofstream fout ("geometry.out"); int n; fin >> n; for (int i = 0; i < n; i ++){ int x, y; fin >> x >> y; nagore p; nadolu q; p.x = x; p.y = y; q.x = x; q.y = y; a.push (p); b.push (q); } int m; fin >> m; for (int i = 0; i < m; i ++){ nagore p; fin >> p.x >> p.y; c.push (p); } fout << 1 << '\n'; nagore aa = a.top (); a.pop (); nadolu bb = b.top (); b.pop (); nadolu cc; cc.x = c.top ().x; cc.y = c.top ().y; // if (c.top ().y - aa.y > aa.y - a.top ().y || bb.y - cc.y > b.top ().y - bb.y) break; nagore xx = max (a.top (), c.top ()); nadolu yy = max (b.top (), cc); int res1 = aa.y - xx.y, res2 = yy.y - bb.y; if (res1 > res2){ fout << "3 " << aa.x << ' ' << aa.y << '\n'; b.push (bb); } else{ fout << "3 " << bb.x << ' ' << bb.y << '\n'; a.push (aa); }a.push (c.top ()); b.push (cc); c.pop (); fout << "0\n"; return 0; }