#include<stdio.h>
void main(){
int i,num1,num2,j,n=0;
printf("The fraction serials with demominator 40 is:\n");
for(i=1;i<40;i++){
num1=40;
num2=i;
for(j=2;j<=num2;j++)
if(num1%j==0&&num2%j==0)
break;
if(j>num2){
printf("%2d/40 ",i);
n++;
if(n%8==0)
printf("\n");
}}
}