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 in C++ (GCC 9.2.1) (judge verdict: Accepted)

#include <bits/stdc++.h>

using namespace std;


typedef long long ll;
ll mod=1e9+0LL;
ll MOD=1e18+0LL;
ll md=1000000007;

const double PI=acos(-1);

typedef vector<int> vi;
typedef pair<int,int> pii;

#define     sz(v)       ((int)((v).size()))
#define     all(v)      ((v).begin()),((v).end())
#define     pb           push_back
#define     ff           first
#define     ss           second
#define     line         printf("\n")
#define     gap          ' '
#define     ctn          continue;
ll poW(ll a ,ll n)
{
    if(n==0) return 1;
    if(n%2==0)
    {
        ll b=poW(a,n/2);
        return (b*b)%md;
    }
    return (poW(a,n-1)*a)%md;
}
bool cmp(const pii &a,const pii &b)     { return (a.ff*b.ss) < (a.ss*b.ff);}
bool isOdd(int n)       { return (n%2)!=0; }
template <class T>
void printVector(vector <T> &v,string s="")
{
    cout<<s;
    for(int i=0;i<sz(v);i++)
    {
        cout<<v[i]<<gap;
    }
    line;
}

int toInt(string str) {
	int num;
	istringstream iss(str);
	iss>>num; return num;
}

template <class T> string toStr(T par) {
	ostringstream oss;
	oss<<par;
	return oss.str();
}

void sieve(vector<int>&v)
{
    int i,j;
    v.pb(1);
    bool visit[1002];
    memset(visit,0,sizeof(visit));
    for(i=2;i<=1001;i++)
    {
        if(!visit[i])
        {
            for(j=i*i;j<=1001;j+=i)
            {
                visit[j]=1;
            }
            v.pb(i);
            //cout<<i<<gap<<v.back();line;
        }
    }
}
bool isPrime(int x) {
	if (x < 2) return false;
	for (int y = 2; y * y <= x; y++)
		if (x % y == 0)
			return false;
	return true;
}


int main()
{
    int cs=1;
    //scanf("%d",&cs);
    while(cs--)
    {
        int a;
        cin>>a;
        cout<<a*(1+a+(a*a));
    }
}