Problem:
 Score : 100 points    Problem Statement Given an integer a as input, print the value a + a^2 + a^3 .      Constraints  1 \leq a \leq 10  a is an integer.         Input Input is given from Standard Input in the following format:  a       Output Print the value a + a^2 + a^3 as an integer.        Sample Input 1 2      Sample Output 1 14  When a = 2 , we have a + a^2 + a^3 = 2 + 2^2 + 2^3 = 2 + 4 + 8 = 14 .  Print the answer as an input. Outputs such as 14.0 will be judged as incorrect.       Sample Input 2 10      Sample Output 2 1110

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache





MOD = 10**9+7
INF = float('inf')
AZ = "abcdefghijklmnopqrstuvwxyz"






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n): return kaijo_memo[n]
  if(len(kaijo_memo) == 0): kaijo_memo.append(1)
  while(len(kaijo_memo) <= n): kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n): return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0): gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n): gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if n == r: return 1
  if n < r or r < 0: return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1: arr.append([temp, 1])
  if arr==[]: arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b: a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n-1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n: return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

def base_10_to_n_without_0(X, n):
  X -= 1
  if X//n: return base_10_to_n_without_0(X//n, n)+[X%n]
  return [X%n]


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count




a = I()
print(a+a*a+a*a*a)

Solution (Python):
print((lambda x:x+x*x+x*x*x)(int(input())))

Solution (Python):
import sys

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


def resolve():
    a = int(input())
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    resolve()

Solution (Python):
a = int(input())
print(a + a*a + a**3)

Solution (Python):


import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
import sys

def I(): return int(sys.stdin.readline().rstrip())

a = I()

print(a+a**2+a**3)

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


ans = 0
for i in range(1, 4):
  ans += N**i
print(ans)

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

print(a + a*a + a*a*a)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def exit(*argv, **kwarg):
    print(*argv, **kwarg)
    sys.exit()


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))



def a_int(): return int(read())


def ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter, xor, add
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  
from functools import reduce
from math import gcd


def lcm(a, b):
    
    g = gcd(a, b)
    return a // g * b


a = a_int()
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
n = int(input())
print(n+n**2+n**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
sum = a*(1+a*(1+a))
print(sum)

Solution (Python):
a=int(input())
b=a**2
c=a**3
print(a+b+c)

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

a = x + x*x + x*x*x
print(a)

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

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a*a + a*a*a)

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

n = a + a*a + a*a*a

print(n)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = input()
a = int(a)
  
print( a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a = ii()

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(int(a + a ** 2 + a ** 3))

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a=input()
a=int(a)
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

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

ans = suu+ suu**2+suu**3
print(ans)

Solution (Python):
a = input()
a = int(a)
print(a + a**2 + a**3)

Solution (Python):
def main():
    a = int(input())
    answer = solve(a)
    print(answer)


def solve(a):
    return a + a**2 + a**3


if __name__ == "__main__":
    main()

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
X = a + (a ** 2) + (a ** 3)
print(X)

Solution (Python):
a = (int)(input())
ret = a * a
ret += ret * a
ret += a
print("{}".format(ret))

Solution (Python):
a= int(input())
print(a+a**2+a**3)

Solution (Python):

import sys


def solve(a: int):
    print(a + a**2 + a**3)
    return



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

if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gcd, sqrt
from operator import mul
from functools import reduce
from operator import mul
from pprint import pprint



sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


a = I()
print(a + a ** 2 + a ** 3)

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

print(a+a**2+a**3)

Solution (Python):
A=int(input())
ans=A+A**2+A**3
print(ans)

Solution (Python):
a = int(input())
n1 = int(pow(a,1))
n2 = int(pow(a,2))
n3 = int(pow(a,3))
print (n1+n2+n3)

Solution (Python):
a = int(input())
b = (a) + (a * a) + (a * a * a)
print(b)

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

print(a + a ** 2 + a ** 3)

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

ans=a+a**2+a**3

print(ans)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
N, = map(int, input().split())
print(N+N**2+N**3)

Solution (Python):
def calculate(n):
  n3 = n**3
  n2 = n**2
  return n+n2+n3

n = int(raw_input())
print(calculate(n))

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):


a = int(input("\n"))

if 1 <= a <= 10:
    print(int(a + (a**2) + (a**3)))

Solution (Python):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

INF = float("inf")


a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
b = a + pow(a,2) + pow(a,3)
print(b)

Solution (Python):

def main():
    a = int(input())
    print(a+(a**2)+(a**3))
    
if __name__ == '__main__':
    main()

Solution (Python):
a = int(input())
print(a+a**2+a**3)

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

print(a + a*a + a*a*a)

Solution (Python):
def calc(a):
    k = a**2
    j = a**3
    l = a+k+j
    return l

a = int(input())
m = calc(a)
print(m)

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

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = (lambda: (sys.stdin.readline()).rstrip())
    input_list = (lambda: input().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    a = input_number()
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    main()

Solution (Python):
a=int(input())
print(a + a*a + a*a*a)

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

print(int(n+n**2+n**3))

Solution (Python):


a = int(input())

1<=a<=10
print(a*a*a+a*a+a)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
import sys
def input():return sys.stdin.readline()[:-1]
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
a=N()
print(a+a*a+a**3)

Solution (Python):
a = int(input())
print(a+(a**2)+(a**3))

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
if __name__ == "__main__":
    a = int(input())

    print(a+a**2+a**3)

Solution (Python):
a = int(input())
A = a + (a**2) + (a**3)
print(A)

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

print(a + a**2 + a**3)

Solution (Python):

a=int(input())

print(a+a**2+a**3)

Solution (Python):
num = int(input())
print(int(num + num**2 + num**3))

Solution (Python):
a = int(input())
dos = a * a
tres = a * a * a	
print(a + dos + tres)

Solution (Python):
a = int(input())
print (a + (a ** 2) + (a ** 3))

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
l = [a**i for i in range(4)]
print(sum(l)-1)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a*a + a*a*a)

Solution (Python):
def main():
    n = int(input())
    print(n+n*n+n*n*n)
 
 
if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10000)
    main()

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
n = int(input())
print(n + n**2 + n**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
n=int(input())
print(n+n**2+n**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


a=int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
n = 2
m = 3
print(a + a ** n + a ** m)

Solution (Python):
a=int(input())
b=a+a**2+a**3
print(b)

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

print(a+a**2+a**3)

Solution (Python):
a = int(input())
 
print(str(a + (a ** 2) + (a ** 3)))

Solution (Python):
a = int(input())
print(a + (a ** 2) + (a ** 3))

Solution (Python):
a = int(input())
print(a**1 + a**2 + a**3)

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

print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

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

print(a + a**2 + a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
def calc(a):
    return a+a**2+a**3
n = int(input())
print(calc(n))

Solution (Python):
a = int(input())
print(a+(a**2)+(a**3))

Solution (Python):
a = int(input())
print(int(a + a**2 + a**3))

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
sum_a = a + a ** 2 + a ** 3
print(sum_a)

Solution (Python):
A = int(input())
C = A*A
D = C*A
print(A+C+D)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a*a+a*a*a)

Solution (Python):
a=int(input())
ans=a+a**2+a**3
print(ans)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

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

ans = a + a**2 + a**3

print(ans)

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

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

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

print(a + a ** 2 + a ** 3)

Solution (Python):
a=int(input())
ans=a+a*a+a**3
print(ans)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
def binpow(a, b):
    res=1
    while b>0:
        if b&1:
            res=res*a
        a=a*a
        b>>=1
    
    return res


def main():
    a=int(input())
    print(a+binpow(a, 2)+binpow(a, 3))


if __name__=='__main__':
    main()

Solution (Python):
a = input()
b = int(a)
print(b+b**2+b**3)

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

print( a*a*a + a*a +a )

Solution (Python):
a = int(input())
print(a+a**2+a**3)

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

print(a+a*a+a*a*a)

Solution (Python):
a=int(input())
ans=a+a*a+a**3
print(ans)

Solution (Python):
a=int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
ans = a + a**2 + a**3
print(ans)

Solution (Python):
a = int(input())
res = a + a *a + a * a * a
print(res)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
n = int(input())
print(n+n**2+n**3)

Solution (Python):
x = int(input(""))

print(x + x*x + x*x*x)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
a_2 = a**2
a_3 = a**3
print(a+a_2+a_3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):

def calc(a):
    c=0
    for i in range (1,4):
        c += a**i
    return c

print(calc(int(input())))

Solution (Python):
n = int(input())
print(n+n**2+n**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):

import sys
input = sys.stdin.readline

a = int(input())
print(int(a+a**2+a**3))

Solution (Python):
a = int(input())
ans = a+a*a+a*a*a

print(ans)

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

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
sum = 0
for i in range(3):
    sum += a ** (i+1)
print(int(sum))

Solution (Python):
a = int(input())
print (a + a **2 + a **3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

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

print(a + a**2 + a**3)

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

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
num = int(input())
total = num + num**2 + num **3
print(total)

Solution (Python):
a = eval(input())
print(int(a+(a**2)+(a**3)))

Solution (Python):
a = int(input())
ans = a + a**2 + a**3
print(ans)

Solution (Python):
a = int(input())
print(a**1 + a**2 +a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
n = int(input())
print(n + pow(n,2) + pow(n,3))

Solution (Python):
a=int(input())
print(a+a*a+a*a*a)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
n=int(input().strip())
result=n*(1+n+(n**2))
print(result)

Solution (Python):


a = int(input())

print(a + a ** 2 + a * a * a)

Solution (Python):

val_1 = int(input())
val_2 = val_1 * val_1
val_3 = val_1 * val_1 * val_1

answer = val_1 + val_2 + val_3
print(answer)

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

a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

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


print(a+a**2+a**3)

Solution (Python):
N = int(input())
print(N+N**2+N**3)

Solution (Python):
a = int(input())
print(a+(a**2)+(a**3))

Solution (Python):
m = int(input())
re = 0

for i in range(1,4):
    kai = m**i
    re += kai

print(re)

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

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):

a = int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print((a)+(a*a)+(a*a*a))

Solution (Python):

a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

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

A = a + a**2 + a**3

print(A)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

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

ans = a + a**2 + a**3

print(ans)

Solution (Python):
a = int(input())
re = a + a**2 + a**3
print(re)

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

print(str(a + (a ** 2) + (a ** 3)))

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

print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a=int(input())
ans=a+a**2+a**3
print(ans)

Solution (Python):
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007

inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')



def solve():
    
    

    
        
        
    a=ii()
    print(a+a*a+a*a*a)
        














        
if __name__ =="__main__":

    if path.exists('input.txt'):
        sys.stdin=open('input.txt', 'r')
        sys.stdout=open('output.txt','w')
    else:
        input=sys.stdin.readline
    solve()

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

print(a+a*a+a*a*a)

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

print(a + a**2 + a**3)

Solution (Python):
a=int(input())
print(a+(a*a)+(a*a*a))

Solution (Python):
from sys import stdin





def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return list(mi())
def si(): return stdin.readline().rstrip()
def lsi(): return list(si())

res=['NET', 'DA']



test_case=1
while test_case:
    test_case-=1


    n=ii()
    print(n+n**2+n**3)

Solution (Python):

def main():
    X =int(input())
    print(int(X + X**2 + X**3))


if __name__ == "__main__":
    main()

Solution (Python):
a=int(input())
print(int(a+a*a+a*a*a))

Solution (Python):
a = int(input())
print(int(a + a**2 + a**3))

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





def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))




def main():
	a=II()
	print(a+a**2+a**3)





if __name__ == "__main__":
	main()

Solution (Python):
n = int(input())
print(n + n**2 + n**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(int(a+a**2+a**3))

Solution (Python):
a = int(input())
n = a + a**2 + a**3
print(n)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

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

print(x+x*x+x*x*x)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

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

print(int+int**2+int**3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a + a*a + a*a*a)

Solution (Python):
a = int(input())
print(a + a*a + a*a*a)

Solution (Python):


import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    a = ii()
    print(a + a ** 2 + pow(a, 3))


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
print(N+N**2+N**3)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())

print(n+n**2+n**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(int(a+(a**2)+(a**3)))

Solution (Python):


a=int(input())
reslt= a + a**2+a**3
print(reslt)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a + a*a + a*a*a)

Solution (Python):

N = int(input())
print(N+N**2+N**3)

Solution (Python):
num = int(input())
print(num + (num ** 2) + (num ** 3))

Solution (Python):

N = int(input())
print(N+N**2+N**3)

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

print(a+a**2+a**3)

Solution (Python):
def expression_value(a):
    if 1<=a<=10:
        return a+(a**2)+(a**3)
    else:
        return "wrong input"
a=int(input())
print(expression_value(a))

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

print(val + val **2 + val **3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+(a**2)+(a**3))

Solution (Python):
x = int(input())
print(x + x ** 2 + x ** 3)

Solution (Python):
a = int(input())
print(a + a*a + a*a*a)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a**3 + a**2 + a)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
ans = a + a**2 + a**3
print(ans)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
A = int(input())
A2 = A * A
A3 = A * A * A
ans = A + A2 + A3
print(ans)

Solution (Python):

def main():
    x = int(input())
    ans = x + x**2 + x**3
    print(ans)

main()

Solution (Python):

a = int(input())
print(a + a**2 + a**3)

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

print(int(a+a**2+a**3))

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
import numpy as np


def main(a):
    return a + a*a+a*a*a


a = int(input())
print(main(a))

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

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

ans = a + a ** 2 + a ** 3

print(ans)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
b = a+a**2+a**3
print(b)

Solution (Python):
a=int(input())
print(a+a*a+a*a*a)

Solution (Python):
n=int(input())
print(n+n**2+n**3)

Solution (Python):
a=int(input())
y=a**2
x=a**3
z=a+x+y
print(z)

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

print( a + a ** 2 + a ** 3)

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

print(a + a**2 + a**3)

Solution (Python):
a=int(input())
print(a+a*a+a**3)

Solution (Python):


a = int(input())
print(a+a**2+a**3)

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

    a = int(readline())
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    main()

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = input()
first_a = int(a)
second_a = int(a)**2
third_a = int(a)**3
sum_a = first_a + second_a + third_a
print(sum_a)

Solution (Python):


a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
s = input().split()
intA = int(s[0])

intR = intA
intR2 = intA*intA
intR3 = intA*intA*intA



print(intR + intR2 + intR3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
n = int(input())
print(n + n * n + n * n * n)

Solution (Python):
a = int(input())
print((a)+(a**2)+(a**3))

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

print(a + a**2 + a**3)

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

print(a+a**2+a**3)

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

def main():
    a_2 = a*a
    a_3 = a*a*a
    print(int(a+a_2+a_3))
main()

Solution (Python):

val_1 = int(input())
val_2 = val_1 * val_1
val_3 = val_1 * val_1 * val_1

answer = val_1 + val_2 + val_3
print(answer)

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

b = a + a**2 + a**3

print(b)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
i = int(input())
print(i + i**2 + i**3)

Solution (Python):
a=int(input())
s=a+a**2+a**3
res=int(s)
print(res)

Solution (Python):
def main():
    a = int(input())
    print(int(a+a*a+a*a*a))

main()

Solution (Python):
def main ():
	a = int (input())
	print(a + a**2 + a**3)


main ()

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
if __name__ == "__main__":
    a = int(input())
    r = a + a**2 + a**3
    print(r)

Solution (Python):
a = int(input())
print(a + a*a + a*a*a)

Solution (Python):
a=int(input())
ans=a+a**2+a*a**2
print(ans)

Solution (Python):
a=int(input())
print(a+a*a+a**3)

Solution (Python):
a = int(input())
ans = (a + a**2 + a**3)
print(ans)

Solution (Python):
a = input()
a = int(a)
print(a+a*a+a*a*a)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
number = int(input())
sum = pow(number, 1) + pow(number, 2) + pow(number, 3)
print(sum)

Solution (Python):
a = int(input())
ans = a + a**2 + a**3
print(ans)

Solution (Python):


inpnum = int(input())

sum = lambda n,t : n ** t

print(inpnum + sum(inpnum, 2) + sum(inpnum, 3))

Solution (Python):
N = int(input())
ans = N+(N*N)+(N*N*N)
print(ans)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+(a**2)+(a**3))

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    a = int(input())
    ans = a + a**2 + a**3
    print(ans)
if __name__ == "__main__":
    main()

Solution (Python):
a=int(input())
if(a>=1 and a<=10):
    val=a+(a*a)+(a*a*a)
    print(val)

Solution (Python):
a = int(input())
print('{0}'.format(a+a*a+a*a*a))

Solution (Python):
import math
a=input()
a=int(a)
print(a+pow(a,2)+pow(a,3))

Solution (Python):
a= int(input())
result = 0
for i in range(3):
    result+= pow(a, i+1)
print(result)

Solution (Python):
a = int(input())
print(a*a*a+a*a+a)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a=int(input())
print(a+a*a+a*a*a)

Solution (Python):
a=int(input())
print(a+(a**2)+(a**3))

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

print(a+a**2 +a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
n = int(input())
print(n**3 + n**2 + n)

Solution (Python):
a = int(input())
print(a + (a * a) + (a * a * a))

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

b = a + a**2 + a**3
print(b)

Solution (Python):
a=int(input())
 
b=a+(a**2)+(a**3)
print(b)