#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int ans[30005];
  int cnt = 0;
  int sum1 = 0, sum2 = 0;
  for (int i = n; i > 0; i--) {
    if (sum1 <= sum2) {
      sum1 += i;
      ans[cnt++] = i;
    } else
      sum2 += i;
  }
  printf("%d\n", abs(sum1 - sum2));
  printf("%d", cnt);
  for (int i = 0; i < cnt; i++) printf(" %d", ans[i]);
  cout << endl;
  return 0;
}
