#include<iostream>
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 = a;
a=b;
b=c;
c=d;
d=e;
e=f;
f=g;
g=h;
h=temp;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" " <<e<<" "<<f<<" "<<g<<" "<<h<<;
return 0;
}