#include<bits/stdc++.h>
#define cs const
#define pb push_back
using namespace std;

cs int N = 4e5 + 5; 

int n, a[N], b[N];
int xa[N], ya[N];
int xb[N], yb[N];
int nxt[N];
vector<int> ans; 
int main() {
	#ifdef FSYo
	freopen("1.in", "r", stdin);
	#endif
	cin >> n; 
	for(int i = 1; i <= n + n; i++) {
		scanf("%d%d", &a[i], &b[i]);
		if(a[i] < 0) ya[-a[i]] = i;
		else xa[a[i]] = i;
		if(b[i] < 0) yb[-b[i]] = i;
		else xb[b[i]] = i;  
	}
	static bool ex[N];
	for(int i = 1; i <= n + n; i++)
	if(a[i] > 0 && b[i] > 0 && !ex[i]) {
		vector<int> cir, d; 
		int x = i; 
		while(!ex[x]) {
			cir.pb(x), ex[x] = 1; 
			if(cir.size() & 1) {
				if(a[x] > 0) 
					d.pb(1), x = ya[a[x]];
				else 
					d.pb(0), x = xa[-a[x]];
			}
			else {
				if(b[x] > 0) 
					d.pb(1), x = yb[b[x]];
				else 
					d.pb(0), x = xb[-b[x]];
			}
		}
		int o[2][2];
		memset(o, 0, sizeof o);
		for(int j = 0; j < d.size(); j++)
			++ o[d[j]][j % 2];
		if(abs(o[0][0] - o[0][1]) != 1 
			|| abs(o[1][0] - o[1][1]) != 1) {
			puts("NO"); return 0;
		}
		vector<int> l, r, c;
		for(int i = 0; i < cir.size(); i++) {
			int x = cir[i];
			if(l.size() >= 2 && c.back() == c[c.size() - 2]) {
				int lp = l.back();
				int rp = r.back();
				int dir = c.back();
				l.pop_back();
				r.pop_back();
				c.pop_back();
				if(dir) {
					nxt[r.back()] = lp;
					nxt[rp] = x; 
					r.back() = x;
				} 
				else {
					nxt[x] = lp;
					nxt[rp] = l.back();
					l.back() = x; 
				}
				c.back() = d[i];
			}
			else {
				l.pb(x), r.pb(x), c.pb(d[i]);
			}
		}
		if(c.size() == 4) {
			nxt[r[0]] = l[3];
			nxt[r[3]] = l[2];
		}
		for(int j = l[c[1]]; j; j = nxt[j]) ans.pb(j);
		for(int j = l[c[0]]; j; j = nxt[j]) ans.pb(j);
	}
	if(ans.size() != 2 * n) {
		puts("NO");
		return 0;
	}
	puts("YES");
	for(int x : ans)
	cout << a[x] << ' ' << b[x] << '\n';
	return 0;
}