import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class LuxuriousHouses {

	public static void main(String[] args) throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(in.readLine());

		StringTokenizer st = new StringTokenizer(in.readLine());

		int[] buildings = new int[n];
		for (int i = 0; i < n; i++) {
			buildings[i] = Integer.parseInt(st.nextToken());
		}

		int max = 0;
		StringBuilder sb = new StringBuilder();

		for (int i = n - 1; i >= 0; i--) {
			int res = Math.max(max - buildings[i] + 1, 0);

			if(buildings[i] > max)
				max = buildings[i];

			sb.append(res + " ");
		}

		System.out.println(sb.reverse().substring(1));
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class LuxuriousHouses {

	public static void main(String[] args) throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(in.readLine());

		StringTokenizer st = new StringTokenizer(in.readLine());

		int[] buildings = new int[n];
		for (int i = 0; i < n; i++) {
			buildings[i] = Integer.parseInt(st.nextToken());
		}

		int max = 0;
		StringBuilder sb = new StringBuilder();

		for (int i = n - 1; i >= 0; i--) {
			int res = Math.max(max - buildings[i] + 1, 0);

			if(buildings[i] > max)
				max = buildings[i];

			sb.insert(0, res + " ");
		}

		System.out.println(sb);
	}
}


//package javaapplication1;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

    public class Main
    {

        public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int n;

        n = in.nextInt();

        int a[] = new int [n + 1];
        int res[] = new int [n + 1];

        for(int i = 1 ; i <= n ; i ++)
            a[i] = in.nextInt();

        int big = a[n];
        res[n] = 0;
        for(int i = n - 1 ; i >= 1 ; i --)
        {
            if(a[i] > big)
            {
                res[i] = 0;
                big = a[i];
            }
            else res[i] = big - a[i] + 1;

        }

        for(int i = 1 ; i <= n ; i ++)
            System.out.printf(res[i] + " ");

    }

}


//package javaapplication1;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

    public class Main
    {

        public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int n;

        n = in.nextInt();

        int a[] = new int [n + 1];
        int res[] = new int [n + 1];

        for(int i = 1 ; i <= n ; i ++)
            a[i] = in.nextInt();

        int big = -1;

        for(int i = n ; i >= 1 ; i --)
        {
            if(a[i] >= big)
            {
                res[i] = 0;
                big = a[i];
            }
            else res[i] = big - a[i] + 1;

        }

        for(int i = 1 ; i <= n ; i ++)
            System.out.printf(res[i] + " ");

    }

}


package javaapplication1;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

    public class Main
    {

        public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int n;

        n = in.nextInt();

        int a[] = new int [n + 1];
        int res[] = new int [n + 1];

        for(int i = 1 ; i <= n ; i ++)
            a[i] = in.nextInt();

        int big = -1;

        for(int i = n ; i >= 1 ; i --)
        {
            if(a[i] >= big)
            {
                res[i] = 0;
                big = a[i];
            }
            else res[i] = big - a[i] + 1;

        }

        for(int i = 1 ; i <= n ; i ++)
            System.out.printf(res[i] + " ");

    }

}


//package javaapplication1;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

    public class Main
    {

        public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int n;

        n = in.nextInt();

        int a[] = new int [n + 1];
        int res[] = new int [n + 1];

        for(int i = 1 ; i <= n ; i ++)
            a[i] = in.nextInt();

        int big = a[n];
        res[n] = 0;
        for(int i = n - 1 ; i >= 1 ; i --)
        {
            if(a[i] >= big)
            {
                res[i] = 0;
                big = a[i];
            }
            else res[i] = big - a[i] + 1;

        }

        for(int i = 1 ; i <= n ; i ++)
            System.out.printf(res[i] + " ");

    }

}


import java.util.*;
import java.io.*;
public class CodeF581B{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    int n = Integer.parseInt(br.readLine());
    long[] a = new long[n];
    StringTokenizer st = new StringTokenizer(br.readLine(), " ");
    long max = 0;
    for(int i = 0; i < n; i++){
      a[i] = Integer.parseInt(st.nextToken());
      //max = Math.max(max, a[i]);
    }
    int pos = 0;
    for(int i = 0; i < n; i++){
      max = 0;
      if( i == n-1)
      pw.println("0");
      else{

      for(int j = i; j < n; j++){
        if(a[j] > max){
          max = a[j];
          //pos = j;
        }

      }
      if( max > a[i])
        pw.print(max-a[i]+1);
      else
        pw.print("0");
      pw.print(" ");
      }

    }
    pw.close();
  }
}


import java.util.*;
import java.io.*;
public class CodeF581B{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    int n = Integer.parseInt(br.readLine());
    long[] a = new long[n];
    long [] res = new long[n];
    StringTokenizer st = new StringTokenizer(br.readLine(), " ");
    long max = 0;
    for(int i = 0; i < n; i++){
      a[i] = Integer.parseInt(st.nextToken());
      //max = Math.max(max, a[i]);
    }
    int pos = 0;
    max = 0;
    for(int i = 0; i < n; i++){

      if( i == n-1) res[i] = 0;
        //pw.println("0");
      else{
        if(pos == 0 || i > pos){
          max = 0;
          for(int j = i; j < n; j++){
            if(a[j] >= max){
              max = a[j];
              pos = j;
            }
          }
        }
        if( i != pos && a[i] == max) res[i] = 1;
          //pw.print("1");
        else if( max > a[i]) res[i] = max-a[i]+1;
         // pw.print(max-a[i]+1);
        else res[i] = 0;
          //pw.print("0");
        //pw.print(" ");
      }

    }
    for(int i = 0; i< n; i++)
      pw.print(res[i]+" ");
    pw.close();
  }
}


import java.util.*;
import java.io.*;
public class CodeF581B{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    int n = Integer.parseInt(br.readLine());
    long[] a = new long[n];
    //long [] res = new long[n];
    StringTokenizer st = new StringTokenizer(br.readLine(), " ");
    long max = 0;
    for(int i = 0; i < n; i++){
      a[i] = Integer.parseInt(st.nextToken());
      //max = Math.max(max, a[i]);
    }
    int pos = 0;
    max = 0;
    for(int i = n-1; i >= 0; i--){
      if( a[i] > max) max = a[i];
      if( i == n-1) a[i] = 0;
        //pw.println("0");
      else{
//        if(pos == 0 || i > pos){
//          max = 0;
//          for(int j = i; j < n; j++){
//            if(a[j] >= max){
//              max = a[j];
//              pos = j;
//            }
//          }
//        }

        if( a[i] == max) a[i] = 0;
          //pw.print("1");
        else if( max > a[i]) a[i] = max-a[i]+1;
         // pw.print(max-a[i]+1);
        else a[i] = 0;
          //pw.print("0");
        //pw.print(" ");
      }

    }
    for(int i = 0; i< n; i++)
      pw.print(a[i]+" ");
    pw.close();
  }
}


import java.util.*;
import java.io.*;
public class CodeF581B{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    int n = Integer.parseInt(br.readLine());
    long[] a = new long[n];
    //long [] res = new long[n];
    StringTokenizer st = new StringTokenizer(br.readLine(), " ");
    long max = 0;
    for(int i = 0; i < n; i++){
      a[i] = Integer.parseInt(st.nextToken());
      //max = Math.max(max, a[i]);
    }
    int pos = 0;
    max = 0;
    for(int i = 0; i < n; i++){

      if( i == n-1) a[i] = 0;
        //pw.println("0");
      else{
        if(pos == 0 || i > pos){
          max = 0;
          for(int j = i; j < n; j++){
            if(a[j] >= max){
              max = a[j];
              pos = j;
            }
          }
        }
        if( i != pos && a[i] == max) a[i] = 1;
          //pw.print("1");
        else if( max > a[i]) a[i] = max-a[i]+1;
         // pw.print(max-a[i]+1);
        else a[i] = 0;
          //pw.print("0");
        //pw.print(" ");
      }

    }
    for(int i = 0; i< n; i++)
      pw.print(a[i]+" ");
    pw.close();
  }
}


import java.util.*;
import java.io.*;
public class CodeF581B{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    int n = Integer.parseInt(br.readLine());
    long[] a = new long[n];
    StringTokenizer st = new StringTokenizer(br.readLine(), " ");
    long max = 0;
    for(int i = 0; i < n; i++){
      a[i] = Integer.parseInt(st.nextToken());
      //max = Math.max(max, a[i]);
    }
    int pos = 0;
    max = 0;
    for(int i = 0; i < n; i++){

      if( i == n-1)
        pw.println("0");
      else{
        if(pos == 0 || i > pos){
          max = 0;
          for(int j = i; j < n; j++){
            if(a[j] >= max){
              max = a[j];
              pos = j;
            }
          }
        }
        if( i != pos && a[i] == max)
          pw.print("1");
        else if( max > a[i])
          pw.print(max-a[i]+1);
        else
          pw.print("0");
        pw.print(" ");
      }

    }
    pw.close();
  }
}


import java.util.*;
import java.io.*;
public class CodeF581B{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    int n = Integer.parseInt(br.readLine());
    long[] a = new long[n];
    StringTokenizer st = new StringTokenizer(br.readLine(), " ");
    long max = 0;
    for(int i = 0; i < n; i++){
      a[i] = Integer.parseInt(st.nextToken());
      //max = Math.max(max, a[i]);
    }
    int pos = 0;
    max = 0;
    for(int i = 0; i < n; i++){

      if( i == n-1)
        pw.println("0");
      else{
        if(pos == 0 || i > pos){
          max = 0;
          for(int j = i; j < n; j++){
            if(a[j] > max){
              max = a[j];
              pos = j;
            }
          }
        }
        if( max > a[i])
          pw.print(max-a[i]+1);
        else
          pw.print("0");
        pw.print(" ");
      }

    }
    pw.close();
  }
}


import java.util.*;
import java.io.*;
public class CodeF581B{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    int n = Integer.parseInt(br.readLine());
    long[] a = new long[n];
    //long [] res = new long[n];
    StringTokenizer st = new StringTokenizer(br.readLine(), " ");
    long max = 0;
    for(int i = 0; i < n; i++){
      a[i] = Integer.parseInt(st.nextToken());
      //max = Math.max(max, a[i]);
    }
    int pos = n-1;
    max = 0;
    for(int i = n-1; i >= 0; i--){
      if( a[i] > max){
        max = a[i];
        pos = i;
      }
      if( i == n-1) a[i] = 0;
        //pw.println("0");
      else{
//        if(pos == 0 || i > pos){
//          max = 0;
//          for(int j = i; j < n; j++){
//            if(a[j] >= max){
//              max = a[j];
//              pos = j;
//            }
//          }
//        }

        if(i != pos && a[i] == max) a[i] = 1;
        else if(i == pos && a[i] == max) a[i] = 0;
          //pw.print("1");
        else if( max > a[i]) a[i] = max-a[i]+1;
         // pw.print(max-a[i]+1);
        else a[i] = 0;
          //pw.print("0");
        //pw.print(" ");
      }

    }
    for(int i = 0; i< n; i++)
      pw.print(a[i]+" ");
    pw.close();
  }
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class CodeForces {
    public static void main(String[] args)throws IOException {
        //MyScanner sc = new MyScanner(new FileReader("input.txt"));
        //PrintWriter out = new PrintWriter("output.txt");
        PrintWriter out = new PrintWriter(System.out);
        MyScanner sc = new MyScanner(System.in);

        int n = sc.nextInt();
        long [] arr =new long[n];
        long  []Final = new long[n];
        for(int i = 0 ; i < n ; i ++)
            arr[i] = sc.nextInt();
        Arrays.fill(Final,0);
       long  MAX = arr[n-1];
        for(int i = n-2 ; i >= 0 ; i --)
        {

            if(arr[i] < MAX){
                Final[i] = MAX - arr[i] + 1 ;

            }
            else{
                MAX = arr[i];
            }
        }
        for(int i = 0 ; i < n ; i ++)
            out.print(Final[i] +" ");
        out.flush();
        out.close();

    }

    static long gcd(long a, long b) { return b==0 ? a : gcd(b, a % b); }
    static long lcm(long a, long b) { return (a / gcd(a, b)) * b; }
    static class MyScanner
    {
        StringTokenizer st;
        BufferedReader br;

        public MyScanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public MyScanner(FileReader s) throws FileNotFoundException {	br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException { return Double.parseDouble(next()); }

        public boolean ready() throws IOException {return br.ready();}
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class CodeForces {
    public static void main(String[] args)throws IOException {
        //MyScanner sc = new MyScanner(new FileReader("input.txt"));
        //PrintWriter out = new PrintWriter("output.txt");
        PrintWriter out = new PrintWriter(System.out);
        MyScanner sc = new MyScanner(System.in);

        int n = sc.nextInt();
        long [] arr =new long[n];
        long  []Final = new long[n];
        for(int i = 0 ; i < n ; i ++)
            arr[i] = sc.nextInt();
        Arrays.fill(Final,0);
       long  MAX = arr[n-1];
        for(int i = n-1 ; i >= 0 ; i --)
        {

            if(arr[i] < MAX){
                Final[i] = MAX - arr[i] + 1 ;

            }
            else{
                MAX = arr[i];
            }
        }
        for(int i = 0 ; i < n ; i ++)
            out.print(Final[i] +" ");
        out.flush();
        out.close();

    }

    static long gcd(long a, long b) { return b==0 ? a : gcd(b, a % b); }
    static long lcm(long a, long b) { return (a / gcd(a, b)) * b; }
    static class MyScanner
    {
        StringTokenizer st;
        BufferedReader br;

        public MyScanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public MyScanner(FileReader s) throws FileNotFoundException {	br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException { return Double.parseDouble(next()); }

        public boolean ready() throws IOException {return br.ready();}
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class CodeForces {
    public static void main(String[] args)throws IOException {
        //MyScanner sc = new MyScanner(new FileReader("input.txt"));
        //PrintWriter out = new PrintWriter("output.txt");
        PrintWriter out = new PrintWriter(System.out);
        MyScanner sc = new MyScanner(System.in);

        int n = sc.nextInt();
        long [] arr =new long[n];
        long  []Final = new long[n];
        for(int i = 0 ; i < n ; i ++)
            arr[i] = sc.nextInt();
        Arrays.fill(Final,0);
       long  MAX = 0;
        for(int i = n-1 ; i >= 0 ; i --)
        {

            if(arr[i] < MAX){
                Final[i] = MAX - arr[i] + 1 ;

            }
            else{
                MAX = arr[i];
            }
        }
        for(int i = 0 ; i < n ; i ++)
            out.print(Final[i] +" ");
        out.flush();
        out.close();

    }

    static long gcd(long a, long b) { return b==0 ? a : gcd(b, a % b); }
    static long lcm(long a, long b) { return (a / gcd(a, b)) * b; }
    static class MyScanner
    {
        StringTokenizer st;
        BufferedReader br;

        public MyScanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public MyScanner(FileReader s) throws FileNotFoundException {	br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException { return Double.parseDouble(next()); }

        public boolean ready() throws IOException {return br.ready();}
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class CodeForces {
    public static void main(String[] args)throws IOException {
        //MyScanner sc = new MyScanner(new FileReader("input.txt"));
        //PrintWriter out = new PrintWriter("output.txt");
        PrintWriter out = new PrintWriter(System.out);
        MyScanner sc = new MyScanner(System.in);

        int n = sc.nextInt();
        int [] arr =new int[n];
        int []Final = new int[n];
        for(int i = 0 ; i < n ; i ++)
            arr[i] = sc.nextInt();
        Arrays.fill(Final,0);
        int MAX = arr[n-1];
        for(int i = n-2 ; i >= 0 ; i --)
        {

            if(arr[i] < MAX){
                Final[i] = MAX - arr[i] + 1 ;

            }
            else{
                MAX = arr[i];
            }
        }
        for(int i = 0 ; i < n ; i ++)
            out.print(Final[i] +" ");
        out.flush();
        out.close();

    }

    static long gcd(long a, long b) { return b==0 ? a : gcd(b, a % b); }
    static long lcm(long a, long b) { return (a / gcd(a, b)) * b; }
    static class MyScanner
    {
        StringTokenizer st;
        BufferedReader br;

        public MyScanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public MyScanner(FileReader s) throws FileNotFoundException {	br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException { return Double.parseDouble(next()); }

        public boolean ready() throws IOException {return br.ready();}
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class CodeForces {
    public static void main(String[] args)throws IOException {
        //MyScanner sc = new MyScanner(new FileReader("input.txt"));
        //PrintWriter out = new PrintWriter("output.txt");
        PrintWriter out = new PrintWriter(System.out);
        MyScanner sc = new MyScanner(System.in);

        int n = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; ++i)
            a[i] = sc.nextInt();
        int[] maxH = new int[n];

        for(int i = n - 1; i > 0; --i)
            maxH[i - 1] = Math.max(a[i], maxH[i]);
        for(int i = 0; i < n - 1; ++i)
            if(a[i] > maxH[i])
                out.format("%d ", 0);
            else
                out.format("%d ", maxH[i] - a[i] + 1);
        out.println(0);
        out.flush();
        out.close();

    }

    static long gcd(long a, long b) { return b==0 ? a : gcd(b, a % b); }
    static long lcm(long a, long b) { return (a / gcd(a, b)) * b; }
    static class MyScanner
    {
        StringTokenizer st;
        BufferedReader br;

        public MyScanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public MyScanner(FileReader s) throws FileNotFoundException {	br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException { return Double.parseDouble(next()); }

        public boolean ready() throws IOException {return br.ready();}
    }
}


    import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

    import java.io.*;
    import java.util.*;

    public class Main {
        public static void main(String args[])
        {
            FastReader sc = new FastReader();
            int n = sc.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
            }
            int max = a[n-1];
            int[] b = new int[n];
            for (int i = n-1, h = 0; i >= 0; --i, h++) {
                max = Math.max(max, a[i]);
                //System.out.println (max + " " + a[i]);
                if(max > a[i]) {
                    int k = max - a[i] + 1;
                    b[h] = k;
                }
                else {
                    b[h] = 0;
                }
            }
            for (int i = 0; i < n; i++) System.out.print(b[n-i-1] + " ");
        }

        static class FastReader
        {
            BufferedReader br;
            StringTokenizer st;

            public FastReader()
            {
                br = new BufferedReader(new
                        InputStreamReader(System.in));
            }

            String next()
            {
                while (st == null || !st.hasMoreElements())
                {
                    try
                    {
                        st = new StringTokenizer(br.readLine());
                    }
                    catch (IOException  e)
                    {
                        e.printStackTrace();
                    }
                }
                return st.nextToken();
            }

            int nextInt()
            {
                return Integer.parseInt(next());
            }

            long nextLong()
            {
                return Long.parseLong(next());
            }

            double nextDouble()
            {
                return Double.parseDouble(next());
            }

            String nextLine()
            {
                String str = "";
                try
                {
                    str = br.readLine();
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
                return str;
            }
        }
    }


    import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

    import java.io.*;
    import java.util.*;

    public class Main {
        public static void main(String args[])
        {
            FastReader sc = new FastReader();
            int n = sc.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
            }
            int max = a[n-1];
            int[] b = new int[n];
            b[0] = 0;
            for (int i = n-2, h = 1; i >= 0; --i, h++) {
                //System.out.println(max);
                b[n-i-1] = Math.max(0, max + 1 - a[i]);
                max  = Math.max(a[i], max);
            }
            for (int i = 0; i < n; i++) System.out.print(b[n-i-1] + " ");
        }

        static class FastReader
        {
            BufferedReader br;
            StringTokenizer st;

            public FastReader()
            {
                br = new BufferedReader(new
                        InputStreamReader(System.in));
            }

            String next()
            {
                while (st == null || !st.hasMoreElements())
                {
                    try
                    {
                        st = new StringTokenizer(br.readLine());
                    }
                    catch (IOException  e)
                    {
                        e.printStackTrace();
                    }
                }
                return st.nextToken();
            }

            int nextInt()
            {
                return Integer.parseInt(next());
            }

            long nextLong()
            {
                return Long.parseLong(next());
            }

            double nextDouble()
            {
                return Double.parseDouble(next());
            }

            String nextLine()
            {
                String str = "";
                try
                {
                    str = br.readLine();
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
                return str;
            }
        }
    }


    import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

    import java.io.*;
    import java.util.*;

    public class Main {
        public static void main(String args[])
        {
            FastReader sc = new FastReader();
            int n = sc.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
            }
            int max = a[n-1];
            int[] b = new int[n];
            b[0] = 0;
            for (int i = n-2, h = 1; i >= 0; --i, h++) {
                max  = Math.max(a[i], max);
                b[n-i-1] = Math.max(0, max + 1 - a[i]);
            }
            for (int i = 0; i < n; i++) System.out.print(b[n-i-1] + " ");
        }

        static class FastReader
        {
            BufferedReader br;
            StringTokenizer st;

            public FastReader()
            {
                br = new BufferedReader(new
                        InputStreamReader(System.in));
            }

            String next()
            {
                while (st == null || !st.hasMoreElements())
                {
                    try
                    {
                        st = new StringTokenizer(br.readLine());
                    }
                    catch (IOException  e)
                    {
                        e.printStackTrace();
                    }
                }
                return st.nextToken();
            }

            int nextInt()
            {
                return Integer.parseInt(next());
            }

            long nextLong()
            {
                return Long.parseLong(next());
            }

            double nextDouble()
            {
                return Double.parseDouble(next());
            }

            String nextLine()
            {
                String str = "";
                try
                {
                    str = br.readLine();
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
                return str;
            }
        }
    }


    import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

    import java.io.*;
    import java.util.*;

    public class Main {
        public static void main(String args[])
        {
            FastReader sc = new FastReader();
            int n = sc.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
            }
            int max = a[n-1];
            int[] b = new int[n];
            b[0] = 0;
            for (int i = n-2, h = 1; i >= 0; --i, h++) {
                max = Math.max(max, a[i]);
                //System.out.println (max + " " + a[i]);
                if(max >= a[i]) {
                    int k = max - a[i] + 1;
                    b[h] = k;
                }
                else {
                    b[h] = 0;
                }
            }
            for (int i = 0; i < n; i++) System.out.print(b[n-i-1] + " ");
        }

        static class FastReader
        {
            BufferedReader br;
            StringTokenizer st;

            public FastReader()
            {
                br = new BufferedReader(new
                        InputStreamReader(System.in));
            }

            String next()
            {
                while (st == null || !st.hasMoreElements())
                {
                    try
                    {
                        st = new StringTokenizer(br.readLine());
                    }
                    catch (IOException  e)
                    {
                        e.printStackTrace();
                    }
                }
                return st.nextToken();
            }

            int nextInt()
            {
                return Integer.parseInt(next());
            }

            long nextLong()
            {
                return Long.parseLong(next());
            }

            double nextDouble()
            {
                return Double.parseDouble(next());
            }

            String nextLine()
            {
                String str = "";
                try
                {
                    str = br.readLine();
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
                return str;
            }
        }
    }


/**
 * Created by mo on 9/14/16.
 */
import java.util.*;
import java.io.*;

public class Problem581B {
    public static void main(String[] args){
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        int[] arr = new int[n];
        int[] max = new int[n];
        for (int i = 0; i < n; i++){
            arr[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++){
            int lux = Integer.MIN_VALUE;
            for (int j = i; j < n; j++){
                lux = Math.max(arr[j], lux);
            }
            max[i] = lux;
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            int res = max[i] - arr[i];
            if (res != 0){
                res++;
            }
            sb.append(res).append(' ');
        }
        System.out.println(sb);
    }
    }
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }
        long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextLong();
            }
            return a;
        }
    }
}


/**
 * Created by mo on 9/14/16.
 */
import java.util.*;
import java.io.*;

public class Problem581B {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        int[] arr = new int[n];
        int[] max = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            int lux = Integer.MIN_VALUE;
            for (int j = i; j < n; j++) {
                lux = Math.max(arr[j], lux);
            }
            max[i] = lux;
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            int res = max[i] - arr[i];
            if (res != 0) {
                res++;
            }
            sb.append(res).append(' ');
        }
        System.out.println(sb);
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }

        public FastScanner() {
            this(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }

        long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextLong();
            }
            return a;
        }
    }
}


/**
 * Created by mo on 9/14/16.
 */
import java.util.*;

public class Problem581B {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        int[] max = new int[n];
        for (int i = 0; i < n; i++){
            arr[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++){
            int lux = Integer.MIN_VALUE;
            for (int j = i; j < n; j++){
                lux = Math.max(arr[j], lux);
            }
            max[i] = lux;
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            int res = max[i] - arr[i];
            if (res != 0){
                res++;
            }
            sb.append(res).append(' ');
        }
        System.out.println(sb);
    }
}


/**
 * Created by mo on 9/14/16.
 */
import java.util.*;
import java.io.*;

public class Problem581B {
    public static void main(String[] args){
        FastScanner sc = new Scanner();
        int n = sc.nextInt();
        int[] arr = new int[n];
        int[] max = new int[n];
        for (int i = 0; i < n; i++){
            arr[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++){
            int lux = Integer.MIN_VALUE;
            for (int j = i; j < n; j++){
                lux = Math.max(arr[j], lux);
            }
            max[i] = lux;
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            int res = max[i] - arr[i];
            if (res != 0){
                res++;
            }
            sb.append(res).append(' ');
        }
        System.out.println(sb);
    }
    }
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }
        long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextLong();
            }
            return a;
        }
    }
}


/**
 * Created by mo on 9/14/16.
 */
import java.util.*;

public class Problem581B {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = sc.nextInt();
        int[] b = new int[n];
        b[n-1] = 0;
        int max = a[n-1];
        StringBuilder sb = new StringBuilder();
        for (int i = b.length - 2; i >= 0; i--){
            if (a[i] <= max) b[i] = max + 1 - a[i];
            else {
                max = a[i];
                b[i] = 0;
            }
        }
        for (int i : b) sb.append(i).append(' ');
        System.out.println(sb);
    }
}


/**
 * Created by mo on 9/14/16.
 */
import java.util.*;
import java.io.*;

public class Problem581B {
    public static void main(String[] args){
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = sc.nextInt();
        int[] b = new int[n];
        b[n-1] = 0;
        int max = a[n-1];
        StringBuilder sb = new StringBuilder();
        for (int i = b.length - 2; i >= 0; i--){
            if (a[i] <= max) b[i] = max + 1 - a[i];
            else {
                max = a[i];
                b[i] = 0;
            }
        }
        for (int i : b) sb.append(i).append(' ');
        System.out.println(sb);
    }
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }
        long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextLong();
            }
            return a;
        }
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class popo {

    public static void main(String[] args) {

        InputReader in=new InputReader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        int n=in.nextInt();
        int []a=new int[n];
        for (int i=0;i<n;i++)
        {
            a[i]=in.nextInt();
        }
        int []b=new int[n];
        int max=Integer.MIN_VALUE;
        for (int i=n-1;i>=0;i--)
        {
            if(max<a[i])
            {
                max=a[i];
                b[i]=0;
            }
            else
            {
                if(max!=a[i])
                b[i]=max-a[i]+1;

            }
        }
        for (int i : b)
        {
            out.print(i+" ");
        }

        out.close();

    }
    static class coor{
        int x;
        int y;

        public coor(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }
    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class popo {

    public static void main(String[] args) {

        InputReader in=new InputReader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        int n=in.nextInt();
        int []a=new int[n];
        for (int i=0;i<n;i++)
        {
            a[i]=in.nextInt();
        }
        int []b=new int[n];
        int max=Integer.MIN_VALUE;
        for (int i=n-1;i>=0;i--)
        {
            if(max<a[i])
            {
                max=a[i];
                b[i]=0;
            }
            else
            {
                if(max!=a[i])
                b[i]=max-a[i]+1;
                else
                    b[i]=max-a[i];
            }
        }
        for (int i : b)
        {
            out.print(i+" ");
        }

        out.close();

    }
    static class coor{
        int x;
        int y;

        public coor(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }
    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}


import org.omg.CORBA.MARSHAL;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.net.InetAddress;
import java.nio.Buffer;
import java.util.*;
import javax.swing.tree.TreeNode;

public class Segmentedtree {

    public static long []st;
    public static int mod= 1000000007;

    public static void main(String[] args) throws IOException {

       // BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        InputReader in=new InputReader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        int n=in.nextInt();
        long []a=new long[n];
        for (int i=0;i<n;i++)
        {
            a[i]=in.nextInt();
        }
       constructtree(a);
        for (int i=0;i<n;i++)
        {
            long res= query(0,n-1,i,n-1,0);
            if(res!=a[i])
            {
                out.print(res-a[i]+1+" ");
            }else
            {
                out.print(res-a[i]+" ");
            }
           // out.println(res);
        }

        out.close();

}

    public static int nextPowerOf2(final int a) {
        int b = 1;
        while (b < a) {
            b = b << 1;
        }
        return b;
    }
    private static long [] constructtree(long[] a) {

        int next2power=nextPowerOf2(a.length);
        st=new long[next2power*2-1];
        //System.out.println(size);
       // st=new long[size];
        Arrays.fill(st,Integer.MAX_VALUE);
        constructST(a,0,a.length-1,0);
        return st;
    }
    private static void constructST(long []a,int start,int end,int pos)
    {
        if(start==end)
        {
            st[pos]=a[start];
            return ;
        }
        int mid=(start+end)>>1;
        constructST(a,start,mid,pos*2+1);
        constructST(a,mid+1,end,pos*2+2);
        st[pos]=Math.max(st[2*pos+1],st[2*pos+2]);
    }
    private static long query(int ss,int se,int qs,int qe,int pos)
    {
        if(qs<=ss && qe>=se) //total overlap
        {
           return st[pos];
        }
        if(ss>qe || se<qs)  //no overlap
        {
            return Integer.MIN_VALUE;
        }
        int mid=(ss+se)>>1;
        return Math.max(query(ss,mid,qs,qe,pos*2+1),
                query(mid+1,se,qs,qe,2*pos+2));

    }
    private static void updatefirst(int []a,int start,int delta){

        a[start]=delta;
        update(a,delta,start,0,a.length-1,0);

    }
    private static void update(int []a,int delta,int start,int low,int high,int pos)
    {
        if(start<low || start>high)
        {
            return;
        }
        if(low==high)
        {
            st[pos]=delta;
            return;
        }
        int mid=(low+high)>>1;
        update(a,delta,start,low,mid,(pos*2+1));
        update(a,delta,start,mid+1,high,(pos*2+2));
        st[pos]=Math.min(st[pos*2+1],st[pos*2+2]);
    }

    public static long euclgcd(long a, long b) {
        if (b == 0)
            return a;
        else
            return euclgcd(b, a % b);

    }
    static HashMap<Long,String> fibb=new HashMap<Long,String>();
    public static int fib(long l)
    {	if (l==0) return (int) 0;
        if(l==1||l==2)
            return  (int) (1);
        if (!fibb.containsKey(l))
        {	long temp1=(long) (((long)(fib(l/2+1)%1000000007)*(fib(l-l/2)%1000000007))%1000000007);
            long temp2=(long) (((long)(fib(l/2)%1000000007)*(fib(l-l/2-1)%1000000007))%1000000007);
            long temp=((long)temp1%1000000007+temp2%1000000007)%1000000007;
            fibb.put(l,(temp%1000000007)+"");
        }
        return Integer.parseInt((fibb.get(l)))%1000000007;
    }
    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class popo {

    public static void main(String[] args) {

        InputReader in=new InputReader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        int n=in.nextInt();
        int []a=new int[n];
        for (int i=0;i<n;i++)
        {
            a[i]=in.nextInt();
        }
        int []b=new int[n];
        int max=Integer.MIN_VALUE;
        for (int i=n-1;i>=0;i--)
        {
            if(max<a[i])
            {
                max=a[i];
                b[i]=max-a[i];
            }
            else
            {
                if(max!=a[i])
                b[i]=max-a[i]+1;
                else
                    b[i]=max-a[i];
            }
        }
        for (int i : b)
        {
            out.print(i+" ");
        }

        out.close();

    }
    static class coor{
        int x;
        int y;

        public coor(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }
    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class popo {

    public static void main(String[] args) {

        InputReader in=new InputReader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        int n=in.nextInt();
        int []a=new int[n];
        for (int i=0;i<n;i++)
        {
            a[i]=in.nextInt();
        }
        int []b=new int[n];
        int max=Integer.MIN_VALUE;
        for (int i=n-1;i>=0;i--)
        {
            if(max<a[i])
            {
                max=a[i];
                b[i]=0;
            }
            else
            {

                b[i]=max-a[i]+1;

            }
        }
        for (int i : b)
        {
            out.print(i+" ");
        }

        out.close();

    }
    static class coor{
        int x;
        int y;

        public coor(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }
    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}


import org.omg.CORBA.MARSHAL;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.net.InetAddress;
import java.nio.Buffer;
import java.util.*;
import javax.swing.tree.TreeNode;

public class Segmentedtree {

    public static long []st;
    public static int mod= 1000000007;

    public static void main(String[] args) throws IOException {

       // BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        InputReader in=new InputReader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        int n=in.nextInt();
        int []a=new int[n];
        for (int i=0;i<n;i++)
        {
            a[i]=in.nextInt();
        }
       constructtree(a);
        for (int i=0;i<n;i++)
        {
            int res= (int) query(0,n-1,i,n-1,0);
            if(res!=a[i])
            {
                out.print(res-a[i]+1+" ");
            }else
            {
                out.print(res-a[i]+" ");
            }
           // out.println(res);
        }

        out.close();

}

    public static int nextPowerOf2(final int a) {
        int b = 1;
        while (b < a) {
            b = b << 1;
        }
        return b;
    }
    private static long [] constructtree(int[] a) {

        int next2power=nextPowerOf2(a.length);
        st=new long[next2power*2-1];
        //System.out.println(size);
       // st=new long[size];
        Arrays.fill(st,Integer.MAX_VALUE);
        constructST(a,0,a.length-1,0);
        return st;
    }
    private static void constructST(int []a,int start,int end,int pos)
    {
        if(start==end)
        {
            st[pos]=a[start];
            return ;
        }
        int mid=(start+end)>>1;
        constructST(a,start,mid,pos*2+1);
        constructST(a,mid+1,end,pos*2+2);
        st[pos]=Math.max(st[2*pos+1],st[2*pos+2]);
    }
    private static long query(int ss,int se,int qs,int qe,int pos)
    {
        if(qs<=ss && qe>=se) //total overlap
        {
           return st[pos];
        }
        if(ss>qe || se<qs)  //no overlap
        {
            return Integer.MIN_VALUE;
        }
        int mid=(ss+se)>>1;
        return Math.max(query(ss,mid,qs,qe,pos*2+1),
                query(mid+1,se,qs,qe,2*pos+2));

    }
    private static void updatefirst(int []a,int start,int delta){

        a[start]=delta;
        update(a,delta,start,0,a.length-1,0);

    }
    private static void update(int []a,int delta,int start,int low,int high,int pos)
    {
        if(start<low || start>high)
        {
            return;
        }
        if(low==high)
        {
            st[pos]=delta;
            return;
        }
        int mid=(low+high)>>1;
        update(a,delta,start,low,mid,(pos*2+1));
        update(a,delta,start,mid+1,high,(pos*2+2));
        st[pos]=Math.min(st[pos*2+1],st[pos*2+2]);
    }

    public static long euclgcd(long a, long b) {
        if (b == 0)
            return a;
        else
            return euclgcd(b, a % b);

    }
    static HashMap<Long,String> fibb=new HashMap<Long,String>();
    public static int fib(long l)
    {	if (l==0) return (int) 0;
        if(l==1||l==2)
            return  (int) (1);
        if (!fibb.containsKey(l))
        {	long temp1=(long) (((long)(fib(l/2+1)%1000000007)*(fib(l-l/2)%1000000007))%1000000007);
            long temp2=(long) (((long)(fib(l/2)%1000000007)*(fib(l-l/2-1)%1000000007))%1000000007);
            long temp=((long)temp1%1000000007+temp2%1000000007)%1000000007;
            fibb.put(l,(temp%1000000007)+"");
        }
        return Integer.parseInt((fibb.get(l)))%1000000007;
    }
    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

}


import org.omg.CORBA.MARSHAL;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.net.InetAddress;
import java.nio.Buffer;
import java.util.*;
import javax.swing.tree.TreeNode;

public class Segmentedtree {

    public static long []st;
    public static int mod= 1000000007;

    public static void main(String[] args) throws IOException {

       // BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        InputReader in=new InputReader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        int n=in.nextInt();
        long []a=new long[n];
        for (int i=0;i<n;i++)
        {
            a[i]=in.nextLong();
        }
       constructtree(a);
        for (int i=0;i<n;i++)
        {
            long res= query(0,n-1,i,n-1,0);
            if(res!=a[i])
            {
                out.print(res-a[i]+1+" ");
            }else
            {
                out.print(res-a[i]+" ");
            }
           // out.println(res);
        }

        out.close();

}

    public static int nextPowerOf2(final int a) {
        int b = 1;
        while (b < a) {
            b = b << 1;
        }
        return b;
    }
    private static long [] constructtree(long[] a) {

        int next2power=nextPowerOf2(a.length);
        st=new long[next2power*2-1];
        //System.out.println(size);
       // st=new long[size];
        Arrays.fill(st,Long.MAX_VALUE);
        constructST(a,0,a.length-1,0);
        return st;
    }
    private static void constructST(long []a,int start,int end,int pos)
    {
        if(start==end)
        {
            st[pos]=a[start];
            return ;
        }
        int mid=(start+end)>>1;
        constructST(a,start,mid,pos*2+1);
        constructST(a,mid+1,end,pos*2+2);
        st[pos]=Math.max(st[2*pos+1],st[2*pos+2]);
    }
    private static long query(int ss,int se,int qs,int qe,int pos)
    {
        if(qs<=ss && qe>=se) //total overlap
        {
           return st[pos];
        }
        if(ss>qe || se<qs)  //no overlap
        {
            return Long.MIN_VALUE;
        }
        int mid=(ss+se)>>1;
        return Math.max(query(ss,mid,qs,qe,pos*2+1),
                query(mid+1,se,qs,qe,2*pos+2));

    }
    private static void updatefirst(int []a,int start,int delta){

        a[start]=delta;
        update(a,delta,start,0,a.length-1,0);

    }
    private static void update(int []a,int delta,int start,int low,int high,int pos)
    {
        if(start<low || start>high)
        {
            return;
        }
        if(low==high)
        {
            st[pos]=delta;
            return;
        }
        int mid=(low+high)>>1;
        update(a,delta,start,low,mid,(pos*2+1));
        update(a,delta,start,mid+1,high,(pos*2+2));
        st[pos]=Math.min(st[pos*2+1],st[pos*2+2]);
    }

    public static long euclgcd(long a, long b) {
        if (b == 0)
            return a;
        else
            return euclgcd(b, a % b);

    }
    static HashMap<Long,String> fibb=new HashMap<Long,String>();
    public static int fib(long l)
    {	if (l==0) return (int) 0;
        if(l==1||l==2)
            return  (int) (1);
        if (!fibb.containsKey(l))
        {	long temp1=(long) (((long)(fib(l/2+1)%1000000007)*(fib(l-l/2)%1000000007))%1000000007);
            long temp2=(long) (((long)(fib(l/2)%1000000007)*(fib(l-l/2-1)%1000000007))%1000000007);
            long temp=((long)temp1%1000000007+temp2%1000000007)%1000000007;
            fibb.put(l,(temp%1000000007)+"");
        }
        return Integer.parseInt((fibb.get(l)))%1000000007;
    }
    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

}


import java.util.Scanner;

public class pre32
{
    public static void main(String args[])
    {
        Scanner obj = new Scanner(System.in);
        int n = obj.nextInt();
        int[] arr = new int[n];
        for(int i=0;i<n;i++)
            arr[i] = obj.nextInt();
        for(int i=0;i<n;i++)
        {
            int max = Integer.MIN_VALUE;
            if(i==n-1)
                System.out.print(0);
            else
            {
                for(int j=i+1;j<n;j++)
                {
                    if(max<arr[j] && arr[j]>arr[i])
                        max = arr[j];
                }
                if(max<0)
                    System.out.print(0+" ");
                else
                    System.out.print((max-arr[i]+1)+" ");
            }
        }
    }
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class pre32
{
    public static void main(String args[])
    {
        Scanner obj = new Scanner(System.in);
        int n = obj.nextInt();
        int[] arr = new int[n];
        ArrayList<Node> data = new ArrayList<>();
        for(int i=0;i<n;i++)
        {
            arr[i] = obj.nextInt();
            data.add(new Node(arr[i],i));
        }
        Collections.sort(data);
        int index = data.size()-1;
        for(int i=0;i<n;i++)
        {
            int u = index;
            for(int j=u;;j--)
            {
                if(data.get(j).value>=arr[i] && data.get(j).index>=i)
                {
                    if(data.get(j).value-arr[i]==0)
                        System.out.print(0+" ");
                    else
                        System.out.print(data.get(j).value-arr[i]+1+" ");
                    break;
                }
            }
        }
    }
}
class Node implements Comparable<Node>
{
    int value,index;
    Node(int value,int index)
    {
        this.value = value;
        this.index = index;
    }

    @Override
    public int compareTo(Node o) {
        return this.value-o.value;
    }
}


import java.util.Scanner;
import java.util.Stack;

public class pre33
{
    public static void main(String args[])
    {
        Scanner obj = new Scanner(System.in);
        int n = obj.nextInt(), arr[] = new int[n];
        for(int i=0;i<n;i++)
            arr[i] = obj.nextInt();
        int max = 0;
        Stack<Integer> stack = new Stack<>();
        for(int i=arr.length-1;i>=0;i--)
        {
            if(max-arr[i]<0)
            {
                max = arr[i];
                stack.push(0);
            }
            else
            {
                stack.push(max-arr[i]+1);
            }
        }
        while (!stack.isEmpty())
        {
            System.out.print(stack.pop()+" ");
        }
    }
}


import java.util.Scanner;

public class pre32
{
    public static void main(String args[])
    {
        Scanner obj = new Scanner(System.in);
        int n = obj.nextInt();
        int[] arr = new int[n];
        for(int i=0;i<n;i++)
            arr[i] = obj.nextInt();
        for(int i=0;i<n;i++)
        {
            int max = Integer.MIN_VALUE;
            if(i==n-1)
                System.out.print(0);
            else
            {
                for(int j=i+1;j<n;j++)
                {
                    if(max<arr[j])
                        max = arr[j];
                }
                System.out.print((max-arr[i]+1)+" ");
            }
        }
    }
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class pre32
{
    public static void main(String args[])
    {
        Scanner obj = new Scanner(System.in);
        int n = obj.nextInt();
        int[] arr = new int[n];
        ArrayList<Node> data = new ArrayList<>();
        for(int i=0;i<n;i++)
        {
            arr[i] = obj.nextInt();
            data.add(new Node(arr[i],i));
        }
        Collections.sort(data);
        int index = data.size()-1;
        for(int i=0;i<n;i++)
        {
            int u = index;
            for(int j=u;;j--)
            {
                if(data.get(j).value>=arr[i] && data.get(j).index>=i)
                {
                     if(data.get(j).value-arr[i]==0 && data.get(j).index==i)
                        System.out.print(0+" ");
                    else if(data.get(j).value-arr[i]==0)
                         System.out.print(1);
                    else
                        System.out.print(data.get(j).value-arr[i]+1+" ");
                    break;
                }
            }
        }
    }
}
class Node implements Comparable<Node>
{
    int value,index;
    Node(int value,int index)
    {
        this.value = value;
        this.index = index;
    }

    @Override
    public int compareTo(Node o) {
        return this.value-o.value;
    }
}


import java.util.Scanner;

/**
 * Created by MenonS on 02-10-2015.
 */
public class B322 {
    public  static  void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int h = scanner.nextInt();
        int[] floors = new int[h];
        int[] output  = new int[h];
        for(int i=0;i<h;i++){
            floors[i] = scanner.nextInt();
        }
        int currentMax =0;
        for(int j = floors.length-1; j>=0;j--){

                if(j==floors.length-1){
                    output[j] = 0;
                }else{
                    if(currentMax >= floors[j]) {
                        output[j] = currentMax - floors[j] + 1;
                    }
                }
                if(floors[j] > currentMax) {
                   currentMax = floors[j];
                }
        }
        for(int k=0;k<h;k++){
            System.out.print(output[k]);
            if(k!=h){
                System.out.print(" ");
            }
        }

    }
}


import java.util.Scanner;

/**
 * Created by MenonS on 02-10-2015.
 */
public class B322 {
    public  static  void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int h = scanner.nextInt();
        int[] floors = new int[h];
        int[] output  = new int[h];
        for(int i=0;i<h;i++){
            floors[i] = scanner.nextInt();
        }
        int currentMax =0;
        for(int j = floors.length-1; j>=0;j--) {
            output[j] = Math.max(0, currentMax - floors[j] + 1);
            currentMax = Math.max(currentMax,floors[j]);
        }
        StringBuffer buffer = new StringBuffer();
        for(int k=0;k<h;k++){
            buffer.append(output[k]+" ");
            if(k==h-1){
                System.out.print(buffer);
            }
        }
    }
}


/**
 * Created by MenonS on 02-10-2015.
 */
public class B322 {
    public  static  void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int h = scanner.nextInt();
        int[] floors = new int[h];
        int[] output  = new int[h];
        for(int i=0;i<h;i++){
            floors[i] = scanner.nextInt();
        }
        int currentMax =0;
        for(int j = floors.length-1; j>=0;j--) {
            output[j] = Math.max(0, currentMax - floors[j] + 1);
            currentMax = Math.max(currentMax,floors[j]);
        }
        StringBuffer buffer = new StringBuffer();
        for(int k=0;k<h;k++){
            buffer.append(output[k]+" ");
            if(k==h-1){
                System.out.print(buffer);
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by Microsoft on 18/10/2015.
 */
public class algo_contest1_q5 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        int input []=new int[n];
        String ins[]=br.readLine().split(" ");
        for(int i=0;i<n;i++){
            input[i]=Integer.parseInt(ins[i]);
        }
        int help[]=new int[n];
        help[n-1]=input[n-1];
        for(int i=n-2;i>-1;i--){
            if(input[i]>help[i+1])
                help[i]=input[i];
            else help[i]=help[i+1];
        }
        for(int i=0;i<n;i++){
            if(help[i]==input[i])
                System.out.print(0+" ");
            else {
                System.out.print(help[i]-input[i]+1+" ");
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by Microsoft on 18/10/2015.
 */
public class algo_contest1_q5 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        int input []=new int[n];
        int repeats[]=new int[n];
        String ins[]=br.readLine().split(" ");
        for(int i=0;i<n;i++){
            input[i]=Integer.parseInt(ins[i]);
        }
        int help[]=new int[n];
        help[n-1]=input[n-1];
        for(int i=n-2;i>-1;i--){
            if(input[i]>help[i+1])
                help[i]=input[i];
            else if (input[i]==help[i+1]){
                repeats[i]=repeats[i+1]+1;
                help[i]=help[i+1];
            }
            else{ help[i]=help[i+1];
                repeats[i]=repeats[i+1];
            };
        }
//        for (int i=0;i<n;i++){
//            System.out.print(repeats[i]+"  ");
//        }
//        System.out.println();
        for(int i=0;i<n;i++){

            if(help[i]==input[i]&&repeats[i]==0)
                System.out.print(0+" ");
            else if(help[i]==input[i]&&repeats[i]>0){
                System.out.print(1+" ");
//                repeats[i+1]--;
            }
            else {
                System.out.print(help[i]-input[i]+1+" ");
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by Microsoft on 18/10/2015.
 */
public class algo_contest1_q5 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        int input []=new int[n];
        int repeats[]=new int[n];
        String ins[]=br.readLine().split(" ");
        for(int i=0;i<n;i++){
            input[i]=Integer.parseInt(ins[i]);
        }
        int help[]=new int[n];
        help[n-1]=input[n-1];
        for(int i=n-2;i>-1;i--){
            if(input[i]>help[i+1])
                help[i]=input[i];
            else if (input[i]==help[i+1]){
                repeats[i]++;
                help[i]=help[i+1];
            }
            else help[i]=help[i+1];
        }
        for(int i=0;i<n;i++){
            if(help[i]==input[i]&&repeats[i]==0)
                System.out.print(0+" ");
            else if(help[i]==input[i]&&repeats[i]>0){
                System.out.print(1+" ");
                repeats[i+1]--;
            }
            else {
                System.out.print(help[i]-input[i]+1+" ");
            }
        }
    }
}


import java.util.*;
import java.io.*;
public class Solution{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        long[] arr = new long[n];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < arr.length; ++i){
        	arr[i] = Long.parseLong(st.nextToken());
        }
        TreeSet<Long> set = new TreeSet<Long>();
        for(int i = 0; i < n-1; ++i){
        	for(int j = i+1; j < n; ++j){
        		set.add(arr[j]);
        	}
        	if(set.last() > arr[i])System.out.print((set.last()-arr[i]+1)+" ");
        	else System.out.print("0 ");
        	set.clear();
        }
        System.out.print("0");
    }
}


import java.util.*;
import java.io.*;
public class Solution{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        long[] arr = new long[n];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < arr.length; ++i){
        	arr[i] = Long.parseLong(st.nextToken());
        }
        TreeSet<Long> set = new TreeSet<Long>();
        for(int i = 0; i < n-1; ++i){
        	for(int j = i+1; j < n; ++j){
        		set.add(arr[j]);
        	}
        	System.out.print((set.last()-arr[i]+1)+" ");
        	set.clear();
        }
        System.out.print("0");
    }
}


import java.util.*;
import java.io.*;
public class Solution{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        long[] arr = new long[n];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < arr.length; ++i){
        	arr[i] = Long.parseLong(st.nextToken());
        }
        long max = arr[n-1];
        long[] temp = new long[n];
        for(int i = n-2; i >= 0 ; --i){
        	if(arr[i] > max)max=arr[i];
        	else if(arr[i] == max)temp[i] = 1;
        	else temp[i] = max - arr[i]+1;
        }
        for(long i : temp){
        	System.out.print(i+" ");
        }
    }
}


import java.util.*;
import java.io.*;
public class Solution{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        long[] arr = new long[n];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < arr.length; ++i){
        	arr[i] = Long.parseLong(st.nextToken());
        }
        long max = arr[n-1];
        long[] temp = new long[n];
        for(int i = n-1; i >= 0 ; --i){
        	if(arr[i] > max)max=arr[i];
        	if(arr[i] == max)temp[i] = 0;
        	else if(arr[i] < max)temp[i] = max - arr[i]+1;
        }
        System.out.println(Arrays.toString(temp));
    }
}


import java.util.*;
import java.io.*;
public class Solution{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        long[] arr = new long[n];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < arr.length; ++i){
        	arr[i] = Long.parseLong(st.nextToken());
        }
        long max = arr[n-1];
        long[] temp = new long[n];
        for(int i = n-1; i >= 0 ; --i){
        	if(arr[i] > max)max=arr[i];
        	if(arr[i] == max)temp[i] = 0;
        	else if(arr[i] < max)temp[i] = max - arr[i]+1;
        }
        for(long i : temp){
        	System.out.print(i+" ");
        }
    }
}


import java.io.PrintWriter;
import java.util.Scanner;

public class luxuryhooses {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		int[] houses = new int[n];
		for(int i = 0; i < n; i++) houses[i] = scan.nextInt();
		int[] ans = new int[n];
		int maximali = 0;
		for(int i = n-1; i >= 0; i--){
			maximali = Math.max(maximali, houses[i]);
			ans[i] = maximali-houses[i];
			if(ans[i] != 0) ans[i]++;
		}
		String a = "";
		for(int i = 0; i < n; i++){
			a += ans[i] + " ";
		}
		out.println(a.trim());
		out.flush();
	}

}


import java.io.PrintWriter;
import java.util.Scanner;

public class luxuryhooses {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		int[] houses = new int[n];
		for(int i = 0; i < n; i++) houses[i] = scan.nextInt();
		int[] ans = new int[n];
		int maximali = 0;
		for(int i = n-1; i >= 0; i--){
			maximali = Math.max(maximali, houses[i]);
			if(houses[i] < maximali) ans[i] = maximali-houses[i]+1;
		}
		for(int i = 0; i < n; i++){
			out.print(ans[i] + " ");
		}
		out.flush();
	}

}


import java.io.PrintWriter;
import java.util.Scanner;

public class luxuryhooses {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		int[] houses = new int[n];
		for(int i = 0; i < n; i++) houses[i] = scan.nextInt();
		int[] ans = new int[n];
		int maximali = 0;
		boolean w = false;
		for(int i = n-1; i >= 0; i--){
			if(maximali < houses[i]){
				ans[i]--;
			}
			maximali = Math.max(maximali, houses[i]);
			ans[i]++;
			if(houses[i] < maximali) ans[i] = maximali-houses[i]+1;
		}
		for(int i = 0; i < n; i++){
			out.print(ans[i] + " ");
		}
		out.flush();
	}

}


import java.util.Scanner;

public class abdelmagied {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int [] arr= new int[100000];
        for(int i = 0 ; i < n ; i++) {
        	arr[i] = sc.nextInt();
        }
       solve(arr , n);
	}

	public static void solve(int []arr , int n) {
		int maxi = 0;
		int ans[] = new int[100000];
		for(int i = n - 1 ; i >= 0 ; i--) {
			if(arr[i] > maxi) {
			    maxi = arr[i];
			    ans[i] = 0;
			}else {
				 ans[i] = (maxi + 1) - arr[i];
			}
		}
	  for(int i = 0 ; i < n ; i++) {
		  System.out.print(ans[i] + " ");
	  }
	}

}


package problemSolving;
import java.util.Scanner;

public class abdelmagied {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int [] arr= new int[100000];
        for(int i = 0 ; i < n ; i++) {
        	arr[i] = sc.nextInt();
        }
       solve(arr , n);
	}

	public static void solve(int []arr , int n) {
		int maxi = 0;
		int ans[] = new int[100000];
		for(int i = n - 1 ; i >= 0 ; i--) {
			if(arr[i] > maxi) {
			    maxi = arr[i];
			    ans[i] = 0;
			}else {
				 ans[i] = (maxi + 1) - arr[i];
			}
		}
	  for(int i = 0 ; i < n ; i++) {
		  System.out.print(ans[i] + " ");
	  }
	}

}


package problemSolving;
import java.util.Scanner;

public class abdelmagied {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int [] arr= new int[n];
        for(int i = 0 ; i < n ; i++) {
        	arr[i] = sc.nextInt();
        }
       solve(arr , n);
	}

	public static void solve(int []arr , int n) {
		int maxi = 0;
		int ans[] = new int[n];
		for(int i = n - 1 ; i >= 0 ; i--) {
			if(arr[i] > maxi) {
			    maxi = arr[i];
			    ans[i] = 0;
			}else {
				 ans[i] = (maxi + 1) - arr[i];
			}
		}
	  for(int i = 0 ; i < n ; i++) {
		  System.out.print(ans[i] + " ");
	  }
	}

}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;

public class Codechef{

    public static void main (String[] args) throws java.lang.Exception
    {
    	Scanner sc =new Scanner(System.in);
         int n=sc.nextInt();
         int arr[]=new int[n];
         for(int i=0;i<n;i++){
         	arr[i]=sc.nextInt();
         }
         int dp[]=new int[n];
         int max=0;
         for(int i=0;i<n;i++){
         	max=0;
         	for(int j=i+1;j<n;j++){
         		max=Math.max(max,arr[j]);
         	}

         	if(i==n-1){
         		System.out.println(0);
         		return;
         	}
         	int x=(max+1)-arr[i];
             if(x>0)
         	System.out.print(x+" ");
              else{
              	System.out.print(0+" ");
              }

         }

	}

}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;

public class Codechef{

    public static void main (String[] args) throws java.lang.Exception
    {
    	Scanner sc =new Scanner(System.in);
         int n=sc.nextInt();
         long arr[]=new long[n];
         for(int i=0;i<n;i++){
         	arr[i]=sc.nextLong();
         }

         long max=arr[n-1];
         arr[n-1]=0;
          for(int i=n-2;i>=0;i--){
          	if(arr[i]>max){
               max=arr[i];
               arr[i]=0;
          	}else{
          		arr[i]=max+1-arr[i];
          	}
          }
          for(int i=0;i<n;i++){
          	System.out.print(arr[i]+" ");
          }

	}

}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;

public class Codechef{

    public static void main (String[] args) throws java.lang.Exception
    {
    	Scanner sc =new Scanner(System.in);
         int n=sc.nextInt();
         int arr[]=new int[n];
         for(int i=0;i<n;i++){
         	arr[i]=sc.nextInt();
         }
         int dp[]=new int[n];
         int max=0;
         for(int i=0;i<n;i++){
         	max=0;
         	for(int j=i+1;j<n;j++){
         		max=Math.max(max,arr[j]);
         	}

         	if(i==n-1){
         		System.out.println(0);
         		return;
         	}
         	System.out.print((max+1)-arr[i]+" ");

         }

	}

}


import java.util.Scanner;

public class JavaApplication31 {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] t = new int[n];
        int[] a = new int[n];

        for (int i = 0; i < n; i++) {
            t[i] = scan.nextInt();
        }
        int max = t[n - 1];
        a[n - 1] = 0;
        for (int i = n - 2; i >= 0; i--) {

            if (t[i] >= max) {
                max = t[i];
                t[i] = 0;
            } else {
                a[i] = max - t[i] + 1;
            }
        }
        for (int i = 0; i < n; i++) {
            System.out.print(a[i] + " ");
        }

    }

}