#include <iostream>
#include <vector>
using namespace std;
int n;
vector<string>s;
string a;
int main() {
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        s.push_back(a);
        for (int j = i; j >= max(0, i - 3); j--)
        {
            cout << i - j + 1 << "=" << s[j];
            if(j != 0)
                cout << " ";
        }
        cout << endl;
    }
}