#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int totalValue = (n + 1) * (n / 2) + (n % 2) * (n / 2 + 1);
  int halfTotalValue = totalValue / 2;
  vector<bool> used(60001);
  int firstSum = 0;
  vector<int> result;
  while (firstSum < halfTotalValue) {
    int wanted = min(halfTotalValue - firstSum, n);
    while (used[wanted] && wanted != 0) {
      --wanted;
    }
    if (wanted == 0) {
      break;
    }
    used[wanted] = true;
    firstSum += wanted;
    result.push_back(wanted);
  }
  cout << abs((totalValue - firstSum) - firstSum) << '\n' << result.size();
  for (int i = 0; i < result.size(); ++i) {
    cout << ' ' << result[i];
  }
  cout << '\n';
  return 0;
}
