#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  if ((n) % 4 == 0 || (n) % 4 == 3) {
    cout << 0 << "\n";
    if ((n) % 2 == 0) {
      cout << n / 2 << " ";
      for (int i = 1; i <= n / 4; i++) {
        cout << i << " " << n + 1 - i << " ";
      }
    } else {
      cout << (n + 1) / 2 << " ";
      for (int i = 1; i <= (n + 1) / 4; i++) {
        cout << i << " " << n - i << " ";
      }
    }
  } else {
    cout << 1 << "\n";
    if (n % 2 == 0) {
      cout << (n / 2) << " ";
      cout << 1 << " ";
      for (int i = 1; i < (n + 2) / 4; i++) {
        cout << i + 2 << " " << n + 1 - i << " ";
      }
    } else {
      cout << (n - 1) / 2 << " ";
      for (int i = 1; i <= (n - 1) / 4; i++) {
        cout << i + 1 << " " << n + 1 - i << " ";
      }
    }
  }
  cout << "\n";
  return 0;
}
