#include <bits/stdc++.h>
using namespace std;
inline int mod(int n, int m) {
  int ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
int gcd(int a, int b) { return (b == 0 ? a : gcd(b, a % b)); }
int exp(int a, int b, int m) {
  if (b == 0) return 1;
  if (b == 1) return mod(a, m);
  int k = mod(exp(a, b / 2, m), m);
  if (b & 1) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
const int MAXN = 200100;
int mat[150][150];
int dp[150][150];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int k;
  cin >> k;
  if (k == 0) {
    cout << 1 << " " << 1 << "\n";
    cout << 0 << "\n";
    return 0;
  }
  int val = (1LL << 18) - 1;
  int nk = (1LL << 18) - 1;
  for (int i = 0; i < 18; i++) {
    if ((1LL << i) & k) {
      nk ^= (1 << i);
    }
  }
  int full = val;
  int m = 4;
  int n = 3;
  mat[1][1] = full;
  mat[1][2] = mat[1][3] = mat[2][3] = k;
  mat[1][4] = mat[2][2] = mat[2][4] = 0;
  mat[2][1] = nk;
  mat[3][1] = mat[3][2] = mat[3][3] = full;
  mat[3][4] = k;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= m; j++) {
      dp[i][j] = 0;
    }
  }
  cout << n << " " << m << "\n";
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cout << mat[i][j] << " ";
    }
    cout << "\n";
  }
}
