#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>

using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define debug(x) cout<<#x<<": "<<x<<endl
#define MOD 1000000007

#define MAX_N 2000

typedef long long ll;
typedef unsigned long long ull;

int main(void)
{
    int N, K;
    cin >> N >> K;
    vector<int> g[MAX_N];
    REP(i, N) {
        int A, B;
        cin >> A >> B;
        A--;
        B--;
        g[A].pb(B);
        g[B].pb(A);
    }
    int ret = MAX_N;
    REP(k, N) {
        if (true) {
            int d[MAX_N];
            fill(d, d + N, MAX_N);
            queue<int> q;
            q.pb(k);
            d[k] = 0;
            while (!q.empty()) {
                int x = q.front();
                q.pop();
                if (d[x] == K) {
                    continue;
                }
                for (int i = 0; g[x].size(); i++) {
                    int to = g[x][i];
                    if (d[to] > d[x] + 1) {
                        d[to] = d[x] + 1;
                        q.pb(to);
                    }
                }
            }
            for (int i = 0; g[k].size(); i++) {
                int to = g[k][i];
                
        }
    }
    return 0;
}
