Problem:
 Score : 300 points    Problem Statement You are given an integer N .  Find a triple of positive integers h , n and w such that 4/N = 1/h + 1/n + 1/w .  If there are multiple solutions, any of them will be accepted.      Constraints  It is guaranteed that, for the given integer N , there exists a solution such that h,n,w \leq 3500 .         Inputs Input is given from Standard Input in the following format:  N       Outputs Print a triple of positive integers h , n and w that satisfies the condition, in the following format:  h  n  w         Sample Input 1 2      Sample Output 1 1 2 2  4/2 = 1/1 + 1/2 + 1/2 .       Sample Input 2 3485      Sample Output 2 872 1012974 1539173474040  It is allowed to use an integer exceeding 3500 in a solution.       Sample Input 3 4664      Sample Output 3 3498 3498 3498

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

for h in range(1, 3501):
	for n in range(1, 3501):
		if 4*h*n-N*n-N*h == 0: continue
		w = N*h*n/(4*h*n-N*n-N*h)
		if w.is_integer() and 1 <= w:
			print(h, n, int(w))
			exit()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    N = int(input())

    for h in range(1, 3501):
        for n in range(1, 3501):
            if 4 * h * n - N * n - N * h > 0:
                w = (N * h * n) / (4 * h * n - N * n - N * h)
                if w.is_integer() and w > 0 and 4 * h * n * w == N * n * w + N * h * w + N * h * n:
                    print(h, n, int(w))
                    exit()


if __name__ == '__main__':
    resolve()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    N = int(input())

    for h in range(1, 3501):
        for n in range(1, 3501):
            if 4 * h * n - N * n - N * h > 0:
                w = (N * h * n) / (4 * h * n - N * n - N * h)
                if w.is_integer() and w > 0 and 4 * h * n * w == N * n * w + N * h * w + N * h * n:
                    print(h, n, int(w))
                    exit()


if __name__ == '__main__':
    resolve()

Solution (Python):
import math
const=3500+1
N = int(input())
ans=4/N
flg=False
for h in range(1,const):
    for n in range(h,const):
        tmp=4*h*n-N*n-N*h
        if tmp != 0:
            w = N*h*n/tmp
            if w == int(w) and w>0:
                print(h,n,int(w) )
                flg=True
                break
    if flg==True:
        break

Solution (Python):
import math
const=3500+1
N = int(input())
ans=4/N
flg=False
for h in range(int(N/4),const):
    for n in range(h,const):
        tmp=4*h*n-N*n-N*h
        if tmp != 0:
            w = N*h*n/tmp
            if w == int(w) and w>0:
                print(h,n,int(w) )
                flg=True
                break
    if flg==True:
        break

Solution (Python):
def main(n):
  if n%2==0:
    print(n,n,n//2)
    exit()
  if n==3:
    print(2,2,3)
    exit()
  s=n//4
  for i in range(2*s,3500*2):
    for a in range(s,i-3):
      b=i-a
      c=a*b*n/(4*a*b-n*b-n*a)
      if float.is_integer(c) and c>0:
        print(a,b,int(c))
        exit()

if __name__=='__main__':
  import sys
  input = sys.stdin.readline
  n=int(input())
  main(n)

Solution (Python):
n = int(input())
for i in range(1,3501):
  for j in range(1,3501):
    if 4*i*j-n*j-n*i:
      if (n*i*j)/(4*i*j-n*j-n*i) == (n*i*j)//(4*i*j-n*j-n*i) and (n*i*j)//(4*i*j-n*j-n*i) > 0:
        print(i,j,(n*i*j)//(4*i*j-n*j-n*i))
        quit()

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
        N=int(input())
        for h in range(1,3501):
            for n in range(h,3501):
                if 4*h*n-N*n-N*h==0:
                    continue
                else:
                    temp=(N*h*n)/(4*h*n-N*n-N*h)
                    if temp>0 and temp.is_integer():
                        return [h,n,int(temp)]
    for i in main():
        print(i,end=' ')


resolve()

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
        N=int(input())
        while True:
            for h in range(1,3501):
                for n in range(h,3501):
                    if 4*h*n-N*n-N*h==0:
                        continue
                    else:
                        temp=(N*h*n)/(4*h*n-N*n-N*h)
                        if temp>0 and temp.is_integer():
                            return [h,n,int(temp)]
    for i in main():
        print(i,end=' ')


resolve()

Solution (Python):
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True 
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n = inn()
for h in range(1,3501):
    for m in range(1,3501):
        x = 4*h*m-n*m-n*h
        if x>0 and n*h*m%x==0:
            w = n*h*m//x
            print("{} {} {}".format(h,m,w))
            
            exit()

Solution (Python):
N=int(input())
for h in range(1,3501):
    for n in range(1,3501):
        if 4*h*n-(h+n)*N>0:
            if (h*n*N)%(4*h*n-(h+n)*N)==0 and (h*n*N)//(4*h*n-(h+n)*N)>=1:
                print(h,n,(h*n*N)//(4*h*n-(h+n)*N))
                exit()

Solution (Python):
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    if 4*i*j-i*n-j*n!=0:
      k=(i*j*n)/(4*i*j-i*n-j*n)
      if k>0 and k.is_integer():
        print(i,j,int(k))
        exit(0)

Solution (Python):
N = int(input())

if N%2 == 0:
  print(N, N, N//2)
else:
  for h in range(1, 3501):
    if 4*h <= N:
      continue
    for n in range(h, 3501):
      num = N*h*n
      dem = 4*h*n - N*(h+n)
      if dem > 0 and num%dem == 0:
        print(h, n, num//dem)
        quit()

Solution (Python):
N = int(input())

if N%2 == 0:
  print(N, N, N//2)
else:
  for h in range(3500, -1, -1):
    num = N*h*h; diff_num = N*h
    dem = 4*h*h - N*(h+h); diff_dem = 4*h - N
    for n in range(h, -1, -1):
      if dem <= 0:
        break
      if num%dem == 0:
        print(h, n, num//dem)
        quit()
      num -= diff_num
      dem -= diff_dem

Solution (Python):
N = int(input())

if N%2 == 0:
  print(N, N, N//2)
else:
  for h in range(1, 3501):
    for n in range(1, 3501):
      num = N*h*n
      dem = 4*h*n - N*(h+n)
      if dem > 0 and num%dem == 0:
        print(h, n, num//dem)
        quit()

Solution (Python):
N = int(input())

if N%4 == 0:
    print(*[(3*N)//4]*3)
else:
    for w in range(1, 3501):
        for n in range(w+1, 3501):
            if 4*n*w - w*N - n*N <= 0:
                continue
            elif (n*w*N) % (4*n*w - w*N - n*N) == 0:
                h = (n*w*N) // (4*n*w - w*N - n*N)
                print(h, n, w)
                exit()

Solution (Python):
N = int(input())

for h in range(1, 3501):
  for n in range(1, 3501):
    if 4*n*h-N*n-N*h == 0:
      continue
    w = N*h*n/(4*n*h-N*n-N*h)
    if w > 0 and w.is_integer():
      ans = [n, h, int(w)]
print(*ans)

Solution (Python):
N=int(input())
for h in range(3500,0,-1):
    for n in range(3500,0,-1):
        X=(4/N)-(1/h)-(1/n)
        if X>0 and X<=1:
            w=int(1/X)
            if 4/N==(1/h+1/n+1/w):
                print(h,n,w)
                exit()

Solution (Python):
import sys
import math  
import bisect  
import queue  


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())

    for h in range(1, 3501):
        for n in range(1, 3501):
            numerator = 4 * h * n - N * (h + n)
            denominator = N * h * n
            if (numerator >= 1) and (numerator <= denominator):
                if denominator % numerator == 0:
                    w = denominator // numerator
                    return print(h, n, w)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
import sys

for h in range(1,3501):
    for n in range(1,3501):
        if 4*h*n - N*n - N*h > 0:
            if (N*h*n / (4*h*n - N*n - N*h)) == (N*h*n // (4*h*n - N*n - N*h)):
                print(h,n,N*h*n // (4*h*n - N*n - N*h))
                sys.exit()

Solution (Python):
N = int(input())

for h in range(1, 3500+1):
  for n in range(1, 3500+1):
    if 4*h*n - N*n - N*h == 0:
      continue
    w = (N*h*n) // (4*h*n - N*n - N*h)
    if w < 1 or w > 3500:
      continue
    if 4*h*n*w == N*(n*w + h*w + n*h):
      print(h, n, w)
      exit()

Solution (Python):
N = int(input())

for h in range(1, 3500+1):
  for n in range(1, 3500+1):
    if 4*h*n - N*n - N*h == 0:
      continue
    w = (N*h*n) // (4*h*n - N*n - N*h)
    if w < 1 or w > 3500:
      continue
    if 4*h*n*w == N*(n*w + h*w + n*h):
      print(h, n, w)
      exit()

Solution (Python):
N=int(input())


for h in range(1,3501):
    for n in range(1,3501):
        if 4*h*n-N*(n+h)>0 and (N*h*n)%(4*h*n-N*(n+h))==0:
            print(h,n,(N*h*n)//(4*h*n-N*(n+h)))
            exit()

Solution (Python):
def main():
  N=int(input())
  for h in range(1,3501):
    for n in range(1,3501):
      if 4*h*n>N*(h+n) and (N*h*n)%(4*h*n-N*(h+n))==0:
        print(h,n,(N*h*n)//(4*h*n-N*(h+n)))
        return
main()

Solution (Python):
N=int(input())

flag=False
def chk(h,n,w,N):
    val1=4*h*n*w
    val2=N*(n*w+h*w+h*n)
    if val1==val2:
        return True
    else:
        return False
def calc(h,n,N):
    if (4*h*n-(n+h)*N)==0:
        return -1
    val=(N*h*n)//(4*h*n-(n+h)*N)
    return val
for h in range(1,3501):
    for n in range(1,3501):
        w=calc(h,n,N)
        if w<=0:
            continue
        else:
            if chk(h,n,w,N):
                ans=[h,n,w]
                print(*ans)
                exit()

Solution (Python):
N = int(input())

def func():
    for h in range(1, 3501):
        for n in range(1, 3501):
            temp1 = N * n * h
            temp2 = 4 * h * n - N * (n + h)
            if temp2 != 0:
                w = temp1 // temp2
                if w * temp2 == temp1 and w >= 1:
                    print(h, n, w)
                    return None
func()

Solution (Python):
N = int(input())

for h in range(1, 3501):
    for n in range(1, 3501):
        temp1 = N * n * h
        temp2 = 4 * h * n - N * (n + h)
        if temp2 != 0:
            w = temp1 // temp2
            if w * temp2 == temp1 and w >= 1:
                ans = (h, n, w)
                break
h, n, w = ans
print(h, n ,w)

Solution (Python):
N = int(input())
for h in range(3501):
    for n in range(h):
        if 4 * h * n - N * (h + n) > 0 and (N * h * n) % (4 * h * n - (N * (h + n))) == 0:
            w = (N * h * n) // (4 * h * n - N * (h + n))
            print(h, n, w)
            exit()

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  N=I()
  for h in range(1,3501):
    for n in range(1,3501):
      a=4*h*n-N*n-N*h
      b=N*h*n
      if a<=0:
        continue
      w=b//a

      if b%a==0:
        return str(h)+' '+str(n)+' '+str(w)


print(main())

Solution (Python):
N=int(input())
for h in range(3501):
 for n in range(h):
  d=4*h*n-N*(h+n)
  if d>0 and N*h*n%d<1:print(h,n,N*h*n//d);exit()

Solution (Python):
import sys;N=int(input())
for h in range(3501):
 for n in range(h):
  d=4*h*n-N*(h+n)
  if d>0 and N*h*n%d<1:print(h,n,N*h*n//d);sys.exit()

Solution (Python):






L=3501
N=int(input())
def solve():
    for h in range(1,L):
        for n in range(1,h):
            d = 4*h*n - N*(h+n)
            if d > 0 and N*h*n % d == 0:
                print(h,n,N*h*n // d)
                return
solve()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(read())
for i in range(1, 3501):
    for h in range(i, 3501):
        check = 4 * i * h - n * (i + h)
        if check > 0:
            v = n * i * h
            if v % check == 0:
                print(i, h, v // check)
                exit()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(read())
for i in range(1, 3500):
    for h in range(1, 3500):
        check = 4 * i * h - n * (i + h)
        if check > 0:
            v = n * i * h / check
            if v.is_integer():
                print(i, h, int(v))
                exit()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def solve(N):
    M = 3501

    for h in range(1, M):
        for n in range(h, M):
            denominator = 4 * n * h - N * h - N * n
            if denominator <= 0:
                continue
            numerator = N * h * n

            if numerator % denominator == 0:
                return h, n, numerator // denominator


def main():
    N = int(input())
    h, n, w = solve(N)
    print(h, n, w)


if __name__ == "__main__":
    main()

Solution (Python):
def solve():
    N = int(input())
    M = 3501

    for h in range(1, M):
        for n in range(h, M):
            numerator = N * h * n
            denominator = 4 * n * h - N * h - N * n
            if numerator <= 0 or denominator <= 0:
                continue
            if numerator % denominator == 0:
                return h, n, numerator // denominator


h, n, w = solve()
print(h, n, w)

Solution (Python):
N=int(input())
for i in range(1,3501):
    for j in range(1,3501):
        if 4*i*j-N*(i+j)>0 and N*i*j%(4*i*j-N*(i+j))==0:
            print(i,j,N*i*j//(4*i*j-N*(i+j)))
            exit()

Solution (Python):
MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)

def main():
    n = int(input())
    if n%2 == 0:
        print(n//2,n,n)
        return
    for i in range(1,3501):
        for j in range(i + 1,3501):
            if (n * i * j)%(4 * i * j - n * j - n * i) == 0:
                ans = (i ,j , (n * i * j)//(4 * i * j - n * j - n * i))
                break
    
    print(*ans)

if __name__ =='__main__':
    main()

Solution (Python):
N = int(input())
for a in range(1,3501):
    for b in range(a,3501):
        m =  (4*a*b) - N*(a+b)
        if m> 0 and N*a*b % m == 0:
            c = (N*a*b)//m
            break
    else:
        continue
    break
print(a,b,c)

Solution (Python):
N = int(input())
for a in range(1,3501):
    for b in range(1,3501):
        m =  (4*a*b) - N*(a+b)
        if m> 0 and N*a*b % m == 0:
            c = (N*a*b)//m
            break
    else:
        continue
    break
print(a,b,c)

Solution (Python):


N=int(input())


import math as m
t=0
for i in range(m.ceil(N/4),m.floor(N*3/4)+1):
    
    if 4*i==N:
        continue
    for j in range(m.ceil(N*i/(4*i-N)),m.floor(2*N*i/(4*i-N))+1):
        
        if 4*i*j-N*i-N*j==0:
            continue
        k=int((N*i*j)/(4*i*j-N*i-N*j))
        
        if 4*i*j*k==N*(i*j+i*k+j*k):
            h=i
            n=j
            t=1
            break
    if t==1:
        break

print(h,n,k)

Solution (Python):


N=int(input())


import math as m
t=0
for i in range(m.ceil(N/4),m.floor(N*3/4)+1):
    
    if 4*i==N:
        continue
    for j in range(m.ceil(N*i/(4*i-N)),m.floor(2*N*i/(4*i-N))+1):
        
        if 4*i*j-N*i-N*j==0:
            continue
        k=int((N*i*j)/(4*i*j-N*i-N*j))
        
        if 4*i*j*k==N*(i*j+i*k+j*k):
            h=i
            n=j
            t=1
            break
    if t==1:
        break

print(h,n,k)

Solution (Python):
import fractions
N = int(input())
for h in range(1,3501):
    for n in range(1, 3501):
        q = 4*n*h-N*(n+h)
        p = n*h*N
        if q <= 0:
            continue
        if p%q==0:
            ans = [h,n,p//q]
print(*ans)

Solution (Python):
N = int(input())
for a in range(1,3501):
    for b in range(1,3501):
        if (4*a*b) - N*(a+b) != 0:
            r = (N*a*b) % ( (4*a*b) - N*(a+b) )
            if r == 0:
                c = (N*a*b) // ( (4*a*b) - N*(a+b) )
                if c > 0:
                    break
    else:
        continue
    break
print(a,b,c)

Solution (Python):

N = int(input())
def solve(h, n):
    x = N * h * n
    y = 4 * h * n - N * (n + h)
    if y <= 0:
        return -1
    if x % y == 0:
        return x // y
    else:
        return -1
    
flg = False
for h in range(1, 3501):
    if flg: break
    for n in range(1, 3501):
        if flg: break
        if solve(h, n) != -1:
            print(h, n, solve(h, n))
            flg = True

Solution (Python):
import sys
N = int(input())
for h in range(1,3501):
    for n in range(1,3501):
        tmp = 4*h*n-N*(n+h)
        if tmp == 0:
            continue
        d,m = divmod(N*h*n, tmp)
        if m == 0 and d > 0:
            print(h,n,d)
            sys.exit()

Solution (Python):
N=int(input())

import sys

for h in range(1,3501):
    for n in range(h,3501):
        a=(h*n*N)
        b=(4*h*n-(n+h)*N)
        if b==0:
            continue

        
        

        
        

        
        
        if a%b==0:
            w = a/b
            if N*(n*w+h*w+h*n)!=4*n*w*h:
                continue
            
            if w>0:
                w=int(w)
                print(h,n,w)
                '''

                print(4/N)
                print(1/h+1/n+1/w)
                print(a,b)
                print(a/b)
                '''
                sys.exit()

Solution (Python):
N = int(input())

for h in range(1, 3501):
    for n in range(1, 3501):
        num = N * h * n
        denom = 4 * h * n - N * n - N * h
        if denom > 0 and num % denom == 0:
            w = num // denom
            break
    else:
        continue
    break
print(h, n, w)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]

n = INT()
for i in range(1, 3501):
    for j in range(i, 3501):
        a = 4 * i * j - (i + j) * n
        b = i * j * n
        if a != 0:
            k = b // a
            if k > 0 and 4 * i * j * k == n * (i * j + j * k + k * i):
                print(i, j, k)
                exit()

Solution (Python):
N = int(input())

for h in range(1,3501):
    for n in range(h,3501):
        wd = 4*h*n - n*N - h*N
        wu = N*h*n
        if wd > 0 and wu % wd == 0:
            w = wu // wd
            print(h,n,w)
            exit()

Solution (Python):
N = int(input())
for h in range(1,3501):
    for n in range(1,3501):
        if (4*h*n-N*h-N*n)>0 and (h*n)%(4*h*n-N*h-N*n)==0:
            print(h,n,h*n*N//(4*h*n-N*h-N*n))
            exit()

Solution (Python):
N = int(input())
for h in range(1,3501):
    for n in range(1,h):
        if (4*h*n-N*h-N*n)>0 and (h*n)%(4*h*n-N*h-N*n)==0:
            print(h,n,h*n*N//(4*h*n-N*h-N*n))
            exit()

Solution (Python):
N = int(input())
for h in range(1,3501):
    for n in range(1,3501):
        if (4*h*n-N*h-N*n)>0 and (h*n)%(4*h*n-N*h-N*n)==0:
            print(h,n,h*n*N//(4*h*n-N*h-N*n))
            exit()

Solution (Python):
def main():
    n = int(input())
    has_answered = False
    for x in range(1, 3501):
        if has_answered:
            break
        for y in range(x, 3501):
            if 4 * x * y - n * y - n * x > 0 and (n * x * y) % (4 * x * y - n * y - n * x) == 0:
                print(x, y, (n * x * y) // (4 * x * y - n * y - n * x))
                has_answered = True
                break


if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline
from collections import defaultdict, Counter

N = int(input())
for h in range(1, 3501):
    for n in range(1, 3501):
        x = (4*h*n-N*n-N*h)
        if x == 0:
            continue
        w = int(N*n*h/x)
        if w < 1 or 3500 < w:
            continue
        if N*(w*n+h*w+h*n) == 4*h*n*w:
            print(h, n, w)
            exit()

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10


def solve():
    N = II()
    for h in range(1, 3501):
        for w in range(1, 3501):
            if (4 * h * w - N * w - N * h) == 0:
                continue
            n = N * h * w / (4 * h * w - N * w - N * h)
            if n.is_integer() and n > 0:
                print(h, w, int(n))
                return
    return



if __name__ == '__main__':
    solve()

Solution (Python):
import math
N = int(input())
flag = False
for h in range(1, 3501, 1):
    for n in range(1, 3501, 1):
        bumbo = 4 * h * n - N * h - N * n
        bunshi = N * h * n
        if bumbo == 0:
            continue
        wc = math.ceil(bunshi / bumbo)
        wf = math.floor(bunshi / bumbo)
        if wc == wf and wc >= 1:
            ans_h = h
            ans_n = n
            ans_w = wc
            flag = True
            break
    if flag:
        break
print(ans_h, ans_n, ans_w)

Solution (Python):
N=int(input())

for n in range(1,3501):
    for h in range(1,3501):
        up,down=N*n*h,4*h*n-N*(h+n)
        if down!=0:
            if up%down==0 and up//down>0:
                print(h,n,(N*n*h)//(4*n*h-N*(h+n)))
                exit()

Solution (Python):
N=int(input())
for i in range(1,3501):
	for j in range(1,3501):
		if ((4*i*j)-(N*i)-(N*j))>0:
			if (i*j*N)%((4*i*j)-(N*i)-(N*j))==0:
				k=(i*j*N)//((4*i*j)-(N*i)-(N*j))
				print(i,j,k)
				exit()

Solution (Python):
n = int(input())
t = 0
for a in range(1, 3501):
    if t != 0:
        break
    for b in range(1, 3501):
        if (4 * a * b - n * (a + b)) != 0:
            if (n * a * b) % (4 * a * b - n * (a + b)) == 0 and (n * a * b) // (4 * a * b - n * (a + b)) > 0:
                print(a, b, (n * a * b) // (4 * a * b - n * (a + b)))
                t = 1
                break

Solution (Python):
M = 3501
N = int(input())
for h in range(1, M):
    for w in range(1, M):
        u = 4*h*w-N*w-N*h
        d = N*h*w
        if u <= 0:
            continue
        if d % u == 0:
            print(h, w, d//u)
            exit()

Solution (Python):
import sys
n = int(input())

for i in range(1, 3501):
    for j in range(1, 3501):
        if 4*i*j-n*i-n*j > 0:
            if (n*i*j)%(4*i*j-n*i-n*j) == 0:
                print(i, j, n*i*j//(4*i*j-n*i-n*j))
                sys.exit()

Solution (Python):
import sys
n = int(input())

for i in range(1, 3501):
    for j in range(1, 3501):
        if 4*i*j-n*i-n*j > 0:
            if (n*i*j)%(4*i*j-n*i-n*j) == 0:
                print(i, j, n*i*j//(4*i*j-n*i-n*j))
                sys.exit()

Solution (Python):



def main():
  N = int(input())
  for h in range(1,3501):
    for n in range(1, 3501):
      d = 4*h*n - N * (h+n)
      if d <= 0:
        continue
      w = (N*h*n) / d
      if w.is_integer():
        print(h, n, int(w))
        return

if __name__=='__main__':
  main()

Solution (Python):
N = int(input())

max_num = 3500
for h in range(1,max_num+1):
    for n in range(1, max_num+1):
        if 4*h*n - N*n - N*h <= 0:
            continue
        if N*h*n % (4*h*n - N*n - N*h) == 0:
            w = int(N*h*n / (4*h*n - N*n - N*h))
            Ans = [h, n, w]
            break

print(' '.join(map(str, Ans)))

Solution (Python):
N = int(input())
end = False
for h in range(1, 3501):
    if end:
        break
    for n in range(1, 3501):
        if (4 * h * n - N * n - N * h):
            if (N * h * n) % (4 * h * n - N * n - N * h) == 0:
                w = (N * h * n) // (4 * h * n - N * n - N * h)
                if w > 0:
                    print(h, n, w)
                    end = True
                    break

Solution (Python):
N = int(input())


for h in range(3501):
    for w in range(3501):
        if 4*h*w-N*w-N*h <= 0:continue
        if N*h*w % (4*h*w-N*w-N*h) == 0:
            print(h,w,N*h*w // (4*h*w-N*w-N*h))
            exit()

Solution (Python):
n=int(input())
for a in range(1,3*n//4+1):
    if n>=4*a:
        continue
    b = a
    while True:
        if n*(a+b)>=4*a*b:
            b+=1
            continue
        x = a*b*n
        y = 4*a*b-n*(a+b)
        if y>0 and x%y==0:
            c = x//y
            print("{} {} {}".format(a,b,c))
            exit(0)
        if x/y<b:
            break
        b+=1

Solution (Python):

N = int(input())


for h in range(1, 3500+1):
    for w in range(1, 3500 + 1):
        n1 = 4*h*w - h*N - w*N
        if n1:
            l = (h*w*N) / n1
            if 0 < l <= 3500 and int(l) == l:
                print(int(h), int(l), int(w))
                exit()

Solution (Python):
N=int(input())
flag=True

for h in range(1,3501):
  for n in range(1,3501):
    if 4*h*n-N*n-N*h !=0:
      if (N*h*n)%(4*h*n-N*n-N*h)==0:
        w=(N*h*n)//(4*h*n-N*n-N*h)
        if w>0:
          print(h,n,w)
          flag=False
          break
  if flag==False:
    break

Solution (Python):
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    if 4*i*j-n*i-n*j>0:
      if (n*i*j)%(4*i*j-n*i-n*j)==0:
        print(i,j,(n*i*j)//(4*i*j-n*i-n*j))
        exit()

Solution (Python):
N = int(input())

for h in range(1, 3501):
    for n in range(1, 3501):
        if 4*h*n != N*(n+h):
            x = N*h*n
            y = 4*h*n - N*(n+h)
            w = x // y
            if x % y == 0 and 1 <= w <= 3500:
                print(h, n, w)
                exit()

Solution (Python):

import sys


def solve(N: int):
    for i in range(1, 3501):
        for j in range(i, 3501):
            z = 4*i*j - N*(j+i)
            if z > 0:
                h, r = divmod((N*i*j), z)
                if r == 0:
                    print(h, i, j)
                    exit()
            

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())

from math import *

for h in range(1, 3501):
    for n in range(1, 3501):
        try:
            w = N*h*n / (4*h*n - N*n - N*h)
        except:
            continue
        if ceil(w) == floor(w) and w > 0:
            print(h, n, int(w))
            exit()

Solution (Python):
N = int(input())
flag = 0
for a in range(1,3501):
    if flag ==1:
        break
    for b in range(1,3501):
        if 4*a*b - a*N - b*N != 0:
            if a*b*N // (4*a*b - a*N - b* N) > 0 and a*b*N % (4*a*b - a*N - b* N) ==0:
                c = int(a*b*N / (4*a*b - a*N - b* N))
                print(a, b, c)
                flag = 1
                break

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

N = ni()
m = 3500 // 4

def f():
    ans = []
    for h in range(3501):
        for n in range(3501):
            c = h * n * N
            d = 4 * h * n - N * n - N * h
            if d > 0 and c % d == 0:
                ans = [h, n, c // d]
                return ans

print(*f())

Solution (Python):
def calc(N, h, n):
    base = 4 * h * n - N * n - N * h
    if base <= 0:
        return False, -1
    ret = (N*h*n) / base
    return ret == int(ret) and 0 <= ret <= 3500, int(ret)

N = int(input())

def f(N):
    for h in range(1, 3501):
        for n in range(1, 3501):
            judge, ret = calc(N,h,n)
            if judge:
                return h, n, ret
    return -1, -1, -1

print(*f(N))

Solution (Python):
def main():
    n = int(input())
    x, y, z = 0, 0, 0
    f = False
    for i in range(1, 3501):
        for j in range(i, 3501):
            if (4*i*j - i*n - j*n) > 0 and i*j*n % (4*i*j - i*n - j*n) == 0:
                x = i
                y = j
                z = i*j*n // (4*i*j - i*n - j*n)
                f = True
                break
        if f:
            break
    print(x, y, z)

if __name__ == "__main__":
    main()

Solution (Python):
import math
n=int(input())
for a in range(math.ceil(n/4),3501):
    q=4/n-1/a
    if q==0:continue
    for b in range(math.ceil(q),3501):
        if not 4*a*b==b*n+a*n:
            t=a*b*n/(4*a*b-b*n-a*n)
            if t>0 and t%1==0:
                print(a,b,int(t))
                exit()

Solution (Python):
N=int(input())
if N%2==0:
  print(N//2,N,N)
else:
  for i in range(1,3501):
    for j in range(1,3501):
      if 4*i*j-N*i-N*j>0:
        if (N*i*j/(4*i*j-N*i-N*j)).is_integer():
          print(i,j,int((N*i*j/(4*i*j-N*i-N*j))))
          exit()