static int process(String line) {
		if(line == null || line.trim().length() == 0)
			return 0;
		int[] inp = giveArray(line.trim().split(" "));
		int n = inp[0], b = inp[1], h = inp[2], w = inp[3];
		int[][] havail = new int[h][];
		int[] hcost = new int[h];
		
		for(int i = 0; i < h; i++) {
			hcost[i] = Integer.parseInt(readLine().trim());
			havail[i] = giveArray(readLine().trim().split(" "));
		}
		long cost = Long.MAX_VALUE;
		for(int i = 0; i < w; i++) {
			long min = Long.MAX_VALUE;
			for(int j = 0; j < h; j++) {
				if(havail[j][i] >= n)
					min = Math.min(min, hcost[j]);
			}
			if(min == Long.MAX_VALUE) {
			}
			else {
				cost = Math.min(min * n, cost);
			}
		}
		
		if(cost > b) {
			System.out.println("stay home");
		}
		else
			System.out.println(cost);
		
		return 1;

	}