#include <bits/stdc++.h>
using namespace std;

int n;
vector <int> e[1001];
bool have[1001];

struct node
{
	int leftMark, rightMark;
	node* sonLeft, *sonRight;
	void updateMark()
	{
		leftMark = sonLeft->leftMark;
		rightMark = sonRight->rightMark;
	}
}*start, *want;

struct step
{
	int fromA, fromB;
	int toA, toB;
};

node* addNode(int L, int R, int from)
{
	node *t = new node();
	t->leftMark = L;
	t->rightMark = R;
	if(L == R+1)
	{
		return t;
	}
	for(int i = 0; i < e[L].size(); i++)
		if(e[L][i] != from)
			have[e[L][i]] = true;
	int M = -1;
	for(int j = 0; j < e[R].size(); j++)
		if(e[R][j] != from)
			if(have[e[R][j]])
				M = e[R][j];
	for(int i = 0; i < e[L].size(); i++)
		have[e[L][i]] = false;
	t->sonLeft = addNode(L, M, R);
	t->sonRight = addNode(M, R, L);
	return t;
}

node* input()
{
	for(int i = 1; i <= n; i++)
		e[i].clear();
	for(int i = 1; i <= n-3; i++)
	{
		int a, b;
		cin >> a >> b;
		e[a].push_back(b);
		e[b].push_back(a);
	}
	for(int i = 1; i <= n; i++)
	{
		int j = i+1;
		if(i == n) j = 1;
		e[i].push_back(j);
		e[j].push_back(i);
	}
	return addNode(n, 1, -1);
}

void print(node *p, string append)
{
	cout << append << p->leftMark << " " << p->rightMark << endl;
	if(p->sonLeft != NULL)
		print(p->sonLeft, append + "\t");
	if(p->sonRight != NULL)
		print(p->sonRight, append + "\t");
}

vector <step> record;

void rotateToRight(node *r)
{
	step t;
	node *s = r->sonLeft;
	node *a = s->sonLeft;
	node *b = s->sonRight;
	node *c = r->sonRight;
	t.fromA = s->leftMark;
	t.fromB = s->rightMark;
	r->sonLeft = a;
	r->sonRight = s;
	s->sonLeft = b;
	s->sonRight = c;
	s->updateMark();
	r->updateMark();
	t.toA = s->leftMark;
	t.toB = s->rightMark;
	record.push_back(t);
}

void rotateToLeft(node *r)
{
	step t;
	node *s = r->sonRight;
	node *a = r->sonLeft;
	node *b = s->sonLeft;
	node *c = s->sonRight;
	t.fromA = s->leftMark;
	t.fromB = s->rightMark;
	r->sonLeft = s;
	r->sonRight = c;
	s->sonLeft = a;
	s->sonRight = b;
	s->updateMark();
	r->updateMark();
	t.toA = s->leftMark;
	t.toB = s->rightMark;
	record.push_back(t);
}

void rotateMiddleToRoot(node *p, int middle)
{
	int myMiddle = p->sonLeft->rightMark;
	if(myMiddle == middle)
		return;
	if(myMiddle < middle)
	{
		rotateMiddleToRoot(p->sonLeft, middle);
		rotateToRight(p);
	}
	else if(myMiddle > middle)
	{
		rotateMiddleToRoot(p->sonRight, middle);
		rotateToLeft(p);
	}
}

void normalize(node *p)
{
	if(p->leftMark - p->rightMark <= 2) return;
	int middle = (p->leftMark + p->rightMark) / 2;
	rotateMiddleToRoot(p, middle);
	normalize(p->sonLeft);
	normalize(p->sonRight);
}

int MAIN()
{
	memset(have, 0, sizeof(have));
	cin >> n;
	start = input();
	normalize(start);
	vector <step> record1 = record;
	record.clear();
	want = input();
	normalize(want);

	cout << record.size() + record1.size() << endl;

	for(int i = 0; i < record1.size(); i++)
		cout << record1[i].fromA << " " << record1[i].fromB << endl;
	for(int i = record.size()-1; i >= 0; i--)
		cout << record[i].toA << " " << record[i].toB << endl;
	return 0;
}

int main()
{
	#ifdef LOCAL_TEST
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif
	ios :: sync_with_stdio(false);
	cout << fixed << setprecision(16);
	return MAIN();
}
