If only two letters are used, you basically have binary numbers. Loop through all combinations of 2 letters, and for each combination, get all the 4-digit to 6-digit binary numbers and replace the 0s with your first letter and 1s with your second letter.