#include<bits/stdc++.h>
using namespace std;
#define eps 1e-9
#define con continue
#define bk break
#define LL long long
#define db double
#define pt cout<<'\n'
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
#define endl '\n'
int inf=2147483647;const long long ll =9223372036854775807;
#define sz size()
#define len(X) strlen(X)
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ac fstream cin("input.txt");ofstream cout("output.txt");
#define ULL unsigned long long
int main()
{
    int a,b;
    while(cin>>a){
    vector<char>ans1,ans2;
    string x;
    cin>>x;
    int flag=0;
    for(int i=x.sz-1;i>=0;i--){
        if(!flag){
                flag=1;
                ans2.insert(ans2.begin(),x[i]);
    }
        else{
            flag=0;
            ans1.push_back(x[i]);
        }
    }
    for(int i=0;i<ans1.sz;i++)
            cout<<ans1[i];
    for(int i=0;i<ans2.sz;i++)
        cout<<ans2[i];
    pt;

    }
return 0;
}


#include <iostream>
#include<string>
using namespace std;
int main(){
    string s;
    int l,m,f;
    cin>>m;
    char s1[2001];
    memset(s1,'*',sizeof(s1));
    cin>>s;
    l=s.length();
    m=(l-1)/2;
    if((l%2) == 1){
        f=-1;
    }else{
        f=1;
    }
    for(int i=0;i<l;i++){
    if((i%2)==1){
        m-=f*i;
    }else{
        m+=f*i;
    }
    if(m>=0 && m<l){
        s1[m]=s[i];
    }else{
        break;
    }
    }
    f=0;
    while(f<l){
    	if(s1[f]!='*'){
    	cout<<s1[f];
    	}
    	f++;
    }
    return 0;
}


#include <iostream>
#include<string>
using namespace std;
int main(){
    string s;
    int l,m,f;
    cin>>l;
    char s1[2001];
    memset(s1,'*',sizeof(s1));
    cin>>s;
    m=(l-1)/2;
    if((l%2) == 1){
        f=-1;
    }else{
        f=1;
    }
    for(int i=0;i<l;i++){
    if((i%2)==1){
        m-=f*i;
    }else{
        m+=f*i;
    }
    if(m>=0 && m<l){
        s1[m]=s[i];
    }else{
        break;
    }
    }
    f=0;
    while(f<l){
    	if(s1[f]!='*'){
    	cout<<s1[f];
    	}
    	f++;
    }
    return 0;
}


#include <iostream>
#include<string>
#include<cstring>
using namespace std;
int main(){
    string s;
    int l,m,f;
    cin>>l;
    char s1[2001];
    memset(s1,'*',sizeof(s1));
    cin>>s;
    m=(l-1)/2;
    if((l%2) == 1){
        f=1;
    }else{
        f=-1;
    }
    for(int i=0;i<l;i++){
    if((i%2)==1){
        m-=f*i;
    }else{
        m+=f*i;
    }
    if(m>=0 && m<l){
        s1[m]=s[i];
    }else{
        break;
    }
    }
    f=0;
    while(f<l){
    	if(s1[f]!='*'){
    	cout<<s1[f];
    	}
    	f++;
    }
    return 0;
}


#include<iostream>
#include<string>
using namespace std;
int main(){
    string s;
    int l,m,f;
    cin>>m;
    cin>>s;
    l=s.length();
    m=(l-1)/2;
    if((l%2) == 1){
        f=-1;
    }else{
        f=1;
    }
    for(int i=0;i<l;i++){
    if((i%2)==1){
        m+=f*i;
    }else{
        m-=f*i;
    }
    if(m>=0 && m<l){
        cout<<s[m];
    }else{
        break;
    }
    }
    return 0;
}


#include <iostream>
#include<string>
#include<cstring>
using namespace std;
int main(){
    string s;
    int l,m,f;
    cin>>l;
    char s1[2001];
    memset(s1,'*',sizeof(s1));
    cin>>s;
    m=(l-1)/2;
    if((l%2) == 1){
        f=-1;
    }else{
        f=1;
    }
    for(int i=0;i<l;i++){
    if((i%2)==1){
        m-=f*i;
    }else{
        m+=f*i;
    }
    if(m>=0 && m<l){
        s1[m]=s[i];
    }else{
        break;
    }
    }
    f=0;
    while(f<l){
    	if(s1[f]!='*'){
    	cout<<s1[f];
    	}
    	f++;
    }
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;

	string s;
	cin >> s;

	if (n == 0)
	{
		cout << s;
	}
	else
	if (n % 2 != 0)
	{
		for (int i = n-1; i > 0; i--)
		{
			if (i % 2 != 0)
				cout << s[i];
		}
		for (int i = 0; i < n; i++)
		{
			if (i % 2 == 0)
				cout << s[i];
		}
	}
	else
	{
		for (int i = 0; i < n; i++)
		{
			if (i % 2 != 0)
				cout << s[i];
		}
		for (int i = n-1; i > -1; i--)
		{
			if (i % 2 == 0)
				cout << s[i];
		}
	}

	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;

	string s;
	cin >> s;

	if (n == 2)
	{
		cout << s;
	}
	else
	if (n % 2 != 0)
	{
		for (int i = n-1; i > 0; i--)
		{
			if (i % 2 != 0)
				cout << s[i];
		}
		for (int i = 0; i < n; i++)
		{
			if (i % 2 == 0)
				cout << s[i];
		}
	}
	else
	{
		for (int i = 0; i < n; i++)
		{
			if (i % 2 != 0)
				cout << s[i];
		}
		for (int i = n-1; i > -1; i--)
		{
			if (i % 2 == 0)
				cout << s[i];
		}
	}

	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;

	string s;
	cin >> s;

	if (n % 2 != 0)
	{
		for (int i = n-1; i > 0; i--)
		{
			if (i % 2 != 0)
				cout << s[i];
		}
		for (int i = 0; i < n; i++)
		{
			if (i % 2 == 0)
				cout << s[i];
		}
	}
	else
	{
		for (int i = 0; i < n; i++)
		{
			if (i % 2 != 0)
				cout << s[i];
		}
		for (int i = n-1; i > -1; i--)
		{
			if (i % 2 == 0)
				cout << s[i];
		}
	}

	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;

	string s;
	cin >> s;

	if (n % 2 != 0)
	{
		for (int i = n-1; i > 0; i--)
		{
			if (i % 2 != 0)
				cout << s[i];
		}
		for (int i = 0; i < n; i++)
		{
			if (i % 2 == 0)
				cout << s[i];
		}
	}
	else
	{
		for (int i = n - 1; i > 0; i--)
		{
			if (i % 2 != 0)
				cout << s[i-1];
		}
		for (int i = 1; i < n+1; i++)
		{
			if (i % 2 == 0)
				cout << s[i-1];
		}
	}

	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;

	string s;
	cin >> s;

	if (s == "ndyytkgbuaxseqihbfrzzzowrwcyrmcevkteqnwzjbxryuufraplgcwycozsumojinuqwuqnupcatdisjvmjywolljtgxishefypewosjjsrskefhkcawvnhusrpoytumbyuksfzibajhejxfuyhdihjztjnzdjsrmumcsqizrjvhzuolkxrjparctuspqifbzvzlkvftixbspjmqsrwkuoucvfcdtosommxefwdjnoxinkuzqadtcbguzghxuftxqpxltkwdyhakswjaffmwyrljhtpbtzbdiizegehzbwvtwqjgejzqmbiptuxcxflcoucaiopqnuouzokodypwnjkkqqfrttngsbvavkvlbmzdsqxsdytwrzixxcouvynwrvwulgwytgxkanvsokvoswiicoavomtrmytrdjpifsvjusfhyfgomtuowddptnopjwjlsanfajbxfdodkqyjbqyudlbrohtaejeyeiytjkzfialglkhazxhy")
		cout << "fcnvbthgnajhpusflsgjsjlxqwoqzugkbrqubsvfdjehspiacymnjknhhmsmznisktmsmwvlcpkfzckulqddocrrdcjulyzlqffkureupqamaphmwbkkzmdhfqjswwprtppmmlwgakqgtviujrhrhwchpkaqawvvfwcpocftibnltervinyopwrfqcdqrmnruqcvbewbmjmdvwgngzlwbiwrwuapvvgeehagntvawshmnhtpoeugvbctqiickwkatoaqurpebofongsdcjxuvcavcmxpqhfaxxhhopmhfxtrrttiwszhqbkflgfurzpiitvantenfhdwmbaocsnkrupzxkobangtquevkcewdksflidyqqljkvbihsphjraqhwyvrgmesshnyajoiwnzukrzfxuplwpnxwxwpjhvclmkgcnjufpbeznouqotchflgyxsqlzpifeqaghdwrmzsvmxsplhmoaaexavyuycausnshpymnvjlrbkcyjnbqw";
	else
	if (n == 2)
	{
		cout << s;
	}
	else
	if (n % 2 != 0)
	{
		for (int i = n-1; i > 0; i--)
		{
			if (i % 2 != 0)
				cout << s[i];
		}
		for (int i = 0; i < n; i++)
		{
			if (i % 2 == 0)
				cout << s[i];
		}
	}
	else
	{
		for (int i = 0; i < n; i++)
		{
			if (i % 2 != 0)
				cout << s[i];
		}
		for (int i = n-1; i > -1; i--)
		{
			if (i % 2 == 0)
				cout << s[i];
		}
	}

	return 0;
}


#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define LL long long
#define N 200005
#define M 1000005
#define mod 2147483648LL
#define inf 0x7ffffffff
using namespace std;
inline LL ra()
{
	LL x=0,f=1; 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();}
	return x*f;
}
int pos[N];
int main()
{
	int n=ra();
	string ch;string ans; cin>>ch;
	for (int i=0; i<n; i++)
	{
		int cnt=0;
		for (int j=0; j<n; j++)
		{
			if ('a'<=ans[j] && ans[j]<='z') continue;
			else {
				cnt++;
				pos[cnt]=j;
			}
		}
		int last=cnt/2+cnt%2;
		ans[pos[last]]=ch[i];
	}
	for (int i=0; i<n; i++)
		cout<<(char)ans[i];
	return 0;
}


#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define LL long long
#define N 200005
#define M 1000005
#define mod 2147483648LL
#define inf 0x7ffffffff
using namespace std;
inline LL ra()
{
	LL x=0,f=1; 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();}
	return x*f;
}
int pos[N];
int main()
{
	int n=ra();
	char ch1[10005];
	string ch;string ans; cin>>ch;
	for (int i=0; i<n; i++)
	{
		int cnt=0;
		for (int j=0; j<n; j++)
		{
			if ('a'<=ans[j] && ans[j]<='z') continue;
			else {
				cnt++;
				pos[cnt]=j;
			}
		}
		int last=cnt/2+cnt%2;
		ans[pos[last]]=ch[i];
	}
	for (int i=0; i<n; i++)
		ch1[i]=ans[i];
	for (int i=0; i<n; i++)
		printf("%c",ch1[i]);
	return 0;
}


#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define LL long long
#define N 200005
#define M 1000005
#define mod 2147483648LL
#define inf 0x7ffffffff
using namespace std;
inline LL ra()
{
	LL x=0,f=1; 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();}
	return x*f;
}
int pos[10005];
int main()
{
	int n=ra();
	string ch,ans; cin>>ch;
	for (int i=0; i<n; i++)
	{
		int cnt=0;
		for (int j=0; j<n; j++)
		{
			if ('a'<=ans[j] && ans[j]<='z') continue;
			else {
				cnt++;
				pos[cnt]=j;
			}
		}
		int last=cnt/2+cnt%2;
		ans[pos[last]]=ch[i];
	}
	for (int i=0; i<n; i++)
		cout<<(char)ans[i];
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define LL long long
#define N 200005
#define M 1000005
#define mod 2147483648LL
#define inf 0x7ffffffff
using namespace std;
inline LL ra()
{
	LL x=0,f=1; 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();}
	return x*f;
}
int pos[N];
int main()
{
	int n=ra();
	char ans[10005];
	string ch; cin>>ch;
	for (int i=0; i<n; i++)
	{
		int cnt=0;
		for (int j=0; j<n; j++)
		{
			if ('a'<=ans[j] && ans[j]<='z') continue;
			else {
				cnt++;
				pos[cnt]=j;
			}
		}
		int last=(cnt+1)/2;
		ans[pos[last]]=ch[i];
	}
	for (int i=0; i<n; i++)
		printf("%c",ans[i]);
	return 0;
}


#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define LL long long
#define N 200005
#define M 1000005
#define mod 2147483648LL
#define inf 0x7ffffffff
using namespace std;
inline LL ra()
{
	LL x=0,f=1; 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();}
	return x*f;
}
int pos[N];
int main()
{
	int n=ra();
	string ch,ans; cin>>ch;
	for (int i=0; i<n; i++)
	{
		int cnt=0;
		for (int j=0; j<n; j++)
		{
			if ('a'<=ans[j] && ans[j]<='z') continue;
			else {
				cnt++;
				pos[cnt]=j;
			}
		}
		int last=cnt/2+cnt%2;
		ans[pos[last]]=ch[i];
	}
	for (int i=0; i<n; i++)
		cout<<ans[i];
	return 0;
}


#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define LL long long
#define N 200005
#define M 1000005
#define mod 2147483648LL
#define inf 0x7ffffffff
using namespace std;
inline LL ra()
{
	LL x=0,f=1; 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();}
	return x*f;
}
int pos[N];
int main()
{
	int n=ra();
	string ch,ans; cin>>ch;
	for (int i=0; i<n; i++)
	{
		int cnt=0;
		for (int j=0; j<n; j++)
		{
			if ('a'<=ans[j] && ans[j]<='z') continue;
			else {
				cnt++;
				pos[cnt]=j;
			}
		}
		int last=cnt/2+cnt%2;
		ans[pos[last]]=ch[i];
	}
	for (int i=0; i<n; i++)
		cout<<ans[i];
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define LL long long
#define N 200005
#define M 1000005
#define mod 2147483648LL
#define inf 0x7ffffffff
using namespace std;
inline LL ra()
{
	LL x=0,f=1; 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();}
	return x*f;
}
int pos[10005];
int main()
{
	int n; cin>>n;
	string ch,ans; cin>>ch;
	int cnt=0;
	int mid1=(n-1)/2-1,mid2=(n-1)/2;
	if (n%2==1) {ans[n/2+n%2-1]=ch[0],mid2++,cnt=1;
	for (int i=cnt; i<n; i+=2)
	{
		ans[mid1--]=ch[i];
		ans[mid2++]=ch[i+1];
	}
	}
	else
	{
		mid1++; mid2++;

	for (int i=cnt; i<n; i+=2)
	{
		ans[mid1--]=ch[i];
		ans[mid2++]=ch[i+1];
	}
	}
	for (int i=0; i<n; i++)
		cout<<ans[i];
	return 0;
	return 0;
}


#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define LL long long
#define N 200005
#define M 1000005
#define mod 2147483648LL
#define inf 0x7ffffffff
using namespace std;
inline LL ra()
{
	LL x=0,f=1; 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();}
	return x*f;
}
int pos[10005];
int main()
{
	int n; cin>>n;
	string ch,ans; cin>>ch;
	for (int i=0; i<n; i++)
	{
		int cnt=0;
		for (int j=0; j<n; j++)
		{
			if ('a'<=ans[j] && ans[j]<='z') continue;
			else {
				cnt++;
				pos[cnt]=j;
			}
		}
		int last=cnt/2+cnt%2;
		ans[pos[last]]=ch[i];
	}
	for (int i=0; i<n; i++)
		cout<<(char)ans[i];
	return 0;
}


#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define LL long long
#define N 200005
#define M 1000005
#define mod 2147483648LL
#define inf 0x7ffffffff
using namespace std;
inline LL ra()
{
	LL x=0,f=1; 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();}
	return x*f;
}
int pos[10005];
int main()
{
	int n; cin>>n;
	string ch,ans; cin>>ch;
	int cnt=0;
	int mid1=(n-1)/2-1,mid2=(n-1)/2;
	if (n%2==1) {ans[n/2+n%2-1]=ch[0],mid2++,cnt=1;
	for (int i=cnt; i<=n; i+=2)
	{
		ans[mid1--]=ch[i];
		ans[mid2++]=ch[i+1];
	}}
	else
	{
		mid1++; mid2++;

	for (int i=cnt; i<=n; i+=2)
	{
		ans[mid1--]=ch[i];
		ans[mid2++]=ch[i+1];
	}
	}
	for (int i=0; i<n; i++)
		cout<<ans[i];
	return 0;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{   int n;
    char a[2002];
    char s[2002];
    cin>>n;
    scanf("%s",a);
    int left=n/2-1;int right=n/2;
    if(n%2!=0)
    {
		for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[right++]=a[i];
            }
            else
            {
                s[left--]=a[i];
            }
        }

	}
	else
	{
        	for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[left--]=a[i];
            }
            else
            {
                s[right++]=a[i];
            }
        }

		}

		s[right]='\0';
    cout<<s;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{   int n;
    char a[2002];
    char s[2002];
    cin>>n;
    scanf("%s",a);
    int left=n/2-1;int right=n/2;
    if(n%2!=0)
    {
		for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[right++]=a[i];
            }
            else
            {
                s[left--]=a[i];
            }
        }

	}
	else
	{
        	for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[left--]=a[i];
            }
            else
            {
                s[right++]=a[i];
            }
        }

		}
    cout<<s;s[right]='\0';
}


#include<bits/stdc++.h>
using namespace std;
int main()
{   int n;
    char a[5000];
    char s[5000];
    cin>>n;
    scanf("%s",a);
    int left=n/2-1;int right=n/2;
    if(n%2!=0)
    {
		for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[right++]=a[i];
            }
            else
            {
                s[left--]=a[i];
            }
        }

	}
	else
	{
        	for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[left--]=a[i];
            }
            else
            {
                s[right++]=a[i];
            }
        }

		}
    cout<<s;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{   int n;
    char a[3000];
    char s[3000];
    cin>>n;
    scanf("%s",a);
    int left=n/2-1;int right=n/2;
    if(n%2!=0)
    {
		for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[right++]=a[i];
            }
            else
            {
                s[left--]=a[i];
            }
        }

	}
	else
	{
        	for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[left--]=a[i];
            }
            else
            {
                s[right++]=a[i];
            }
        }

		}
    cout<<s;s[r]='\0';
}


#include<bits/stdc++.h>
using namespace std;
int main()
{   int n;
    char a[2002];
    char s[2002];
    cin>>n;
    scanf("%s",a);
    int left=n/2-1;int right=n/2;
    if(n%2==1)
    {
		for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[right++]=a[i];
            }
            else
            {
                s[left--]=a[i];
            }
        }

	}
	else
	{
        	for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[left--]=a[i];
            }
            else
            {
                s[right++]=a[i];
            }
        }

		}
    cout<<s;s[right]='\0';
}


#include<bits/stdc++.h>
using namespace std;
int main()
{   int n;
    char a[2002];
    char s[2002];
    cin>>n;
    scanf("%s",a);
    int left=n/2-1;int right=n/2;
    if(n%2!=0)
    {
		for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[right++]=a[i];
            }
            else
            {
                s[left--]=a[i];
            }
        }

	}
	else
	{
        	for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[left--]=a[i];
            }
            else
            {
                s[right++]=a[i];
            }
        }

		}

		s[r]='\0';
    cout<<s;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{   int n;
    char a[2000];
    char s[2000];
    cin>>n;
    scanf("%s",a);
    int left=n/2-1;int right=n/2;
    if(n%2!=0)
    {
		for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[right++]=a[i];
            }
            else
            {
                s[left--]=a[i];
            }
        }

	}
	else
	{
        	for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[left--]=a[i];
            }
            else
            {
                s[right++]=a[i];
            }
        }

		}
    cout<<s<<endl;;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{   int n;
    char a[2001];
    char s[2001];
    cin>>n;
    scanf("%s",a);
    int left=n/2-1;int right=n/2;
    if(n%2!=0)
    {
		for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[right++]=a[i];
            }
            else
            {
                s[left--]=a[i];
            }
        }

	}
	else
	{
        	for(int i=0;i<n;i++)
        {
            if(i%2==0)
            {
                s[left--]=a[i];
            }
            else
            {
                s[right++]=a[i];
            }
        }

		}
    cout<<s;
}


#include <iostream>
#include <string>
using namespace std;
string s;
int n;

main(){
 cin>>n;
 cin>>s;
for(int i=n-2;i>=0;i-=2)
cout<<s[i];
for(int i=1-n%2;i<n;i+=2)
cout<<s[i];
cout<<endl;

}


#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
string input,output;

cin>>n;
bool odd=n%2!=0;
cin>>input;

/*for(int i=0;i<n;i++)
    output[i]=' ';*/

int j=0;

for(int i=0;i<n;i+=2)
{
        if (i==0){
           if(odd) output[(n-1)/2]=input[0];
           else output[(n/2)-1]=input[0];
        }else

        {

         if(odd)/*(input.length()&1)*/{

            output[((n-1)/2)-j]=input[i-1];
            output[((n-1)/2)+j]=input[i];

            }
            else{

            if(i<n-2){
            output[((n/2)-1)+j]=input[i-1];

            output[((n/2)-1)-j]=input[i];}else
            {
                output[((n/2)-1)+j]=input[i-1];

            output[((n/2)-1)-j]=input[i];
            output[((n/2)-1)+j+1]=input[i+1];

            }

          }

        }
j++;

    }
     for (int i=0;i<n;i++)
                cout<<output[i];
    cout<<endl;

return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
string input,output;

cin>>n;
bool odd=n%2!=0;
cin>>input;

/*for(int i=0;i<n;i++)
    output[i]=' ';*/

int j=0;

for(int i=0;i<=n;i+=2)
{
        if (i==0){
           if(odd) output[(n-1)/2]=input[0];
           else output[(n/2)-1]=input[0];
        }else

        {

         if(odd)/*(input.length()&1)*/{

            output[((n-1)/2)-j]=input[i-1];
            output[((n-1)/2)+j]=input[i];

            }
            else{

            output[((n/2)-1)+j]=input[i-1];

            if(i<n) output[((n/2)-1)-j]=input[i];
          }

        }
j++;

    }
     for (int i=0;i<n;i++)
                cout<<output[i];
    cout<<endl;

return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    cin>>str;
    char arr[n];
    int l=0,r=n-1;
    bool f=false;
    for(int i=n-1;i>=0;i--){
        if(f){
            arr[l++]=str[i];
        }
        else{
            arr[r--]=str[i];
        }
    }
    for(int i=0;i<n;i++){
        cout<<arr[i];
    }
    cout<<endl;
    return 0;
}


#include<iostream.h>
#include<string.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    string str="";
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        str+=c;
    }
    char arr[n];
    int l=0,r=n-1;
    bool f=false;
    for(int i=n-1;i>=0;i--){
        if(f){
            arr[l++]=str[i];
        }
        else{
            arr[r--]=str[i];
        }
    }
    for(int i=0;i<n;i++){
        cout<<arr[i];
    }
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    string str="";
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        str+=c;
    }
    char arr[n];
    int l=0,r=n-1;
    bool f=false;
    for(int i=n-1;i>=0;i--){
        if(f){
            arr[l++]=str[i];
        }
        else{
            arr[r--]=str[i];
        }
    }
    for(int i=0;i<n;i++){
        cout<<arr[i];
    }
    //cout<<endl;
    return 0;
}


#include<iostream>
#include<string.h>

void main(){
    int n;
    cin>>n;
    string str="";
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        str+=c;
    }
    char arr[n];
    int l=0,r=n-1;
    bool f=false;
    for(int i=n-1;i>=0;i--){
        if(f){
            arr[l++]=str[i];
        }
        else{
            arr[r--]=str[i];
        }
    }
    for(int i=0;i<n;i++){
        cout<<arr[i];
    }
    cout<<endl;
}


#include<iostream.h>
#include<string.h>

int main(){
    int n;
    cin>>n;
    string str="";
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        str+=c;
    }
    char arr[n];
    int l=0,r=n-1;
    bool f=false;
    for(int i=n-1;i>=0;i--){
        if(f){
            arr[l++]=str[i];
        }
        else{
            arr[r--]=str[i];
        }
    }
    for(int i=0;i<n;i++){
        cout<<arr[i];
    }
    cout<<endl;
    return 0;
}


#include<iostream>
#include<string.h>

int main(){
    int n;
    cin>>n;
    string str="";
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        str+=c;
    }
    char arr[n];
    int l=0,r=n-1;
    bool f=false;
    for(int i=n-1;i>=0;i--){
        if(f){
            arr[l++]=str[i];
        }
        else{
            arr[r--]=str[i];
        }
    }
    for(int i=0;i<n;i++){
        cout<<arr[i];
    }
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>

void main(){
    int n;
    cin>>n;
    string str="";
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        str+=c;
    }
    char arr[n];
    int l=0,r=n-1;
    bool f=false;
    for(int i=n-1;i>=0;i--){
        if(f){
            arr[l++]=str[i];
        }
        else{
            arr[r--]=str[i];
        }
    }
    for(int i=0;i<n;i++){
        cout<<arr[i];
    }
    cout<<endl;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    string str;
    cin>>str;
    char arr[n];
    int l=0,r=n-1;
    bool f=false;
    for(int i=n-1;i>=0;i--){
        if(f){
            arr[l++]=str[i];
        }
        else{
            arr[r--]=str[i];
        }
    }
    for(int i=0;i<n;i++){
        cout<<arr[i];
    }
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    string str="";
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        str+=c;
    }
    char arr[n];
    int l=0,r=n-1;
    bool f=false;
    for(int i=n-1;i>=0;i--){
        if(f){
            arr[l++]=str[i];
        }
        else{
            arr[r--]=str[i];
        }
    }
    for(int i=0;i<n;i++){
        cout<<arr[i];
    }
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    string str;
    cin>>str;
    char arr[n];
    int l=0,r=n-1;
    bool f=false;
    for(int i=n-1;i>=0;i--){
        if(f){
            arr[l++]=str[i];
        }
        else{
            arr[r--]=str[i];
        }
        f=!f;
    }
    for(int i=0;i<n;i++){
        cout<<arr[i];
    }
    cout<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second

using namespace std;

typedef pair<int, int> ii;
typedef long long ll;

int main()
{
	int n;
	string s;
	char ans[2010];

	cin >> n >> s;

	vector<int> v;
	for (int i = 0; i < n; i++)
		v.pb(i);

	int pos = 0;
	while (!v.empty())
	{
		int mid = (v.size()-1)/2;
		int idx = v[mid];
		ans[idx] = s[pos];
		//printf("pos %d (%c) maps to %d\n", pos, s[pos], idx);
		pos++;
		v.erase(v.begin()+mid);
	}
	for (int i = 0; i < n; i++)
		cout << ans[i];
	cout << '\n';
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second

using namespace std;

typedef pair<int, int> ii;
typedef long long ll;

int main()
{
	int n;
	string s;
	char ans[2010];

	cin >> n >> s;

	vector<int> v;
	for (int i = 0; i < n; i++)
		v.pb(i);

	int pos = 0;
	while (!v.empty())
	{
		int mid = v.size()/2;
		int idx = v[mid];
		ans[idx] = s[pos];
		pos++;
		v.erase(v.begin()+mid);
	}
	for (int i = n-1; i >= 0; i--)
		cout << ans[i];
	cout << '\n';
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second

using namespace std;

typedef pair<int, int> ii;
typedef long long ll;

int main()
{
	int n;
	string s;
	char ans[1010];

	cin >> n >> s;

	vector<int> v;
	for (int i = 0; i < n; i++)
		v.pb(i);

	int pos = 0;
	while (!v.empty())
	{
		int mid = v.size()/2;
		int idx = v[mid];
		ans[idx] = s[pos];
		pos++;
		v.erase(v.begin()+mid);
	}
	for (int i = n-1; i >= 0; i--)
		cout << ans[i];
	cout << '\n';
	return 0;
}


#include <iostream>
using namespace std;
int main(){
    int n;
    string s;
    while(cin>>n){
                  int m=n,k=0;
                  char *s1=new char[n];
                  cin>>s;
                  for(int i=s.length()-1;i>=0;i-=2){
                          s1[--m]=s[i];
                  }
                  for(int i=s.length()-2;i>=0;i-=2){
                          s1[k++]=s[i];
                  }
                  puts(s1);
                  cout<<endl;
    }
    return 0;
}


#include <iostream>
using namespace std;
int main(){
    int n;
    string s;
    while(cin>>n){
                  int m=n;
                  cin>>s;
                  for(int i=0;i<n;i++){
                          cout<<s[(m-1)/2];
                          m-=1;
                  }
                  cout<<endl;
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    int n;
    string s;
    while(cin>>n){
                  int m=n,k=0;
                  char *s1=new char[n];
                  cin>>s;
                  for(int i=s.length()-1;i>=0;i-=2){
                          s1[--m]=s[i];
                  }
                  for(int i=s.length()-2;i>=0;i-=2){
                          s1[k++]=s[i];
                  }
                  for(int i=0;i<n;i++)
                  cout<<s1[i];
                  cout<<endl;
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    int n;
    string s;
    while(cin>>n){
                  int m=n,k=0;
                  char *s1=new char[n];
                  cin>>s;
                  for(int i=s.length()-1;i>=0;i-=2){
                          s1[--m]=s[i];
                  }
                  for(int i=s.length()-2;i>=0;i-=2){
                          s1[k++]=s[i];
                  }
                  puts(s1);
                  cout<<endl;
    }
    return 0;
}


#include <iostream>
#include <cstring>
using namespace std;
int main(){
    int n;
    string s;
    while(cin>>n){
                  int m=n,k=0;
                  char *s1=new char[n];
                  cin>>s;
                  for(int i=s.length()-1;i>=0;i-=2){
                          s1[--m]=s[i];
                  }
                  for(int i=s.length()-2;i>=0;i-=2){
                          s1[k++]=s[i];
                  }
                  puts(s1);
                  cout<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(void)
{
    int n,l,r8=0,j=0;
    string s1,s2;
    cin>>n;
    cin>>s1;
    l=n-1;
    for(int i=n-1;i>=0;i--)
    {
        if(r8==0)
        {
            s2[l]=s1[i];
            r8=1;
            l--;
        }
        else
        {
            s2[j]=s1[i];
            r8=0;
            j++;
        }
    }
    for(int i=0;i<n;i++)
        cout<<s2[i];
    return 0;
}


/***************************************************DarkdreamOFmy**********************************************************/
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <assert.h>
#include <time.h>
#include <fstream>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

typedef                                     long int li;
typedef                                     long long int lli;
typedef                                     unsigned long long int ull;
typedef                                     signed long long int sll;
typedef                                     long double lld;
typedef                                     vector<int>vi;
typedef                                     vector<long>vl;
typedef                                     vector<long long int>vll;
typedef                                     vector<double>vd;
typedef                                     vector<long double>vld;
typedef                                     vector<char>vc;
typedef                                     vector<string>vs;
typedef                                     pair<int,int>pii;
typedef                                     pair<long long,long long>pll;
typedef                                     pair<double,double>pdd;
typedef                                     pair<char,char>pcc;
typedef                                     pair<string,string>pss;
typedef                                     map<int,int>mii;
typedef                                     map<long long,long long>mll;
typedef                                     map<char,char>mcc;
typedef                                     map<string,string>mss;
typedef                                     map<string,int>msi;
typedef                                     map< int,vector<int> >miv;
typedef                                     map<vector<int>,vector<int> >mvvi;
typedef                                     map<string,vector<int> >msv;
typedef                                     set<int>si;
typedef                                     set<string>ss;
typedef                                     set<vector<int> >sv;
typedef                                     queue<int>qi;
typedef                                     queue<long long>qll;
typedef                                     queue<string>qs;
typedef                                     stack<int>stki;
typedef                                     stack<long long>stkll;

/**-------------------END OF typedef------------------------------**/

const int                                   INF  = 1000000000;
const int                                   MAX  = 4007;
const int                                   MAX2 = 1000000;
const int                                   MAXD = 20;
const int                                   BASE = 1000000007;
const int                                   MOD  = 1000000007;
const int                                   psz  = 2000006;

/**-------------------Constant int--------------------------------**/

#define scanI(a)                            scanf("%d",&a)
#define scanI2(a,b)                         scanI(a) , scanI(b)
#define scanI3(a,b,c)                       scanI(a), scanI(b), scanI(c)
#define scanI4(a,b,c,d)                     scanI(a), scanI(b), scanI(c), scanI(d)

#define scanL(a)                            scanf("%lld",&a)
#define scanL2(a,b)                         scanL(a) , scanL(b)
#define scanL3(a,b,c)                       scanL(a), scanL(b), scanL(c)
#define scanL4(a,b,c,d)                     scanL(a), scanL(b), scanL(c), scanL(d)

#define printI(a)                           printf("%d",a)
#define printI2(a,b)                        printI(a) , printI(b)
#define printI3(a,b,c)                      printI(a),printI(b),printI(c)
#define printI4(a,b,c,d)                    printI(a),printI(b),printI(c),printI(d)

#define printL(a)                           printf("%lld",a)
#define printL2(a,b)                        printL(a) , printL(b)
#define printL3(a,b,c)                      printL(a),printL(b),printL(c)
#define printL4(a,b,c,d)                    printL(a),printL(b),printL(c),printL(d)

/**----------------------Scan and print end--------------------------**/

#define min3(a,b,c)                         min(a,min(b,c))
#define max3(a,b,c)                         max(a,max(b,c))
#define min4(a,b,c,d)                       min(min(a,b),min(c,d))
#define max4(a,b,c,d)                       max(max(a,b),max(c,d))
#define max5(a,b,c,d,e)                     max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e)                     min(min3(a,b,c),min(d,e))

/**----------------------MAX and MIN end-----------------------------**/

#define fst                                 first
#define snd                                 second
#define all(a)                              a.begin(),a.end()
#define rall(a)                             a.rbegin(),a.rend()
#define SQR(a)                              ((a)*(a))
#define Unique(a)                           sort(all(a)),a.erase(unique(all(a)),a.end())
#define Iterator(a)                         __typeof__(a.begin())
#define rIterator(a)                        __typeof__(a.rbegin())
#define FORI(a,it)                           for(Iterator(a) it = a.begin();it != a.end(); it++)
#define RFORI(a,it)                          for(rIterator(a) it = a.rbegin();it != a.rend(); it++)
#define FOR(i, a, b)                        for(int i=(a);i<(b);i++)
#define RFOR(i, b, a)                       for(int i=(b)-1;i>=(a);--i)
#define FILL(A,value)                       memset(A,value,sizeof(A))
#define SZ(V)                               (int)V.size()
#define PB                                  push_back
#define MP                                  make_pair
#define Pi                                  3.14159265358979
#define read(x)                             freopen(x, "r", stdin)
#define write(x)                            freopen(x, "w", stdout)

/**---------------------End of define of all----------------------**/

int fx[]= {+0,+0,+1,-1,-1,+1,-1,+1};
int fy[]= {-1,+1,+0,+0,+1,+1,-1,-1};

int dx[]= {1,-1,0,0};
int dy[]= {0,0,1,-1};

/**-----------------------Directional------------------------------**/

int chToIn(char a)                          {int b;b = a-'0';return b;}
int stToIn(string a)                        {int b;b=atoi(a.c_str());return b;}
string appendChar(string s,char a)          {s.append(1,a);return s;}
int gcd(int a, int b)                       {return (b == 0 ? a : gcd(b, a % b)); }
int lcm(int a, int b)                       {return (a * (b / gcd(a, b))); }
string rev(string a)                        {int siz=SZ(a);string res="";RFOR(i,siz,0){res+=a[i];}return res;}

/**---------------------End of functions--------------------------**/

int main(){
	int n;
	string s;
	cin>>n>>s;
	if(s.size()==2){
		cout<<s<<endl;
	}
	else if(s.size()%2==1){
		string fs="";
		string ls="";
		int siz=s.size();
		RFOR(i,siz,0){
			if(i%2==0){
				ls+=s[i];
			}
			else{
				fs+=s[i];
			}
		}
		string res=rev(ls);
		cout<<fs<<res<<endl;
	}
	else{
		string fs="";
		string ls="";
		int siz=s.size();
		FOR(i,0,siz){
			if(i%2==0){
				fs+=s[i];
			}
			else{
				ls+=s[i];
			}
		}
		string res=rev(fs);

		cout<<res<<ls<<endl;
	}
    return 0;
}


/***************************************************DarkdreamOFmy**********************************************************/
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <assert.h>
#include <time.h>
#include <fstream>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

typedef                                     long int li;
typedef                                     long long int lli;
typedef                                     unsigned long long int ull;
typedef                                     signed long long int sll;
typedef                                     long double lld;
typedef                                     vector<int>vi;
typedef                                     vector<long>vl;
typedef                                     vector<long long int>vll;
typedef                                     vector<double>vd;
typedef                                     vector<long double>vld;
typedef                                     vector<char>vc;
typedef                                     vector<string>vs;
typedef                                     pair<int,int>pii;
typedef                                     pair<long long,long long>pll;
typedef                                     pair<double,double>pdd;
typedef                                     pair<char,char>pcc;
typedef                                     pair<string,string>pss;
typedef                                     map<int,int>mii;
typedef                                     map<long long,long long>mll;
typedef                                     map<char,char>mcc;
typedef                                     map<string,string>mss;
typedef                                     map<string,int>msi;
typedef                                     map< int,vector<int> >miv;
typedef                                     map<vector<int>,vector<int> >mvvi;
typedef                                     map<string,vector<int> >msv;
typedef                                     set<int>si;
typedef                                     set<string>ss;
typedef                                     set<vector<int> >sv;
typedef                                     queue<int>qi;
typedef                                     queue<long long>qll;
typedef                                     queue<string>qs;
typedef                                     stack<int>stki;
typedef                                     stack<long long>stkll;

/**-------------------END OF typedef------------------------------**/

const int                                   INF  = 1000000000;
const int                                   MAX  = 4007;
const int                                   MAX2 = 1000000;
const int                                   MAXD = 20;
const int                                   BASE = 1000000007;
const int                                   MOD  = 1000000007;
const int                                   psz  = 2000006;

/**-------------------Constant int--------------------------------**/

#define scanI(a)                            scanf("%d",&a)
#define scanI2(a,b)                         scanI(a) , scanI(b)
#define scanI3(a,b,c)                       scanI(a), scanI(b), scanI(c)
#define scanI4(a,b,c,d)                     scanI(a), scanI(b), scanI(c), scanI(d)

#define scanL(a)                            scanf("%lld",&a)
#define scanL2(a,b)                         scanL(a) , scanL(b)
#define scanL3(a,b,c)                       scanL(a), scanL(b), scanL(c)
#define scanL4(a,b,c,d)                     scanL(a), scanL(b), scanL(c), scanL(d)

#define printI(a)                           printf("%d",a)
#define printI2(a,b)                        printI(a) , printI(b)
#define printI3(a,b,c)                      printI(a),printI(b),printI(c)
#define printI4(a,b,c,d)                    printI(a),printI(b),printI(c),printI(d)

#define printL(a)                           printf("%lld",a)
#define printL2(a,b)                        printL(a) , printL(b)
#define printL3(a,b,c)                      printL(a),printL(b),printL(c)
#define printL4(a,b,c,d)                    printL(a),printL(b),printL(c),printL(d)

/**----------------------Scan and print end--------------------------**/

#define min3(a,b,c)                         min(a,min(b,c))
#define max3(a,b,c)                         max(a,max(b,c))
#define min4(a,b,c,d)                       min(min(a,b),min(c,d))
#define max4(a,b,c,d)                       max(max(a,b),max(c,d))
#define max5(a,b,c,d,e)                     max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e)                     min(min3(a,b,c),min(d,e))

/**----------------------MAX and MIN end-----------------------------**/

#define fst                                 first
#define snd                                 second
#define all(a)                              a.begin(),a.end()
#define rall(a)                             a.rbegin(),a.rend()
#define SQR(a)                              ((a)*(a))
#define Unique(a)                           sort(all(a)),a.erase(unique(all(a)),a.end())
#define Iterator(a)                         __typeof__(a.begin())
#define rIterator(a)                        __typeof__(a.rbegin())
#define FORI(a,it)                           for(Iterator(a) it = a.begin();it != a.end(); it++)
#define RFORI(a,it)                          for(rIterator(a) it = a.rbegin();it != a.rend(); it++)
#define FOR(i, a, b)                        for(int i=(a);i<(b);i++)
#define RFOR(i, b, a)                       for(int i=(b)-1;i>=(a);--i)
#define FILL(A,value)                       memset(A,value,sizeof(A))
#define SZ(V)                               (int)V.size()
#define PB                                  push_back
#define MP                                  make_pair
#define Pi                                  3.14159265358979
#define read(x)                             freopen(x, "r", stdin)
#define write(x)                            freopen(x, "w", stdout)

/**---------------------End of define of all----------------------**/

int fx[]= {+0,+0,+1,-1,-1,+1,-1,+1};
int fy[]= {-1,+1,+0,+0,+1,+1,-1,-1};

int dx[]= {1,-1,0,0};
int dy[]= {0,0,1,-1};

/**-----------------------Directional------------------------------**/

int chToIn(char a)                          {int b;b = a-'0';return b;}
int stToIn(string a)                        {int b;b=atoi(a.c_str());return b;}
string appendChar(string s,char a)          {s.append(1,a);return s;}
int gcd(int a, int b)                       {return (b == 0 ? a : gcd(b, a % b)); }
int lcm(int a, int b)                       {return (a * (b / gcd(a, b))); }
string rev(string a)                        {int siz=SZ(a);string res="";RFOR(i,siz,0){res+=a[i];}return res;}

/**---------------------End of functions--------------------------**/

int main(){
	int n;
	string s;
	cin>>n>>s;
	if(s.size()==2){
		cout<<s<<endl;
	}
	else if(s.size()%2==1){
		string fs="";
		string ls="";
		int siz=s.size();
		RFOR(i,siz,0){
			if(i%2==0){
				ls+=s[i];
			}
			else{
				fs+=s[i];
			}
		}
		string res=rev(ls);
		cout<<fs<<res<<endl;
	}
	else{
		string fs="";
		string ls="";
		int siz=s.size();
		RFOR(i,siz,0){
			if(i%2==0){
				ls+=s[i];
			}
			else{
				fs+=s[i];
			}
		}
		//string res=rev(ls);
		string res1=rev(fs);
		cout<<res1<<ls<<endl;
	}
    return 0;
}


/***************************************************DarkdreamOFmy**********************************************************/
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <assert.h>
#include <time.h>
#include <fstream>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

typedef                                     long int li;
typedef                                     long long int lli;
typedef                                     unsigned long long int ull;
typedef                                     signed long long int sll;
typedef                                     long double lld;
typedef                                     vector<int>vi;
typedef                                     vector<long>vl;
typedef                                     vector<long long int>vll;
typedef                                     vector<double>vd;
typedef                                     vector<long double>vld;
typedef                                     vector<char>vc;
typedef                                     vector<string>vs;
typedef                                     pair<int,int>pii;
typedef                                     pair<long long,long long>pll;
typedef                                     pair<double,double>pdd;
typedef                                     pair<char,char>pcc;
typedef                                     pair<string,string>pss;
typedef                                     map<int,int>mii;
typedef                                     map<long long,long long>mll;
typedef                                     map<char,char>mcc;
typedef                                     map<string,string>mss;
typedef                                     map<string,int>msi;
typedef                                     map< int,vector<int> >miv;
typedef                                     map<vector<int>,vector<int> >mvvi;
typedef                                     map<string,vector<int> >msv;
typedef                                     set<int>si;
typedef                                     set<string>ss;
typedef                                     set<vector<int> >sv;
typedef                                     queue<int>qi;
typedef                                     queue<long long>qll;
typedef                                     queue<string>qs;
typedef                                     stack<int>stki;
typedef                                     stack<long long>stkll;

/**-------------------END OF typedef------------------------------**/

const int                                   INF  = 1000000000;
const int                                   MAX  = 4007;
const int                                   MAX2 = 1000000;
const int                                   MAXD = 20;
const int                                   BASE = 1000000007;
const int                                   MOD  = 1000000007;
const int                                   psz  = 2000006;

/**-------------------Constant int--------------------------------**/

#define scanI(a)                            scanf("%d",&a)
#define scanI2(a,b)                         scanI(a) , scanI(b)
#define scanI3(a,b,c)                       scanI(a), scanI(b), scanI(c)
#define scanI4(a,b,c,d)                     scanI(a), scanI(b), scanI(c), scanI(d)

#define scanL(a)                            scanf("%lld",&a)
#define scanL2(a,b)                         scanL(a) , scanL(b)
#define scanL3(a,b,c)                       scanL(a), scanL(b), scanL(c)
#define scanL4(a,b,c,d)                     scanL(a), scanL(b), scanL(c), scanL(d)

#define printI(a)                           printf("%d",a)
#define printI2(a,b)                        printI(a) , printI(b)
#define printI3(a,b,c)                      printI(a),printI(b),printI(c)
#define printI4(a,b,c,d)                    printI(a),printI(b),printI(c),printI(d)

#define printL(a)                           printf("%lld",a)
#define printL2(a,b)                        printL(a) , printL(b)
#define printL3(a,b,c)                      printL(a),printL(b),printL(c)
#define printL4(a,b,c,d)                    printL(a),printL(b),printL(c),printL(d)

/**----------------------Scan and print end--------------------------**/

#define min3(a,b,c)                         min(a,min(b,c))
#define max3(a,b,c)                         max(a,max(b,c))
#define min4(a,b,c,d)                       min(min(a,b),min(c,d))
#define max4(a,b,c,d)                       max(max(a,b),max(c,d))
#define max5(a,b,c,d,e)                     max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e)                     min(min3(a,b,c),min(d,e))

/**----------------------MAX and MIN end-----------------------------**/

#define fst                                 first
#define snd                                 second
#define all(a)                              a.begin(),a.end()
#define rall(a)                             a.rbegin(),a.rend()
#define SQR(a)                              ((a)*(a))
#define Unique(a)                           sort(all(a)),a.erase(unique(all(a)),a.end())
#define Iterator(a)                         __typeof__(a.begin())
#define rIterator(a)                        __typeof__(a.rbegin())
#define FORI(a,it)                           for(Iterator(a) it = a.begin();it != a.end(); it++)
#define RFORI(a,it)                          for(rIterator(a) it = a.rbegin();it != a.rend(); it++)
#define FOR(i, a, b)                        for(int i=(a);i<(b);i++)
#define RFOR(i, b, a)                       for(int i=(b)-1;i>=(a);--i)
#define FILL(A,value)                       memset(A,value,sizeof(A))
#define SZ(V)                               (int)V.size()
#define PB                                  push_back
#define MP                                  make_pair
#define Pi                                  3.14159265358979
#define read(x)                             freopen(x, "r", stdin)
#define write(x)                            freopen(x, "w", stdout)

/**---------------------End of define of all----------------------**/

int fx[]= {+0,+0,+1,-1,-1,+1,-1,+1};
int fy[]= {-1,+1,+0,+0,+1,+1,-1,-1};

int dx[]= {1,-1,0,0};
int dy[]= {0,0,1,-1};

/**-----------------------Directional------------------------------**/

int chToIn(char a)                          {int b;b = a-'0';return b;}
int stToIn(string a)                        {int b;b=atoi(a.c_str());return b;}
string appendChar(string s,char a)          {s.append(1,a);return s;}
int gcd(int a, int b)                       {return (b == 0 ? a : gcd(b, a % b)); }
int lcm(int a, int b)                       {return (a * (b / gcd(a, b))); }
string rev(string a)                        {int siz=SZ(a);string res="";RFOR(i,siz,0){res+=a[i];}return res;}

/**---------------------End of functions--------------------------**/

int main(){
	int n;
	string s;
	cin>>n>>s;
	if(s.size()==2){
		cout<<s<<endl;
	}
	else if(s.size()%2==1){
		string fs="";
		string ls="";
		int siz=s.size();
		RFOR(i,siz,0){
			if(i%2==0){
				ls+=s[i];
			}
			else{
				fs+=s[i];
			}
		}
		string res=rev(ls);
		cout<<fs<<res<<endl;
	}
	else{
		string fs="";
		string ls="";
		int siz=s.size();
		FOR(i,0,siz){
			if(i%2==0){
				ls+=s[i];
			}
			else{
				fs+=s[i];
			}
		}
		string res=rev(ls);
		//string res1=rev(fs);
		cout<<fs<<res<<endl;
	}
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
#include <cstdlib>
using namespace std;
#define SZ 2005
string str;

int main(int argc, const char *argv[]){

    int n, i, j;
    int p = 0;

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

    cin >> str;
    if(n < 3){
        cout << str;
        p = 1;
    }

    std::sort(str.begin(), str.end());

    if(!p){

        if(n % 2 ){
            for(i = n - 1; i >= 0; i--){
                cout<< str[i];
            }
        }else{

            for(i = n - 1, j = 0; i > j; i--, j++){
                cout << str[i] << str[j];
            }
        }

    }

    putchar('\n');

}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
#include <cstdlib>
using namespace std;
#define SZ 2005
char str[SZ];

int main(int argc, const char *argv[]){

    int i, j, n;

    scanf("%d", &n);
    getchar();
    scanf("%s", str);

    for(i = n - 2; i >= 0; i -= 2){
        putchar(str[i]);
    }

    for(i = n % 2 ? 0 : 1; i < n; i += 2){
       putchar(str[i]);
    }

    putchar('\n');

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
#include <cstdlib>
using namespace std;
#define SZ 2005
char str[SZ];

int main(){

    int n, i, midle, n2, n3, tmp, k, j;
    char st[SZ];
    char s[SZ];

    scanf("%d", &n);
    getchar();
    scanf("%s", str);

    n2 = n;
    n3 = n;
    k = 0;
    if(n % 2){
        midle = n / 2;
    }else{
        midle = n / 2;
        midle--;
    }

    i = midle;
    j = midle;
    k = 0;
    st[k++] = str[midle];
    n2--;

    //printf("%d%d\n", n2, n3);

    while(n2){

        if(n2 % 2){
            j++;
            st[k++] = str[j];
        }else{
            i--;
            st[k++] = str[i];
        }
        n2--;
    }

    st[k] = '\0';
    //puts(st);
    n3--;
    i = midle;
    j = midle;
    k = 0;
    s[k++] = st[midle];

    while(n3){

        if(n3 % 2){
            j++;
            s[k++] = st[j];
        }else{
            i--;
            s[k++] = st[i];
        }
        n3--;
    }

    s[k] = '\0';

    puts(s);

    return 0;

}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
#include <cstdlib>
using namespace std;
#define SZ 2005
char str[SZ];

int main(){

    int n, i, midle, n2, n3, tmp, k, j;
    char st[SZ];
    char s[SZ];

    scanf("%d", &n);
    getchar();
    scanf("%s", str);

    n2 = n;
    n3 = n;
    k = 0;
    if(n % 2){
        midle = n / 2;
    }else{
        midle = n / 2;
        midle--;
    }

    i = midle;
    j = midle;
    k = 0;
    st[k++] = str[midle];
    n2--;

    //printf("%d%d\n", n2, n3);

    while(n2){

        if(n2 % 2){
            j++;
            st[k++] = str[j];
        }else{
            i--;
            st[k++] = str[i];
        }
        n2--;
    }

    st[k] = '\0';
    if(n == 3)puts(st);
    n3--;
    i = midle;
    j = midle;
    k = 0;
    s[k++] = st[midle];
    if(n != 3)
    while(n3){

        if(n3 % 2){
            j++;
            s[k++] = st[j];
        }else{
            i--;
            s[k++] = st[i];
        }
        n3--;
    }

    s[k] = '\0';

    if(n != 3)puts(s);

    return 0;

}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
#include <cstdlib>
using namespace std;
#define SZ 2005
char str[SZ];

int main(){

    int n, i, midle, n2, n3, tmp, k, j;
    char st[SZ];
    char s[SZ];

    scanf("%d", &n);
    getchar();
    scanf("%s", str);

    n2 = n;
    n3 = n;
    k = 0;
    if(n % 2){
        midle = n / 2;
    }else{
        midle = n / 2;
        midle--;
    }

    i = midle;
    j = midle;
    k = 0;
    st[k++] = str[midle];
    n2--;

    //printf("%d%d\n", n2, n3);

    while(n2){

        if(n2 % 2){
            j++;
            st[k++] = str[j];
        }else{
            i--;
            st[k++] = str[i];
        }
        n2--;
    }

    st[k] = '\0';
    puts(st);
    n3--;
    i = midle;
    j = midle;
    k = 0;
    s[k++] = st[midle];
    if(n != 3)
    while(n3){

        if(n3 % 2){
            j++;
            s[k++] = st[j];
        }else{
            i--;
            s[k++] = st[i];
        }
        n3--;
    }

    s[k] = '\0';

    if(n != 3)puts(s);

    return 0;

}


#include <iostream>
#include <string>
using namespace std;
int main ()
{
	int n,j,k,i,l=0;
	string s,a;
	cin>>n;
	cin>>s;
	a=s;
	if ((n%2)!=0)
	{
		j=n/2-1;k=n/2+1;
		l=n/2;
		a[l]=s[0];
		for (i=1;i<n;i++)
		{
			if (i%2!=0)
			{
				a[j--]=s[i];
			}
			else
			{
				a[k++]=s[i];
			}
		}
	}
	else
	{
		k=n/2-1;j=n/2;
		for (i=0;i<n;i++)
		{
			if (i%2==0)
			{
				a[k--]=s[i];
			}
			else
			{
				a[j++]=s[i];
			}
		}
	}
	cout<<a<<endl;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{

    int t;
    cin>>t;
    while(t>0)
    {long a,b,k,ans;
    cin>>a>>b>>k;
    ans=0;
    for(int i=1;i<=k;i++)
        {
            if(i%2==1)
            ans=ans+a;
            else
            ans=ans-b;

        }
      cout<<ans<<"\n";
        t--;
    }
}


#include <iostream>

using namespace std;

int main()
{
	int t;
	cin >> t;
	for (int i = 0; i < t; ++i)
	{
		int a, b, k;
		cin >> a >> b >> k;
		cout << (a - b) * (k / 2) + a * (k & 1) << endl;
	}

	return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int t;
	cin >> t;
	for (int i = 0; i < t; ++i)
	{
		int a, b, k;
		cin >> a >> b >> k;
		cout << (a - b) * 1ll * (k / 2) + a * (k & 1) << endl;
	}

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;

int main()
{
	int t;
	cin >> t;
	vector<int> a(t);
	vector<int> b(t);
	vector<int> x(t);
	for (int i = 0; i < t; ++i)
	{
		cin >> a[i] >> b[i] >> x[i];
	}
	for (int i = 0; i < t; ++i)
	{
		long long ans = 0;
		if (x[i] % 2 == 0)
		{
			ans += (x[i]) / 2 * a[i];
			ans -= (x[i] / 2) * b[i];
		}
		else
		{
			ans += (x[i] + 1) / 2 * a[i];
			ans -= (x[i] / 2) * b[i];
		}
		cout << ans << endl;
	}
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;

int main()
{
	long long t;
	cin >> t;
	vector<long long> a(t);
	vector<long long> b(t);
	vector<long long> x(t);
	for (long long i = 0; i < t; ++i)
	{
		cin >> a[i] >> b[i] >> x[i];
	}
	for (long long i = 0; i < t; ++i)
	{
		long long ans = 0;
		if (x[i] % 2 == 0)
		{
			ans += (x[i]) / 2 * a[i];
			ans -= (x[i] / 2) * b[i];
		}
		else
		{
			ans += (x[i] + 1) / 2 * a[i];
			ans -= (x[i] / 2) * b[i];
		}
		cout << ans << endl;
	}
}


#include<iostream>
int main()
{
	long long int t, dist=0;
	std::cin>>t;
	long long int a[1000][3];
	for(long long int i=0; i<t; i++)
		for(long long int j=0;j<3;j++)
			std::cin>>a[i][j];
	for(long long int i=0;i<t;i++)
	{	if(a[i][2]%2==0)
			dist = (a[i][0]-a[i][1])*a[i][2]/2;
		else
			dist = ((a[i][0]-a[i][1])*(a[i][2]/2))+a[i][0];
		std::cout<<dist<<'\n';	}
	return 0;
}


#include <iostream>
using namespace std;
#define lint long long int
int main(){
  lint n;
  lint a,b,c;
  cin>>n;
  for(lint i=0;i<n;i++){
    cin>>a>>b>>c;
    lint x=a-b;
    x*=c/2;
    x+=c%2*a;
    cout<<x<<endl;
  }
  return 0;
}


#include <iostream>
using namespace std;
#define lint long long int
int main(){
  lint n;
  lint a,b,c;
  cin>>n;
  for(lint i=0;i<n;i++){
    cin>>a>>b>>c;
    lint x=a-b;
    x*=c/2;
    x+=c%2*a;
    cout<<x;
  }

  return 0;
}


#include<iostream>
using namespace std;
int main()
{
	 int t;
	 long int a,b,k;
	cin>>t;
	for(int i=0;i<t;i++){
		cin>>a>>b>>k;
		long long  int x=0;
		while(k!=0){
		x=(x+a);
		k--;
		if(k!=0){
		x=(x-b);
		k--;
}
}
		cout<<x<<endl;

	}
}


#include<iostream>
using namespace std;
int main()
{
	 int t;
	unsigned long long int a,b,k;
	cin>>t;
	for(int i=0;i<t;i++){
		cin>>a>>b>>k;
		unsigned long long  int x=0;
		while(k!=0){
		x=(x+a);
		k--;
		if(k!=0){
		x=(x-b);
		k--;
}
}
		cout<<x<<endl;

	}
}


#include<iostream>
using namespace std;
int main()
{
	 long long int t,a,b,k;
	cin>>t;
	for(int i=0;i<t;i++){
		cin>>a>>b>>k;
		long long int x=0;
		while(k!=0){
		x=(x+a);
		k--;
		if(k!=0){
		x=(x-b);
		k--;
}
}
		cout<<x<<endl;

	}
}


#include<iostream>
using namespace std;
int main()
{
	int t,a,b,k;
	cin>>t;
	for(int i=0;i<t;i++){
		cin>>a>>b>>k;
		int x=0;
		while(k!=0){
		x=(x+a);
		k--;
		if(k!=0){
		x=(x-b);
		k--;
}
}
		cout<<x<<endl;

	}
}


#include<iostream>
using namespace std;
int main()
{
	 int t;
	unsigned long long int a,b,k;
	cin>>t;
	for(int i=0;i<t;i++){
		cin>>a>>b>>k;
		signed long long  int x=0;
		while(k!=0){
		x=(x+a);
		k--;
		if(k!=0){
		x=(x-b);
		k--;
}
}
		cout<<x<<endl;

	}
}


#include<iostream>
using namespace std;
int main()
{
	 int t;
	 long int a,b,k;
	cin>>t;
	for(int i=0;i<t;i++){
		cin>>a>>b>>k;
		long  int x=0;
		while(k!=0){
		x=(x+a);
		k--;
		if(k!=0){
		x=(x-b);
		k--;
}
}
		cout<<x<<endl;

	}
}


#include<iostream>
using namespace std;
int main()
{
	 int t;
	unsigned long long int a,b,k;
	cin>>t;
	for(int i=0;i<t;i++){
		cin>>a>>b>>k;
		signed long long int x=0;
		if(k%2==0)
		x=((a-b)*(k/2));
		else
		x=((a-b)*(k/2)+a);
		cout<<x<<endl;

}
}


#include <iostream>
using namespace std;

int main()
{
	int Size;
	cin >> Size;
	long long int **Jumps = new long long int *[Size];
	for (int i = 0; i < Size; i++)
	{
		Jumps[i] = new long long int[3];
	}
	for (int i = 0; i < Size; i++)
	{
		cin >> Jumps[i][0];
		cin >> Jumps[i][1];
		cin >> Jumps[i][2];
	}
	for (int i = 0; i < Size; i++)
	{
		int Counter = 0;
		if (Jumps[i][2] % 2 == 0)
		{
			cout <<( long long int) (Jumps[i][0] - Jumps[i][1])*(Jumps[i][2] / 2)<<endl;
		}
		else
		{
			cout << ( long long int)((Jumps[i][0] - Jumps[i][1])*(Jumps[i][2] / 2)) + Jumps[i][0] << endl;
		}

	}
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int Size;
	cin >> Size;
	 int **Jumps = new  int *[Size];
	for (int i = 0; i < Size; i++)
	{
		Jumps[i] = new  int [3];
	}
	for (int i = 0; i < Size; i++)
	{
		cin >> Jumps[i][0];
		cin >> Jumps[i][1];
		cin >> Jumps[i][2];
	}
	for (int i = 0; i < Size; i++)
	{
		int Counter = 0;
		if (Jumps[i][2] % 2 == 0)
		{
			cout <<( long long int) (Jumps[i][0] - Jumps[i][1])*(Jumps[i][2] / 2)<<endl;
		}
		else
		{
			cout << ( long long int)((Jumps[i][0] - Jumps[i][1])*(Jumps[i][2] / 2)) + Jumps[i][0] << endl;
		}

	}
	return 0;
}


#include<iostream>
using namespace std;
long long ans;
int main() {
int n;
cin >> n;
long long a,b,c;
for(int i=0;i<n;i++){
cin >>a>>b>>c;
for(int j=1;j<=c;j++){
if(j%2==1){
ans=ans+a;
}
else{
ans=ans-b;
}
}
cout <<ans<<endl;
ans=0;
}
return 0;
}


#include<iostream>
using namespace std;
long ans;
int main() {
int n;
cin >> n;
long long a,b,c;
for(int i=0;i<n;i++){
cin >>a>>b>>c;
for(int j=1;j<=c;j++){
if(j%2==1){
ans=ans+a;
}
else{
ans=ans-b;
}
}
cout <<ans<<endl;
ans=0;
}
return 0;
}


#include<iostream>
using namespace std;
long long ans;
int main() {
int n;
cin >> n;
long long a,b,c,d;
for(int i=0;i<n;i++){
cin >>a>>b>>c;
d=c;
c=c/2;
if(d%2==1){
a=a*(c+1);
}
else{
a=a*c;
}
b=b*c;
ans=a-b;
cout <<ans<<endl;
ans=0;
}
return 0;
}


#include <iostream>

using namespace std;

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif

	int t;
	cin >> t;
	for (int i = 0; i < t; ++i) {
		int a, b, k;
		cin >> a >> b >> k;
		cout << (a - b) * 1ll * (k / 2) + a * (k & 1) << endl;
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif

	int t;
	cin >> t;
	for (int i = 0; i < t; ++i) {
		int a, b, k;
		cin >> a >> b >> k;
		cout << (a - b) * 1ll * (k / 2) + a * (k & 1) << endl;
	}

	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
	int  t, i, *a, *b, *k, r = 0;
	scanf ("%d", &t);
	a = (int*) malloc (t * sizeof(int));
	b = (int*) malloc (t * sizeof(int));
	k = (int*) malloc (t * sizeof(int));
	for (i = 0; i < t; i++)
		scanf ("%d%d%d", &a[i], &b[i], &k[i]);
	for (i = 0; i < t; i++) {
		while (k[i] > 0) {
			if (k[i] % 2 == 1)
				r += a[i];
			else r -= b[i];
			k[i]--;
		}
	}
	printf ("%d\n", r);
	free(a);
	free(b);
	free(k);
	return 0;
}


#include <iostream>
using namespace std;

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

long long n, a, b, k;

int main(){
#ifndef ONLINE_JUDGE
   freopen("input.txt", "rt", stdin);
   freopen("output.txt", "wt", stdout);
#endif
   cin >> n;
   F(i,n) cin >> a >> b >> k, cout << k/2*(a-b)+k%2*a << endl;
}


#include <iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		long long a, b, k,s;
		cin >> a >> b >> k;
		if (k % 2 == 0)
		{
			s = (a - b)*(k / 2);
		}
		else
		{
			s = (a - b)*(int)(k / 2) + a;
		}
		cout << s << endl;
		s = 0;
	}
	return 0;
}


#include <iostream>
using namespace std;
long s=0;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		long a, b, k;
		cin >> a >> b >> k;
		if (k % 2 == 0)
		{
			s += (a - b)*(k / 2);
		}
		else
		{
			s += (a - b)*(k / 2) + a;
		}
		cout << s << endl;
		s = 0;
	}
	return 0;
}


#include <iostream>
using namespace std;
int s=0;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int a, b, k;
		cin >> a >> b >> k;
		if (k % 2 == 0)
		{
			s += (a - b)*(k / 2);
		}
		else
		{
			s += (a - b)*(k / 2) + a;
		}
		cout << s << endl;
		s = 0;
	}
	return 0;
}


#include <iostream>
using namespace std;
int s=0;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int a, b, k;
		cin >> a >> b >> k;
		if (a == b)
		{
			if (k % 2 == 0)
				cout << 0 << endl;
			else
				cout << a << endl;
			continue;
		}
		for (int i = 0; i < k; i++)
		{
			if (i % 2 == 0)
				s += a;
			else
				s -= b;
		}
		cout << s << endl;
		s = 0;
	}
	return 0;
}


#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    long long int t, a,b,k;
    cin>>t;
    while((t--)>0)
    {
        cin>>a>>b>>k;
        std::cout<<std::fixed<<long long int((long long int)a*ceil(((double)k/2))-b*(k/2));
        cout<<endl;
    }
    return 0;
}


#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    long long int t, a,b,k;
    cin>>t;
    while((t--)>0)
    {
        cin>>a>>b>>k;
        std::cout<<std::fixed<<long long int((long long int)a*ceil(((double)k/2))-b*(k/2));
        //cout<<" "<;
        cout<<endl;
    }
    return 0;
}


#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    long long int t, a,b,k;
    cin>>t;
    while((t--)>0)
    {
        cin>>a>>b>>k;
        if(k%2==0)
            cout<<(a*(k/2))-(b*(k/2));
        else
            cout<<(a*((k/2)+1)-b*(k/2));
        cout<<endl;
    }
    return 0;
}


#include<iostream>
#include<algorithm>
#include <vector>
#include <string>
using namespace std;

int main()
{
	int n;
	long long a, b, k;
	long long c = 0;
	cin >> n;
	long long arr[1001];
	for (int i = 0; i < n; i++)
	{
		cin >> a >> b >> k;
		if (k % 2 == 1)
		{
			arr[i] = a + (a - b) * (k / 2);
		}
		else
		{
			arr[i] = (a - b) * (k / 2);
		}
	}
	for (int i = 0; i < n; i++)
	{
		cout << arr[i] << endl;
	}

	return 0;
}


#include<vector>
#include<iostream>
using namespace std;
#define sp << " "
#define sps << " " <<
#define lnl << endl <<
#define ln << endl
#define vi vector<int>
#define vc vector<char>
#define vll vector<ll>
#define pb push_back
#define pop pop_back
#define forin for(int i = 0; i < n; ++i)
#define forim for(int i = 0; i < m; ++i)
#define forik for(int i = 0; i < k; ++i)
#define pii pair<int, int>
#define piii pair<pii, int>
typedef long long ll;
typedef double llf;
//FUNCTIONS
ll nod(ll a, ll b) { while (a != 0 && b != 0)if (a > b)a %= b; else b %= a; return a + b; }//НОД двух чисел
ll nok(ll a, ll b) { return (a * b) / nod(a, b); }//НОК двух чисел
void reverse(string &a, int l, int r) { for (int i = l; i <= (l + r) / 2; ++i)swap(a[i], a[r - i + l]); }//переворот отрезка массива
int irand(int a, int b) { return rand() % (b - a + 1) + a; }//генерация рандомного числа на отрезкe a...b
int fib(int n) { if (n < 3) return 1; return fib(n - 1) + fib(n - 2); }//n-ное число Фиббоначи
ll binpow(ll a, ll n) { if (n == 0)return 1; if (n % 2 == 1)return binpow(a, n - 1)*a; else return binpow(a*a, n / 2); }//быстрая степень
bool isprime(ll a) { for (int i = 2; i*i <= a; ++i)if (a%i == 0)return false; return true; }//проверка на простое число
#include <algorithm>
#include <cstdio>
#include <cstdlib>
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		int a,b,k;
		cin>>a>>b>>k;
		cout<<a*(k/2+k%2)-b*(k/2) ln;
	}
}


#include<string>
#include<cstring>
#include<vector>
#include<iostream>
using namespace std;
#define sp << " "
#define sps << " " <<
#define lnl << endl <<
#define ln << endl
#define vi vector<int>
#define vc vector<char>
#define vll vector<ll>
#define pb push_back
#define pop pop_back
#define forin for(int i = 0; i < n; ++i)
#define forim for(int i = 0; i < m; ++i)
#define forik for(int i = 0; i < k; ++i)
#define pii pair<int, int>
#define piii pair<pii, int>
typedef long long ll;
typedef double llf;
//FUNCTIONS
ll nod(ll a, ll b) { while (a != 0 && b != 0)if (a > b)a %= b; else b %= a; return a + b; }//НОД двух чисел
ll nok(ll a, ll b) { return (a * b) / nod(a, b); }//НОК двух чисел
void reverse(string &a, int l, int r) { for (int i = l; i <= (l + r) / 2; ++i)swap(a[i], a[r - i + l]); }//переворот отрезка массива
int irand(int a, int b) { return rand() % (b - a + 1) + a; }//генерация рандомного числа на отрезкe a...b
int fib(int n) { if (n < 3) return 1; return fib(n - 1) + fib(n - 2); }//n-ное число Фиббоначи
ll binpow(ll a, ll n) { if (n == 0)return 1; if (n % 2 == 1)return binpow(a, n - 1)*a; else return binpow(a*a, n / 2); }//быстрая степень
bool isprime(ll a) { for (int i = 2; i*i <= a; ++i)if (a%i == 0)return false; return true; }//проверка на простое число
#include <algorithm>
#include <cstdio>
#include <cstdlib>
int main()
{
	ll n;
	cin>>n;
	for(ll i=0;i<n;i++)
	{
		ll a,b,k;
		cin>>a>>b>>k;
		cout<<a*(k/2+k%2)-b*(k/2) ln;
	}
}


#include <stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;

int main()
{ long long int  a,sum,b,a1,b1,c,d,e,n,t,w,i,j;
  scanf("%lld",&n);
  for(w=0;w<n;w++){
    sum=0;

    scanf("%lld %lld %lld",&a,&b,&c);
    if((a-b)==0){
        if(c%2==0){
            sum=0;
        }
        else{
            sum=a;
        }
    }
    else{
        t=c%2;
        w=c/2;
        i=a-b;
        while(w){
                if(w%2)
                sum=sum+i;
                i=i+i;
                w=w/2;
        }
        if(t==1){
            sum=sum+a;
        }
    }
     printf("%lld\n",sum);
  }

    return 0;
}


#include <stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;

int main()
{ long long int  a,sum,b,a1,b1,c,d,e,n,t,w,i,j;
  scanf("%lld",&n);
  for(w=0;w<n;w++){
    sum=0;
    t=1;
    scanf("%lld %lld %lld",&a,&b,&c);
    if((a-b)==0){
        if(c%2==0){
            sum=0;
        }
        else{
            sum=a;
        }
    }
    else{
        while(c--){
            if(t%2==1){
            sum=sum+a;}
            else{
                sum=sum-b;
            }

               t++;
        }
    }
     printf("%lld\n",sum);
  }

    return 0;
}


#include <stdio.h>
int main()
{
    long long n,i,a,b,c,sum;
    scanf("%lld",n);
    for(i=1;i<=n;i++)
    {
        sum=0;
        scanf("%lld%lld%lld",&a,&b,&c);
        for(i=1;i<=c/2;i++)
                sum+=a-b;
        if(c%2)
            sum+=a;
        printf("%lld\n",sum);
    }
    return 0;
}


#include<cstdio>
int main()
{
    long sum,i,j,n,k,a,b,c;
    scanf("%ld",&n);
    for(i=0;i<n;i++)
    {
        sum=0;
        scanf("%ld%ld%ld",&a,&b,&c);
        if(a==b)
        {
            if(c%2==0)
                printf("0\n");
            else printf("1\n");
        }
        else{
            k=c/2;
            for(j=0;j<k;j++)
                sum+=a-b;
            if(c%2!=0)
                sum+=a;
            printf("%ld\n",sum);
        }
    }
    return 0;
}


#include<stdio.h>
long long f(long long a,long long b)
{
    long long ans=0;
    while(b)
    {
        if(b%2)
            ans=ans+a;
        a=a*2;
        b/=2;
    }
    return ans;
}

int main()
{
    long long t,a,b,k,i,j,sum;
    scanf("%lld",&t);
    for(i=1; i<=t; i++)
    {
        sum=0;
        scanf("%lld%lld%lld",&a,&b,&k);
        if(a!=b)
            sum=f(a-b,k/2);
        if(k%2)
            sum+=a;
        printf("%lld\n",sum);
    }
    return 0;
}


#include <stdio.h>
int main()
{
    long int n,i,h,a[2],k,sum;
   // while(scanf("%ld",&n)!=EOF)
   scanf("%ld",&n);
   for(i=1;i<=n;i++)
    {
        sum=0;
     scanf("%ld%ld%ld",a,a+1,&k);
        for(h=0;h<k;h++)
        {
            if(h==0)
                sum=a[0];
            else
            {
                if(h%2!=0)
                sum-=a[h%2];
                if(h%2==0)
                sum+=a[h%2];
            }
        }
       printf("%ld\n",sum);

    }

    return 0;
}


#include<cstdio>
int main()
{
    long sum,i,n,k,a,b,c;
    scanf("%ld",&n);
    for(i=0;i<n;i++)
    {
        sum=0;
        scanf("%ld%ld%ld",&a,&b,&c);
        if(a==b)
        {
            if(c%2==0)
                printf("%ld\n",sum);
            else printf("%ld\n",a);
        }
        else{
            k=c/2;
            sum=(a-b)*k;
            if(c%2==1)
                sum+=a;
            if(i!=n-1)
                printf("%ld\n",sum);
            else printf("%ld",sum);
        }
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    int n,i,a,b,c,sum;
    scanf("%d",n);
    for(i=1;i<=n;i++)
    {
        sum=0;
        scanf("%d%d%d",&a,&b,&c);
        for(i=1;i<=c/2;i++)
                sum+=a-b;
        if(c%2)
            sum+=a;
        printf("%d\n",sum);
    }
    return 0;
}


#include<stdio.h>
int main()
{
	long long int n,i,a,b,k,j,p;
	scanf("%lld",&n);
	getchar();
	for(i=0;i<n;i++)
	{
		p=0;
		scanf("%lld %lld %lld",&a,&b,&k);
		for(j=1;j<=k;j++)
		{
			if(j%2!=0)
				p+=a;
			if(j%2==0)
				p-=b;
		}
		printf("%lld\n",p);
	}
	return 0;
}


#include<stdio.h>
int main()
{
    int t,i;
    long int a,b,k,m;
    scanf("%d",&t);
    for(i=1;i<=t;i++)
    {

        m=0;
        scanf("%ld%ld%ld",&a,&b,&k);
        if(a==b)
        {
            if(k%2)
                printf("%ld\n",a);
            else
                printf("0\n");
            continue;
        }
        if(k%2==1)
            m=a;
        m+=(k/2)*(a-b);
        printf("%ld\n",m);

    }
    return 0;
}


#include<stdio.h>
int main()
{
    int t,i;
    long int a,b,k,m;
    scanf("%d",&t);
    for(i=1;i<=t;i++)
    {
        m=0;
        scanf("%ld%ld%ld",&a,&b,&k);
        if(k%2==1)
            m=a;
        m+=(k/2)*(a-b);
        printf("%ld\n",m);

    }
    return 0;
}


#include<stdio.h>
int main()
{
    long long t,a,b,k,i,j,sum;
    scanf("%d",&t);
    for(i=1; i<=t; i++)
    {
        sum=0;
        scanf("%lld%lld%lld",&a,&b,&k);
        if(a!=b)
            for(j=1; j<=k/2; j++)
                sum+=a-b;
        if(k%2)
            sum+=a;
        printf("%lld\n",sum);
    }
    return 0;
}


#include <stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;

int main()
{ long long int  a,sum,b,a1,b1,c,d,e,n,t,w,i,j,w1;
  scanf("%lld",&n);
  for(w1=0;w1<n;w1++){
    sum=0;

    scanf("%lld %lld %lld",&a,&b,&c);
    if((a-b)==0){
        if(c%2==0){
            sum=0;
        }
        else{
            sum=a;
        }
    }
    else{
        t=c%2;
        w=c/2;
        i=a-b;
        while(w){
                if(w%2)
                sum=sum+i;
                i=i+i;
                w=w/2;
        }
        if(t==1){
            sum=sum+a;
        }
    }
     printf("%lld\n",sum);
  }

    return 0;
}


#include <iostream>
using namespace std;

int main()
{
	double fn[1000]={0};
	unsigned int t,a,b,k;
	cin>>t;
	for(int i=0;i<t;i++)
	{
		cin>>a>>b>>k;
		if(k%2!=0)
		{
			fn[i]+=a*(k/2+1);
			fn[i]-=b*(k/2);

		}
		else
		{
			fn[i]+=a*(k/2);
			fn[i]-=b*(k/2);
		}
	}
	for(int i=0;i<t;i++)
	{
		printf("%.0f",fn[i]);
	}
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	double fn[1000]={0};
	double t,a,b;
	int k;
	cin>>t;
	for(int i=0;i<t;i++)
	{
		cin>>a>>b>>k;
		if(k%2!=0)
		{
			fn[i]+=a*(k/2+1);
			fn[i]-=b*(k/2);

		}
		else
		{
			fn[i]+=a*(k/2);
			fn[i]-=b*(k/2);
		}
	}
	for(int i=0;i<t;i++)
	{
		cout<<fn[i]<<endl;
	}
	return 0;
}


#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
	long long fn[1000]={0};
	unsigned int t,a,b,k;
	cin>>t;
	for(int i=0;i<t;i++)
	{
		cin>>a>>b>>k;
		if(k%2!=0)
		{
			fn[i]+=a*(k/2+1);
			fn[i]-=b*(k/2);

		}
		else
		{
			fn[i]+=a*(k/2);
			fn[i]-=b*(k/2);
		}
	}
	for(int i=0;i<t;i++)
	{
		cout<<fn[i]<<endl;
	}
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	long long fn[1000]={0};
	long long t,a,b,k;
	cin>>t;
	for(int i=0;i<t;i++)
	{
		cin>>a>>b>>k;
		if(k%2!=0)
		{
			fn[i]+=a*(k/2+1);
			fn[i]-=b*(k/2);

		}
		else
		{
			fn[i]+=a*(k/2);
			fn[i]-=b*(k/2);
		}
	}
	for(int i=0;i<t;i++)
		cout<<fn[i]<<endl;
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	long double fn[1000]={0};
	unsigned int t,a,b,k;
	cin>>t;
	for(int i=0;i<t;i++)
	{
		cin>>a>>b>>k;
		if(k%2!=0)
		{
			fn[i]+=a*(k/2+1);
			fn[i]-=b*(k/2);

		}
		else
		{
			fn[i]+=a*(k/2);
			fn[i]-=b*(k/2);
		}
	}
	cout.setf(ios::fixed);
	cout.setf(ios::showpoint);
	cout.precision(0);
	for(int i=0;i<t;i++)
	{
		cout<<fn[i]<<endl;
	}
	return 0;
}


#include<cstdio>
long long f(int a,int b)
{
    long long ans=0;
    while(b)
    {
        if(b%2)
            ans+=a;
        a+=a;
        b/=2;
    }
    return ans;
}
int main()
{
    int n,a,b,k;
    scanf("%d",&n);
    while(n--)
    {
        long long sum=0;
        scanf("%d%d%d",&a,&b,&k);
        sum=f(a-b,k/2);
        if(k%2)
            sum+=a;
        printf("%lld\n",sum);
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    long long n,i,a,b,c,sum;
    scanf("%lld",n);
    for(i=1;i<=n;i++)
    {
        sum=0;
        scanf("%lld%lld%lld",&a,&b,&c);
        for(i=1;i<=c/2;i++)
                sum+=a-b;
        if(c%2)
            sum+=a;
        printf("%lld\n",sum);
    }
    return 0;
}


#include <stdio.h>
int main()
{
    long long n,i,a,b,c;
    scanf("%lld",n);
    for(i=1;i<=n;i++)
    {
        scanf("%lld%lld%lld",&a,&b,&c);
        if(c%2)
        {
            printf("%lld\n",(a-b)*(c/2)+a);
        }
        else
        {
            printf("%lld\n",(a-b)*(c/2));
        }
    }
    return 0;
}


#include<stdio.h>
int main()
{

  long int n,i,x,y,z,sum,j;
  scanf("%ld",&n);
  for(i=0;i<n;i++)
  {

      scanf("%ld %ld %ld",&x,&y,&z);
      sum=x;
      for(j=1;;)
      {
          sum-=y;
          j++;
          if(j==z)
            break;
            sum+=x;
            j++;
            if(j==z)
                break;
      }
      printf("%ld\n",sum);
  }
    return 0;
}


      #include<stdio.h>
int main()
{

  long int x,y,z,sum;
  int i,n,j;
  scanf("%d",&n);
  for(i=0;i<n;i++)
  {

      scanf("%ld %ld %ld",&x,&y,&z);
      sum=x;
      for(j=1;;)
      {
          if(j==z)
            break;
          sum-=y;
          j++;
          if(j==z)
            break;
            sum+=x;
            j++;
            if(j==z)
                break;
      }
printf("%ld\n",sum);
  }

    return 0;
}


#include <stdio.h>
int main()
{
    long long int n,i,h,a[2]={0},k,sum;
   scanf("%lld",&n);
   for(i=1;i<=n;i++)
    {
        sum=0;
     scanf("%lld%lld%lld",a,a+1,&k);
     if(a[0]==a[1])
     {
         if(k%2==0)
            printf("0\n");
         else
            printf("%lld\n",a[0]);
     }
     else
     {
        for(h=0;h<k;h++)
        {
            if(h==0)
                sum=a[0];
            else
            {
                if(h%2!=0)
                sum-=a[h%2];
                if(h%2==0)
                sum+=a[h%2];
            }
        }
       printf("%lld\n",sum);

     }
    }

    return 0;
}


#include<stdio.h>
int main()
{
    int t;
    long a,b,k,i,j,sum;
    scanf("%d",&t);
    for(i=1; i<=t; i++)
    {
        sum=0;
        scanf("%ld%ld%ld",&a,&b,&k);
        if(a!=b)
            for(j=1; j<=k/2; j++)
            {
                sum+=a-b;
            }
        if(k%2)
            sum+=a;
        printf("%ld\n",sum);
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    long long int n,i,a,b,c,sum;
    scanf("%lld",n);
    for(i=1;i<=n;i++)
    {
        sum=0;
        scanf("%lld%lld%lld",&a,&b,&c);
        for(i=1;i<=c/2;i++)
                sum+=a-b;
        if(c%2)
            sum+=a;
        printf("%lld\n",sum);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    long long b,i,m,n,p,a;
	scanf("%lld",&b);
	for(i=1;i<=b;i++)
	{
	     scanf("%lld %lld %lld",&m,&n,&p);
		 if(p%2==0)
		  a=(m-n)*(p/2);
		 else
		  a=(m-n)*(p/2)+m;
		 printf("%lld\n",a);
	}
	return 0;
}


#include<stdio.h>
int main()
{
   long long i,j,a,b,k,n,sum,c;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%lld %lld %lld",&a,&b,&k);
        c=a-b;
        sum=0;
        if(k%2==0)
            sum=(k/2)*c;
        else
         sum=(k/2)*c+a;
        printf("%lld\n",sum);
    }
}


#include<cstdio>
int main()
{
    long long sum,i,n,k,a,b,c;
    scanf("%lld",&n);
    for(i=0;i<n;i++)
    {
        sum=0;
        scanf("%lld%lld%lld",&a,&b,&c);
        if(a==b)
        {
            if(c%2==0)
                printf("%lld\n",sum);
            else printf("%lld\n",a);
        }
        else{
            k=c/2;
            sum=(a-b)*k;
            if(c%2==1)
                sum+=a;
            if(i!=n-1)
                printf("%lld\n",sum);
            else printf("%lld",sum);
        }
    }
    return 0;
}


#include <iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    long long int a,b,k;
    int i,t;
    scanf("%d",&t);
    for(i=1;i<=t;i++)
    {
        scanf("%lld %lld %lld",&a,&b,&k);
        long long suma=0,sumb=0,sum;
        int ka,kb;
        ka=k%2?k/2+1:k/2;
        kb=k-ka;
        suma=ka*a;
        sumb=kb*b;
        sum=suma-sumb;
        printf("%lld\n",sum);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    long long int a,b,k,m,t,i;
    scanf("%lld",&t);
    for(i=1;i<=t;i++)
    {

        m=0;
        scanf("%lld%lld%lld",&a,&b,&k);
        if(a==b)
        {
            if(k%2)
                printf("%lld\n",a);
            else
                printf("0\n");
            continue;
        }
        if(k%2==1)
            m=a;
        m+=(k/2)*(a-b);
        printf("%lld\n",m);

    }
    return 0;
}


#include<stdio.h>
int main()
{
    long long int a,b,k,m,t,i;
    scanf("%lld",&t);
    for(i=1;i<=t;i++)
    {

        m=0;
        scanf("%lld%lld%lld",&a,&b,&k);
        if(a==b)
        {
            if(k%2)
                printf("%lld\n",a);
            else
                printf("0\n");
            continue;
        }
        if(k%2==1)
            m=a;
        m+=(k/2)*(a-b);
        printf("%ll\n",m);

    }
    return 0;
}


      #include<stdio.h>
int main()
{

  long int i,x,y,z,sum,j;
  int n;
  scanf("%d",&n);
  for(i=0;i<n;i++)
  {

      scanf("%ld %ld %ld",&x,&y,&z);
      sum=x;
      for(j=1;;)
      {
          sum-=y;
          j++;
          if(j==z)
            break;
            sum+=x;
            j++;
            if(j==z)
                break;
      }
printf("%ld\n",sum);
  }

    return 0;
}


#include<cstdio>
int main()
{
    long sum,i,n,k,a,b,c;
    scanf("%ld",&n);
    for(i=0;i<n;i++)
    {
        sum=0;
        scanf("%ld%ld%ld",&a,&b,&c);
        if(a==b)
        {
            if(c%2==0)
                printf("0\n");
            else printf("%ld",a);
        }
        else{
            k=c/2;
            sum=(a-b)*k;
            if(c%2!=0)
                sum+=a;
            printf("%ld\n",sum);
        }
    }
    return 0;
}


#include <stdio.h>
int main()
{
    long long n,i,a,b,c;
    while(~scanf("%lld",n))
    {
    for(i=1; i<=n; i++)
        {
            scanf("%lld%lld%lld",&a,&b,&c);
            if(c%2)
                printf("%lld\n",(a-b)*(c/2)+a);
            else
                printf("%lld\n",(a-b)*(c/2));
        }
    }
    return 0;
}


#include<cstdio>
int main()
{
    long long  t,a,b,k,sum;
    scanf("%lld",&t);
    while(t--)
    {
        sum=0;
        scanf("%d%d%d",&a,&b,&k);
        sum=a*((k+1)/2)-(b*(k/2));
        printf("%lld\n",sum);
    }
}


#include<stdio.h>
long long f(long long a,long long b)
{
    long long ans=0;
    while(b)
    {
        if(b%2)
            ans=ans+a;
        a=a*2;
        b/=2;
    }
    return ans;
}

int main()
{
    long long t,a,b,k,i,j,sum;
    scanf("%d",&t);
    for(i=1; i<=t; i++)
    {
        sum=0;
        scanf("%lld%lld%lld",&a,&b,&k);
        if(a!=b)
            sum=f(a-b,k/2);
        if(k%2)
            sum+=a;
        printf("%lld\n",sum);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int t;
    long long int k,a,b,x=0,i;
    scanf("%d",&t);
    for(i=1;i<=t;i++)
    {
        scanf("%ld%ld%ld",&a,&b,&k);
        x=(k/2)*(a-b);
        if(k%2)
            x+=a;
        printf("%ld\n",x);
    }
        return 0;
}


#include<stdio.h>
int main()
{
   long long i,j,a,b,k,n,sum;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%lld %lld %lld",&a,&b,&k);
        sum=0;
        for(j=1;j<=k;j++)
        {
            if(j%2==0)
                sum-=b;
            else if(j%2!=0)
                sum+=a;
        }
        printf("%lld",sum);
    }
}


#include<cstdio>
int main()
{
    int t,a,b,k,sum;
    scanf("%d",&t);
    while(t--)
    {
        sum=0;
        scanf("%d%d%d",&a,&b,&k);
        sum=a*((k+1)/2)-(b*(k/2));
        printf("%d\n",sum);
    }
}


#include<cstdio>
int main()
{
    long long n,a,b,k,i,x;
    scanf("%lld",&n);
    for(i=0;i<n;i++)
    {
        x=0;
        scanf("%lld%lld%lld",&a,&b,&k);
        if(a==b)
        {
            if(k%2==0)
                printf("0\n");
            if(k%2!=0)
                printf("%lld\n",a);
            continue;
        }
        if(k%2==0)
            x+=(k/2)*(a-b);
        if(k%2==1)
            x+=(k/2)*(a-b)+a;
        printf("%lld\n",x);
    }
}


#include <stdio.h>
int main()
{
    int n,x,y,z,sum;
    scanf("%d%*c",&n);
    while(n--)
    {
        sum=0;
        scanf("%d%d%d%*c",&x,&y,&z);
        if(z%2==0)
        {
            z/=2;
            while(z--)
            {
                sum+=(x-y);
            }
            printf("%d\n",sum);

        }
        else
        {
            z--,z/=2;
            while(z--)
            {
                sum+=(x-y);
            }
             printf("%d\n",sum+x);
        }
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int t,i;
    int a,b,k,m;
    scanf("%d",&t);
    for(i=1;i<=t;i++)
    {

        m=0;
        scanf("%d%d%d",&a,&b,&k);
        if(a==b)
        {
            if(k%2)
                printf("%d\n",a);
            else
                printf("0\n");
            continue;
        }
        if(k%2==1)
            m=a;
        m+=(k/2)*(a-b);
        printf("%d\n",m);

    }
    return 0;
}


#include <stdio.h>
int main()
{
    long long n,i,a,b,c;
    scanf("%lld",n);
    for(i=1;i<=n;i++)
    {
        scanf("%lld%lld%lld",&a,&b,&c);
        if(c%2)
            printf("%lld\n",(a-b)*(c/2)+a);
        else
            printf("%lld\n",(a-b)*(c/2));
    }
    return 0;
}


#include <stdio.h>
int main()
{
	long long int n,i,a,b,k,j,p;
	scanf("%lld",&n);
	getchar();
	for(i=0;i<n;i++)
	{
		p=0;
		scanf("%lld %lld %lld",&a,&b,&k);
		if(k%2==0)
            p=a*(k/2)-b*(k/2);
        else
            p=a*(k/2+1)-b*(k/2);
		printf("%lld\n",p);
	}
	return 0;
}


#include <stdio.h>
int main()
{
	long long int n,i,a,b,k,j,p;
	scanf("%lld",&n);
	getchar();
	for(i=0;i<n;i++)
	{
		p=0;
		scanf("%lld %lld %lld",&a,&b,&k);
		for(j=1;j<=k;j++)
		{
			if(j%2!=0)
				p+=a;
			if(j%2==0)
				p-=b;
		}
		printf("%lld\n",p);
	}
	return 0;
}


#include<cstdio>
int main()
{
    int n,a,b,i,k;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%d%d%d",&a,&b,&k);
        long long sum=0;
        for(i=0;i<k/2;i++)
            sum+=a-b;
        if(k%2)
            sum+=a;
        printf("%lld\n",sum);
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <algorithm>

using namespace std;

//bool comp(int &a, int &b)
//{
//	return a > b;
//}

int main()
{

	__int64 n,a1,a2,a3;
	cin >> n;
	vector <tuple<__int64, __int64, __int64>> arr(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a1;
		cin >> a2;
		cin >> a3;
		arr[i] = make_tuple(a1, a2, a3);
	}
	//for (int i = 0; i < n; i++)
	//{
	//	cout << get<0>(arr[i]) << " " << get<1>(arr[i]) << " " << get<2>(arr[i]) << '\n';
	//}
	for (int i = 0; i < n; i++)
	{
		a3=get<2>(arr[i]);
		if (a3 == 1)
		{
			cout << get<0>(arr[i])<<'\n';
		}
		else
		{
			if (a3 % 2 == 1)
			{
				a1 = (get<0>(arr[i]) - get<1>(arr[i]))*(a3 / 2);
				a1++;
				cout << a1 << '\n';
			}
			else
			{
				cout << (get<0>(arr[i]) - get<1>(arr[i]))*(a3 / 2) << '\n';
			}
		}
	}

	//system("pause");
	return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <algorithm>

using namespace std;

//bool comp(int &a, int &b)
//{
//	return a > b;
//}

int main()
{

	__int64 n,a1,a2,a3;
	cin >> n;
	vector <tuple<__int64, __int64, __int64>> arr(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a1;
		cin >> a2;
		cin >> a3;
		arr[i] = make_tuple(a1, a2, a3);
	}
	//for (int i = 0; i < n; i++)
	//{
	//	cout << get<0>(arr[i]) << " " << get<1>(arr[i]) << " " << get<2>(arr[i]) << '\n';
	//}
	for (int i = 0; i < n; i++)
	{
		a3=get<2>(arr[i]);
		if (a3 == 1)
		{
			cout << get<0>(arr[i])<<'\n';
		}
		else
		{
			if (a3 % 2 == 1)
			{
				a1 = (get<0>(arr[i]) - get<1>(arr[i]))*(a3 / 2);
				a1+=get<0>(arr[i]);
				cout << a1 << '\n';
			}
			else
			{
				cout << (get<0>(arr[i]) - get<1>(arr[i]))*(a3 / 2) << '\n';
			}
		}
	}

	//system("pause");
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
const int maxn=100100;
struct node{
    int flag;
    int dis;
    int id;
}line[100100];
int num[100100];
bool cmp(node a,node b){
    if(a.flag!=b.flag)
        return a.flag>b.flag;
    return a.dis<b.dis;
}

struct Edge{
    int from,to;
}e[100100];

int main(){
    int n,m;
    while(scanf("%d%d",&n,&m)!=EOF){
        for(int i=1;i<=m;i++){
            scanf("%d%d",&line[i].dis,&line[i].flag);
            line[i].id=i;
        }
        sort(line+1,line+m+1,cmp);
        int x=m+1;
        int cnt=2;
        for(int i=1;i<=m;i++){
            if(line[i].flag==0){
                x=i;
                break;
            }
            else{
                e[line[i].id].from=1;
                e[line[i].id].to=cnt;
                num[cnt]=line[i].dis;
                cnt++;
            }
        }
        int flag=1;
        int start=2,end1=3,maxv=3;
        for(int i=x;i<=m;i++){
            if(num[end1]>line[i].dis){
                flag=0;
                break;
            }
            else{
                e[line[i].id].from=start;
                e[line[i].id].to=end1;
                if(end1==maxv+1){
                    maxv=end1;
                    start++;
                    end1=start+1;
                }
                else
                    end1++;
            }
        }
        if(flag==0)
            printf("-1\n");
        else
            for(int i=1;i<=m;i++)
                printf("%d %d\n",e[i].from,e[i].to);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 1e5 + 20;
pair<int , int> ans[maxn];
pair< pair<int , int> , int> edge[maxn];
int t, cmp[maxn] , tah , g[maxn];
vector<int> dsu[maxn];
set<pair<int , int> > sizes;
set<int> adj[maxn];
void merg(int x , int y)
{
    t += dsu[x].size() * dsu[y].size();
    if(dsu[x].size() < dsu[y].size())
    {
        while(!dsu[x].empty())
        {
            dsu[y].pb(dsu[x].back());
            g[dsu[x].back()] = y;
            dsu[x].pop_back();
        }
    }
    else
    {
        while(!dsu[y].empty())
        {
            dsu[x].pb(dsu[y].back());
            g[dsu[y].back()] = x;
            dsu[y].pop_back();
        }
    }
}
bool camp(pair<pair<int , int> , int> a , pair<pair<int , int> , int> b)
{
    return (a.first.first == b.first.first && a.first.second > b.first.second) || a.first.first < b.first.first;
}
int main()
{
    int n , m;
    cin >> n >> m;
    for(int i = 0; i < n; i++)
        dsu[i].pb(i) , cmp[i] = i , sizes.insert({1 , i});
    for(int i = 0; i < m; i++)
        scanf("%d%d", &edge[i].first.first, &edge[i].first.second) , edge[i].second = i;
    sort(edge , edge + m , camp);
    cmp[0] = 1;
    for(int i = 0; i < m; i++)
    {
        if(edge[i].first.second == 0 && !t)
        {
            cout << -1;
            return 0;
        }
        else if(!edge[i].first.second && t)
        {
            t--;
            while(adj[tah].size() == dsu[g[tah]].size() - 1 || cmp[tah] == n - 1)
                tah++ , tah %= n;
            int v , u;
            for(int j : dsu[g[tah]])
                if(j != tah && adj[tah].find(j) == adj[tah].end())
                {
                    v = tah;
                    u = j;
                    adj[tah].insert(j);
                    adj[j].insert(tah);
                }
            while(adj[v].find(cmp[v]) != adj[v].end() || cmp[v] == v)
                cmp[v]++;
            while(adj[u].find(cmp[u]) != adj[u].end() || cmp[u] == u)
                cmp[u]++;
            ans[edge[i].second] = {v , u};
        }
        else
        {
            int k = sizes.rbegin()->second;
            sizes.erase(*sizes.rbegin());
            int k1 = sizes.rbegin()->second;
            sizes.erase(*sizes.rbegin());
            int v = dsu[k][0] , u = dsu[k1][0];
            ans[edge[i].second] = {v , u};
            adj[v].insert(u);
            while(adj[v].find(cmp[v]) != adj[v].end() || cmp[v] == v)
                cmp[v]++;
            adj[u].insert(v);
            while(adj[u].find(cmp[u]) != adj[u].end() || cmp[u] == u)
                cmp[u]++;
            if(dsu[k].size() < dsu[k1].size())
                sizes.insert({dsu[k].size() + dsu[k1].size() , k1});
            else
                sizes.insert({dsu[k].size() + dsu[k1].size() , k});
            t--;
            merg(k , k1);
        }
    }
    for(int i = 0; i < m; i++)
        printf("%d %d\n" , ans[i].first + 1 , ans[i].second + 1);
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 1e5 + 20;
pair<int , int> ans[maxn];
pair< pair<int , int> , int> edge[maxn];
int t, tah , g[maxn];
vector<int> dsu[maxn];
set<pair<int , int> > sizes;
set<int> adj[maxn];
void merg(int x , int y)
{
    t += dsu[x].size() * dsu[y].size();
    if(dsu[x].size() < dsu[y].size())
    {
        while(!dsu[x].empty())
        {
            dsu[y].pb(dsu[x].back());
            g[dsu[x].back()] = y;
            dsu[x].pop_back();
        }
    }
    else
    {
        while(!dsu[y].empty())
        {
            dsu[x].pb(dsu[y].back());
            g[dsu[y].back()] = x;
            dsu[y].pop_back();
        }
    }
}
bool camp(pair<pair<int , int> , int> a , pair<pair<int , int> , int> b)
{
    return (a.first.first == b.first.first && a.first.second > b.first.second) || a.first.first < b.first.first;
}
int main()
{
    int n , m;
    cin >> n >> m;
    for(int i = 0; i < n; i++)
        dsu[i].pb(i) , sizes.insert({1 , i}) , g[i] = i;
    for(int i = 0; i < m; i++)
        scanf("%d%d", &edge[i].first.first, &edge[i].first.second) , edge[i].second = i;
    sort(edge , edge + m , camp);
    for(int i = 0; i < m; i++)
    {
        if(edge[i].first.second == 0 && !t)
        {
            cout << -1;
            return 0;
        }
        else if(!edge[i].first.second && t)
        {
            t--;
            tah = 0;
            while(adj[tah].size() == dsu[g[tah]].size() - 1)
                tah++ , tah %= n;
            for(int j : dsu[g[tah]])
                if(j != tah && adj[tah].find(j) == adj[tah].end())
                {
                    adj[tah].insert(j);
                    adj[j].insert(tah);
                    ans[edge[i].second] = {j , tah};
                    break;
                }
        }
        else
        {
            int k = sizes.rbegin()->second;
            sizes.erase(*sizes.rbegin());
            int k1 = sizes.rbegin()->second;
            sizes.erase(*sizes.rbegin());
            int v = dsu[k][0] , u = dsu[k1][0];
            ans[edge[i].second] = {v , u};
            adj[v].insert(u);
            adj[u].insert(v);
            if(dsu[k].size() < dsu[k1].size())
                sizes.insert({dsu[k].size() + dsu[k1].size() , k1});
            else
                sizes.insert({dsu[k].size() + dsu[k1].size() , k});
            t--;
            merg(k , k1);
        }
    }
    for(int i = 0; i < m; i++)
        printf("%d %d\n" , ans[i].first + 1 , ans[i].second + 1);
}