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;
int n,m;
int ans;
set<int> g[100];
int C[100];

int main(){
  scanf("%d %d", &n, &m);
  for(int i=0;i<n;i++){
    printf("lst %d\n",i);
    fflush(stdout);
    
    int k;
    scanf("%d",&k);
    C[i]=k;
    for(int j=0;j<k;j++){
      int v;
      scanf("%d",&v);
      if(v!=-1){
        g[i].insert(v);
        g[v].insert(i);
      }
    }
  }
  
  ans=0;
  for(int pos=0;pos<n;pos++){
    ans+= C[pos]*(C[pos]-1);
  }
  
  printf("ans %d\n",ans);
  fflush(stdout);
  return 0;
}