A+B - 4
while 1: try: A, B = map(int, input().split()) print(A+B) except: break
예외처리문을 사용해 예외가 발생하면 break를 걸어줬다.
https://wikidocs.net/30