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 <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n,m;

int rest[501];

int main(void){
	scanf("%d%d",&n,&m);
	int res=0;
	for(int i=0;i<n;i++){
		printf("lst %d\n",i);
		fflush(stdout);
		scanf("%d",&rest[i]);
		if(rest[i]==0)continue;
		res+=rest[i]*(rest[i]-1);
		for(int j=0;j<rest[i];j++){
			int a;
			scanf("%d",&a);
		}
	}
	printf("ans %d\n",res);
	fflush(stdout);
	return 0;
}