#include <stdio.h>
int main(void){
  int k,r1,r2,s;
  scanf("%d",&k);
  for(int i=1;i<(k+1);k++){
    for(int j=1;j<(k+1);j++){
      for(int l=1;l<(k+1);l++{
        r1=i%j;
        while(r1!=0){
          i=j;
          j=r1;
          r1=i%j;
        }
        s=j;
        r2=l%s;
        while(r2!=0){
          l=s;
          s=r2;
          r2=l%s;
        }
      }
     }
    }
       return 0; 
}