import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.util.Arrays; import java.util.Stack; /** * * @author cteam33 */ public class regulate { public static void main(String[] args) throws IOException { int N,M,C,T; String line; byte cable[][] = new byte[8001][8001]; boolean ok[] = new boolean[8001]; BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); Stack s = new Stack(); int i,j,s1,s2,c; CS cs[][] = new CS[8001][101]; for(i=0;i<8001;i++) { for(j=0;j<101;j++){ cs[i][j] = new CS(); } } while(true){ line = reader.readLine(); while(line.trim().equals("")) line = reader.readLine(); String[] arr = line.split(" "); N = Integer.parseInt(arr[0]); M = Integer.parseInt(arr[1]); C = Integer.parseInt(arr[2]); T = Integer.parseInt(arr[3]); if( N == 0 && M == 0 && C == 0 && T == 0) break; for( i = 0;i