stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long int n;

    cin>>n;

    cout<<(n*(n+1))/2<<endl;

    return 0;

}




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



int main() {

  int n;

  scanf("%d", &n);

  printf("%d\n", n*(n + 1)/2);

  return 0;

}
// Slower C++ solution:


#include<bits/stdc++.h>

#define lln long long int

#define llu unsigned lln

#define sc(n) scanf("%d",&n);

#define scl(n) scanf("%lld",&n);

#define scd(n) scanf("%lf",&n);

#define pf(res) printf("%d\n",res);

#define pfl(res) printf("%lld\n",res);

#define pfd(res) printf("%lf\n",res);

#define maxii 100005

using namespace std;

typedef pair<int,int> pii;

typedef pair<lln,lln> pll;

 vector<int> vi[maxii];

 vector<int>:: iterator child;

typedef vector<lln> vl;

typedef vector<pii> vii;

typedef vector<pll> vll;





int arr[maxii];

int arr2[maxii];

bool check[maxii];



bool dfs(int node,int c)

{

    check[node]=true;

    arr2[node]=c;

    for(int child=0;child<vi[node].size();child++)

    {

        if(check[vi[node][child]]==false)

        {

            if(dfs(vi[node][child],c^1)==false)

            {

                return false;

            }

        }

        else if(arr2[node]==arr2[vi[node][child]])

        {

            return false;

        }

        //else if()

    }

    return true;

}



int main()

{

    int n;

    cin>>n;

    int res=n*(n+1);

    res/=2;

    cout<<res;



}










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



int main() {

  int n;

  scanf("%d", &n);

  printf("%d\n", n*(n + 1)/2);

  return 0;

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

using namespace std;

int main(){

	

	long long sum=0,n;

	cin>>n;

		

			sum= n*(n+1)/2;

			cout<<sum;



	



	

}

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



int main() {

  int n;

  scanf("%d", &n);

  printf("%d\n", n*(n + 1)/2);

  return 0;

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

#include<algorithm>

using namespace std;

int main()

{

    int n;

    cin>>n;

    cout<<(n*(1+n))/2;

    return 0;

}


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



int main() {

  int n;

  scanf("%d", &n);

  printf("%d\n", n*(n + 1)/2);

  return 0;

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

#include <algorithm>

using namespace std;

int main(){

	

	int n;

	cin>>n;

	cout<<n*(n+1)/2<<"\n";

	

	return 0;

	}

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



int main() {

  int n;

  scanf("%d", &n);

  printf("%d\n", n*(n + 1)/2);

  return 0;

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

#include <vector>

#include <algorithm>

#include <climits>

using namespace std ;



int main(){

    std::ios_base::sync_with_stdio(0);  cin.tie(NULL);  cout.tie(NULL);

    long long  n ;

    cin >> n ;

    cout << n * (n + 1 ) / 2 ;

    return 0 ;

}

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



int main() {

  int n;

  scanf("%d", &n);

  printf("%d\n", n*(n + 1)/2);

  return 0;

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

#include <cstdio>

#include <vector>

#include <iostream>

#include <algorithm>

#define LL long long

using namespace std;

const int MAXN = 2e5+55;

int vis[MAXN];

int main()

{

   int n;

   cin>>n;

   cout<<1ll*n*(n+1)/2;

    return 0;

}


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

int main()

{

    int number,ans ;

    scanf("%d",&number);

    ans = number*(number+1) / 2 ;

    printf("%d\n",ans);

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

#include <iostream>

#include <cstdio>

#include <cmath>

#include <cstring>

#include <cctype>

#include <queue>

#include <map>

#include <string>

#include <vector>

#include <set>

#include <math.h>

#include <stack>

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <time.h>

#define ll long long

#define chushihua(x,y) memset(x,y,sizeof x)

using namespace std;

const int MAXX = 100000 + 10;

const double PI = 3.14159265358979323846;

const ll mod = 1000000007;

int main() {

	int a, b, c;

	while (cin >> a) {

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

	}

	return 0;

}

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

int main()

{

    int number,ans ;

    scanf("%d",&number);

    ans = number*(number+1) / 2 ;

    printf("%d\n",ans);

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

using namespace std;

int main()

{

    long long int n;

    cin>>n;

    cout<<(n*(n+1))/2<<endl;

    return 0;

}




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

int main()

{

    int number,ans ;

    scanf("%d",&number);

    ans = number*(number+1) / 2 ;

    printf("%d\n",ans);

}
// Slower C++ solution:


#include<bits/stdc++.h>

#define lln long long int

#define llu unsigned lln

#define sc(n) scanf("%d",&n);

#define scl(n) scanf("%lld",&n);

#define scd(n) scanf("%lf",&n);

#define pf(res) printf("%d\n",res);

#define pfl(res) printf("%lld\n",res);

#define pfd(res) printf("%lf\n",res);

#define maxii 100005

using namespace std;

typedef pair<int,int> pii;

typedef pair<lln,lln> pll;

 vector<int> vi[maxii];

 vector<int>:: iterator child;

typedef vector<lln> vl;

typedef vector<pii> vii;

typedef vector<pll> vll;





int arr[maxii];

int arr2[maxii];

bool check[maxii];



bool dfs(int node,int c)

{

    check[node]=true;

    arr2[node]=c;

    for(int child=0;child<vi[node].size();child++)

    {

        if(check[vi[node][child]]==false)

        {

            if(dfs(vi[node][child],c^1)==false)

            {

                return false;

            }

        }

        else if(arr2[node]==arr2[vi[node][child]])

        {

            return false;

        }

        //else if()

    }

    return true;

}



int main()

{

    int n;

    cin>>n;

    int res=n*(n+1);

    res/=2;

    cout<<res;



}










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

int main()

{

    int number,ans ;

    scanf("%d",&number);

    ans = number*(number+1) / 2 ;

    printf("%d\n",ans);

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

using namespace std;

int main(){

	

	long long sum=0,n;

	cin>>n;

		

			sum= n*(n+1)/2;

			cout<<sum;



	



	

}

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

int main()

{

    int number,ans ;

    scanf("%d",&number);

    ans = number*(number+1) / 2 ;

    printf("%d\n",ans);

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

#include<algorithm>

using namespace std;

int main()

{

    int n;

    cin>>n;

    cout<<(n*(1+n))/2;

    return 0;

}


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

int main()

{

    int number,ans ;

    scanf("%d",&number);

    ans = number*(number+1) / 2 ;

    printf("%d\n",ans);

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

#include <algorithm>

using namespace std;

int main(){

	

	int n;

	cin>>n;

	cout<<n*(n+1)/2<<"\n";

	

	return 0;

	}

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

int main()

{

    int number,ans ;

    scanf("%d",&number);

    ans = number*(number+1) / 2 ;

    printf("%d\n",ans);

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

#include <vector>

#include <algorithm>

#include <climits>

using namespace std ;



int main(){

    std::ios_base::sync_with_stdio(0);  cin.tie(NULL);  cout.tie(NULL);

    long long  n ;

    cin >> n ;

    cout << n * (n + 1 ) / 2 ;

    return 0 ;

}

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

int main()

{

    int number,ans ;

    scanf("%d",&number);

    ans = number*(number+1) / 2 ;

    printf("%d\n",ans);

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

#include <cstdio>

#include <vector>

#include <iostream>

#include <algorithm>

#define LL long long

using namespace std;

const int MAXN = 2e5+55;

int vis[MAXN];

int main()

{

   int n;

   cin>>n;

   cout<<1ll*n*(n+1)/2;

    return 0;

}


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

int main()

{

int n,sum;

scanf("%d",&n);

sum = (n*(n+1))/2.0;

printf("%d\n",sum);

return 0;

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

#include <iostream>

#include <cstdio>

#include <cmath>

#include <cstring>

#include <cctype>

#include <queue>

#include <map>

#include <string>

#include <vector>

#include <set>

#include <math.h>

#include <stack>

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <time.h>

#define ll long long

#define chushihua(x,y) memset(x,y,sizeof x)

using namespace std;

const int MAXX = 100000 + 10;

const double PI = 3.14159265358979323846;

const ll mod = 1000000007;

int main() {

	int a, b, c;

	while (cin >> a) {

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

	}

	return 0;

}

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

int main()

{

int n,sum;

scanf("%d",&n);

sum = (n*(n+1))/2.0;

printf("%d\n",sum);

return 0;

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

using namespace std;

int main()

{

    long long int n;

    cin>>n;

    cout<<(n*(n+1))/2<<endl;

    return 0;

}




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

int main()

{

int n,sum;

scanf("%d",&n);

sum = (n*(n+1))/2.0;

printf("%d\n",sum);

return 0;

}
// Slower C++ solution:


#include<bits/stdc++.h>

#define lln long long int

#define llu unsigned lln

#define sc(n) scanf("%d",&n);

#define scl(n) scanf("%lld",&n);

#define scd(n) scanf("%lf",&n);

#define pf(res) printf("%d\n",res);

#define pfl(res) printf("%lld\n",res);

#define pfd(res) printf("%lf\n",res);

#define maxii 100005

using namespace std;

typedef pair<int,int> pii;

typedef pair<lln,lln> pll;

 vector<int> vi[maxii];

 vector<int>:: iterator child;

typedef vector<lln> vl;

typedef vector<pii> vii;

typedef vector<pll> vll;





int arr[maxii];

int arr2[maxii];

bool check[maxii];



bool dfs(int node,int c)

{

    check[node]=true;

    arr2[node]=c;

    for(int child=0;child<vi[node].size();child++)

    {

        if(check[vi[node][child]]==false)

        {

            if(dfs(vi[node][child],c^1)==false)

            {

                return false;

            }

        }

        else if(arr2[node]==arr2[vi[node][child]])

        {

            return false;

        }

        //else if()

    }

    return true;

}



int main()

{

    int n;

    cin>>n;

    int res=n*(n+1);

    res/=2;

    cout<<res;



}










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

int main()

{

int n,sum;

scanf("%d",&n);

sum = (n*(n+1))/2.0;

printf("%d\n",sum);

return 0;

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

using namespace std;

int main(){

	

	long long sum=0,n;

	cin>>n;

		

			sum= n*(n+1)/2;

			cout<<sum;



	



	

}

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

int main()

{

int n,sum;

scanf("%d",&n);

sum = (n*(n+1))/2.0;

printf("%d\n",sum);

return 0;

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

#include<algorithm>

using namespace std;

int main()

{

    int n;

    cin>>n;

    cout<<(n*(1+n))/2;

    return 0;

}


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

int main()

{

int n,sum;

scanf("%d",&n);

sum = (n*(n+1))/2.0;

printf("%d\n",sum);

return 0;

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

#include <algorithm>

using namespace std;

int main(){

	

	int n;

	cin>>n;

	cout<<n*(n+1)/2<<"\n";

	

	return 0;

	}

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

int main()

{

int n,sum;

scanf("%d",&n);

sum = (n*(n+1))/2.0;

printf("%d\n",sum);

return 0;

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

#include <vector>

#include <algorithm>

#include <climits>

using namespace std ;



int main(){

    std::ios_base::sync_with_stdio(0);  cin.tie(NULL);  cout.tie(NULL);

    long long  n ;

    cin >> n ;

    cout << n * (n + 1 ) / 2 ;

    return 0 ;

}

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

int main()

{

int n,sum;

scanf("%d",&n);

sum = (n*(n+1))/2.0;

printf("%d\n",sum);

return 0;

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

#include <cstdio>

#include <vector>

#include <iostream>

#include <algorithm>

#define LL long long

using namespace std;

const int MAXN = 2e5+55;

int vis[MAXN];

int main()

{

   int n;

   cin>>n;

   cout<<1ll*n*(n+1)/2;

    return 0;

}


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

int main()

{

    int n,total;

    scanf("%d",&n);

    total=(n*(n+1))/2;

    printf("%d",total);

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

#include <iostream>

#include <cstdio>

#include <cmath>

#include <cstring>

#include <cctype>

#include <queue>

#include <map>

#include <string>

#include <vector>

#include <set>

#include <math.h>

#include <stack>

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <time.h>

#define ll long long

#define chushihua(x,y) memset(x,y,sizeof x)

using namespace std;

const int MAXX = 100000 + 10;

const double PI = 3.14159265358979323846;

const ll mod = 1000000007;

int main() {

	int a, b, c;

	while (cin >> a) {

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

	}

	return 0;

}

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

int main()

{

    int n,total;

    scanf("%d",&n);

    total=(n*(n+1))/2;

    printf("%d",total);

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

using namespace std;

int main()

{

    long long int n;

    cin>>n;

    cout<<(n*(n+1))/2<<endl;

    return 0;

}




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

int main()

{

    int n,total;

    scanf("%d",&n);

    total=(n*(n+1))/2;

    printf("%d",total);

}
// Slower C++ solution:


#include<bits/stdc++.h>

#define lln long long int

#define llu unsigned lln

#define sc(n) scanf("%d",&n);

#define scl(n) scanf("%lld",&n);

#define scd(n) scanf("%lf",&n);

#define pf(res) printf("%d\n",res);

#define pfl(res) printf("%lld\n",res);

#define pfd(res) printf("%lf\n",res);

#define maxii 100005

using namespace std;

typedef pair<int,int> pii;

typedef pair<lln,lln> pll;

 vector<int> vi[maxii];

 vector<int>:: iterator child;

typedef vector<lln> vl;

typedef vector<pii> vii;

typedef vector<pll> vll;





int arr[maxii];

int arr2[maxii];

bool check[maxii];



bool dfs(int node,int c)

{

    check[node]=true;

    arr2[node]=c;

    for(int child=0;child<vi[node].size();child++)

    {

        if(check[vi[node][child]]==false)

        {

            if(dfs(vi[node][child],c^1)==false)

            {

                return false;

            }

        }

        else if(arr2[node]==arr2[vi[node][child]])

        {

            return false;

        }

        //else if()

    }

    return true;

}



int main()

{

    int n;

    cin>>n;

    int res=n*(n+1);

    res/=2;

    cout<<res;



}










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

int main()

{

    int n,total;

    scanf("%d",&n);

    total=(n*(n+1))/2;

    printf("%d",total);

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

using namespace std;

int main(){

	

	long long sum=0,n;

	cin>>n;

		

			sum= n*(n+1)/2;

			cout<<sum;



	



	

}

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

int main()

{

    int n,total;

    scanf("%d",&n);

    total=(n*(n+1))/2;

    printf("%d",total);

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

#include<algorithm>

using namespace std;

int main()

{

    int n;

    cin>>n;

    cout<<(n*(1+n))/2;

    return 0;

}


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

int main()

{

    int n,total;

    scanf("%d",&n);

    total=(n*(n+1))/2;

    printf("%d",total);

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

#include <algorithm>

using namespace std;

int main(){

	

	int n;

	cin>>n;

	cout<<n*(n+1)/2<<"\n";

	

	return 0;

	}

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

int main()

{

    int n,total;

    scanf("%d",&n);

    total=(n*(n+1))/2;

    printf("%d",total);

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

#include <vector>

#include <algorithm>

#include <climits>

using namespace std ;



int main(){

    std::ios_base::sync_with_stdio(0);  cin.tie(NULL);  cout.tie(NULL);

    long long  n ;

    cin >> n ;

    cout << n * (n + 1 ) / 2 ;

    return 0 ;

}

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

int main()

{

    int n,total;

    scanf("%d",&n);

    total=(n*(n+1))/2;

    printf("%d",total);

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

#include <algorithm>

using namespace std;



int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	unsigned long long a;

	cin >> a;

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

	return 0;

}

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



int main()

{

	int N;

	scanf("%d", &N);

	printf("%d",N=N*(N+1)/2);

	return 0;

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

using namespace std;

int main()

{

    int n;

    cin>>n;

    cout<<n*(n+1)/2<<endl;

    return 0;

}


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



int main()

{

	int N;

	scanf("%d", &N);

	printf("%d",N=N*(N+1)/2);

	return 0;

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

#include <algorithm>

using namespace std;



int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	unsigned long long a;

	cin >> a;

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

	return 0;

}

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



int main() 

{

  int N;

  scanf("%d", &N);

  printf("%d\n", N*(N + 1)/2);

  

  return 0;

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

using namespace std;

int main()

{

    int n;

    cin>>n;

    cout<<n*(n+1)/2<<endl;

    return 0;

}


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



int main() 

{

  int N;

  scanf("%d", &N);

  printf("%d\n", N*(N + 1)/2);

  

  return 0;

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

using namespace std;

int main()

{

    long long int n;

    cin>>n;

    cout<<(n*(n+1))/2<<endl;

}


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



int main() 

{

  int N;

  scanf("%d", &N);

  printf("%d\n", N*(N + 1)/2);

  

  return 0;

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

#define ll long long int

using namespace std;

int main()

{

    ll t,a,b,c,i,j,k,n;





    cin>>n;

    cout<<(n*(n+1))/2<<endl;

    return 0;

}


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



int main() 

{

  int N;

  scanf("%d", &N);

  printf("%d\n", N*(N + 1)/2);

  

  return 0;

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

using namespace std;



int main() {

    ios::sync_with_stdio(false);

    cin.tie(0); cout.tie(0);



    int n;

    cin >> n;

    cout << n*(n+1)/2;

}

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



int main() 

{

  int N;

  scanf("%d", &N);

  printf("%d\n", N*(N + 1)/2);

  

  return 0;

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

#include <cstdio>

#include <cstring>

using namespace std;



const int maxn = 500000 + 5;



struct Node{

	int value;

	Node *Left_Child,*Right_Child;

}pool[maxn],*tail = pool;



Node *root,*NUL;



void Insert(int key){

	Node *x = tail++;

	Node *fa = NUL;

	Node *cur = root;

	

	x->value = key;

	x->Left_Child = NUL;

	x->Right_Child = NUL;

	

	while(cur != NUL){

		fa = cur;

		if(cur->value > x->value)cur = cur->Left_Child;

		else cur = cur->Right_Child;

	}

	

	if(fa == NUL)root = x;

	else {

		if(fa->value > x->value)fa->Left_Child = x;

		else fa->Right_Child = x;

	}

}



void Preorder(Node *cur){

	if(cur == NUL)return;

	printf(" %d",cur->value);

	Preorder(cur->Left_Child);

	Preorder(cur->Right_Child);

}



void Inorder(Node *cur){

	if(cur == NUL)return;

	Inorder(cur->Left_Child);

	printf(" %d",cur->value);

	Inorder(cur->Right_Child);

}



bool find(int key){

	Node *cur = root;

	while(cur != NUL){

		if(cur->value > key)cur = cur->Left_Child;

		else if(cur->value < key)cur = cur->Right_Child;

		else return true;

	}

	return false;

}



int main(){

	int n;

	scanf("%d",&n);

	for(int i = 1;i <= n; i++){

		char s[15];

		scanf("%s",s);

		if(strcmp(s,"insert") == 0){

			int key;

			scanf("%d",&key);

			Insert(key);

		}

		else if(strcmp(s,"print") == 0){

			Inorder(root);

			printf("\n");

			Preorder(root);

			printf("\n");

		}

		else {

			int key;

			scanf("%d",&key);

			if(find(key))printf("yes\n");

			else printf("no\n");

		}

	}

}

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

#include<cstring>

#include<cstdlib>

#include<ctime>

#define MAXN 500000

struct node

{

	int key;

	node *ch[2];

};

node tree[MAXN+5];

node *Root,*NIL,*ncnt;

//bool first=true;

void Init()

{

	NIL=&tree[0];

	ncnt=&tree[1];

	Root=NIL;

}

inline node *NewNode(int val)

{

	node *p=++ncnt;

	p->key=val;

	p->ch[0]=p->ch[1]=NIL;

	return p;

}

void Insert(node *&rt,int val)

{

	if(rt==NIL)

	{

		rt=NewNode(val);

		return;

	}

	int d=(val>=rt->key);

	Insert(rt->ch[d],val);

}

void PreOrder(node *&rt)

{

	if(rt==NIL)

		return;

//	if(first==true)

//		printf("%d",rt->key),first=false;

//	else

		printf(" %d",rt->key);

	PreOrder(rt->ch[0]);

	PreOrder(rt->ch[1]);

}

void InOrder(node *&rt)

{

	if(rt==NIL)

		return;

	InOrder(rt->ch[0]);

//	if(first==true)

//		printf("%d",rt->key),first=false;

//	else

		printf(" %d",rt->key);

	InOrder(rt->ch[1]);

}

node *Find(node *rt,int val)

{

	if(rt==NIL)

		return NIL;

	if(rt->key==val)

		return rt;

	int d=(val>rt->key);

	return Find(rt->ch[d],val);

}

int main()

{

	Init();

	int n,x;

	char op[100];

	scanf("%d",&n);

	for(int i=0;i<n;i++)

	{

		scanf("%s",op);

		if(op[0]=='i')

			scanf("%d",&x),Insert(Root,x);

		else if(op[0]=='p')

		{

			InOrder(Root);

			printf("\n");

			PreOrder(Root);

			printf("\n");

		}

		else if(op[0]=='f')

		{

			scanf("%d",&x);

			if(Find(Root,x)==NIL)

				printf("no\n");

			else

				printf("yes\n");

		}

	}

	return 0;

}