# Python 3 - 372 At the moment, this is my ungolfed version I can and will do better. n=int(input());s=str;p=[];r=range for a in r(1,n): for b in r(1,a): for i in r(1,n): if i!=a and i!=b: if s(i) in s(a) and s(i) in s(b): if s(a).count(s(i))<len(s(a)) and s(b).count(s(i))<len(s(b)): if not '0' in s(a) and not '0' in s(b): if eval(s(a).replace(s(i),'')+'/'+s(b).replace(s(i),''))==a/b: if a+b<=n:p.append([a,b]) print(p)