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