import java.util.Scanner;
public class main
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
int k = in.nextInt();
int[][] g = new int[n][n];
for (int i = 0; i < m; i++)
{
int x = in.nextInt();
int y = in.nextInt();
x--;
y--;
g[x][y] = 1;
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)
{
System.out.println((i+1) + " " + (j + 1));
k--;
}
}
}
}
}