Tram tickets have six-digit numbers(from $000000$ to $999999$).A ticket is called $lucky$ if the sum of its first three digits is equal to that of its last three digits.A ticket is called $medium$ if the sum of all of its digits is $27$.Let $A$ and $B$ denote the numbers of $lucky$ tickets and $medium$ tickets,respectively.Find $A-B$.
(I have solved this using $\text{Generating Function}$ .But the solution consists of many calculations .So,I want to see a easy and nice solution.)
St.Petersburg 1989
"Questions we can't answer are far better than answers we can't question"