/* package whatever; // don't place package name! */
 
import java.util.*;
import java.lang.*;
import java.io.*;
 
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    public static void main(String[] args){
        int[] yourArray = new int[]{10, 18, -12, 4, 8, -3, -5, 67, 9, 14};
        int depth = 4;
        System.out.println(Arrays.toString(new Ideone().a(yourArray, depth)));
    }
 
    int[]a(int[]a,int b){if(b<1)return a;int e=a.length-1,c[]=new int[e],i=e;for(;i-->0;)c[i]=a[i+1]-a[i];return a(c,b-1);}
}