#include "bits/stdc++.h"
using namespace std;
int g[222][222];
int main(int argc, char* argv[])
{
int n, m, k;
cin>>n>>m>>k;
for (int i = 0; i < m; i++)
{
int x, y;
cin>>x>>y;
x--;
y--;
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)
{
cout << i + 1 << ' ' << j + 1 << endl;
k--;
}
}
}
}