1. Abridged Problem Statement  
You have N members, each with strength Si and beauty Bi. Two members “hate” each other if one is stronger but less beautiful, or weaker but more beautiful. You must select the largest possible subset with no such hatred between any two. Output its size and the original indices of selected members (in any order).

2. Detailed Editorial  
We model each member as a point (S, B). A “hate” pair is exactly an inversion in these two coordinates: one point has larger S but smaller B. To avoid any hate, in the chosen subset the sequence of strengths and beauties must be consistently ordered—i.e., if you sort by strength, beauties must strictly increase. Our goal becomes finding the largest chain in the partial order (S₁ < S₂ and B₁ < B₂).  

Key steps:  
1. Sort all members by increasing strength S; if two members share the same S, place the one with higher beauty first.  Sorting by B descending for equal S ensures that we never pick two members with equal S (because their B would go down, breaking strict increase).  
2. Extract the sequence of beauties in this sorted order.  
3. Compute the Longest Increasing Subsequence (LIS) on this beauty sequence.  This yields the maximum number of members you can invite without any hate.  
4. To reconstruct which members form this LIS, we store, for each element, the position it occupies in the LIS dp‐array and keep a back‐pointer to its predecessor in the subsequence. Finally we trace back from the end of the LIS.  

Complexities:  
- Sorting: O(N log N)  
- LIS via patience sorting + binary search: O(N log N)  
- Reconstruction: O(N)  

Overall: O(N log N), which is fast for N up to 100 000.

3. Provided C++ Solution with Detailed Comments  
```cpp
#include <bits/stdc++.h>
using namespace std;

// Overload output for pair
template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &x) {
    return out << x.first << ' ' << x.second;
}

// Overload input for pair
template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &x) {
    return in >> x.first >> x.second;
}

// Overload input for vector
template<typename T>
istream &operator>>(istream &in, vector<T> &a) {
    for (auto &x: a) {
        in >> x;
    }
    return in;
}

// Overload output for vector
template<typename T>
ostream &operator<<(ostream &out, const vector<T> &a) {
    for (auto x: a) {
        out << x << ' ';
    }
    return out;
}

int n;  // number of members
// Each member stored as {strength, beauty, original_index}
vector<array<int,3>> a;

// Read input
void read() {
    cin >> n;
    a.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i][0] >> a[i][1];
        a[i][2] = i + 1;  // store 1-based original index
    }
}

// Solve one test case
void solve() {
    // 1) Sort by strength ascending; if tie, beauty descending
    sort(a.begin(), a.end(), [&](auto x, auto y) {
        if (x[0] != y[0])
            return x[0] < y[0];
        return x[1] > y[1];
    });

    // lis will store the current tail values of each LIS length
    vector<int> lis;
    // pos[i] will store the length-1 index this element achieves in the LIS
    vector<int> pos(n, -1);

    // 2) Compute LIS on beauty
    for (int i = 0; i < n; i++) {
        int b = a[i][1];
        // find position to insert b in lis (lower_bound for strict increase)
        auto it = lower_bound(lis.begin(), lis.end(), b);
        int idx = int(it - lis.begin());
        pos[i] = idx;  // this element becomes the end of an LIS of length idx+1
        if (it == lis.end()) {
            // extend the LIS
            lis.push_back(b);
        } else {
            // replace to keep the tail as small as possible
            *it = b;
        }
    }

    int length = lis.size();  // length of LIS
    vector<int> answer;       // to store indices of chosen members

    // 3) Reconstruct the LIS by going backwards
    for (int i = n - 1; i >= 0; i--) {
        if (pos[i] == length - 1) {
            answer.push_back(a[i][2]);  // collect original index
            length--;
        }
    }
    reverse(answer.begin(), answer.end());

    // Output result
    cout << answer.size() << '\n';
    cout << answer << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    read();
    solve();
    return 0;
}
```

4. Python Solution with Detailed Comments  
```python
import sys
import bisect

def main():
    input = sys.stdin.readline
    n = int(input())
    members = []
    for i in range(n):
        s, b = map(int, input().split())
        members.append((s, b, i+1))  # store 1-based index

    # 1) Sort by strength asc, beauty desc when strengths tie
    members.sort(key=lambda x: (x[0], -x[1]))

    # Arrays for LIS
    lis = []          # will store tail beauties
    lis_idx = []      # will store which member index ends that LIS length
    prev = [-1] * n   # back-pointer to reconstruct path

    # 2) Build LIS on beauty dimension
    for i, (s, b, orig) in enumerate(members):
        # find place in lis for b
        pos = bisect.bisect_left(lis, b)
        if pos == len(lis):
            # extending the LIS
            lis.append(b)
            lis_idx.append(i)
        else:
            # replace to get smaller tail
            lis[pos] = b
            lis_idx[pos] = i

        # set back-pointer: if pos > 0, link to end of previous length
        if pos > 0:
            prev[i] = lis_idx[pos-1]
        else:
            prev[i] = -1

    # 3) Reconstruct the LIS sequence of original indices
    length = len(lis)
    seq = []
    # start from the last index in lis_idx
    idx = lis_idx[-1]
    while idx != -1:
        seq.append(members[idx][2])  # original index
        idx = prev[idx]
    seq.reverse()

    # 4) Output
    print(len(seq))
    print(*seq)

if __name__ == "__main__":
    main()
```

5. Compressed Editorial  
- Model members as points (S, B).  
- Hate = inversion in (S, B). Select largest subset avoiding inversions ⇒ find maximum chain with S and B both increasing.  
- Sort by S↑, B↓ (to handle equal S). Extract beauty sequence.  
- Compute LIS on beauties in O(N log N), track positions and back-pointers for reconstruction.  
- Output LIS length and the corresponding original indices.