#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const* argv[]) {
  int n;
  scanf("%d", &n);
  vector<int> s;
  long long sum1 = 0, sum2 = 0;
  for (long long i = n; i > 0; i--) {
    if (sum1 <= sum2) {
      sum1 += i;
      s.push_back(i);
    } else {
      sum2 += i;
    }
  }
  printf("%lld\n", abs(sum1 - sum2));
  printf("%d", s.size());
  for (int i = 0; i < s.size(); ++i) printf(" %d", s[i]);
  printf("\n");
  return 0;
}
