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):
from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
from bisect import bisect,bisect_right,bisect_left

def get_int():
    return int(stdin.readline().strip())


def get_tuple():
    return map(int, stdin.readline().split())


def get_list():
    return list(map(int, stdin.readline().split()))

a = get_int()
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**2+a**3)

Solution (Python):
import sys
from collections import defaultdict, deque, Counter
import math


from bisect import bisect_left, bisect_right





input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)

def solve():
    n = getN()
    
    print(n + n * n + n * n* n)
def main():
    n = getN()
    for _ in range(n):
        solve()


if __name__ == "__main__":
    
    solve()

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):
import sys
input = sys.stdin.readline


def main():
    N = int(input().strip())
    
    return N + N**2 + N**3

if __name__ == "__main__":
    print(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):
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())
print(a+a**2+a**3)

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

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






print(a+pow(a,2) + pow(a,3))

Solution (Python):




import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return np.array(x)

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*N+N*N*N)

Solution (Python):


a, = map(int, input().split())

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

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

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

a=getN()

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):
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+pow(a, 2)+pow(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):
a = int(input())
ans = a + pow(a, 2) + pow(a, 3)
print(ans)

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

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

    print(N + N ** 2 + N ** 3)


resolve()

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

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):
import math
from collections import Counter
from decimal import Decimal

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

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

Solution (Python):
a = int(input())
print(a+pow(a,2)+pow(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())
answer = a + a * a + a * a * a
print(answer)

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 + 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
sys.setrecursionlimit(10 ** 7)

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

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

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

Solution (Python):



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

    print(N+N*N+N*N*N)

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())
print(a + a**2 + a**3)

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

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

ans = n + n**2 + n**3

print(ans)

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





"""
    A = []
    for _ in range(N):
        A.append(list(map(int,input().split())))
"""

print(N+N**2+N**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):
import sys

import math
import collections

import bisect
import itertools
import fractions

import copy

import decimal

import queue



sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7


ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))




def main():
    i = ni()
    print(i + i ** 2 + i ** 3)


if __name__ == '__main__':
    main()

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

ans = n + n**2 + n**3

print(ans)

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):
from sys import stdin

A=int(stdin.readline())

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*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):



import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

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

main()

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


if __name__ == '__main__':
    main()

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

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

print(a**2+a**3+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*a+a*a*a)

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):
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):
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

    print(N + N**2 + N**3)




if __name__ == "__main__":
    main()

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**3 + a**2 + 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+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())


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

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())
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):
n = int(input())
print(n + n**2 + n**3)

Solution (Python):
import sys

import math
import itertools

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):
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


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):
a=int(input())
print(a+a**2+a**3)

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

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

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):


from pprint import pprint
import sys

sys.setrecursionlimit(10 ** 6)


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

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):
import math
import fractions
import collections
import itertools
a=int(input())
print(a+pow(a,2)+pow(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):
N= int(input())
print(N+N*N+N*N*N)

Solution (Python):
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot,
                  log2, pi, radians, sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits


def inp():
    return(int(input()))


def inlist():
    return(list(map(int, input().split())))


def instr():
    s = input()
    return(list(s[:len(s)]))


def invr():
    return(map(int, input().split()))


a = inp()

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())
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):
import sys
import math
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
n = II()
print(n+n**2+n**3)

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

print(int(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())

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())
print(a+a**2+a**3)

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

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

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

Solution (Python):
import itertools
import decimal
import math
from collections import Counter
import sys
input = sys.stdin.readline

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

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

Solution (Python):
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
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):
def solve():
    a = int(input())

    
    return a + a**2 + a**3


print(solve())

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

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

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

Solution (Python):
from sys import stdin
n = int(stdin.readline().rstrip())
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):
from sys import stdin
import sys
import math



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

Solution (Python):
input = raw_input

a = int(input())
a2 = a ** 2
a3 = a ** 3
out = a + a2+ a3
print(out)

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

if __name__ == '__main__':
    main()

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

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

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

print(res)

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):
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
import numpy as np
import math  
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate 
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache 

def main():
    n = int(sys.stdin.readline())
    print(n+n**2+n**3)
    return 0

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):
n=int(input())
print(int(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())
print(A+A**2+A**3)

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

Solution (Python):
import sys
from io import StringIO
import unittest


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

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

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2"""
        output = """14"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """10"""
        output = """1110"""
        self.assertIO(input, output)


if __name__ == "__main__":
    
    resolve()

Solution (Python):

import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


a = z()
print(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**2+a**3+a)

Solution (Python):



import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline




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

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

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

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*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*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())
print(a + a ** 2 + a ** 3)

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

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

Solution (Python):
import bisect
import sys
import math
from collections import deque
from heapq import heappush, heappop

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))


INF = 1 << 29


DIV = 998244353

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac = fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV

    return CONV()


def cumsum(As):
    s = 0
    for a in As:
        s += a
        yield s


sys.setrecursionlimit(200005)


def dijkstra(G,start=0):
    heap = []
    cost = [INF]*len(G)
    heappush(heap,(0,start))
    while len(heap)!=0:
        c,n = heappop(heap)
        if cost[n] !=INF:
            continue
        cost[n]=c
        for e in G[n]:
            ec,v = e
            if cost[v]!=INF:
                continue
            heappush(heap,(ec+c,v))
    return cost


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




main()

Solution (Python):
N = int(input())
print(int(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 math

import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit


ipt = stdin.readline
setrecursionlimit(10**7)

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

    return

if __name__ == '__main__':
    main()

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

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

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())
print(a+a**2+a**3)

Solution (Python):
i=int(input())
print(i+i**2+i**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):
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

a = INT()

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):
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())
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**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*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())
print(a + a ** 2 + a ** 3)

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**2 + a**3)

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

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

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

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):
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

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):
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):
import sys
def input(): return sys.stdin.readline().strip()


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


if __name__ == "__main__":
    main()

Solution (Python):

import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys


buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A):
    return A + A**2 + A**3


def main():
    A = read_int()
    print(slv(A))


if __name__ == '__main__':
    main()

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**3+a**2+a**1)

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())
ans=a+a*a+a*a*a
print(ans)

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


if __name__ == "__main__":
    main()

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

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

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

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):
def main():
    s = int(input())
    print(s+(s**2)+(s**3))

if __name__ == '__main__':
    main()

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

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*a + a*a*a)

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*a+a**3)

Solution (Python):

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

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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N = readint()
    print(N + N ** 2 + N ** 3)


if __name__ == "__main__":
    main()

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    a = I()

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

if __name__ == '__main__':
    resolve()

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())
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, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left 
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

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

Solution (Python):


import sys
input=sys.stdin.readline

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**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 resolve():
    a = int(input())
    print(a+a**2+a**3)
resolve()

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

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*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 + n**2 + n**3)