Spots, plages, and flares on lambda Andromedae and II Pegasi