#include <iostream>
#include <vector>

using namespace std;

vector < bool > v;

istream & operator >> (istream & in, _Bit_reference b)
{
    bool x;
    in >> x;
    b = x;
    return in;
}

int main()
{
    v.resize(5);
    for (int i = 0; i < 5; ++i)
        cin >> v[i];
    for (int i = 4; i >= 0; --i)
        cout << v[i] << " ";
    cout << "\n";
    return 0;
}
