#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <map>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;

int main()
{
    int x,y,z;
    cin >> x >> y >> z;
    swap(x,y);
    swap(x,z);
    cout << x << " " << y << " " << z << endl;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string a,b,c;
    int x,y;
    cin>>a>>b>>c;
    x=a.size();
    y=b.size();
    if(a[x-1]==b[0] && b[y-1]==c[0])
        cout<<"YES";
    else
        cout<<"NO";
    return 0;
}
