There's an old English nursery rhyme called Great A, little a, Bouncing B that this is most likely based on. The earliest version in print of that rhyme goes back to 1744…

Notes

*That means a spanking – originally it was with a branch from a hickory tree.
**An early definition of "cat" in US slang was "itinerant worker" – before it came to mean just "guy".

The closest British version of this rhyme is:

A, B, C, tumble down D,
The cat's in the cupboard, and can't see me.


*****

Thanks and Acknowledgements

This rhyme can be found in Negro Folk Rhymes, Wise and Otherwise, with a Study by Thomas W. Talley of Fisk University (1922).

Standard English version by Lisa Yannucci.