Simple 4x4 matrix

I am trying to make a 4x4 matrix and I would greatly appreciate any help.
I have 4 text files and I want to do the following. I want to concatenate them and gzip them. Then I want to find the file size of the concatenated file and subtract the value of file A. Finally, I want to output this final value onto the matrix. I think the example will hopefully make more sense

Example: Suppose there is text A and text B

  1. Concatenate them to make AB
  2. Gzip AB to create AB.gzip
  3. File size of AB.gzip MINUS file size of AB
  4. Print the final value on the matrix
    Repeat this until AB,AC,AD; BA,BC,BD; CA,CB,CD; DA,DB,DC is created.

Output should be a matrix:

                    A	B	C	D
A      		
B              	
C                      
D

EDIT: I'm going to make a 40x40 matrix which would require 1560 outputs. I made this example 4x4 for simplicity purposes

Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum under special homework rules.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

If this is not homework, please explain the need for this project, let us know what operating system and shell you're using, and show us (in code tags) what you have tried solve this problem.

How is your script supposed to know which files to process? Are they always in a single directory? Can there be any other files in that directory (before you start cat ing and gzip ing)?