#include <iostream>
#include <fstream>
#include <list>
using namespace std ;

//#define N 17

ifstream infile ("el.txt");     //Input file
ofstream outfile("matrix.txt");     //Output file



int main (){
	int a, b;
	int n;

	infile >> n ;

	int** matrix = new int*[n];
	for (int i = 0; i < n; ++i)
	    matrix[i] = new int[n];


	while (infile >> a && a!=-1){
		infile >> b;
		matrix[a-1][b-1] = 1;
		matrix[b-1][a-1] = 1;
	}

	for (int i=0; i<n; i++){
		for (int j=0; j<n; j++){
			if (matrix[i][j] == 1)
				outfile << " 1 " << " " ;
			else
				outfile << " 9 " << " " ;
		}
		outfile << endl ;
	}

	for (int i = 0; i < n; ++i)
  		delete [] matrix[i];
	delete [] matrix;

	return 0;
}
your text goes here