#include <stdio.h>
void main()
{
int a[5];
int b = 0, c = 0, d = 0, m = 0, n = 0;
int i;
a[0] = 1;
for( ; a[0]<8; a[0]++)
for( a[1] = a[0]+1; a[1]<9; a[1]++)
for( a[2] = a[1]+1; a[2]<10; a[2]++)
for( a[3] = a[2]+1; a[3]<11; a[3]++)
for( a[4] = a[3]+1; a[4]<12; a[4]++)
{
for( i = 0; i<4 ; i++)
{
if( (a[i]==1) || (a[i]==2) )
{
b++;
c++;
d++;
}
if( a[i]==8 )
{
b++;
d++;
}
if( a[i]==3 )
{
c++;
m++;
n++;
}
if( (a[i]==4) || (a[i]==7) || (a[i]==10))
{
m++;
n++;
}
if( (a[i]==5) || (a[i]==9) )
{
c++;
n++;
}
if( (a[i]==6) || (a[i]==11) )
b++;
if( (a[i]==7) || (a[i]==10) || (a[i]==11) )
c++;
}
if( (b>=2) && (c>=3) && (d>=1) && (m>=1) && (n>=2))
{
for( i = 0; i<5; i++)
printf("%d ",a[i]);
printf("\n");
}
}
}