#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int lcm(int a, int b) { return (a / gcd(a, b)) * b; }
int main() {
  int n;
  long long sum1 = 0, sum2 = 0;
  cin >> n;
  vector<int> vec;
  while (n) {
    if (sum1 <= sum2) {
      sum1 += n;
      vec.push_back(n);
    } else
      sum2 += n;
    n--;
  }
  cout << abs(sum1 - sum2) << endl;
  cout << vec.size() << " ";
  for (int i = 0; i < vec.size(); ++i) cout << vec[i] << " ";
  return 0;
}
