The only difference between easy and hard versions is constraints.

You are given n segments on the coordinate axis OX. Segments can intersect, lie inside each other and even coincide. The i-th segment is [l_i; r_i] (l_i ≤ r_i) and it covers all integer points j such that l_i ≤ j ≤ r_i.

The integer point is called bad if it is covered by strictly more than k segments.

Your task is to remove the minimum number of segments so that there are no bad points at all.

Input

The first line of the input contains two integers n and k (1 ≤ k ≤ n ≤ 200) — the number of segments and the maximum number of segments by which each integer point can be covered.

The next n lines contain segments. The i-th line contains two integers l_i and r_i (1 ≤ l_i ≤ r_i ≤ 200) — the endpoints of the i-th segment.

Output

In the first line print one integer m (0 ≤ m ≤ n) — the minimum number of segments you need to remove so that there are no bad points.

In the second line print m distinct integers p_1, p_2, ..., p_m (1 ≤ p_i ≤ n) — indices of segments you remove in any order. If there are multiple answers, you can print any of them.

Examples

Input


7 2
11 11
9 11
7 8
8 9
7 8
9 11
7 9


Output


3
1 4 7 


Input


5 1
29 30
30 30
29 29
28 30
30 30


Output


3
1 2 4 


Input


6 1
2 3
3 3
2 3
2 2
2 3
2 3


Output


4
1 3 5 6 
#include <bits/stdc++.h>
#include <bits/extc++.h>

// abbr
#define for0(i, n) for (auto i = decltype(n)(0); i < n; ++i)
#define for1(i, n) for (auto i = decltype(n)(1); i <= n; ++i)
#define for0r(i, n) for (auto i = n - 1; i >= 0; --i)
#define for1r(i, n) for (auto i = n; i >= 1; --i)
#define forxy(i, x, y) for (auto i = x; i <= y; ++i)
#define foryx(i, x, y) for (auto i = y; i >= x; --i)
#define PB push_back
#define FI first
#define SE second

// type
using ll = int32_t;
// using ll = int64_t;
using Vec = std::vector<ll>;
using Pair = std::pair<ll, ll>;
using Set = std::set<ll>;
using Map = std::map<ll, ll>;
using Hash = std::unordered_map<ll, ll>;
// debug
template<typename C>
std::string ToStr(const C& c) {
    std::string ret("{");
    for (auto v : c)
        ret += std::to_string(v) + ",";
    ret += "}";
    return ret;
}
template<typename T1, typename T2>
std::string ToStr(const std::map<T1, T2>& c) {
    std::string ret("{");
    for (auto& kv : c)
        ret += "<" + std::to_string(kv.first) + "," + std::to_string(kv.second) + ">,";
    ret += "}";
    return ret;
}
template<typename... Args>
std::string format(const std::string& fmt, Args... args) {
    auto sz = ::snprintf(nullptr, 0, fmt.c_str(), args...);  // effective char size
    std::string buf(sz, '?');
    ::snprintf(&buf[0], sz + 1, fmt.c_str(), args...);  // len include '\0'
    return buf;
}
#ifndef ONLINE_JUDGE
# define PRE() (std::clog << "***DEBUG*** ")
# define POST() std::endl
# define dbg(fmt, args...) (PRE() << format(fmt, ##args) << POST())
# define VAR(e) (#e "=") << (e) << (",")
# define VAR2(e1,e2) VAR(e1) << VAR(e2)
# define VAR4(e1,e2,e3,e4) VAR2(e1,e2) << VAR2(e3,e4)
# define dump(e) (PRE() << VAR(e) << POST())
# define dump2(e1,e2) (PRE() << VAR2(e1,e2) << POST())
# define dump3(e1,e2,e3) (PRE() << VAR2(e1,e2) << VAR(e3) << POST())
# define dump4(e1,e2,e3,e4) (PRE() << VAR4(e1,e2,e3,e4) << POST())
# define dump5(e1,e2,e3,e4,e5) (PRE() << VAR4(e1,e2,e3,e4) << VAR(e5) << POST())
# define dump6(e1,e2,e3,e4,e5,e6) (PRE() << VAR4(e1,e2,e3,e4) << VAR2(e5,e6) << POST())
# define dump7(e1,e2,e3,e4,e5,e6,e7) (PRE() << VAR4(e1,e2,e3,e4) << VAR2(e5,e6) << VAR(e7) << POST())
#else
# define dbg(fmt, args...)
# define dump(e)
# define dump2(e1,e2)
# define dump3(e1,e2,e3)
# define dump4(e1,e2,e3,e4)
# define dump5(e1,e2,e3,e4,e5)
# define dump6(e1,e2,e3,e4,e5,e6)
# define dump7(e1,e2,e3,e4,e5,e6,e7)
#endif

// -------------------------------------------------
const ll N = 2e2 + 9;
// const ll INF = 1e9 + 21;
ll n, k;
Set a[N];  // all points
Vec ans;
ll b[N];

void Dump() {
    forxy(i, 7, 11) {
        auto ss = ToStr(a[i]);
        dump3("dump", i, ss);
    }
}

ll Check() {
    for1(i, 200) {
        auto cnt = a[i].size();
        if (cnt > k) {
            dump4("check", cnt, k, i);
            return i;
        }
    }
    return -1;
}

ll Remove(ll x) {
    Map map1;
    for1(i, 200) {
        for (auto v : a[i]) {
            map1[v] += 1;
        }
    }
    Map map2;
    const auto a2 = a[x];
    for (auto kv : map1) {
        if (a2.find(kv.first) != a2.end())
            map2[-kv.second] = kv.first;
    }
    auto cnt = -map2.begin()->first;
    auto p = map2.begin()->second;  // max overload
    dump4("remove", p, cnt, k);

    for1(i, 200) {
        a[i].erase(p);
    }

    return p;
}

void Solve() {
    std::cin >> n >> k;
    for1(p, n) {
        ll l, r;
        std::cin >> l >> r;
        forxy(i, l, r) {
            a[i].insert(p);
        }
    }

    Dump();
    for (;;) {
        auto i = Check();
        if (i < 0)
            break;
        auto v = Remove(i);
        ans.push_back(v);
        Dump();
    }

    // output
    std::cout << ans.size() << std::endl;
    for(auto v : ans) {
        std::cout << v << " ";
    }
    std::cout << "" << std::endl;
}
// -------------------------------------------------

int main() {
#ifndef ONLINE_JUDGE
    ::freopen("../input.txt", "r", stdin);
#endif

    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);

#if 0
    ll t;
    std::cin >> t;
    for0(i, t) Solve();
#else
    Solve();
#endif

    return 0;
}
