    import java.util.Arrays;
     
    public class Main
    {
       static int[] array;
       static void fillRow(int N, int pos)
       {
          if (pos == 0)
            // (N+1)*(N+2)*(N+3)/6 is a lot
            array = new int[2*N];
          if (pos == array.length-1)
          {
             // we don't really have a choice of value here since we need to get to N
             array[array.length-1] = N;
             System.out.println(Arrays.toString(array));
             return;
          }
          for (int i = N; i >= 0; i--)
          {
             array[pos] = i;
             fillRow(N-i, pos+1);
          }
       }
       
       public static void main(String[] args)
       {
          fillRow(2, 0);
       }
    }