The first line contains N and K separated by a space.
Each of the next N lines describes the models available at one location. Line i starts with Mi (1≤Mi≤10), the number of models available at location i, followed by Mi space separated integers Pi,1,…,Pi,Mi, the costs of those models (1≤Pi,j≤100000000).