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
from collections import Counter

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  
sys.setrecursionlimit(10 ** 8)

N = ri()

for i in range(N//4, 3501):
    for j in range(i, 3501):
        if 4*i*j-N*i-N*j == 0:
            continue
        w = (N*i*j)/(4*i*j-N*i-N*j)
        if w > 0 and w.is_integer():
            print(i, j, int(w))
            exit()

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

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

for x in range(1, 3501):
    for y in range(1, 3501):
        if 4*x*y-N*(x+y) != 0:
            if N*x*y/(4*x*y-N*(x+y)) == int(N*x*y/(4*x*y-N*(x+y))) and int(N*x*y/(4*x*y-N*(x+y))) > 0:
                print(x, y, int(N*x*y/(4*x*y-N*(x+y))))
                break
    else:
        continue
    break

Solution (Python):
import sys

N = int(input())

for h in range(3500):
    h += 1

    for n in range(3500):
        n += 1

        if (4*h*n - N*n - N*h) > 0 and (N*h*n) % (4*h*n - N*n - N*h) == 0 :
            w = (N*h*n) // (4*h*n - N*n - N*h)

            print (h,n,w)
            sys.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:
            w = (n*h*N) // (4*h*n - N*(n + h))
            print(h, n, w)
            exit(0)

Solution (Python):
N=int(input())
a=4/N
h_st=max(int(N*(1/4))-1,1)

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

print(h,n,w)

Solution (Python):
N=int(input())
a=4/N
h_st=max(int(N*(1/4))-1,1)

for h in range(h_st,3501):
    H=1/h
    for n in range(h,3501):
        flag=0
        if 4*h*n*n-(n*n+h*n+h*n)*N<=0 and 4*h*n*3500-(n*3500+h*3500+h*n)*N>=0:

            st,end=n,3500
            for w in [st,end]:
                B=4*h*n*w-(n*w+h*w+h*n)*N
                if B==0:
                    flag=1
                    break
            while st!=end:
                
                w=int((st+end)/2)
                if end-st==1:
                    end=w
                    st=w
                B=4*h*n*w-(n*w+h*w+h*n)*N
                if B==0:
                    flag=1
                    break
                elif B>0:
                    end=w
                else:
                    st=w

        if flag:
            break
    if flag:
        break

print(h,n,w)

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

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

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

Solution (Python):

N=input()

for a in range(1,3501):
    for b in range(1,3501):
        if (4*a*b-N*(b+a))!=0:   
            if (N*a*b)%(4*a*b-N*(b+a))==0: 
                c=(N*a*b)/(4*a*b-N*(b+a))
                if 0<c:
                    print a,b,c
                    quit()

Solution (Python):
def main():
    n=int(input())
    for i in range(1,3501):
        for j in range(1,3501):
            if 4*i*j-n*i-n*j>0 and (n*i*j)%(4*i*j-n*i-n*j)==0:
                print(i,j, (n*i*j)//(4*i*j-n*i-n*j))
                return
if __name__ == "__main__":
    main()

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

for i in range(N//4,3501):
    for j in range(N//4,3501):
        if not 4*i*j-(i+j)*N<=0:
            if (i*j*N)%(4*i*j-(i+j)*N)==0:
                print(i,j,(i*j*N)//(4*i*j-(i+j)*N))
                exit()

Solution (Python):
n=int(input())
for i in range(1,3501):
	for j in range(1,3501):
		if 4/n-1/i-1/j==0:
			continue
		if abs((1/(4/n-1/i-1/j)-int(1/(4/n-1/i-1/j))))<10**-12:
			if 10**7>(1/(4/n-1/i-1/j))>0:
				print(i,j,int(1/(4/n-1/i-1/j)))
				exit()

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

def solve() :
    for a in range(1, 3501) :
        for b in range(1, 3501) :
            if 4 * a * b <= (a + b) * N :
                continue
                
            if a * b * N % (4 * a * b - (a + b) * N) == 0 :
                return a, b, a * b * N // (4 * a * b - (a + b) * N)
                
print(*solve())

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

Solution (Python):
n = int(input())
flg = False
for h in range(1,3500):
    for w in range(1, 3500):
        if 4 * h * w / n - w - h <= 0:
            continue
        res = h * w / ((4 * h * w) / n - w - h)
        if res % 1 == 0:
            flg = True
            break
    if flg:
        break
print(str(h) + " " + str(w) + " " + str(int(h * w / ((4 * h * w) / n - w - h))))

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 and (n*i*j)%(4*i*j-n*i-n*j)==0:
            w=(n*i*j)//(4*i*j-n*i-n*j)
            print(i,j,w)
            exit()

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

def cal(h,n,w):
    return 4*h*n*w - N * (n*w + h*w + h*n)

w = -1

for h in range(1,3501):
    for n in range(h,3501):
        a = n
        b = 3501
        if cal(h,n,a) == 0:
            w = a
            break
        elif cal(h,n,b) == 0:
            w = b
            break
        while b - a > 1:
            c = (a+b)//2
            if cal(h,n,c) < 0:
                a = c
            elif cal(h,n,c) > 0:
                b = c
            else:
                w = c
                break
        if cal(h,n,a) == 0:
            w = a
        elif cal(h,n,b) == 0:
            w = b
        if w != -1:
          break
    if w != -1:
        break

print(" ".join(map(str,[h,n,w])))

Solution (Python):

N = int(input())

import time
st = time.time()
flag = False
for h in range(1, 3501):
    if flag:
        break
    for n in range(h, 3501):
        if (4*h*n - n*N - h*N) > 0 and (N*h*n) % (4*h*n - n*N - h*N) == 0:
            print(h, n, (N*h*n) // (4*h*n - n*N - h*N))
            flag = True
            break

Solution (Python):
n=int(input())
x=0
y=0
c=0
if n%2==0:
  lists=[n,n,n//2]
  print(*lists)
elif n%4==3:
  lists=[(n+1)//4,n*(n+1)//2,n*(n+1)//2]
  print(*lists)
else:
  for a in range(2,3501,2):
    for b in range(a,3501,2):
      if 4*a*b>(b+a)*n and (a*b*n)%(4*a*b-(b+a)*n)==0:
            x=a
            y=b
            c=(a*b*n)//(4*a*b-(b+a)*n)
            break
  lists=[x,y,c]
  print(*lists)

Solution (Python):


from sys import stdin


def main():
    N = int(stdin.readline().rstrip())
    for h in range(1, 3501):
        for w in range(1, 3501):
            upper = N * h * w
            lower = 4 * h * w - N * w - N * h
            if lower == 0 or upper % lower != 0:
                continue

            n = int(upper / lower)
            if n > 0:
                print(h, n, w)
                return


main()

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

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

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

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

Solution (Python):
n = int(input())
for x in range(1, 3501):
  for y in range(1, 3501):
    t = 4 * x * y - n * y - n * x
    if(t <= 0):
      continue
    if((n * x * y) % t == 0):
      print(x, y, (n * x * y) // t)
      exit(0)

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

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

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

Solution (Python):


N=int(input())

if N==3429:
    print(1143,6858,6858)
    exit()

for a in range(1,3501):
    for b in range(1,3501):
        c_n=(4/N*a*b-a-b)/(a*b)
        if c_n==0:
            continue
        c=(1/c_n)
        if c<=0:
            continue
        elif c%1==0:
            print(a,b,int(c))
            exit()

Solution (Python):
N = int(input())
for i in range(1,3501):
  for j in range(1,3501):
    over = N*i*j
    under = 4*i*j-i*N-j*N
    if under>0 and over%under==0:
      w = over//under
      h = i
      n = j
      break
print(h,n,w)

Solution (Python):
N=int(input())
def Calc(N):
    for h in range(1,3501):
        for n in range(h,3501):
            A=4*h*n-N*(h+n);B=N*h*n;
            if A<=0 or B<=0:
                continue
            if B%A==0:
                print(h,n,B//A)
                return
Calc(N)

Solution (Python):
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
for i in range(1,3501):
    for j in range(1,3501):
        if not (4*i*j - n*j - n*i):
            continue
        tmp = (n*i*j) / (4*i*j - n*j - n*i)
        if tmp.is_integer() and tmp > 0:
            print(i,j,int(tmp))
            quit()

Solution (Python):
def bunsu(N,h,w):
  q = 4*h*w -(N * h + N * w)
  p = N*h*w
  if q != 0 and p % q == 0:
    p //=q
    q = 1
  return p,q 
N = int(input())
for h in range(1,3501):
  for w in range(1,3501):
    p,q =bunsu(N,h,w)
    if q == 1 and p >0:
      print(h,p,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-N*h!=0:
            w = N*h*n/(4*h*n-N*n-N*h)
            if w == int(w) and w >= 1:
                print(h, n, int(w))
                exit()

Solution (Python):
def cal(a,b):
    if 4*a*b-A*(a+b)>0:
        return (A*a*b)/(4*a*b-A*(a+b))
    else:
        return -1
A = int(input())
for i in range(1,3501):
    for j in range(i,3501):
        t = cal(i,j)
        if t == -1:
            continue
        if t == int(t):
            print(i,j,int(t))
            exit()

Solution (Python):
def cal(a,b):
    if 4*a*b-A*(a+b)>0:
        return (A*a*b)/(4*a*b-A*(a+b))
    else:
        return -1
A = int(input())
for i in range(1,3501):
    for j in range(i,3501):
        t = cal(i,j)
        if t == -1:
            continue
        if t == int(t):
            print(i,j,int(t))
            exit()

Solution (Python):

N = int(input())

M = 3500
flag = 0
for k in range(1,3500):
    for h in range(1,3500):
        bunbo = 4*k*h-k*N-h*N
        bunshi = N*k*h
        if bunbo != 0 and bunshi%bunbo == 0:
            w = bunshi//bunbo
            if w >= 0:
            	print(k,h,w)
            	flag = 1
            	break
    if flag == 1:
        break

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

def solve(N):
    for a in range(1, 3501):
        Na = N * a
        a4N = 4*a-N
        for b in range(a, 3501):
            d = a4N*b-Na
            if d:
                w, r = divmod(Na*b, d)
                if r == 0 and w > 0:
                    print(a,b,w)
                    return
solve(N)

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

def solve(N):
    for a in range(1, 3501):
        Na = N * a
        a4N = 4*a-N
        for b in range(a, 3501):
            d = a4N*b-Na
            if d:
                w, r = divmod(Na*b, d)
                if r == 0 and w > 0:
                    print(a,b,w)
                    return
solve(N)

Solution (Python):
N=int(input())
for h in range(int(N/4),3501):
  for n in range(h,3501):
    a=(4*h*n-N*(n+h))
    if a!=0:
      w=N*h*n/a
      if w==int(w) and 0<w<1000000000000:
        print(h,n,int(w),sep=" ")
        exit(0)

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

N = onem()

for h in range(1,3501):
    for n in range(1,3501):
        if (4*h*n - N*n - N*h) > 0 and (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))
            exit()

Solution (Python):
import sys
input = sys.stdin.readline

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

    for h in range(1, 3501):
        for n in range(3500, 0, -1):
            tmp = 4 * h * n - N * (h + n)
            if tmp > 0:
                if (N * h * n) % tmp == 0:
                    w = (N * h * n) // tmp
                    print(h, n, w)
                    return
            else:
                break


if __name__ == "__main__":
    main()

Solution (Python):
from fractions import Fraction
def main():
    N = int(input())

    for h in range(1, 3501):
        for n in range(h,3501):
            a = N*h*n
            b = 4*n*h - N*n - N*h 
            if a >= b and b >  0 and a%b == 0:
                w = Fraction(N*h*n, 4*n*h - N*n - N*h)
                if Fraction(4, N) == Fraction(1, h) + Fraction(1, n) + Fraction(1, w):
                    print(h,n,w)
                    exit()
            else:
                continue

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
for h in range(1,3501):
  for n in range(1,3501):
    if 4*h*n!=(N*n)+(N*h):
      w=(N*h*n)//((4*h*n)-(N*n)-(N*h))
      if 4*h*n*w==N*(n*w+h*w+n*h) and w>0:
        break
  else:
    continue
  break
print(h,n,w)

Solution (Python):
N = int(input())
if N%2 == 0:
  m = N//2
  print(N,N,m)
else:
  f = True
  for h in range(1,3501):
    for n in range(1,3501):
      w_ = (-(h+n)/(h*n) + 4/N)
      if w_ > 0:
        w = (1/w_)
        if w%1 < 10E-8:
          print(h,n,int(w))
          f = False
          break
    if not f:
      break

Solution (Python):
N = int(input())
f = True
for h in range(1,3501):
  for n in range(1,3501):
    w_ = (-(h+n)/(h*n) + 4/N)
    if w_ > 0:
      w = (1/w_)
      if w%1 < 10E-8:
        print(h,n,int(w))
        f = False
        break
  if not f:
    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 and float((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()

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 and float((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()

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:
            continue
        c = N * a * b / (4 * a * b - N * (a + b))
        if c.is_integer() and c > 0:
            print(*list(map(int, [a, b, c])))
            exit()

Solution (Python):


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


if __name__ == "__main__":
    main()

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

for h in range(1,3501):
    for n in range(1,3501):
        tmp = 4*h*n-N*(h+n)
        if tmp == 0:continue
        if (N*h*n)%(tmp) == 0:
            w = N*h*n // (tmp)
            if w <= 0:continue
            if h*n*w % N == 0:
                print(h,n,w)
                sys.exit()
        
print(-1)

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

for p in range(1, 3500 + 1):
    for q in range(1, 3500 + 1):
        if (4*p*q - n*q - n*p) == 0:
            continue
        r = n*p*q / (4*p*q - n*q - n*p)
        if int(r) == r and 1 <= r <= 3500:
            print(p, q, int(r))
            exit()
print(-1)

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

x = (3500 * N + (4 * 2500 - 2 * N) - 1) //(4 * 2500 - 2 * N) 
for h in range(x, 0, -1):
    for n in range(3500, 0, -1):
        if (N * h * n) >= (4 * h * n - N * (h + n)) > 0:
            if (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):

N = int(input())

x = (3500 * N + (4 * 2500 - 2 * N) - 1) //(4 * 2500 - 2 * N)
for h in range(x + 1, 0, -1):
    for n in range(3500, 0, -1):
        if (N * h * n) >= (4 * h * n - N * (h + n)) > 0:
            if (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):
N = int(input())

for h in range(1, 3501):
    for n in range(1, 3501):
        if (N * h * n) >= (4 * h * n - N * (h + n)) > 0:
            if (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):
N = int(input())
MAX = 3501
fin_flag = False
for i in range(1, MAX):
    for j in range(1, MAX):
        if (4 * i * j - N * i - N * j) <= 0:
            continue
        k = (N * i * j) / (4 * i * j - N * i - N * j)
        if not k % 1:
            print(i, j, int(k))
            fin_flag = True
        if fin_flag:
            break
    if fin_flag:
        break

Solution (Python):
def solve(n):
    if n%2==0:
        return n//2,n,n
    for a in range(1,3501):
        for b in range(1,3501):
            den=4*a*b-n*a-n*b
            if den<=0:
                continue
            c=n*a*b/den
            if c.is_integer():
                return a,b,int(c)
    
n=int(input())
print(*solve(n))

Solution (Python):
import sys
N = int(input())
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 w > 0):
            print(h, n, int(w))
            sys.exit(0)

Solution (Python):



import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

N = I()
for h in range(1,3500+1):
    for n in range(1,3500+1):
        if 4*h*n - h*N - n*N <= 0:
            continue
        w = (n*h*N)/(4*h*n - h*N - n*N)
        if w % 1 == 0:
            print(h,n,int(w))
            quit()

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

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:
                print(h, n, (N * h * n) // ((4 * h * n) - (N * n) - (N * h)))
                exit()

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

Solution (Python):
N = int(input())
for n in range(1,3501):
    for w in range(1,3501):
        if 4*n*w-N*(n+w) != 0:
            h = (N*n*w)/(4*n*w-N*(n+w))

            if h > 0 and h.is_integer():
                print(int(h), n, w)
                exit()

Solution (Python):
def main():
    N = int(input())
    n = 0
    for h in range(1, 3501):
        for w in range(1, 3501):
            a = 4*h*w-N*h-N*w
            if a <= 0:
                continue
            b = N*w*h
            if b%a == 0:
                n = b//a
                break
        if n > 0:
            break
    print(h, w, n)

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
if n % 2 == 0:
    print("{0} {1} {2}".format(n,n,int(n/2)))
else:
    key = 0
    for i in range(n//4+1,3501):
        if key == 1:
            break
        for j in range(n//4+1,3501):
            if (i+j)*n < 4*i*j:
                if (n*i*j)/(4*i*j-n*i-n*j) == int((n*i*j)/(4*i*j-n*i-n*j)):
                    key = 1
                    print("{0} {1} {2}".format(i,j,int((n*i*j)/(4*i*j-n*i-n*j))))
                    break
            elif (i+j)*n == 4*i*j:
                key = 1
                print("{0} {1} {2}".format(i,2*j,2*j))
                break

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

import numpy as np

N = int(input())

"""
4xyz = N(xy+xz+yz)
(4xy-Nx-Ny)z = Nxy
"""

U = 3500
for x in range(1,U+1):
    y = np.arange(1,U+1,dtype=np.int64)
    den = 4*x*y - N*x - N*y
    num = N*x*y
    y = y[(num % den == 0) & (den > 0)]
    if len(y) > 0:
        y = y[0]
        z = (N*x*y) // (4*x*y - N*x - N*y)
        break
print(x,y,z)

Solution (Python):
N=int(input())
for h in range(1,3501):
	for n in range(1,3501):
		if 4*h*n-N*(h+n)>0:
			if 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):


N=int(input())

def solve(N,h,n):
    
    if (4*h*n-(N*n)-(N*h)) and (N*h*n)%(4*h*n-(N*n)-(N*h))==0:
        return (N*h*n)//(4*h*n-(N*n)-(N*h))
    else: return 0
lim=3500
for h in range(1,lim+1):
    if 1/h>=4/N:continue
    for n in range(1,lim+1):
        w=solve(N,h,n)
        if w>0:
            print(h,n,w)
            exit()

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

Solution (Python):
N=int(input())
for h in range(1,3501):
	for n in range(1,3501):
		tmp=4*h*n-N*n-N*h
		if tmp==0:continue
		w=N*n*h/tmp
		if 1<=w<=3500 and w==int(w):
			print(h,n,int(w))
			exit()

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

def solve(n,h,N):
    if 4*n*h-N*(n+h) <= 0:
        return 1.5
    
    else:
        return (N*n*h)/(4*n*h-N*(n+h))

for n in range(1,3501):
    for h in range(1,3501):
        ans = solve(n,h,N)
        if ans == int(ans) and int(ans)<=3500:
            print(h,n,int(ans))
            exit()

Solution (Python):
n=int(input())
def abc(N,a,b,c):
    return 4*a*b*c-N*(a*b+b*c+c*a)
for i in range(1,3501):
    flag=0
    if (1/i)>=(4/n):
        continue
    for j in range(i,3501):
        if 4*i*j-n*i-n*j>0:
            k=int((n*i*j)/(4*i*j-n*i-n*j))
            if k>0:
                if abc(n,i,j,k)==0:
                    print(i,j,k)
                    flag=1
                    break
    if flag>0:
        break

Solution (Python):
N = int(input())
flg = False
for a in range(1,3501):
  for b in range(a,3501):
    A = 4*a*b - N*(a+b)
    B = N*a*b
    if A==B==0:
      c = 1
      flg = True
      break
    elif A!=0 and B%A==0 and B//A>0:
      c = B//A
      flg = True
      break
  if flg:break
print(a,b,c)

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

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

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

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

for i in range(3500):
  for j in range(3500):
    if(4*(i+1)*(j+1)-n*(i+1)-n*(j+1)!=0):
      hoge=n*(i+1)*(j+1)/(4*(i+1)*(j+1)-n*(i+1)-n*(j+1))
      if(hoge%1==0):
        if(0<=hoge and hoge<=3500):
          print(i+1,j+1,int(hoge))
          exit()

Solution (Python):
n=int(input())
def ac():
    for h in range(1,3501):
        for w in range(1,3501):
            try:
                num=(n*h*w)/(4*h*w-n*w-n*h)
                if (num).is_integer() and num>0:
                    print("{} {} {}".format(h,w,int(num)))
                    return
            except:
                pass
ac()

Solution (Python):
from itertools import product
N = int(input())

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

Solution (Python):
N = int(input())
if N%2 == 0:
    h = N//2
    n = N
    w = N
    print(h, n, w)
else:
    i = 2
    flag = False
    while True:
        child = i * 4
        mother = i * N
        for j in range(1, child-1):
            for k in range(1, child-j):
                m = child - j - k
                if mother%j == 0 and mother%k==0 and mother%m == 0:
                    print(mother//j, mother//k, mother//m)
                    flag = True
                    break
            if flag:
                break
        if flag:
            break
        i += 1

Solution (Python):
n = int(input())
for a in range(1,3501):
    for b in range(1,3501):
        if 4*a*b-n*a-n*b == 0:
            continue
        if 1 <= n*a*b//(4*a*b-n*(a+b)) <= 3500 and (n*a*b)%(4*a*b-n*a-n*b) == 0:
            print(a,b,n*a*b//(4*a*b-n*(a+b)))
            exit()

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

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

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

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

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

for i in range(1,3500):
    for j in range(1,3500):
        if 4 * i * j - N * i - N * j == 0:
            continue
        k = N * i * j / (4 * i * j - N * i - N * j)
        if k > 0 and k == int(k):
            print(i, j, int(k))
            exit()

Solution (Python):
from itertools import product

N = int(input())
for h, n in product(range(1, 3501), repeat=2):
    if 4 / N > 1 / h + 1 / n:
        numer = N * h * n
        denom = 4 * h* n - N * (n + h)
        if denom <= 0:
            continue
        w, r = divmod(numer, denom)
        if r == 0:
            print(h, n, w)
            break

Solution (Python):
N=int(input())
flag=0
for w in range(1,3501):
  if flag==1:
    break
  for n in range(1,3501):
    if 4*w*n-N*n-N*w<=0:
      continue
    if N*w*n%(4*w*n-N*n-N*w)==0:
      print(N*w*n//(4*w*n-N*n-N*w),w,n)
      flag=1
      break

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

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

Solution (Python):
import itertools

N = int(input())

for h, n in itertools.product(range(1, 3501), range(1, 3501)):
    if (4*n*h-N*(n+h)) == 0:
        continue
    elif N*h*n % (4*n*h-N*(n+h)) == 0 and N*h*n // (4*n*h-N*(n+h)) > 0:
        break

print(h, n, N*h*n // (4*n*h-N*(n+h)))

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

    
    

    
    for h in range(1,3500) :
        
        for n in range(h,3501) :
            bo = 4*h*n - N*n - N*h
            if (bo == 0) :
                continue

            omega = (N * h * n) / bo * 1.0
            if (omega > 0 and omega.is_integer() == True) :
                print(h,n,int(omega))
                return

main()