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