#include<bits/stdc++.h>
using namespace std;
int main()
{
int d,m,k;
string n,x,z,s,w;
cin>>n>>w>>x>>z>>s;
cout<<n<<' '<<w<<' '<<x<<' '<<z<<' '<<s<<endl;
cout<<w<<' '<<x<<' '<<z<<' '<<s<<endl;
cout<<x<<' '<<z<<' '<<s<<endl;
cout<<z<<' '<<s<<endl;
cout<<s;
}