#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug  9 00:06:28 2020

@author: manish
"""
from math import isclose, gcd

def f(N):
    max_frac = 0
    max_n = max_d = 0
    for d in range(3, N+1):
        res = (3*d//7)/d
        if res > max_frac:
            if isclose(res, 3/7):
                continue
            max_frac = res
            max_n = 3*d//7
            max_d = d
    print(max_n, "/", max_d)
    print(gcd(max_n, max_d))

if __name__ == '__main__':
    import time
    start_time = time.time()
    f(1_000_000)
    print("Program run time(in s): ", (time.time() - start_time)) 


