/* ID: zhangzz4 PROG: milk3 LANG: C++ */ #include<stdio.h> const int N=21; int v[N][N][N]; int g[N]; int min(int a,int b){return a<b?a:b;} int A,B,C; void dfs(int a,int b,int c) { if(v[a][b][c]) return; v[a][b][c]=1; if(a==0) g[c]=1; dfs(a-min(a,B-b),b+min(a,B-b),c); dfs(a-min(a,C-c),b,c+min(a,C-c)); dfs(a,b-min(b,C-c),c+min(b,C-c)); dfs(a+min(b,A-a),b-min(b,A-a),c); dfs(a+min(c,A-a),b,c-min(c,A-a)); dfs(a,b+min(c,B-b),c-min(c,B-b)); } int main() { freopen("milk3.in","r",stdin); freopen("milk3.out","w",stdout); scanf("%d%d%d",&A,&B,&C); dfs(0,0,C); int fir=0; for(int i=0;i<N;i++) if(g[i]) { if(fir) putchar(' '); fir=1; printf("%d",i); } puts(""); }