#include <bits/stdc++.h>
using namespace std;
long long n;
int main() {
  cin >> n;
  vector<long long> one, two;
  long long s1 = 0, s2 = 0;
  bool Prev = true;
  one.push_back(n);
  s1 = n;
  for (long long i = n - 1; i >= 1; i--) {
    if (s1 < s2) {
      one.push_back(i);
      s1 += i;
    } else {
      two.push_back(i);
      s2 += i;
    }
  }
  cout << abs(s1 - s2) << endl;
  cout << one.size() << " ";
  for (long long i = 0; i < one.size(); i++) cout << one[i] << " ";
  return 0;
}
