Dimmesdale

Why did Dimmesdale put an A on himself? Was it supposed to be a sign to himself of what he has done?