#include<iostream>
using namespace std;
int main(){
    int a,b,c,d,e,f,g,h,temp;
    cin>>a>>b>>c>>d>>e>>f>>g>>h;
    temp=a;
    int a=h;
    int h=g;
    int g=f;
    int f=e;
    int e=d;
    int d=c;
    int c=b;
    int b=temp;
    cout<<h<<" "<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<" "<<f<<" "<<g<<" "<<endl;
    return 0;
}