#include <bits/stdc++.h>
int num[60005] = {0};
int main() {
  int n;
  int sum1 = 0, sum2 = 0;
  int c = 0;
  scanf("%d", &n);
  for (int i = n; i >= 1; --i) {
    if (sum1 <= sum2) {
      sum1 += i;
      num[i] = 1;
      ++c;
    } else {
      sum2 += i;
      num[i] = 2;
    }
  }
  int result = sum1 > sum2 ? sum1 - sum2 : sum2 - sum1;
  printf("%d\n%d", result, c);
  for (int i = 1; i <= n; ++i) {
    if (num[i] == 1) printf(" %d", i);
  }
}
