/*
ID:usaco100
LANG:C++
TASK:frac1
*/
#include<stdio.h>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
struct node{
int up,down;
}A[25600];
int n,top;
void swap(int &x,int &y)
{
int tmp=x;
x=y;
y=tmp;
}
int gcd(int x,int y)
{
if (x>y) swap(x,y);
if (x==0) return y;
return (gcd(y%x,x));
}
void init(){
top=0;
for(int i=1;i<=n;i++)
for(int j=0;j<=i;j++)
{
int a=j,b=i;
if(gcd(a,b)==1)
{
A[top].up=a;
A[top].down=b;
top++;
}
}
}
int cmp(node x,node y){
return (double)x.up/x.down<(double)y.up/y.down;
}
int main()
{
freopen("frac1.in","r",stdin);
freopen("frac1.out","w",stdout);
cin>>n;
init();
sort(A,A+top,cmp);
for(int i=0;i<top;i++)
printf("%d/%d\n",A[i].up,A[i].down);
return 0;
}
08-13
08-13