import java.util.*;
public class number11559{
static class Hotel{
public int price;
public boolean isEnough = true;
public Hotel(int price, boolean isEnough){
this.price = price;
this.isEnough = isEnough;
}
}
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int n = sc.nextInt();
int b = sc.nextInt();
int h = sc.nextInt();
int w = sc.nextInt();
Hotel[] hotellist = new Hotel[h];
for(int i = 0; i < h; i++){
int p = sc.nextInt();
boolean isEnough = false;
for(int j = 0; j < w; j++){
int acc = sc.nextInt();
if(acc >= w){
isEnough = true;
}
}
Hotel ho = new Hotel(p * n, isEnough);
hotellist[i] = ho;
}
boolean inBudget = true;
int min = 0;
for(int i = 0; i < hotellist.length; i++){
if(hotellist[i].isEnough == true){
if(hotellist[i].price < hotellist[min].price ){
min = i;
}
}
}
if(hotellist[min].price >= b){
inBudget = false;
}
if(!inBudget){
System.out.println("stay home");
} else {
System.out.println(hotellist[min].price);
}
}
}
}