{"raw_statement":[{"iden":"problem statement","content":"You are given an integer $N$.\nPrint all triples of non-negative integers $(x,y,z)$ such that $x+y+z\\leq N$ in ascending lexicographical order.\nWhat is lexicographical order for non-negative integer triples?A triple of non-negative integers $(x,y,z)$ is said to be **lexicographically smaller** than $(x',y',z')$ if and only if one of the following holds:\n\n*   $x < x'$;\n*   $x=x'$ and $y< y'$;\n*   $x=x'$ and $y=y'$ and $z< z'$."},{"iden":"constraints","content":"*   $0 \\leq N \\leq 21$\n*   $N$ is an integer."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$"},{"iden":"sample input 1","content":"3"},{"iden":"sample output 1","content":"0 0 0\n0 0 1\n0 0 2\n0 0 3\n0 1 0\n0 1 1\n0 1 2\n0 2 0\n0 2 1\n0 3 0\n1 0 0\n1 0 1\n1 0 2\n1 1 0\n1 1 1\n1 2 0\n2 0 0\n2 0 1\n2 1 0\n3 0 0"},{"iden":"sample input 2","content":"4"},{"iden":"sample output 2","content":"0 0 0\n0 0 1\n0 0 2\n0 0 3\n0 0 4\n0 1 0\n0 1 1\n0 1 2\n0 1 3\n0 2 0\n0 2 1\n0 2 2\n0 3 0\n0 3 1\n0 4 0\n1 0 0\n1 0 1\n1 0 2\n1 0 3\n1 1 0\n1 1 1\n1 1 2\n1 2 0\n1 2 1\n1 3 0\n2 0 0\n2 0 1\n2 0 2\n2 1 0\n2 1 1\n2 2 0\n3 0 0\n3 0 1\n3 1 0\n4 0 0"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}