import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); List a = new ArrayList<>(); int ta = 0; if (n % 3 == 1) { a.add(3); ta += 3; } if (n % 3 == 2) { a.add(6); a.add(9); ta += 15; } int x = 15; while (a.size() < n) { a.add(x); ta += x; x += 3; } List b = new ArrayList<>(); int tb = 0; if (n % 3 == 1) { b.add(0); } if (n % 3 == 2) { b.add(0); b.add(3); tb += 3; } int y = 13; if (n == 5 || n == 8 || n == 11 || n == 14) { y = 16; } while (b.size() <= n) { b.add(y); tb += y; y += 3; } int xa = 0; StringBuilder sb = new StringBuilder(); for (int i : a) { sb.append(i).append(' '); xa += i; } sb.deleteCharAt(sb.length() - 1); System.out.println(sb.toString()); int rem = tb - ta; int xb = 0; int cnt = 0; sb = new StringBuilder(); for (int i : b) { if (i != rem) { sb.append(i).append(' '); xb += i; cnt++; } } sb.deleteCharAt(sb.length() - 1); System.out.println(sb.toString()); if (xa != xb || cnt != n) { throw new Exception(); } } }