using System;
class main
{
public static void Main(string[] args)
{
string[] line = Console.ReadLine().Split(' ');
int n = Int32.Parse(line[0]);
int m = Int32.Parse(line[1]);
int k = Int32.Parse(line[2]);
int[,] g = new int[n, n];
for (int i = 0; i < m; ++i)
{
line = Console.ReadLine().Split(' ');
int x = Int32.Parse(line[0]) - 1;
int y = Int32.Parse(line[1]) - 1;
g[x, y] = g[y, x] = 1;
}
for (int i = 0; i < n; ++i)
{
for (int j = i + 1; j < n; j++)
{
if (k > 0 && g[i, j] == 0)
{
Console.WriteLine("{0} {1}", i+1, j+1);
k -= 1;
}
}
}
}
}