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):
N = int(input())
for i in range(1,3501):
    h = i
    for j in range(1,3501):
        n = j
        wb = (4*h*n-N*n-N*h)
        if wb > 0:
            w = (N*h*n)/wb
            if w.is_integer() is True:
                print(h,n,int(w))
                exit()

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

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

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

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

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

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

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

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

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

for i in range(1,3501):
    for j in range(i,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)
            quit()
        else:
            continue

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

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

Solution (Python):
import math
N=int(input())
h_max=math.floor(3*N/4)
d=10**(-5)
for h in range(1,min(h_max+1,3501)):
     if 4/N - 1/h == 0:
          continue
     n_max=math.floor(2/(4/N - 1/h))
     for n in range(h,min(n_max+1,3501)):
          if 4/N-1/h-1/n == 0:
               continue
          w=1/(4/N-1/h-1/n)
          if w-d<round(w) and round(w)<w+d and round(w)>=n:
               print(h,n,round(w))
               break
     else:
          continue
     break

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

for h in range(1,3501):
    if (4*h <= N):
        continue
    nn = int (N*h / (4*h-N))
    for n in range(max(1,nn),3501):
        t = 4*h*n - N*h - N*n
        if t <= 0:
            continue
        s = N*h*n
        if s % t == 0:
            print(h, n, int(s/t))
            quit()

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

for h in range(1, 3501):
    a = 4 * h - N
    if a <= 0:
        continue
    for n in range(max(h, N * h // a + 1), 3501):
        q = 4 * h * n - N * h - N * n
        if q <= 0:
            continue
        p = N * h * n
        if p % q == 0:
            print(h, n, int(p / q))
            quit()

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

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

Solution (Python):
from sys import exit, stdin
N = int(stdin.readline().rstrip())
for i in range(1, 3501):
    for j in range(1, 3501):
            div = 4*i*j-N*i-N*j
            if div <= 0:
                continue
            if (N*i*j) % div == 0:
                print(i, j, (N*i*j) // div)
                exit()

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

Solution (Python):
N = int(input())
ans = []
n = 4/N
for i in range(1,3501):
    flag = True
    for j in range(1,3501):
        if(4*i*j-N*j-N*i==0):
            continue
        k = N*i*j/(4*i*j-N*j-N*i)
        if(int(k)==k and k>0):
            ans=[i,j,int(k)]
            flag = False
            break
    if(not flag):
        break
print(ans[0],ans[1],ans[2])

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

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

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

num = 3505

for i in range(1, num):
    if N / 4 < i:
        for j in range(1, num):
            if N / 4 < (i * j) / (i + j):
                w = (N * i * j) / (4 * i * j - i * N - j * N)
                if w.is_integer():
                    print(i, j, int(w))
                    exit()

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

num = 3505

for i in range(1, num):
    if 4 / N > 1 / i:
        for j in range(1, num):
            if 4 / N > 1 / i + 1 / j:
                w = (N * i * j) / (4 * i * j - i * N - j * N)
                if w.is_integer():
                    print(i, j, int(w))
                    exit()

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

num = 3505

for i in range(1, num):
    if 4 / N > 1 / i:
        for j in range(1, num):
            if 4 / N > 1 / i + 1 / j:
                w = (N * i * j) / (4 * i * j - i * N - j * N)
                if w.is_integer():
                    print(i, j, int(w))
                    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 (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):
def main():
    buf = input()
    N = int(buf)
    if N % 2 == 0:
        print(N // 2, N, N)
        return
    else:
        divisor = N
        mult = 1
        while True:
            factor = factorization(divisor)
            for h in factor:
                for n in factor:
                    for w in factor:
                        if h + n + w == 4 * mult:
                            print(divisor // h, divisor // n, divisor // w)
                            return
            divisor += N
            mult += 1

def factorization(number):
    i = 2
    factor = {1, number}
    while i * i <= number:
        if number % i == 0:
            factor.add(i)
            factor.add(number // i)
        i += 1
    return factor

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

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

Solution (Python):
N = int(input())
is_exist = False
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) == 0:
      print(h, n, (N*h*n) // (4*h*n-N*n-N*h))
      is_exist = True
      break
  if is_exist:
    break

Solution (Python):


N = int(input())

flag = False
for h in range(1,3500):
    for n in range(h,3500):
        if 4 * h * n - N * h - N * n == 0:
            continue
        if (N * n * h) % (4 * h * n - N * h - N * n) != 0:
            continue
        w = int((N * n * h) / (4 * h * n - N * h - N * n))
        if w <= 0:
            continue
        print(n,h,w)
        flag = True
        break
    if flag:
        break

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:
            if 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):
N = int(input())

for h in range(3501):
    for n in range(1,3501):
        a = 4*h*n - N*(h+n)
        if a>0:
            w = N*h*n / a
            if w==int(w):
                print("{} {} {}".format(int(w),n,h))
                exit()

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:
            c=N*a*b/(4*a*b-N*a-N*b)
            if c==int(c):
                if 4*a*b*c==N*(a*b+b*c+c*a):
                    print(a,b,int(c))
                    exit()

Solution (Python):
def solve(N):
    for h in range(1, 3501):
        for n in range(1, 3501):
            d = 4*h*n - N*h - N*n
            if d <= 0: continue
            w = N*h*n / d
            if w == int(w):
                print(h, n, int(w))
                return

N = int(input())

solve(N)

Solution (Python):
def solve(N):
    for h in range(1, 3501):
        for n in range(1, 3501):
            d = 4*h*n - N*h - N*n
            if d == 0: continue
            w = N*h*n / d
            if 0 < w and w == int(w):
                print(h, n, int(w))
                return

N = int(input())

solve(N)

Solution (Python):
import sys

n = int(input())

for a in range(1,3501):
  for b in range(1,3501):
    if((4*a*b - n*b - n*a) > 0):
      c = (n*a*b) / (4*a*b - n*b - n*a)
      if(c.is_integer()):
        print('%d %d %d' % (a, b, c))
        sys.exit()

Solution (Python):
import sys

n = int(input())

for a in range(1,3501):
  for b in range(1,3501):
    if((4*a*b - n*b - n*a) > 0):
      c = (n*a*b) / (4*a*b - n*b - n*a)
      if(c.is_integer()):
        print('%d %d %d' % (a, b, c))
        sys.exit()

Solution (Python):
def main():
    N = int(input())
    w1 = 10**5
    w2 = 1
    try:
        for h in range(1,3501):
            for n in range(1,3501):
                if (4*h*n-N*(h+n))>0:
                    w1 = (N*h*n)//(4*h*n-N*(h+n))
                    w2 = (N*h*n)/(4*h*n-N*(h+n))
                if w1==w2 and w1>0:
                    raise(Exception)
    except Exception:
        print(h,n,w1)
if __name__ == '__main__':
    main()

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

for h in range(N//4 +1, min(3501, 3*N//4 +1)):
  for n in range((N*h)//(4*h-N), min(3501, ((2*N*h)//(4*h-N))+1)):
    
    x = 4*h*n - N*n - N*h
    y = N*h*n
    if x>0 and not y%x:
      print('{} {} {}'.format(h,n,y//x))
      exit()

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

if N==2:
  print('1 2 2')
  exit()

for h in range(N//4 +1, min(3501, 3*N//4 +1)):
  for n in range((N*h)//(4*h-N), min(3501, (2*N*h)//(4*h-N))):
    x = 4*h*n - N*n - N*h
    y = N*h*n
    if x>0 and not y%x:
      print('{} {} {}'.format(h,n,y//x))
      exit()

Solution (Python):
N=int(input())
l=[]
for h in range(1,3501):
  for n in range(1,3501):
    try:
      final=N*h*n/(4*h*n-N*n-N*h)
      if final.is_integer()==True and final>0:
        w=int(final)
        l.append([h,n,w])
    except:
      pass
print("{0} {1} {2}".format(l[0][0],l[0][1],l[0][2]))

Solution (Python):
import sys
MOD = 10 ** 9+7
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())



N = ii()
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):
N=int(input())
for h in range(1,3501):
  for n in range(1,3501):
    if 4*n*h-N*h-N*n>0 and N*h*n%(4*n*h-N*h-N*n)==0:print(h,n,N*h*n//(4*n*h-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*n - N*h)<=0:
            continue

        w = N*h*n/(4*h*n - N*n - N*h)
        flag = w.is_integer()
        
        
        if flag and w>0:
            print(h, n, int(w))
            exit()

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

Solution (Python):
N = int(input())
w1 = 10**5
w2 = 1
try:
    for h in range(1,3501):
        for n in range(1,3501):
            if (4*h*n-N*(h+n))>0:
                w1 = (N*h*n)//(4*h*n-N*(h+n))
                w2 = (N*h*n)/(4*h*n-N*(h+n))
            if w1==w2 and w1>0:
                raise(Exception)
except Exception:
    print(h,n,w1)

Solution (Python):
n=int(input())
flag=True
for a in range(1,3501):
    for b in range(1,3501):
        if 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)))
            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+h) <= 0:
            continue
        if N*h*n < (4*h*n-N*(n+h)):
            continue
        if flag and (N*n*h) % (4*h*n-N*(n+h)) == 0:
            print(str(h)+' '+str(N*n*h //(4*h*n-N*(n+h)))+' '+str(n))
            flag = False
        if not flag:
            break
    if not flag:
        break

Solution (Python):


def f(N):
    for i in range(1, 3501):
        a = 4 * i - N
        b = N * i
        if a <= 0:
            continue
        for j in range(i, 3501):
            c = a * j - b
            d = b * j
            if c <= 0:
                continue
            if d % c == 0:
                return (i, j, d//c)


if __name__ == '__main__':
    N = int(input())
    h, n, w = f(N)
    print(h, n, w)

Solution (Python):
import sys
MOD = 10 ** 9+7
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())



N = ii()
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())

def main():
    for i in range(1, 3500):
        for j in range(1, 3500):
            z = 4 * i * j - n * i - n * j
            if z > 0:
                x = n * i * j / z
                if x == int(x):
                    print(i, j, int(x))
                    sys.exit()


main()

Solution (Python):
n = int(input())
if n%2 == 0:
  print(n,n,n//2)
else:
  for h in range(max(2, n//4),3501):
    for l in range(max(2, n//4),3501):
      m = n*h*l
      c = 4*h*l - n*(h+l)
      if c > 0 and m%c == 0:
        w = m//c
        print(h,l,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 == w // 1 and w > 0:
                w = int(w)
                print(h, n, w)
                exit()

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

Solution (Python):
from itertools import product
n = int(input())
if n%2 == 0:
  print(n,n,n//2)
else:
  for h,l in product(range(max(2, n//4),3501),repeat=2):
    m = n*h*l
    c = 4*h*l - n*(h+l)
    if c > 0 and m%c == 0:
      w = m//c
      break
  print(h,l,w)

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

Solution (Python):
s=int(input());
for n in range(s//4,3501):
 for h in range(3501):
  x=4*h*n-s*n-s*h
  if x>0:
   if ((s*h*n)/x).is_integer():
    print(int((s*h*n)/x),h,n)
    exit()

Solution (Python):
s=int(input());
for n in range(1,3501):
    for h in range(1,3501):
        x=4*h*n-s*n-s*h
        if x>0:
            if ((s*h*n)/x).is_integer():
                print(int((s*h*n)/x),h,n)
                exit()

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

for i in range(1,3501):
    for j in range(i,3501):
        if 4*j*i-n*i-n*j != 0 and (n*i*j)%(4*j*i-n*i-n*j) == 0:
            R = (n*i*j)//(4*j*i-n*i-n*j)
            if R > 0:
                print(i,j,R)
                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:
            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:
                    res1 = h
                    res2 = n
                    res3 = w
                
print(res1, res2, res3)

Solution (Python):
n=int(input())
import sys
for a in range(1,3501):
    for b in range(1,3501):
        if 4*a*b -n*a -n*b<=0:
            continue
        c=n*a*b/(4*a*b -n*a -n*b)
        if not 0<c<=3500:
            continue
        if c==int(c):
            print(a,b,int(c))
            sys.exit()

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

Solution (Python):
import sys
N = int(input())
for h in range(1,3501):
    for n in range(1,3501):
        if 4*h*n -N*h -N*n <= 0: continue
        w = N*h*n/(4*h*n -N*h -N*n)
        if not 0<w<=3500: continue 
        if w.is_integer()==True:
            print(h,n,int(w))
            sys.exit()

Solution (Python):

N = int(input())

for n in range(1,3500+1):
    for h in range(1,3500+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)
            exit()

Solution (Python):
s=int(input())
for i in range(s//4,3501):
    for j in range(1,3501):
        t=4*i*j-i*s-j*s
        y=s*i*j
        if t>0 and s*i*j%t==0:
            print(s*i*j//t,i,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:
            continue
        if (N * i * j) % (4 * i * j - N * j - N * i) == 0:
            print(i, j, (N * i * j) // (4 * i * j - N * j - N * i))
            exit()

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

explore = 1
for h in range(1,3500) :
    if not explore : break
    for n in range(1,3500) :
        if (4*h*n - N*n - N*h) == 0 :
            continue
        elif (N*h*n % (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))
            ans = [h,n,w]
            explore = 0
            break

print(*ans)

Solution (Python):
n = int(input())
imin = n // 4
flag = False
for i in range(imin, 3501):
    num = i * n
    den = 4 * i - n
    if den <= 0:
        continue
    jmin = num // den
    for j in range(jmin, 3501):
        num = i * j * n
        den = 4 * i * j - i * n - j * n
        if den > 0 and num % den == 0:
            k = num // den
            print("{} {} {}".format(i, j, k))
            flag = True
            break
    if flag:
        break

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

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

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

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

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

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

for h in range(1,3501):
    if 4*h != N:
        n_min = max(N*h //(4*h - N), 1)
    else:
        n_min = 1

    for n in range(n_min,3501):
        nume = N*h*n
        enum = 4*h*n - N*n - N*h

        if enum > 0 and nume%enum == 0:
            w = nume//enum
            print(h,n,w)
            exit()

Solution (Python):
N = int(input())
Ans = []
for h in range(1, 3501):
    for n in range(h, 3501):
        if 4 * h * n > N * (h + n) and N*h*n % (4*h*n - N*(h+n)) == 0:
            w = N*h*n // (4*h*n - N*(h+n))
            Ans = [h, n, w]
            break
    if Ans:
        break
print(" ".join(map(str, Ans)))

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

for n in range(1,3501):
    for h in range(1,3501):
        if 4*h*n-N*(n+h) > 0:
            if (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())
def check():
    for h in range(1,3500):
        for n in range(1,3500):
            div = 4 * n * h - N * h - N * n
            if div > 0 and N * h * n % div == 0:
                print(h, n, N * h * n // div)
                return 0
check()

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):
        waru = 4 * h * n - N * n - N * h
        if waru != 0:
            w = (N * h * n) / waru
            if w > 0 and int(w) / w == 1:
                print("{} {} {}".format(h, n, int(w)))
                exit()

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

for i in range(1, 3501):
    for j in range(i, 3501):
        if (4 * i * j - N * i - N * j) <= 0:
            continue
        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(3501):
    for w in range(3501):
        if 4*h*w-N*h-N*w <= 0:
            continue
        n = N*h*w/(4*h*w-N*h-N*w)
        if int(n) == n:
            print(h,int(n),w)
            exit()

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

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

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())



N = ni()
MAX = 3500
EPS = 10**(-6)
ha,wa,na = 0,0,0

for h in range(MAX+1):
    for w in range(MAX+1):
        if 4*h*w - N*w - N*h > 0:            
            if abs((N*h*w) / (4*h*w - N*w - N*h)) - ((N*h*w) // (4*h*w - N*w - N*h)) == 0:
                ha = h
                wa = w
                na = (N*h*w) // (4*h*w - N*w - N*h)
                
print(ha,na,wa)

Solution (Python):
N = int(input())
h_limit = N * 3 // 4
ok = False

for h in range(1, 3501):
	for n in range(1, 3501):
			if 1 / h + 1 / n < 4 / N:
				w = 1 / (4 / N - 1 / h - 1 / n)
				if 0 < w < 10 ** 16 and abs(w - int(w)) < 10 ** (-7):
					print(h, n, int(w))
					ok = True
					break

	if ok:
		break

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.is_integer():
        print(h,n,int(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>0:
        print(h,n,int(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>0:
        print(h,n,int(w))
        exit()

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

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

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

    h, n, w = -1, -1, -1
    for i in range(1, 3501):
        for j in range(i, 3501):
            if 4*i*j > N*i+N*j:
                if N*i*j % (4*i*j-N*i-N*j) == 0:
                    h, n = i, j
                    w = N*i*j // (4*i*j-N*i-N*j)
                    break

        else:
            continue
        break

    print(h, n, w)


if __name__ == '__main__':
    main()

Solution (Python):

N = int(input())

isok=False
for h in range(1,3501):
    bunsi = 4*h - N
    bunbo = N*h
    if bunsi>0:
        n = (bunbo//bunsi) + 1
        bunsi = 4*h*n - N*(h+n)
        bunbo = N*h*n
        if bunsi>0 and bunbo%bunsi==0:
            w = bunbo//bunsi
            isok = True
            break
        
if isok:
    print(h,n,w)
else:
    print("ここ来たらマジでヤバいが")

Solution (Python):
N=int(input())
for h in range(2,3501,2):
  for n in range(2,3501,2):
    if (4*h*n-N*n-N*h) != 0 and (N*h*n)%(4*h*n-N*n-N*h) == 0:
      if 0 < (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):
N=int(input())
for h in range(1,3501):
	for n in range(1,3501):
		A=N*h*n
		B=4*h*n-N*n-N*h
		if B<=0:
			continue
		if A%B==0:
			print(h,n,A//B)
			exit()

Solution (Python):
import sys
import math
import itertools

N=int(input())
if(N%4==0):
    x=3*N//4
    print(x,x,x)
    exit()
for x in range(3501):
    if(4*x-2*N>0 and (N*x)%(4*x-2*N)==0):
        h=(N*x)//(4*x-2*N)
        print(h,x,x)
        exit()
if(N>2000):st=-1
else:st=1
for h,n in itertools.product(range(1,3501)[::st],range(1,3501)[::st]):
    x=N*h*n
    y=4*n*h-N*n-N*h
    if(y>0 and x%y==0):
        print(h,n,x//y)
        break
"""
4/N=1/h+1/n+1/w
4/N=(nw+hw+hn)/nhw
4nhw/N=nw+hw+hn
4nhw=Nnw+Nhw+Nhn
(4nh-Nn-Nh)w=Nhn
w=Nhn/(4nh-Nn-Nh)

4/N=3/x
4x/N=3
4x=3N
h,n,w=3N/4  (N%4==0)

4/N=1/h+2/x
4/N-2/x=1/h
(4x-2N)/Nx=1/h
h=Nx/(4x-2N)
"""

Solution (Python):
import sys
import math
import itertools

N=int(input())
if(N%4==0):
    x=3*N//4
    print(x,x,x)
    exit()
for x in range(3501):
    if(4*x-2*N>0 and (N*x)%(4*x-2*N)==0):
        h=(N*x)//(4*x-2*N)
        print(h,x,x)
        exit()
if(N>2000):st=-1
else:st=1
for h,n in itertools.product(range(1,3501)[::st],range(1,3501)[::st]):
    x=N*h*n
    y=4*n*h-N*n-N*h
    if(y>0 and x%y==0):
        print(h,n,x//y)
        break
"""
4/N=1/h+1/n+1/w
4/N=(nw+hw+hn)/nhw
4nhw/N=nw+hw+hn
4nhw=Nnw+Nhw+Nhn
(4nh-Nn-Nh)w=Nhn
w=Nhn/(4nh-Nn-Nh)

4/N=3/x
4x/N=3
4x=3N
h,n,w=3N/4  (N%4==0)

4/N=1/h+2/x
4/N-2/x=1/h
(4x-2N)/Nx=1/h
h=Nx/(4x-2N)
"""

Solution (Python):
import sys
import math
import itertools

N=int(input())
if(N%4==0):
    x=3*N//4
    print(x,x,x)
    exit()
for x in range(3501):
    if(4*x-2*N>0 and (N*x)%(4*x-2*N)==0):
        h=(N*x)//(4*x-2*N)
        print(h,x,x)
        exit()
for h,n in itertools.product(range(1,3501)[::-1],range(1,3501)[::-1]):
    x=N*h*n
    y=4*n*h-N*n-N*h
    if(y>0 and x%y==0):
        print(h,n,x//y)
        break
"""
4/N=1/h+1/n+1/w
4/N=(nw+hw+hn)/nhw
4nhw/N=nw+hw+hn
4nhw=Nnw+Nhw+Nhn
(4nh-Nn-Nh)w=Nhn
w=Nhn/(4nh-Nn-Nh)

4/N=3/x
4x/N=3
4x=3N
h,n,w=3N/4  (N%4==0)

4/N=1/h+2/x
4/N-2/x=1/h
(4x-2N)/Nx=1/h
h=Nx/(4x-2N)
"""

Solution (Python):
N = int(input())
if N % 2 == 0:
    print(N // 2, N, N)
    quit()
for h in range(1, 3500+1):
    hN = h * N
    for n in range(h, 3500+1):
        b = (4 * h * n - n * N - hN)
        if b <= 0:
            continue
        a = (n * hN)
        if a % b == 0:
            print(h, n, a // b)
            quit()

Solution (Python):
N = int(input())
for h in range(1, 3500 + 1):
    for n in range(h, 3500 + 1):
        if (4 * h * n - N * n - N * h) <= 0:
            continue
        if N * h * n % (4 * h * n - N * n - N * h) == 0:
            w = N * h * n // (4 * h * n - N * n - N * h)
            print("{} {} {}".format(h, n, w))
            exit()

Solution (Python):
N = int(input())
for h in range(1, 3500 + 1):
        for n in range(h, 3500 + 1):
                if (4 * h * n - N * n - N * h) <= 0:
                        continue
                if N * h * n % (4 * h * n - N * n - N * h) == 0:
                        w = N * h * n // (4 * h * n - N * n - N * h)
                        print("{} {} {}".format(h, n, w))
                        exit()

Solution (Python):
N = int(input())
for h in range(1, 3500 + 1):
        for n in range(h, 3500 + 1):
                if (4 * h * n - N * n - N * h) <= 0:
                        continue
                if N * h * n % (4 * h * n - N * n - N * h) == 0:
                        w = N * h * n // (4 * h * n - N * n - N * h)
                        print("{} {} {}".format(h, n, w))
                        exit()

Solution (Python):
N = int(input())
for h in range(1, 3500 + 1):
    for n in range(h, 3500 + 1):
        if (4 * h * n - N * n - N * h) <= 0:
            continue
        if N * h * n % (4 * h * n - N * n - N * h) == 0:
            w = N * h * n // (4 * h * n - N * n - N * h)
            print("{} {} {}".format(h, n, w))
            exit()