#include <iostream>
using namespace std;

long gcd(long a, long b){
	while (a && b)
		if (a > b) a%=b;
		else b%=a;
	return a+b;
}

long calc(long nok, long first){
	if (nok % first != 0)
		return -1;
	long res = nok/first;
	long g = 1;
	long tmp;
	while ( (tmp = gcd(first, res)) != g){
		g = tmp;
		res = nok/first * g;
	}
	return res;
}

int main() {
	// your code goes here
	for (int s = 1; s <= 500; s++)
	   for (int v = s; v <= 500; v++){
	   	long gd = s*v/gcd(s,v);
	   	long a1 = calc(gd,s);
	   	if (a1 == -1){
	   		cout <<"wtf"<<endl;
	   	}
	   	if (a1 > v){
	   		cout <<"not a min [" <<s<<" "<<v<<"] "<<a1<<endl;
	   	}
	   	if (a1*s/gcd(a1,s) != gd){
	   		cout <<"wa [" <<s<<" "<<v<<"]"<<a1<<endl;
	   	}
	   	a1 = calc(gd,v);
	   	if (a1 == -1){
	   		cout <<"wtf"<<endl;
	   	}
		if (a1 > s){
	   		cout <<"not a min [" <<s<<" "<<v<<"]"<<a1<<endl;
	   	}
	   	if (a1*v/gcd(a1,v) != gd){
	   		cout <<"wa [" <<s<<" "<<v<<"]"<<a1<<endl;
	   	}
	   }
	return 0;
}