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 <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <cassert>
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N, M;
	cin >> N >> M;

	int ans = 0;
	for(int i = 0; i < N; i++) {
		int k;
		cout << "lst " << i << endl;
		cin >> k;
		for(int j = 0; j < k; j++) {
			int a;
			cin >> a;
		}
		ans += k * (k - 1);
	}

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