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