#include<stdio.h>
#include<math.h>
int gcd(int a,int b){
	while(a){
		b%=a;
		int c=b;
		b=a;
		a=c;
	}
	return b;
}
int main(){
	int a,b;
	while(scanf("%d%d",&a,&b),a+b){
		double t=sqrt(a);
		double L=999999;
		int w=0;
		int x=0;
		int y=0;
		int z=0;
		double R=999999;
		for(int i=1;i<=b;i++){
			int l=(int)(t*i);
			int r=l+1;
			if(l<=b&&gcd(l,i)==1&&t-(double)l/i<L){
				L=t-(double)l/i;
				w=l;
				x=i;
			}
			if(r<=b&&gcd(r,i)==1&&(double)r/i-t<R){
				R=(double)r/i-t;
				y=r;
				z=i;
			}
		}
		printf("%d/%d %d/%d\n",y,z,w,x);
	}
}