#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int q, n, i, j, c, k, l, a, b, ct, ans, p, s, cs = 1, t, x, qq;
  int ara[3];
  while (cin >> n) {
    vector<int> v1, v2;
    long long int sum1 = n, sum2 = n - 1;
    v1.push_back(n);
    v2.push_back(n - 1);
    for (i = n - 2; i > 0; i -= 2) {
      if (sum1 > sum2) {
        sum2 += i;
        sum1 += (i - 1);
        v2.push_back(i);
        if (i - 1 > 0) v1.push_back(i - 1);
      } else {
        sum1 += i;
        sum2 += (i - 1);
        v1.push_back(i);
        if (i - 1 > 0) v2.push_back(i - 1);
      }
    }
    cout << abs(sum1 - sum2) << endl;
    if (sum1 > sum2) {
      cout << v2.size() << " ";
      for (i = 0; i < v2.size(); i++) {
        cout << v2[i] << " ";
      }
    } else {
      cout << v1.size() << " ";
      for (i = 0; i < v1.size(); i++) {
        cout << v1[i] << " ";
      }
    }
    cout << endl;
  }
}
