#include <cmath>
#include <vector>
#include <iostream>
using namespace std;
int main() {
	int N;
	cin >> N;
	cout.precision(9);
	vector<int> S(N);
	for (int i = 0; i < N; ++i) cin >> S[i];
	for (int i = 0; i < N; ++i) {
		double a = sqrt((S[i] + 0.5) / 20);
		double cx = (i / 10) * 1000 - 4500, cy = (i % 10) * 1000 - 4500;
		cout << i + 1 << endl;
		cout << cx - 4 * a << ' ' << cy << endl;
		cout << cx - 2 * a << ' ' << cy - a << endl;
		cout << cx - 2 * a << ' ' << cy - 4 * a << endl;
		cout << cx << ' ' << cy - a << endl;
		cout << cx + 4 * a << ' ' << cy - 2 * a << endl;
		cout << cx + 2 * a << ' ' << cy << endl;
		cout << cx + 4 * a << ' ' << cy + 2 * a << endl;
		cout << cx << ' ' << cy + a << endl;
		cout << cx - 2 * a << ' ' << cy + 4 * a << endl;
		cout << cx - 2 * a << ' ' << cy + a << endl;
	}
	return 0;
}
