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 FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define ALL(c) c.begin(),c.end()
using namespace std;
typedef long long LL;
typedef int ut;
typedef pair<ut,ut> pr;
typedef vector<ut> VI;
typedef vector<pr> Vpr;
const LL INF = 1LL<<60;
const int SIZE=100;
int main(){
	int N,M;
	cin >> N >> M;
	int k,ans=0,x;
	REP(i,N){
		cout << "lst " << i<< endl; 
		cin >> k;
		ans+=k*(k-1);
		REP(i,k)
			cin >> x;
	}
	cout << "ans " << ans << endl;
}