#include<stdio.h>
int main()
{
    int a,b,c,d,e,f,g,h,temp;
    
    scanf("%d%d%d%d%d%d%d%d",a,b,c,d,e,f,g,h,temp);
    temp=a;
    a=b;
    b=c;
    c=d;
    d=e;
    e=f;
    f=g;
    g=h;
    h=temp
    
    printf("%d%d%d%d%d%d%d%d",temp,a,b,c,d,e,f,g,h);