We held two competitions: Coding Contest and Robot Maneuver.  In each competition, the contestants taking the 3-rd, 2-nd, and 1-st places receive 100000, 200000, and 300000 yen (the currency of Japan), respectively. Furthermore, a contestant taking the first place in both competitions receives an additional 400000 yen.  DISCO-Kun took the X-th place in Coding Contest and the Y-th place in Robot Maneuver. Find the total amount of money he earned.
if __name__ == '__main__':
  x, y = map(int, input().split())
  priceX = priceY = 0
  
  print(y)
  if(x == 1):
    priceX = 300000
  elif(x == 2):
    priceX = 200000
  elif(x == 3):
    priceX = 100000
  else:
  	priceX = 0

  if(y == 1):
    priceY = 300000
  elif(y == 2):
  	priceY = 200000
  elif(y == 3):
   	priceY = 100000
  else:
   	priceY = 0

  print(priceX)
  print(priceY)
  if(x == 1 and y == 1):
   	print(400000 + priceX + priceY)
  else:
   	print(priceX + priceY)
if __name__ == '__main__':
  x, y = map(int, input().split())
  priceX = priceY = 0
  if(x >= 1 and x <= 205 and y >= 1 and y<= 205):
    if(x == 1):
      priceX = 300000
    elif(x == 2):
      priceX = 200000
    elif(x == 3):
      priceX = 100000
    else:
  	  priceX = 0

    if(y == 1):
      priceY = 300000
    elif(y == 2):
  	  priceY = 200000
    elif(y == 3):
   	  priceY = 100000
    else:
   	  priceY = 0
    
    if(x == 1 and y == 1):
   	  print(400000 + priceX + priceY)
    else:
   	  print(priceX + priceY)