Pairwise sequence distances form the symmetric matrix that tree building starts from.
highlighted = computed this step
Measure every pair
We start from 4 equal-length sequences and measure the Hamming distance between every pair — the number of columns in which they differ.
d(W,X)=#{differing columns}
Collect the distances into a matrix
The pairwise distances form a symmetric matrix with a zero diagonal. This matrix — not the sequences themselves — is the input to tree building. The closest pair here, 2, is W and X.