stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define me(a,x) memset(a,x,sizeof(a))

#define sc scanf

#define itn int

using namespace std;

const int N=1e6;

const long long mod=1e9+7;

const int oo=0x7fffffff;

const int sup=0x80000000;

typedef long long ll;

typedef unsigned long long ull;

template <typename it>void db(it *begin,it *end){while(begin!=end)cout<<(*begin++)<<" ";puts("");}

template <typename it>

string to_str(it n){string s="";while(n)s+=n%10+'0',n/=10;reverse(s.begin(),s.end());return s;}

template <typename it>int o(it a){cout<<a<<endl;return 0;}

ll mul(ll a,ll b,ll c){ll ans=0;for(;b;b>>=1,a=(a+a)%c)if(b&1)ans=(ans+a)%c;return ans;}

ll ksm(ll a,ll b,ll c){ll ans=1;for(;b;b>>=1,a=mul(a,a,c))if(b&1)ans=mul(ans,a,c);return ans;}

int n,d[N];

int main(){

	cin>>n;

	for(int i=1;i<=n;i++)cin>>d[i];

	sort(d+1,d+n+1);

	o(d[n/2+1]-d[n/2]);

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

long long int d[1000000];

int main()

{

	long long int n;

	scanf("%ld",&n);

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

	scanf("%ld",&d[i]);

	sort(d+1,d+n+1);

	long long int m,p;

	m=n/2+1;

	p=n/2;

	printf("%ld\n",d[m]-d[p]);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string>

#include <iomanip>

#include <cmath>

#include <vector>

#include <set>

#include <map>

#include <algorithm>





typedef long long ll;

typedef unsigned long long ull;



using namespace std;



#define drobucs ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);



int main() {

	drobucs;

	

	int n;

	cin >> n;



	vector<int> v(n);



	for (auto &t : v) {

		cin >> t;

	}



	sort(v.begin(), v.end());



	cout << v[n / 2] - v[n / 2 - 1];



	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

long long int d[1000000];

int main()

{

	long long int n;

	scanf("%ld",&n);

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

	scanf("%ld",&d[i]);

	sort(d+1,d+n+1);

	long long int m,p;

	m=n/2+1;

	p=n/2;

	printf("%ld\n",d[m]-d[p]);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#define mod 1000000007

#define PI acos(-1)

#include<time.h>

#include<stdio.h>

#include<string.h>

#include<math.h>

#include<map>

#include<queue>

#include<iostream>

#include<vector>

#include<algorithm>

using namespace std;

typedef long long ll;

const ll INF=0x7fffffffffffffff;

const int inf=0x7fffffff;

const int N=1e5+5;

clock_t start,finish;

void time_in(){start=clock();}

void time_out(){finish=clock();double tim=(double)(finish-start)/CLOCKS_PER_SEC;printf("Running time is %lf\n",tim);}

inline ll mul(ll a,ll b){ll s=0;while(b){if(b&1)s=(s+a)%mod;a=(a<<1)%mod;b>>=1;}return s%mod;}

inline ll pow_mul(ll a,ll b){ll s=1;while(b){if(b&1)s=mul(s,a);a=mul(a,a);b>>=1;}return s;}

inline ll poww(ll a,ll b){ll s=1;while(b){if(b&1)s=(s*a)%mod;a=(a*a)%mod;b>>=1;}return s%mod;}

inline bool read(int &ret){char c=getchar();int sgn;if(c==EOF)return 0;while(c!='-'&&(c<'0'||c>'9'))c=getchar();

	sgn=((c=='-')?-1:1);ret=((c=='-')?0:(c-'0'));while(c=getchar(),c>='0'&&c<='9')ret=ret*10+(c-'0');ret*=sgn;return 1;}

inline void write(int x){if(x>9)write(x/10);putchar(x%10+'0');}

int fact[10]={1,1,2,6,24,120,720,5040,40320,362880};

int st[4][2]={1,0,0,1,-1,0,0,-1};

//vector<int>vt[N];

//priority_queue<int>q;

int t,cas;

int n,m,k;

int main()

{

	int a[N];

	while(~scanf("%d",&n))

	{

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

		{

			scanf("%d",&a[i]);

		}

		if(n&1)

		{printf("0\n");continue;}

		sort(a,a+n);

		int x=n>>1;

		if(a[x]>a[x-1])

		{

			printf("%d\n",a[x]-a[x-1]);

		}

		else printf("0\n");

	}

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

long long int d[1000000];

int main()

{

	long long int n;

	scanf("%ld",&n);

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

	scanf("%ld",&d[i]);

	sort(d+1,d+n+1);

	long long int m,p;

	m=n/2+1;

	p=n/2;

	printf("%ld\n",d[m]-d[p]);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

const int maxn=1e5+10;

const int mod=1e6+3;

typedef long long ll;

#define inf 0x3f3f3f3f

#define mem(a,b) memset(a,b,sizeof(a))

#define per(i,a,b) for(int i=(a);i<b;i++)

#define rep(i,a,b) for(int i=(a);i<=b;i++)

#define pi acos(-1.0)

#define mid ((l+r)>>1)

#define lson rt<<1,l,mid

#define rson rt<<1|1,mid+1,r

void read(int &x)

{

	int f=1;x=0;

	char ch=getchar();

	while(ch<'0'||ch>'9')

	{

		if(ch=='-')f=-1;

		ch=getchar();

	}

	while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();

	x*=f;

}

int a[maxn];

int main()

{

	int n;

	read(n);

	int ans=0;

	rep(i,1,n)read(a[i]);

	sort(a+1,a+1+n);

	int x=a[n/2],y=a[n/2+1];

	ans=y-x;

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

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int main(){

	int n,k;

	int a[100005];

	while(~scanf("%d",&n)){

		k=0;

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

		scanf("%d",&a[i]);

		sort(a,a+n);

		if(a[n/2-1]<a[n/2])

		k=a[n/2]-a[n/2-1];

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

	} 

return 0;	

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



typedef unsigned long long ull;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

typedef pair<double, double> pdd;

const ull mod = 1e9 + 7;

#define REP(i,n) for(int i=0;i<(int)n;++i)



//debug

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;



template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){

  os << "(" << v.first << ", " << v.second << ")"; return os;

}

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

  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;

}

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

  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;

}



int main(){

    cin.tie(0);

    ios::sync_with_stdio(false);



    ll N;

    cin >> N;

    vector<ll> d(N);

    REP(i, N) cin >> d[i];



    ll res = 0;

    sort(d.begin(), d.end());

    REP(K, 101010){

    	ll x = d.end() - lower_bound(d.begin(), d.end(), K);

    	ll y = N - x;

    	if(x == y) res++;

    }

    cout << res << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



typedef unsigned long long ull;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

typedef pair<double, double> pdd;

//const ull mod = 1e9 + 7;

const ll mod = 1e9 + 7;

#define REP(i,n) for(int i=0;i<(int)n;++i)



// debug

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;



template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){

  os << "(" << v.first << ", " << v.second << ")"; return os;

}

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

  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;

}

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

  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;

}

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }

template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }



// conversion number to bit

string num2bit(ll num, ll len){

  string bit = "";

  REP(i, len){

    bit += char('0'+(num>>i & 1));

  }

  return bit;

}



int main(){

    cin.tie(0);

    ios::sync_with_stdio(false);



    ll N;

    cin >> N;

    vector<ll> d(N);

    REP(i, N) cin >> d[i];

    sort(d.begin(), d.end());

    cout << max(d[N/2]-d[N/2-1], 0ll) << endl;

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

typedef int64_t Int;

using namespace std;



int main(){

    string S; int Q;

    cin >> S >> Q;



    vector<int> T(200010), F(200010); vector<char> C(200010);

    

    bool rev = false;

    rep(q, Q){

        cin >> T[q];

        if(T[q] == 1) rev = !rev;

        if(T[q] == 2) cin >> F[q] >> C[q];

    }



    bool head = true; string left, right;

    rep(q, Q){

        if(!rev){

            if(T[q] == 1) head = !head;

            if(T[q] == 2){

                if((F[q] == 1 && head) || (F[q] == 2 && !head)) left = C[q] + left;

                if((F[q] == 2 && head) || (F[q] == 1 && !head)) right = right + C[q];  

            }

        } else {

            if(T[q] == 1) head = !head;

            if(T[q] == 2){

                if((F[q] == 1 && head) || (F[q] == 2 && !head)) left = left + C[q];

                if((F[q] == 2 && head) || (F[q] == 1 && !head)) right = C[q] + right;  

            }

        }

    }



    if(rev){

        reverse(S.begin(), S.end());

        cout << right+ S + left << endl; return 0;

    } else {

        cout << left + S + right << endl; return 0;

    }

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

typedef int64_t Int;

using namespace std;

 

int main(){

    string S; int Q;

    cin >> S >> Q;



    deque<char> DQ;

    rep(i, S.length()) DQ.push_back(S[i]);

 

    bool head = true;

    rep(q, Q){

        int T; cin >> T;

 

        if(T == 1) head = !head;

        if(T == 2){

            int F; char C; cin >> F >> C;

            if((F == 1 && head) || (F == 2 && !head)) DQ.push_front(C);

            if((F == 2 && head) || (F == 1 && !head)) DQ.push_back(C);  

        }

    }



    string ans;

    while(!DQ.empty()) {ans.push_back(DQ.front()); DQ.pop_front();}

 

    if(!head) reverse(ans.begin(), ans.end());

    cout << ans << endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

typedef long long ll;

const int N = 2 * 1e5 + 3;



int main() {

  vector<char> cfront(N), cback(N);

  string s;

  int q, t, f, cnt = 0, fi = 0, bi = 0;

  char c;

  cin >> s >> q;

  rep(i, q) {

    cin >> t;

    if (t == 1)

      cnt++;

    else {

      cin >> f >> c;

      if (f == 1) {

        if (cnt % 2 == 0)

          cfront[fi] = c, fi++;  // s = c + s;

        else

          cback[bi] = c, bi++;  // s = s + c;

      } else {

        if (cnt % 2 == 0)

          cback[bi] = c, bi++;  // s = s + c;

        else

          cfront[fi] = c, fi++;  // s = c + s;

      }

    }

  }

  cfront.resize(fi + 1);

  cback.resize(bi + 1);

  if (cnt % 2 != 0) {

    for (int i = bi - 1; i >= 0; --i) cout << cback[i];

    reverse(s.begin(), s.end());

    cout << s;

    rep(i, fi) cout << cfront[i];

  } else {

    for (int i = fi - 1; i >= 0; --i) cout << cfront[i];

    cout << s;

    rep(i, bi) cout << cback[i];

  }



  return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

typedef long long ll;

const int N = 2 * 1e5 + 3;



int main() {

  string s;

  int q, x, f, cnt = 0;

  char c;

  cin >> s >> q;



  deque<int> que;

  rep(i, s.size()) que.push_back(s[i]);



  rep(i, q) {

    cin >> x;

    if (x == 1)

      cnt++;

    else {

      cin >> f >> c;

      if (cnt % 2 == 0) {

        if (f == 1) {

          que.push_front(c);

        } else {

          que.push_back(c);

        }

      } else {

        if (f == 1) {

          que.push_back(c);

        } else {

          que.push_front(c);

        }

      }

    }

  }



  char ac;

  while (que.size()) {

    if (cnt % 2 == 1)

      ac = que.back(), que.pop_back();

    else

      ac = que.front(), que.pop_front();

    cout << ac;

  }

  cout << endl;



  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/*

By Snickeen

*/

#include<bits/stdc++.h>

//#pragma comment(linker, "/STACK:102400000,102400000")

#include <stdio.h>

#include <iostream>

#include <iomanip>

#include <fstream>

#include <string.h>

#include <stdlib.h>

#include <time.h>

#include <limits.h>

#include <math.h>

#include <algorithm>

#include <deque>

#include <queue>

#include <stack>

#include <list>

#include <map>

#include <set>

#include <utility>

#include <sstream>

#include <complex>

#include <string>

#include <vector>

#include <bitset>

#include <functional>

using namespace std;

typedef long long LL;

typedef unsigned long long ULL;

typedef double db;

typedef long double ldb;

#define rep(i,a,b) for(i=a;i<b;i++)

#define repu(i,a,b) for(i=a;i<=b;i++)

#define repd(i,a,b) for(i=a;i>=b;i--)

#define repc(i,a,b,c) for(i=a;i<b;i+=c)

#define repcu(i,a,b,c) for(i=a;i<=b;i+=c)

#define repcd(i,a,b,c) for(i=a;i>=b;i-=c)

#define FIN freopen("input.in","r",stdin)

#define FOUT freopen("output.out","w",stdout)

#define CC(a) memset(a,0,sizeof(a))

#define MST(a,b) memset(a,b,sizeof(a))

#define PII pair<int,int>

#define PLL pair<LL,LL>

#define VI vector<int>

#define VL vector<LL>

#define VII vector<PII >

#define VLL vector<PLL >

#define all(x) x.begin(),x.end()

#define mp make_pair

#define pb push_back

#define pf push_front

#define FF first

#define SS second



template<typename T>inline void gn(T &x){

	x=0;T f=1;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}

	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}

	x*=f;

}

template<typename T>inline void gt(T x){

	if(!x)return;

	gt(x/10);putchar(x%10+'0');

}

 

const LL MAXN=1e5+10;

LL t,n,m,ans;

LL MOD=1e9+7,inf=0x1f1f1f1f;

db eps=1e-5;



string s[111];



int main()

{

//	ios_base::sync_with_stdio(false);cin.tie(0);

	LL i,j,k,l,ca=0;

	cin>>n>>m;

	repu(i,1,n){

		cin>>s[i];

	} 

	repu(i,1,n){

		cout<<s[i]<<endl;

		cout<<s[i]<<endl;

		

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cmath>

#include<cstring>

using namespace std;

int main(){

    char a[105];

    int h,w;

    while(~scanf("%d%d",&h,&w)){

        for(int i=0;i<h;i++){

            scanf("%s",a);

            puts(a);

            puts(a);

        }

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):


#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 200005

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];





int main()

{

  string a[105];

  int n,m;

  cin>>n>>m;

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

  {

      cin>>a[i];

  }

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

  {

      cout<<a[i]<<endl;

      cout<<a[i]<<endl;

  }



}










// Optimized solution to the same problem (faster):
#include <iostream>

#include <cstdio>

#include <cstdlib>

#include <string.h>

#include <math.h>



using namespace std;



int main()

{

    int a,b,c[105][105],d,e,f,g,i;

    char s[105];

    scanf("%d%d",&a,&b);

    for(i=0;i<a;i++)

    {

            scanf("%s",s);

            printf("%s\n",s);

            printf("%s\n",s);

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <cstring>

#include <string>

using namespace std;



int main()

{

	int w,h;

	cin>>w>>h;

	string s[105];

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

	{

		cin>>s[i];

	}

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

	{

		cout<<s[i]<<endl;

		cout<<s[i]<<endl;

	}

	return 0;

}

 

// Optimized solution to the same problem (faster):
#include <cstdio>



int main() {

	char str[110][110];

	int n, m;

	scanf("%d%d", &n, &m);

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

		scanf("%s", str[i]);

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

		puts(str[i]), puts(str[i]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {ll h,w;cin>>h>>w;string s;while(h--) {cin>>s; cout<<s<<endl<<s<<endl;}return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>



int main() {

	char str[110][110];

	int n, m;

	scanf("%d%d", &n, &m);

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

		scanf("%s", str[i]);

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

		puts(str[i]), puts(str[i]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
 #include <stdio.h>

#include <math.h>

#include <string.h>

#include <algorithm>

#include <iostream>

#include <string>

#include <time.h>

#include <queue>

#include <list>

#include <string.h>

#define sf scanf

#define pf printf

#define lf double

#define ll long long

#define p123 printf("123\n");

#define pn printf("\n");

#define pk printf(" ");

#define p(n) printf("%d",n);

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

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

#define ss(n) scanf("%s",n);

#define ps(n) printf("%s",n);

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

#define pld(n) printf("%lld",n);

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

#define plf(n) printf("%lf",n);

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

#define pc(n) printf("%c",n);

#define gc getchar();

#define re(n,a) memset(n,a,sizeof(n));

#define len(a) strlen(a)

#define LL long long

#define eps 1e-6

using namespace std;

const double pi = 3.1415926535;

/*

https://codeforces.com/contest/1106/problems

https://codeforces.com/contest/1106/submit

*/

const ll mod = 1e9+7;

//快速幂 (a^b)%mod

//如果求逆元，则b = mod-2;

ll pow_quick(ll a,ll b){

    ll r = 1,base = a;

    while(b){

        if(b & 1){

            r *= base;

            r %= mod;

        }

        base *= base;

        base %= mod;

        b >>= 1;

    }

    return r;

}



char a[1000000];

int main(){

    int h,w;

    s(h) s(w)

    gc

    for(int i = 0; i < h; i ++){

        ss(a) gc

        puts(a);

        puts(a);

    }

	return 0;

 }/*

int t[100000];

int main(){

    int n = 0;

    s(n)

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

        s(t[i])

    }

    int m;

    s(m)





	return 0;

 }

*/


// Optimized solution to the same problem (faster):
#include <cstdio>



int main() {

	char str[110][110];

	int n, m;

	scanf("%d%d", &n, &m);

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

		scanf("%s", str[i]);

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

		puts(str[i]), puts(str[i]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define ll long long

#define pi acos(-1,0)

int main()

{

   int m,n;

   cin>>m>>n;

   string s;

   for(int i=1;i<=m;i++)

   {

       cin>>s;

       cout<<s<<endl;

       cout<<s<<endl;

   }

   return 0;

   // 2 2 4 1 3

   //

}


// Optimized solution to the same problem (faster):
#include <cstdio>



int main() {

	char str[110][110];

	int n, m;

	scanf("%d%d", &n, &m);

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

		scanf("%s", str[i]);

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

		puts(str[i]), puts(str[i]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main() {

    int h,w;

    string s;

    scanf("%d %d",&h,&w);

    for(int i=0;i<h;++i) {

        cin>>s;

        cout<<s<<'\n'<<s<<'\n';

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>



int main() {

	char str[110][110];

	int n, m;

	scanf("%d%d", &n, &m);

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

		scanf("%s", str[i]);

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

		puts(str[i]), puts(str[i]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;



int main() {

	int x, y;

	cin >> x >> y;

	string str, temp[1001];

	for (int i = 0; i < x; i++) {

		cin >> str;

		temp[i] = str;

	}

	for (int i = 0; i < x; i++){

		cout << temp[i] << endl;

		cout << temp[i] << endl;

	}



}

// Optimized solution to the same problem (faster):
#include <cstdio>



int main() {

	char str[110][110];

	int n, m;

	scanf("%d%d", &n, &m);

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

		scanf("%s", str[i]);

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

		puts(str[i]), puts(str[i]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,b,i;

    cin>>a>>b;

    string s[a];

    for(i=0;i<a;i++)

        cin>>s[i];

    for(i=0;i<a;i++)

        {

            cout<<s[i]<<endl<<s[i]<<endl;

        }



    return 0;

}






// Optimized solution to the same problem (faster):
#include <cstdio>



int main() {

	char str[110][110];

	int n, m;

	scanf("%d%d", &n, &m);

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

		scanf("%s", str[i]);

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

		puts(str[i]), puts(str[i]);

	return 0;

}


// Fastest known solution for this problem: