#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long power(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) ans *= a;
    a = a * a;
    b >>= 1;
  }
  return ans;
}
long long powm(long long a, long long b) {
  a %= MOD;
  long long ans = 1;
  while (b > 0) {
    if (b & 1) ans = (ans * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return ans;
}
int main() {
  long long n;
  cin >> n;
  vector<long long> A, B;
  long long sum = n * (n + 1) / 2;
  long long a = sum / 2;
  for (long long i = n; i >= 1; i--) {
    if (a - i >= 0) {
      A.push_back(i);
      a -= i;
    } else {
      B.push_back(i);
    }
  }
  if (n == 2) {
    A.clear();
    B.clear();
    A.push_back(1);
    B.push_back(2);
  }
  a = accumulate(A.begin(), A.end(), 0);
  long long b = accumulate(B.begin(), B.end(), 0);
  cout << abs(a - b) << "\n" << (int)A.size() << " ";
  for (long long x : A) cout << x << " ";
  cout << "\n";
  return 0;
}
