#include<bits/stdc++.h> using namespace std; int main(){ cout<<"7"<<"31"<<"6"<<endl; cout<<"8"<<"14"<<"14"<<endl; cout<<"2"; return 0; }