import java.io.*; import java.util.*; public class D_matsu{ public static void main(String args[]) throws IOException{ Scanner sc = new Scanner(System.in); while(true){ int p = sc.nextInt(); if(p==0) break; int s = sc.nextInt(); exInt table[][] = new exInt[p+1][s+1]; for(int i=0;i