#include<stdio.h>static int n, ans[20], total;void print_partition(){ putchar('{'); int i; for (i = 0; i < total; i++) printf(i ? ",%d" : "%d", ans[i]); putchar('}'); putchar('n');}void dfs2576(int depth){ int i; for (i = 1; i <= n; i++) { if (total && i < ans[total - 1]) continue; if (depth + i <= 2 * n) { ans[total++] = i; if (depth + i == 2 * n) print_partition(); else dfs2576(depth + i); total--; } }}int main(){ while (scanf("%d", &n), n) { dfs2576(0); putchar('n'); } return 0;}


