Problem: This issue is a reactive issue. It is necessary to create a program that derives the correct answer by interactively responding to the program prepared on the server side.





Example

Input




Output

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int N, M, k[111];

int main() {
	cin >> N >> M;
	memset(k, -1, sizeof(k));
	
	for_(v,0,N) {
		cout << "lst " << v << endl;
		cin >> k[v];
		for_(i,0,k[v]) { int dumy; cin >> dumy; }
	}
	
	int ans = 0;
	for_(v,0,N) ans += (k[v] - 1) * k[v];
	cout << "ans " << ans << endl;
}