#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s = 0, s1 = 0;
  cin >> n;
  vector<int> a, b;
  while (n > 0) {
    if (s >= s1) {
      s1 += n;
      a.push_back(n);
    } else {
      s += n;
      b.push_back(n);
    }
    n -= 1;
  }
  cout << abs(s1 - s) << endl;
  cout << a.size() << " ";
  for (auto x : a) cout << x << " ";
}
