One bar of candy A and two bars of candy B have 777 calories. Two bars of candy A and one bar of candy B contain 783 calories. Find the caloric content of each candy bar.