#include <bits/stdc++.h> using namespace std; int main(){ vector<string> v; int m; string tmp; cin>>m; while(m--){ cin>>tmp; v.insert(v.begin(),tmp); for(int i = 0; i < v.size() && i < 4; i++){ cout<<i+1<<"="<<v[i]<<" "; } cout<<endl; } }
#include <bits/stdc++.h> using namespace std; int main(){ vector<string> v; int m; string tmp; cin>>m; while(m--){ cin>>tmp; v.insert(v.begin(),tmp); for(int i = 0; i < v.size() && i < 4; i++){ cout<<i+1<<"="<<v[i]<<" "; } cout<<endl; } }