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>
#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)

using namespace std;
typedef long long ll;

int main(){
	int N, M, c;
	ll a[105], ans=0;
	
	cin >> N >> M;

	rep(i,N){
		cout << "lst " << i << endl;
		cin >> a[i];
		rep(j,a[i]) cin >> c;
		ans += a[i] * (a[i]-1);
	}

	cout << "ans " << ans << endl;

	return 0;
}