#include <iostream>
#include <vector>

using namespace std;

template < typename T >
int sz(const T & x)
{
    return (int)x.size();
}

int main()
{
    vector < int > x;
    x = {4, 5, 2};
    for (int i = 0; i < x.size() - 1; ++i)
        cout << x[i] + x[i + 1] << " ";
    cout << "\n";

    x.clear();
    for (int i = 0; i < sz(x) - 1; ++i)
        cout << x[i] + x[i + 1] << " ";
    cout << "\n";

    x.clear();
    for (int i = 0; i < x.size() - 1; ++i)
        cout << x[i] + x[i + 1] << " ";
    cout << "\n";

    return 0;
}
