Input (grade 5): A-flat major is the flattest major key Domenico Scarlatti used in his keyboard sonatas, though he used it only twice, in K. 127 and K. 130.
Output (grade 4): A-flat major is the major key with the most flats that Domenico Scarlatti used in his keyboard sonatas, though he used it only twice - in K. 127 and K. 130.