stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

using namespace std;



//B - Calc

int h;

int main() {

    cin >> h;

    cout << h + h*h + h*h*h << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

	int total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	return 0;	

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



//heyyyy



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

	int total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	return 0;	

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    // aulia 

    cin >> x;

    cout << x + x*x + x*x*x << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

	int total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	return 0;	

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a;



int main () {

	cin >> a;

	cout << a + a*a + a*a*a;

}

// Faster C++ solution for the same problem (measured speedup: 5.264901806462063x):
#include<stdio.h>



int main(){

	int total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	return 0;	

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a, result;



int main () {

    cin >> a;

    result = a + a*a + a*a*a;

    cout << result << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include<stdio.h>



int main(){

	int total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	return 0;	

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;

int main() {

    cin >> a;

    cout <<a+a*a+a*a*a<< endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

	int total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	return 0;	

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ll long long int

#define pb push_back

#define ii pair<int,int>

#define setin set.insert

using namespace std;



void solve()

{

    int a;

    cin >> a;

    ll c=a+(a*a)+(a*a*a);

    cout << c << endl;

}



int main()

{



    solve();



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.265113723163919x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
//i hate _____

#include<bits/stdc++.h>



#define ll long long int 

#define ld long double 

#define pb push_back

#define mk make_pair

#define ii pair<int,int>



using namespace std;

double pi=2*acos(0.0);



/*freopen("input.txt","r",stdin);

freopen("output.txt","w",stdout);*/



template<typename T> 

ostream& operator<<(ostream &os, const vector<T> &v) { 

    os << '{'; 

    for (const auto &x : v) os << " " << x;

        return os << '}'; 

}



void solve(){

    int n; cin>>n;

    int ans=n+(n*n)+(n*n*n);

    cout << ans << endl;

}



int main()

{

    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);



    int test_cases=1; 

    //cin>>test_cases;



    for (int tc=1;tc<=test_cases;tc++){

        

        solve();

        //cout << "Case " << tc << ": " << solve() <<endl;

        //printf("Case %d: %.10lf",tc,ans);

    }

    return 0;

}

/*

    problems are the sign of life

*/


// Faster C++ solution for the same problem (measured speedup: 5.340522570804374x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include<iostream>



using namespace std;



int main()

{

    int a;

    cin>>a;

    cout<<a+(a*a)+(a*a*a)<<endl;

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 5.271186138467951x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main()

{

    int a;

    cin>>a;

    cout<<a + a*a +a*a*a;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.261636796942854x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

using namespace std;



int a, b, c;



int main () {

    cin >> a ;

    b = a*a ;

    c = a*a*a ;

    cout << a+b+c << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.271017143598592x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// itung lg

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



//B - Calc

int h;

int main() {

    cin >> h;

    cout << h + h*h + h*h*h << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



//heyyyy



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    // aulia 

    cin >> x;

    cout << x + x*x + x*x*x << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a;



int main () {

	cin >> a;

	cout << a + a*a + a*a*a;

}

// Faster C++ solution for the same problem (measured speedup: 5.264901806462063x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a, result;



int main () {

    cin >> a;

    result = a + a*a + a*a*a;

    cout << result << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;

int main() {

    cin >> a;

    cout <<a+a*a+a*a*a<< endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

    int a ;

 

    scanf("%d",&a);

   printf("%d",a + a*a + a*a*a);

    return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

    int a;

    cin >> a;

    cout << a * (1 + a * (1 + a)) << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.264607796569169x):
#include<cstdio>

main(){int a;scanf("%d",&a);printf("%d\n",a*(1+a*(1+a)));}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ss long long int

using namespace std;



int main()

{

	ss a;

	cin >> a;

	a = a + (a*a) + (a*a*a);

	cout << a << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.267682287640581x):
#include <stdio.h>



int main (){

	int t;

	scanf("%d", &t);

	int ans = t + (t*t)+ (t*t*t);

	printf("%d", ans);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,b;

    cin>>a;

    b=a+a*a+a*a*a;

    cout<<b;

}

// Faster C++ solution for the same problem (measured speedup: 5.261636796942854x):
#include <stdio.h>



int main (){

	int t;

	scanf("%d", &t);

	int ans = t + (t*t)+ (t*t*t);

	printf("%d", ans);

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<string.h>

int main()

{

    long long int s= 0;

    int n =0;

    std::cin>>n;

    s = n+ n*n + n*n*n;

    std::cout<<s<<std::endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.268440530383237x):
#include <stdio.h>



int main (){

	int t;

	scanf("%d", &t);

	int ans = t + (t*t)+ (t*t*t);

	printf("%d", ans);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main (){

	int t;

	scanf("%d", &t);

	int ans = t + (t*t)+ (t*t*t);

	printf("%d", ans);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a=2;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905578341617x):
#include <stdio.h>



int main (){

	int t;

	scanf("%d", &t);

	int ans = t + (t*t)+ (t*t*t);

	printf("%d", ans);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int a,b;

int main() {

	cin>>a;

	b=a+a*a+a*a*a;

	cout<<b<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include <stdio.h>



int main (){

	int t;

	scanf("%d", &t);

	int ans = t + (t*t)+ (t*t*t);

	printf("%d", ans);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

//kopa

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main (){

	int t;

	scanf("%d", &t);

	int ans = t + (t*t)+ (t*t*t);

	printf("%d", ans);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a, result;



int main() {

    cin>>a;

    result = a + a*a + a*a*a;

    cout<<result<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include <stdio.h>



int main (){

	int t;

	scanf("%d", &t);

	int ans = t + (t*t)+ (t*t*t);

	printf("%d", ans);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

//zakha



int a,result;

int main () {

    cin >> a;

    result= a + a*a + a*a*a;

    cout << result << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include <stdio.h>



int main (){

	int t;

	scanf("%d", &t);

	int ans = t + (t*t)+ (t*t*t);

	printf("%d", ans);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ss long long int

using namespace std;



int main()

{

	ss a;

	cin >> a;

	a = a + (a*a) + (a*a*a);

	cout << a << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.267682287640581x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d", &num);

	int sum = 0;

	sum = num + num*num + num*num*num;

	printf("%d", sum);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,b;

    cin>>a;

    b=a+a*a+a*a*a;

    cout<<b;

}

// Faster C++ solution for the same problem (measured speedup: 5.261636796942854x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d", &num);

	int sum = 0;

	sum = num + num*num + num*num*num;

	printf("%d", sum);

}
// Slower C++ solution:
#include<iostream>

#include<string.h>

int main()

{

    long long int s= 0;

    int n =0;

    std::cin>>n;

    s = n+ n*n + n*n*n;

    std::cout<<s<<std::endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.268440530383237x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d", &num);

	int sum = 0;

	sum = num + num*num + num*num*num;

	printf("%d", sum);

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d", &num);

	int sum = 0;

	sum = num + num*num + num*num*num;

	printf("%d", sum);

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a=2;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905578341617x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d", &num);

	int sum = 0;

	sum = num + num*num + num*num*num;

	printf("%d", sum);

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int a,b;

int main() {

	cin>>a;

	b=a+a*a+a*a*a;

	cout<<b<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d", &num);

	int sum = 0;

	sum = num + num*num + num*num*num;

	printf("%d", sum);

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

//kopa

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d", &num);

	int sum = 0;

	sum = num + num*num + num*num*num;

	printf("%d", sum);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a, result;



int main() {

    cin>>a;

    result = a + a*a + a*a*a;

    cout<<result<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d", &num);

	int sum = 0;

	sum = num + num*num + num*num*num;

	printf("%d", sum);

}
// Slower C++ solution:
#include <iostream>

using namespace std;

//zakha



int a,result;

int main () {

    cin >> a;

    result= a + a*a + a*a*a;

    cout << result << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d", &num);

	int sum = 0;

	sum = num + num*num + num*num*num;

	printf("%d", sum);

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ss long long int

using namespace std;



int main()

{

	ss a;

	cin >> a;

	a = a + (a*a) + (a*a*a);

	cout << a << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.267682287640581x):
#include<stdio.h>



int main () {

	int  a;

	scanf ("%d",&a);

	printf("%d",a+a*a+a*a*a);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,b;

    cin>>a;

    b=a+a*a+a*a*a;

    cout<<b;

}

// Faster C++ solution for the same problem (measured speedup: 5.261636796942854x):
#include<stdio.h>



int main () {

	int  a;

	scanf ("%d",&a);

	printf("%d",a+a*a+a*a*a);

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<string.h>

int main()

{

    long long int s= 0;

    int n =0;

    std::cin>>n;

    s = n+ n*n + n*n*n;

    std::cout<<s<<std::endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.268440530383237x):
#include<stdio.h>



int main () {

	int  a;

	scanf ("%d",&a);

	printf("%d",a+a*a+a*a*a);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main () {

	int  a;

	scanf ("%d",&a);

	printf("%d",a+a*a+a*a*a);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a=2;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905578341617x):
#include<stdio.h>



int main () {

	int  a;

	scanf ("%d",&a);

	printf("%d",a+a*a+a*a*a);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int a,b;

int main() {

	cin>>a;

	b=a+a*a+a*a*a;

	cout<<b<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include<stdio.h>



int main () {

	int  a;

	scanf ("%d",&a);

	printf("%d",a+a*a+a*a*a);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

//kopa

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main () {

	int  a;

	scanf ("%d",&a);

	printf("%d",a+a*a+a*a*a);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a, result;



int main() {

    cin>>a;

    result = a + a*a + a*a*a;

    cout<<result<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include<stdio.h>



int main () {

	int  a;

	scanf ("%d",&a);

	printf("%d",a+a*a+a*a*a);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

//zakha



int a,result;

int main () {

    cin >> a;

    result= a + a*a + a*a*a;

    cout << result << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include<stdio.h>



int main () {

	int  a;

	scanf ("%d",&a);

	printf("%d",a+a*a+a*a*a);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ss long long int

using namespace std;



int main()

{

	ss a;

	cin >> a;

	a = a + (a*a) + (a*a*a);

	cout << a << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.267682287640581x):
#include<stdio.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum;

	sum =  ((a) + (a*a) + (a*a*a));

	printf("%d", sum);

	

return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,b;

    cin>>a;

    b=a+a*a+a*a*a;

    cout<<b;

}

// Faster C++ solution for the same problem (measured speedup: 5.261636796942854x):
#include<stdio.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum;

	sum =  ((a) + (a*a) + (a*a*a));

	printf("%d", sum);

	

return 0;

}
// Slower C++ solution:
#include<iostream>

#include<string.h>

int main()

{

    long long int s= 0;

    int n =0;

    std::cin>>n;

    s = n+ n*n + n*n*n;

    std::cout<<s<<std::endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.268440530383237x):
#include<stdio.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum;

	sum =  ((a) + (a*a) + (a*a*a));

	printf("%d", sum);

	

return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum;

	sum =  ((a) + (a*a) + (a*a*a));

	printf("%d", sum);

	

return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a=2;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905578341617x):
#include<stdio.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum;

	sum =  ((a) + (a*a) + (a*a*a));

	printf("%d", sum);

	

return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int a,b;

int main() {

	cin>>a;

	b=a+a*a+a*a*a;

	cout<<b<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include<stdio.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum;

	sum =  ((a) + (a*a) + (a*a*a));

	printf("%d", sum);

	

return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

//kopa

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum;

	sum =  ((a) + (a*a) + (a*a*a));

	printf("%d", sum);

	

return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a, result;



int main() {

    cin>>a;

    result = a + a*a + a*a*a;

    cout<<result<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include<stdio.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum;

	sum =  ((a) + (a*a) + (a*a*a));

	printf("%d", sum);

	

return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

//zakha



int a,result;

int main () {

    cin >> a;

    result= a + a*a + a*a*a;

    cout << result << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include<stdio.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum;

	sum =  ((a) + (a*a) + (a*a*a));

	printf("%d", sum);

	

return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ss long long int

using namespace std;



int main()

{

	ss a;

	cin >> a;

	a = a + (a*a) + (a*a*a);

	cout << a << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.267682287640581x):
#include<stdio.h>

int main(){

	int a;

	scanf ("%d", &a);

	int total = a+ a*a + a*a*a;

	printf("%d", total);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,b;

    cin>>a;

    b=a+a*a+a*a*a;

    cout<<b;

}

// Faster C++ solution for the same problem (measured speedup: 5.261636796942854x):
#include<stdio.h>

int main(){

	int a;

	scanf ("%d", &a);

	int total = a+ a*a + a*a*a;

	printf("%d", total);

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<string.h>

int main()

{

    long long int s= 0;

    int n =0;

    std::cin>>n;

    s = n+ n*n + n*n*n;

    std::cout<<s<<std::endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.268440530383237x):
#include<stdio.h>

int main(){

	int a;

	scanf ("%d", &a);

	int total = a+ a*a + a*a*a;

	printf("%d", total);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>

int main(){

	int a;

	scanf ("%d", &a);

	int total = a+ a*a + a*a*a;

	printf("%d", total);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a=2;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905578341617x):
#include<stdio.h>

int main(){

	int a;

	scanf ("%d", &a);

	int total = a+ a*a + a*a*a;

	printf("%d", total);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int a,b;

int main() {

	cin>>a;

	b=a+a*a+a*a*a;

	cout<<b<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include<stdio.h>

int main(){

	int a;

	scanf ("%d", &a);

	int total = a+ a*a + a*a*a;

	printf("%d", total);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

//kopa

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include<stdio.h>

int main(){

	int a;

	scanf ("%d", &a);

	int total = a+ a*a + a*a*a;

	printf("%d", total);

	return 0;

}