import java.util.*; public class Main { static void solve (int n) { int k; for (int i=1; i<=n/3; i++) { for (int j=i; j<=n/2; j++) { k = n-i-j; if (j<=k) {System.out.println(i+" "+j+" "+k);} else {break;} } } } public static void main(String[] args) { int n = sc.nextInt(); solve(n); } static Scanner sc = new Scanner(System.in); }