#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, s1 = 0, s2 = 0, s = 0;
  cin >> n;
  s1 = ((n + 1) * n) / 2, s2 = s1 / 2;
  vector<long> a;
  for (long i = n; i > 0 && s2 > 0; --i)
    if (s2 >= i)
      if (s2 - i < i && s2 - i != 0) {
        a.push_back(i), a.push_back(s2 - i), s += s2;
        break;
      } else
        a.push_back(i), s2 -= i, s += i;
  cout << abs(s1 - s - s) << '\n' << a.size() << " ";
  for (long i = 0; i < a.size(); cout << a[i] << " ", ++i)
    ;
}
