The Alcoholics Anonymous prayer is based on one by Reinhold Niebuhr. It is:
"God, grant me the serenity to accept the things I cannot change,
courage to change the things I can, and the wisdom to know the
The original prayer by Niebuhr:
"God, give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed, and the wisdom to distinguish the one from the other."
A. A., The Twelve Traditions; Bartlett's Familiar Quotations.