import java.util.*; public class No522{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int a = 1; a <= n/3; a++){ for(int b = a; b <= (n-a)/2; b++){ System.out.println(a+" "+b+" "+(n-a-b)); } } } }