Problem:
 Score: 100 points    Problem Statement  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.      Constraints   1 \leq X \leq 205  1 \leq Y \leq 205  X and Y are integers.         Input  Input is given from Standard Input in the following format:  X  Y       Output  Print the amount of money DISCO-Kun earned, as an integer.        Sample Input 1 1 1      Sample Output 1 1000000  In this case, he earned 300000 yen in Coding Contest and another 300000 yen in Robot Maneuver. Furthermore, as he won both competitions, he got an additional 400000 yen.
In total, he made 300000 + 300000 + 400000 = 1000000 yen.       Sample Input 2 3 101      Sample Output 2 100000  In this case, he earned 100000 yen in Coding Contest.       Sample Input 3 4 4      Sample Output 3 0  In this case, unfortunately, he was the highest-ranked contestant without prize money in both competitions.

Solution (Python):
X, Y = map(int, input().split(' '))
if X == 1 and Y == 1:
    print(1000000)
elif X == 1:
    if Y == 2:
        print(500000)
    elif Y == 3:
        print(400000)
    else:
        print(300000)
elif X == 2:
    if Y == 1:
        print(500000)
    elif Y == 2:
        print(400000)
    elif Y == 3:
        print(300000)
    else:
        print(200000)
elif X == 3:
    if Y == 1:
        print(400000)
    elif Y == 2:
        print(300000)
    elif Y == 3:
        print(200000)
    else:
        print(100000)
else:
    if Y == 1:
        print(300000)
    elif Y == 2:
        print(200000)
    elif Y == 3:
        print(100000)
    else:
        print(0)

Solution (Python):

a,b = map(int,input().split())

res = 0

if a == 1 :
    res += 300000
elif a == 2 :
    res += 200000
elif a == 3 :
    res += 100000

if b == 1 :
    res += 300000
elif b == 2 :
    res += 200000
elif b == 3 :
    res += 100000

if a == 1 and b == 1 :
    res += 400000

print(res)

Solution (Python):
x, y = map(int,input().split())
rwd = 0
if x == 1:
  rwd += 300000
elif x == 2:
  rwd += 200000
elif x == 3:
  rwd += 100000
if y == 1:
  rwd += 300000
elif y == 2:
  rwd += 200000
elif y == 3:
  rwd += 100000
if x == 1 and y == 1:
  rwd += 400000
print(rwd)

Solution (Python):
x, y = input().split()
price = 0
try:
    if 1 <= int(x) <= 205 and 1 <= int(y) <= 205:
        if int(x) == 1 and int(y) == 1:
            price += 400000
        if int(x) == 1:
            price += 300000
        elif int(x) == 2:
            price += 200000
        elif int(x) == 3:
            price += 100000
        if int(y) == 1:
            price += 300000
        elif int(y) == 2:
            price += 200000
        elif int(y) == 3:
            price += 100000

    print(price)
except:
    print(price)

Solution (Python):
n = input().split(' ')
third = 100000
second = 200000
first = 300000
sum = 0
for i in n:
    if int(i) == 3:
        sum = sum + third
    elif  int(i) == 2:
        sum = sum + second
    elif  int(i) == 1:
        sum = sum + first

if int(n[0]) == 1 and int(n[1]) == 1:
    sum = sum + 400000

print(sum)

Solution (Python):
X, Y = [int(x) for x in input().split()]
prize = 0

prize_list = {1:300000, 2:200000, 3:100000}

if X > 0 and X < 4:
    prize += prize_list[X]

if Y > 0 and Y < 4:
    prize += prize_list[Y]

if prize == 600000:
    prize = 1000000

print(prize)

Solution (Python):
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors




a = list(map(int, input().split()))
ans = 0
for i in range(2):
    ans+=max(4-a[i],0)*100000
if(sum(a)==2):
    ans+=400000
    
print(ans)

Solution (Python):
x,y=map(int,input().split())

ttl=0
if(x>3 and y>3):
  ttl=0
else:
  for i in range(1,4):
    if i==x:
        ttl=(4-i)*100000
        break
  for j in range(1,4):
    if j==y:
        ttl=ttl+(4-j)*100000
        break
  if ttl==600000:
    ttl=ttl+400000
print(ttl)

Solution (Python):
input_number = input()
input_list = input_number.split()
coding_contest_rank = int(input_list[0])
robot_maneuver_rank = int(input_list[1])

if coding_contest_rank == 1:
    coding_contest_money = 300000
if robot_maneuver_rank == 1:
    robot_maneuver_money = 300000
if coding_contest_rank == 2:
    coding_contest_money = 200000
if robot_maneuver_rank == 2:
    robot_maneuver_money = 200000
if coding_contest_rank == 3:
    coding_contest_money = 100000
if robot_maneuver_rank == 3:
    robot_maneuver_money = 100000
if coding_contest_rank > 3:
    coding_contest_money = 0
if robot_maneuver_rank > 3:
    robot_maneuver_money = 0
if coding_contest_rank == 1 and robot_maneuver_rank == 1:
    total_money = coding_contest_money + robot_maneuver_money + 400000
    print(total_money)    
else:
    print(coding_contest_money + robot_maneuver_money)

Solution (Python):
X, Y = map(int, input().split())
reward = [300000, 200000, 100000, 0]
X -= 1
Y -= 1
if X >= 3:
  X = 3
if Y >= 3:
  Y = 3
answer = reward[X]+reward[Y]
if X == 0 and Y == 0:
  answer += 400000
print(answer)

Solution (Python):
from sys import stdin
 
lines = stdin.readlines()
X,Y = map(int, lines[0].split())

price = 0
if X == 1:
  price += 300000
elif X == 2:
  price += 200000
elif X == 3:
  price += 100000

if Y == 1:
  price += 300000
elif Y == 2:
  price += 200000
elif Y == 3:
  price += 100000

if X == 1 and Y == 1:
  price += 400000
  
print(price)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

x,y = inpl()
res = 0
if x == 3 :
    res += 100000
if x == 2 :
    res += 200000
if x == 1 :
    res += 300000
if y == 3 :
    res += 100000
if y == 2 :
    res += 200000
if y == 1 :
    res += 300000
if x == 1 and y == 1:
    res += 400000
print(res)

Solution (Python):
A, B = map(int, input().split())

list = [500000,300000,200000,100000,0]

if(A>3):
    A = 4
if(B>3):
    B = 4
elif(A==1 and B==1):
    A=B=0
money = list[A]+list[B]
print(money)

Solution (Python):
x, y = map(int, input().split())
ans = 0
if x ==3:
    ans += 100000
if x ==2:
    ans += 200000
if x ==1:
    ans += 300000
if y ==3:
    ans += 100000
if y ==2:
    ans += 200000
if y ==1:
    ans += 300000
if x == 1 and y == 1:
    ans +=400000
print(ans)

Solution (Python):
def main():
    x,y=list(map(int,input().split(" ")))
    ans=0
    if x==1 and y==1:
        print(300000+300000+400000)
    else:
        if x==1:
            ans=300000
        elif x==2:
            ans=200000
        elif x==3:
            ans=100000
        if y==1:
            ans+=300000
        elif y==2:
            ans+=200000
        elif y==3:
            ans+=100000
        print(ans)

if __name__=="__main__":
    main()

Solution (Python):
def main():
    X, Y = [int(x) for x in input().split()]
    print(a(X)+a(Y)+ (400000 if X==Y==1 else 0))

def a(i):
    if i == 1:
        return 300000
    elif i == 2:
        return 200000
    elif i == 3:
        return 100000
    else:
        return 0
main()

Solution (Python):
x,y=map(int,input().split())
def fun(x):
	price=0
	if x==3:
		price=100000
	elif x==2:
		price=200000
	elif x==1:
		price=300000
	return price
if x ==1 and y ==1:
	print(fun(x)+fun(y)+400000)
else:
	print(fun(x)+fun(y))

Solution (Python):
X, Y = map(int, input().split())

totalAmount = 0
first = 300000
second = 200000
third = 100000
extraPrice = 400000


if X == 1:
    totalAmount = first
    pass
elif X == 2:
    totalAmount = second
    pass
elif X == 3:
    totalAmount = third
    pass
elif X < 1 or X > 3:
    totalAmount = 0
    pass

if Y == 1:
    totalAmount = totalAmount + first
    pass
elif Y == 2:
    totalAmount = totalAmount + second
    pass
elif Y == 3:
    totalAmount = totalAmount + third
    pass
elif Y < 1 or Y > 3:
    totalAmount = totalAmount + 0
    pass

if X == 1 and Y == 1:
    totalAmount = totalAmount + extraPrice

print(totalAmount)

Solution (Python):
x,y = map(int,input().split())
t = [300000,200000,100000]+[0 for i in range(300)]
if x==y==1:
    print(1000000)
else:
    print(t[x-1]+t[y-1])

Solution (Python):
a = list(map(int, input().split()))

for i in range(len(a)):
  if a[i] == 1:
    a[i] = 300000
  elif a[i] == 2:
    a[i] = 200000
  elif a[i] == 3:
    a[i] = 100000
  else:
    a[i] = 0

    
if a[0] == 300000 and a[1] == 300000:
  p = 1000000
else:
  p = a[0] + a[1]
      
print(p)

Solution (Python):
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)

Solution (Python):
a,b=map(int,input().split())
s=0
g=0
if a==1:
  s=300000
elif a==2:
  s=200000
elif a==3:
  s=100000
else:
  s=0
if b==1:
  g=300000
elif b==2:
  g=200000
elif b==3:
  g=100000
else:
  g=0
if a==1 and b==1:
  print(g+s+400000)
else:
  print(s+g)

Solution (Python):
X, Y = map(int, input().split())

sumPriz = 0

if X == 1:
    sumPriz += 300000
elif X == 2:
    sumPriz += 200000
elif X == 3:
    sumPriz += 100000

if Y == 1:
    sumPriz += 300000
    if X == 1:
        sumPriz += 400000
elif Y == 2:
    sumPriz += 200000
elif Y == 3:
    sumPriz += 100000

print(sumPriz)

Solution (Python):
x, y = map(int, input().split())
s = [400000, 300000, 200000, 100000]

ax = 0
ay = 0

if x<4:
	ax=s[x]

if y<4:
	ay=s[y]

ans = ax+ay
if x==1 and y==1:
	ans += s[0]

print(ans)

Solution (Python):
X, Y = map(int,input().split())

p = []

if X == 1:
  p.append(300000)
elif X == 2:
  p.append(200000)
elif X == 3:
  p.append(100000)

if Y == 1:
  p.append(300000)
elif Y == 2:
  p.append(200000)
elif Y == 3:
  p.append(100000)


if X == 1 and Y == 1:
  p.append(400000)

ans = sum(p)
print(ans)

Solution (Python):
x,y=map(int,input().split())
if x==1 and y==1:
  print(1000000)
elif x<=3 and y>=4:
  print((x-4)*(-100000))
elif x>=4 and y<=3:
  print((y-4)*(-100000))
elif x<=3 and y<=3:
  print((x-4)*(-100000)+(y-4)*(-100000))
else:
  print(0)

Solution (Python):
X, Y = map(int, input().split())

if X == 1 and Y == 1:
    print(1000000)

elif (X == 1 and Y == 2) or (X == 2 and Y == 1):
    print(500000)

elif (X == 1 and Y == 3) or (X == 3 and Y == 1) or (X == 2 and Y == 2):
    print(400000)

elif (X == 1 and Y >= 4) or (X >= 4 and Y == 1) or (X == 2 and Y == 3) or (X == 3 and Y == 2):
    print(300000)

elif (X == 2 and Y >= 4) or (X >= 4 and Y == 2) or (X == 3 and Y == 3):
    print(200000)

elif (X == 3 and Y >= 4) or (X >= 4 and Y == 3):
    print(100000)

else:
    print(0)

Solution (Python):
a = input().split()

x = a[0]
y = a[1]
def h(x,y):
    d = dict()
    d = {'1':300000,'2':200000,'3':100000}
    if x=='1' and y =='1':
        print(1000000)
        return
    res = 0
    res = d.get(x,0) + d.get(y,0)
    print(int(res))
h(x,y)

Solution (Python):




x, y = map(int,input().split())
ans = 0

if x == 1:
    ans = 300000
elif x == 2:
    ans = 200000
elif x == 3:
    ans = 100000

if y == 1:
    ans += 300000
elif y == 2:
    ans += 200000
elif y == 3:
    ans += 100000

if x == 1 and y == 1:
    ans += 400000


print(ans)

Solution (Python):
code,implement = input().split(" ")

def prize_dict(rank):
    if rank == "1":
        prize = 300000
    elif rank == "2":
        prize = 200000
    elif rank == "3":
        prize = 100000
    else:
        prize = 0
    return prize


if code == "1" and implement == "1":
    prize = 1000000
else:
    prize = prize_dict(code)+prize_dict(implement)
print(prize)

Solution (Python):
[X,Y] = list(map(int,input().split()))
shokin = 0

if X==1:
    shokin +=300000
elif X==2:
    shokin +=200000
elif X==3:
    shokin +=100000

if Y==1:
    shokin +=300000
    if X==1:
        shokin += 400000
elif Y==2:
    shokin +=200000
elif Y==3:
    shokin +=100000

print(shokin)

Solution (Python):
x,y= map(int, input().split())
c=0
if x==3:
  c+=100000
elif x==2:
  c+=200000
elif x==1:
  c+=300000
if y==3:
  c+=100000
elif y==2:
  c+=200000
elif y==1:
  c+=300000
if x==1 and y==1:
  c+=400000
print(c)

Solution (Python):
X, Y = map(int, input().split())
money = 0
for i in [X, Y]:
    if i == 1:
        money += 300000
    elif i == 2:
        money += 200000
    elif i == 3:
        money += 100000
if X == 1 and Y == 1:
    money += 400000
print(money)

Solution (Python):
X, Y = map(int, input().split())

ans = 0
if X == 1:
    ans += 300000
elif X == 2:
    ans += 200000
elif X == 3:
    ans += 100000

if Y == 1:
    ans += 300000
elif Y == 2:
    ans += 200000
elif Y == 3:
    ans += 100000
if X == Y == 1:
    ans += 400000
print(ans)

Solution (Python):
a,b = map(int,input().split())
price = 0
if a == 1 and b ==1:
  price +=400000
if a == 1:
  price +=300000
elif a ==2:
  price +=200000
elif a ==3:
  price +=100000
else:
  pass
if b == 1:
  price +=300000
elif b ==2:
  price +=200000
elif b ==3:
  price +=100000
else:
  pass
print(price)

Solution (Python):
x, y = [int(item) for item in input().split()]

res = 0

if x == 1:
    res += 300000
elif x == 2:
    res += 200000
elif x == 3:
    res += 100000

if y == 1:
    res += 300000
elif y == 2:
    res += 200000
elif y == 3:
    res += 100000

if x == 1 and y == 1:
    res += 400000

print(res)

Solution (Python):
money = 0
x, y = map(int, input().split())

def func(grade):
    global money
    if grade == 1:
        money += 300000
    elif grade == 2:
        money += 200000
    elif grade == 3:
        money += 100000

func(x)
func(y)

if x == 1 and y == 1:
    money += 400000

print(money)

Solution (Python):
x,y = map(int,input().split())
ans = 0
if x == 1:
    ans += 300000
elif x == 2:
    ans += 200000
elif x == 3:
    ans += 100000

if y == 1:
    ans += 300000
elif y == 2:
    ans += 200000
elif y == 3:
    ans += 100000

if x == 1 and y == 1:
    ans += 400000

print(ans)

Solution (Python):
X, Y = map(int, input().split())
ans = 0
if X == 1:
    ans += 300000
if Y == 1:
    ans += 300000
if X == 2:
    ans += 200000
if Y == 2:
    ans += 200000
if X == 3:
    ans += 100000
if Y == 3:
    ans += 100000
if X == 1 and Y == 1:
    ans += 400000
print(ans)

Solution (Python):
raw_input = input()
input_list = raw_input.split()   
 
coding_contest_rank = int(input_list[0])
robot_rank = int(input_list[1])


if coding_contest_rank == 3:
    coding_money = 100000
if robot_rank == 3:
    robot_money = 100000
if coding_contest_rank == 2:
    coding_money = 200000
if robot_rank == 2:    
    robot_money = 200000
if coding_contest_rank == 1:
    coding_money = 300000
if robot_rank == 1:    
    robot_money = 300000
if coding_contest_rank > 3:
    coding_money = 0
if robot_rank > 3:
    robot_money = 0

if coding_contest_rank == 1 and robot_rank == 1: 
    print(coding_money + robot_money + 400000)
else:
    print(coding_money + robot_money)

Solution (Python):
raw_input = input()
input_list = raw_input.split()   
 
coding_contest_rank = int(input_list[0])
robot_rank = int(input_list[1])


if coding_contest_rank == 3:
    coding_money = 100000
if robot_rank == 3:
    robot_money = 100000
if coding_contest_rank == 2:
    coding_money = 200000
if robot_rank == 2:    
    robot_money = 200000
if coding_contest_rank == 1:
    coding_money = 300000
if robot_rank == 1:    
    robot_money = 300000
if coding_contest_rank > 3:
    coding_money = 0
if robot_rank > 3:
    robot_money = 0

if coding_contest_rank == 1 and robot_rank == 1: 
    print(coding_money + robot_money + 400000)
else:
    print(coding_money + robot_money)

Solution (Python):
x, y = map(int, input().split())

d = {1:300000, 2:200000, 3:100000}

if x == 1 and y == 1:
	print(10**6)
	exit()

su = 0
if x in d:
	su += d[x]
if y in d:
	su += d[y]
print(su)

Solution (Python):
X,Y = map(int,input().split())
ans = 0
if X == 3:
    ans += 100000
if X == 2:
    ans += 200000
if X == 1:
    ans += 300000
if Y == 3:
    ans += 100000
if Y == 2:
    ans += 200000
if Y == 1:
    ans += 300000
if X == 1 and Y == 1:
    ans += 400000
print(ans)

Solution (Python):
x,y=map(int,input().split())
ans=0
if x==1 and y==1:
  print(1000000)
else:
  if x==3:
    ans+=100000
  if y==3:
    ans+=100000
  if x==2:
    ans+=200000
  if y==2:
    ans+=200000
  if x==1:
    ans+=300000
  if y==1:
    ans+=300000
  print(ans)

Solution (Python):
a,b= map(int,input().split())
res=0

if a==1:
    res+=300000
if b==1:
    res+=300000
if a==2: 
    res+=200000
if b==2: 
    res+=200000
if a==3: 
    res+=100000
if b==3: 
    res+=100000    
if a==1 and b==1:
    res=1000000
    
print(res)

Solution (Python):
x, y = map(int,input().split())

ans = 0
if x == 1 and y == 1:
    ans += 4
if x == 1:
    ans += 3
if x == 2:
    ans += 2
if x == 3:
    ans += 1
if y == 1:
    ans += 3    
if y == 2:
    ans += 2
if y == 3:
    ans += 1

print(ans * 100000)

Solution (Python):
a,b = map(int,input().split())
ans = 0
if a == 1:ans += 300000
elif a == 2:ans += 200000
elif a == 3:ans += 100000
if b == 1:ans += 300000
elif b == 2:ans += 200000
elif b == 3:ans += 100000
if ans == 600000:ans += 400000
print(ans)

Solution (Python):
X, Y = map(int,input().split())
AnswerX = 0
AnswerY = 0
AnswerW = 0
if X*Y == 1:
  AnswerW = 400000
if X == 1:
  AnswerX= 300000
elif X==2:
  AnswerX = 200000
elif X==3:
  AnswerX = 100000
if Y == 1:
  AnswerY= 300000
elif Y==2:
  AnswerY = 200000
elif Y==3:
  AnswerY = 100000
  
Answer = AnswerX + AnswerY + AnswerW
print(Answer)

Solution (Python):
X,Y=map(int,input().split())

prize=0

if X==1:
    prize+=300000
    if Y==1:
        prize+=700000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
elif X==2:
    prize+=200000
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
elif X==3:
    prize+=100000
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass
else:
    if Y==1:
        prize+=300000
    elif Y==2:
        prize+=200000
    elif Y==3:
        prize+=100000
    else:
        pass

print(prize)

Solution (Python):
from fractions import gcd
from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
import sys
from bisect import *
import itertools
import copy
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7


def main():
    x, y = map(int, input().split())
    if x == 1 and y == 1:
        print(1000000)
        exit()
    ans = 0
    if x <= 3:
        ans += (4 - x) * 100000
    if y<=3:
        ans += (4 - y) * 100000
    print(ans)
                    


if __name__ == '__main__':
    main()

Solution (Python):

first = 300000
second = 200000
third = 100000
extra = 400000
no = 0

X, Y = map(int, input().split())

if X == 1 and Y == 1:
    {
        print(first + first + extra)
    }
elif X == 1 and Y == 2:
    {
        print(first + second)
    }
elif X == 1 and Y == 3:
    {
        print(first + third)
    }
elif X == 2 and Y == 1:
    {
        print(second + first)
    }
elif X == 2 and Y == 2:
    {
        print(second + second)
    }
elif X == 2 and Y == 3:
    {
        print(second + third)
    }
elif X == 3 and Y == 1:
    {
        print(third + first)
    }
elif X == 3 and Y == 2:
    {
        print(third + second)
    }
elif X == 3 and Y == 3:
    {
        print(third + third)
    }
elif X == 1 and Y > 3:
    {
        print(first + no)
    }
elif X == 2 and Y > 3:
    {
        print(second + no)
    }
elif X == 3 and Y > 3:
    {
        print(third + no)
    }
elif X > 3 and Y == 3:
    {
        print(no + third)
    }
elif X > 3 and Y == 2:
    {
        print(no + second)
    }
elif X > 3 and Y == 1:
    {
        print(no + first)
    }
else:
    {
        print(0 )
    }

Solution (Python):
a,b=map(int,input().split())

sum = 0

if a == 1:
  sum = sum + 300000
elif a == 2 :
  sum = sum + 200000
elif a == 3 :
  sum = sum + 100000
  
if b == 1:
  sum = sum + 300000
elif b == 2 :
  sum = sum + 200000
elif b == 3 :
  sum = sum + 100000
  
if a == 1 and b == 1:
  print(1000000)
else:
  print(sum)

Solution (Python):

x,y=map(int,input().split())
ans=0
if x==1:
    ans+=300000
elif x==2:
    ans+=200000
elif x==3:
    ans+=100000
if y==1:
    ans+=300000
elif y==2:
    ans+=200000
elif y==3:
    ans+=100000
if x==y==1:
    ans+=400000
print(ans)

Solution (Python):
x, y = map(int, input().split())
ans = max([0, (4-x)*100000])+max([0, (4-y)*100000])
if x == 1 and y == 1:
    ans += 400000
    
print(ans)

Solution (Python):
s = 0
for i in map(int, input().split()):
    if i==1:
        s+=300000
    elif i==2:
        s+=200000
    elif i==3:
        s+=100000
if s==600000:
    s=1000000
print(s)

Solution (Python):
from sys import stdin
x,y = map(int, stdin.readline().rstrip().split())

if x == 1 and y == 1:
    print(1000000)
    exit()
else:
    pass
ans = 0
if x == 1:
    ans += 300000
elif x == 2:
    ans += 200000
elif x == 3:
    ans += 100000
else:
    pass
if y == 1:
    ans += 300000
elif y == 2:
    ans += 200000
elif y == 3:
    ans += 100000
else:
    pass

print(ans)

Solution (Python):
s = 0
for i in map(int, input().split()):
    if i == 1:
        s+=300000
    elif i ==2 :
        s+= 200000
    elif i ==3 :
        s+= 100000
if s== 600000:
    s = 1000000
print(s)

Solution (Python):
x, y = map(int, input().split())
d = {
    4: 0,
    3: 100000,
    2: 200000,
    1: 300000
}
ans = d[min(x, 4)] + d[min(y, 4)]
if x * y == 1:
    ans += 400000
print(ans)

Solution (Python):
x,y = map(int, input().split())
point = 0
if x == 1 and y == 1:
    point = 400000
    
if x == 1:
    point += 300000
elif x == 2:
    point += 200000
elif x == 3:
    point += 100000
else:
    pass

if y == 1:
    point += 300000
elif y == 2:
    point += 200000
elif y == 3:
    point += 100000
else:
    pass

print(point)

Solution (Python):
s = 0
for i in map(int, input().split()):
    if i == 1:
        s+=300000
    elif i ==2 :
        s+= 200000
    elif i ==3 :
        s+= 100000
if s== 600000:
    s = 1000000
print(s)

Solution (Python):
def A():
    temp = [int(i) for i in input().split()]
    ans = 0
    for n in temp:
        if n<4:
            ans += (4-n)*100000
    if temp[0] == 1 and temp[1] == 1:
        ans += 400000
    print(ans)

A()

Solution (Python):
def main():
    X,Y=map(int,input().split())
    if X==1 and Y==1:
        print('1000000')
    elif (X==1 and Y==2) or (X==2 and Y==1):
        print('500000')
    elif (X==1 and Y==3) or (X==3 and Y==1):
        print('400000')
    elif (X==1 and Y>3) or (X>3 and Y==1):
        print('300000')
    elif (X==2 and Y==2):
        print('400000')
    elif (X==2 and Y==3) or (X==3 and Y==2):
        print('300000')
    elif (X==2 and Y>3) or (X>3 and Y==2):
        print('200000')
    elif (X==3 and Y==3):
        print('200000')
    elif (X==3 and Y>3) or (X>3 and Y==3):
        print('100000')
    else:
        print('0')
        

        
if __name__=='__main__':
    main()

Solution (Python):
list = [int(i) for i in input().split()]
money = 0

for i in range(len(list)):
    if list[i] == 1:
        money += 300000
    elif list[i] == 2:
        money += 200000
    elif list[i] == 3:
        money += 100000

if list[0] * list[1] == 1:
    money += 400000

print(money)

Solution (Python):
x,y=map(int,input().split())
score = max(4-x,0)+max(4-y,0)
if score==6:
  score+=4
print(score*100000)

Solution (Python):
X, Y = map(int, input().split())
first = 300000
second = 200000 
third = 100000
if ((X==1 and ((X<205 and X>=1) and (Y>=1 and Y<205)) and Y==1)):
    print(first+first+400000)
elif (X==2 and Y==2):
    print(second+second)
elif (X==3 and Y==3):
    print(third+third)
elif ((X==1 and Y==2) or(X==2 and Y==1)):
    print(first+second)
elif ((X==1 and Y==3) or(X==3 and Y==1) ):
     print(first+third)
elif ((X==2 and Y==3) or(X==3 and Y==2) ):
    print(second+third)
elif ((X==3 and Y>3) or(X>3and Y==3) ):
    print(third)
elif ((X==2 and Y>3) or(X>3 and Y==2) ):
    print(second)
elif ((X==1 and Y>3) or(X>3 and Y==1) ):
    print(first)
else:
    print(0)

Solution (Python):
s = input().split()
m = 0
n = 0
if s[0] == '1':
  m += 300000
  n += 1
elif s[0] == '2':
    m += 200000
elif s[0] == '3':
    m += 100000
if s[1] == '1':
  m += 300000
  n += 1
elif s[1] == '2':
    m += 200000
elif s[1] == '3':
    m += 100000
if n == 2:
  m += 400000
print(m)

Solution (Python):

a, b = map(int, input().split())
money = 0
if a == 1:
    money += 300000
    if b == 2:
        money  += 200000
    elif b ==3:
        money  += 100000

    elif b == 1:
        money += 700000

elif a == 2:
    money += 200000
    if b == 2:
        money += 200000
    elif b == 3:
        money += 100000
    elif b ==1:
        money += 300000

elif a == 3:
    money += 100000
    if b == 2:
        money += 200000
    elif b == 3:
        money += 100000
    elif b == 1:
        money += 300000

else:
    if b == 2:
        money += 200000
    elif b == 3:
        money += 100000
    elif b == 1:
        money += 300000

print(money)

Solution (Python):
x , y = map(int,input().split())
n = max(x , y)
if x == y == 1:
    print(1000000)
elif min(x , y) == 1:
    if n == 2:
        print(500000)
    elif n == 3:
        print(400000)
    else:
        print(300000)
elif min(x , y) == 2:
    if n == 2:
        print(400000)
    elif n == 3:
        print(300000)
    else:
        print(200000)
elif min(x , y) == 3:
    if n == 3:
        print(200000)
    else:
        print(100000)
else:
    print(0)

Solution (Python):
s = 0
for i in map(int, raw_input().split()):
    if i == 1:
        s+=300000
    elif i ==2 :
        s+= 200000
    elif i ==3 :
        s+= 100000
if s== 600000:
    s = 1000000
print(s)

Solution (Python):

first = 300000
second = 200000
third = 100000
extra = 400000
no = 0

X, Y = map(int, input().split())

if X == 1 and Y == 1:
    {
        print(first + first + extra)
    }
elif X == 1 and Y == 2:
    {
        print(first + second)
    }
elif X == 1 and Y == 3:
    {
        print(first + third)
    }
elif X == 2 and Y == 1:
    {
        print(second + first)
    }
elif X == 2 and Y == 2:
    {
        print(second + second)
    }
elif X == 2 and Y == 3:
    {
        print(second + third)
    }
elif X == 3 and Y == 1:
    {
        print(third + first)
    }
elif X == 3 and Y == 2:
    {
        print(third + second)
    }
elif X == 3 and Y == 3:
    {
        print(third + third)
    }
elif X == 1 and Y > 3:
    {
        print(first + no)
    }
elif X == 2 and Y > 3:
    {
        print(second + no)
    }
elif X == 3 and Y > 3:
    {
        print(third + no)
    }
elif X > 3 and Y == 3:
    {
        print(no + third)
    }
elif X > 3 and Y == 2:
    {
        print(no + second)
    }
elif X > 3 and Y == 1:
    {
        print(no + first)
    }
else:
    {
        print(0 + no)
    }

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x,y = map(int,read().split())

answer = 0
for t in [x,y]:
    if t == 1:
        answer += 3
    elif t == 2:
        answer += 2
    elif t == 3:
        answer += 1
if x == y == 1:
    answer = 10

answer *= (10**5)
print(answer)

Solution (Python):

X, Y = map(int, input().split())

def get_money(rank):
    money = 0
    if rank == 1:
        money = 300000
    elif rank == 2:
        money = 200000
    elif rank == 3:
        money = 100000
    return money

ans = 0
ans += get_money(X)
ans += get_money(Y)

if X == 1 and Y == 1:
    ans += 400000

print(ans)

Solution (Python):
X,Y=map(int,input().split())
ans=0
if X==1:
  ans+=300000
if X==2:
  ans+=200000
if X==3:
  ans+=100000
if Y==1:
  ans+=300000
if Y==2:
  ans+=200000
if Y==3:
  ans+=100000
if X==1 and Y==1:
  ans+=400000
print(ans)

Solution (Python):
aw = 0
for i in map(int, input().split()):
    if i == 1:
        aw+=300000
    elif i ==2 :
        aw+= 200000
    elif i ==3 :
        aw+= 100000
if aw== 600000:
    aw= 1000000
print(aw)

Solution (Python):
ranks = list(map(int,input().split()))
x, y = ranks[0], ranks[1]
total = 0

if x == 1 :
    total += 300000
elif x == 2 :
    total += 200000
elif x == 3 :
    total += 100000

if y == 1 :
    total += 300000
elif y == 2 :
    total += 200000
elif y == 3 :
    total += 100000

if x == y == 1 :
    total += 400000

print(total)

Solution (Python):
X,Y = map(int,input().split())
Z = int(400000)

if X == 1:
	A = 300000
elif X == 2:
	A = 200000
elif X == 3:
  	A = 100000
else:
  	A = 0

if Y == 1:
	B = 300000
elif Y == 2:
	B = 200000
elif Y == 3:
  	B = 100000
else:
  	B = 0
    
if X + Y == 2:
	print(A + B + Z)
else:
  	print(A + B)

Solution (Python):
x, y = map(int, input().split())
r = 0

if x == 1 or y == 1:
	r += 300000
if x == 2 or y == 2:
	r += 200000
if x == 3 or y == 3:
	r += 100000	
if x == 1 and y == 1:
	r = 1000000
if x == 2 and y == 2:
	r = 400000
if x == 3 and y == 3:
	r = 200000

print(r)

Solution (Python):
X,Y = map(int,input().split())
money=0
if X==1:
    money=money+300000
elif X==2:
    money=money+200000
elif X==3:
    money=money+100000
if Y==1:
    money=money+300000
elif Y==2:
    money=money+200000
elif Y==3:
    money=money+100000
if X==1 and Y==1:
    money=money+400000
print(money)

Solution (Python):
x,y=(int(x) for x in input().split())
b = 0
if x == 1:
    b += 300000
elif x == 2:
    b += 200000
elif x == 3:
    b += 100000
else:
    b += 0
if y == 1:
    b += 300000
elif y == 2:
    b += 200000
elif y == 3:
    b += 100000
else:
    b += 0
if x == 1 and y == 1:
    b += 400000

print(b)

Solution (Python):
X, Y = input().split()
X = int(X)
Y = int(Y)
if X >= 4 and Y >= 4:
    print(0)
elif X == 1 and Y == 1:
    print(1000000)
elif X <= 3:
    if Y >= 4:
        print(400000-X*100000)
    else:
        print((400000-X*100000)+(400000-Y*100000))
else:
    print(400000-Y*100000)

Solution (Python):
x,y=map(int,input().split())
if x==1 and y==1:print(1000000)
else:
  if x==1:
    if y==2:print(500000)
    elif y==3:print(400000)
    else:print(300000)
  elif x==2:
    if y==1:print(500000)
    elif y==2:print(400000)
    elif y==3:print(300000)
    else:print(200000)
  elif x==3:
    if y==1:print(400000)
    elif y==2:print(300000)
    elif y==3:print(200000)
    else:print(100000)
  else:
    if y==1:print(300000)
    elif y==2:print(200000)
    elif y==3:print(100000)
    else:print(0)

Solution (Python):
x,y=map(int,input().split())
ans=0
if x==1:
  ans=ans+300000
elif x==2:
  ans=ans+200000
elif x==3:
  ans=ans+100000

if y==1:
  ans=ans+300000
elif y==2:
  ans=ans+200000
elif y==3:
  ans=ans+100000
if x==1and y==1:
  ans=ans+400000
print(ans)

Solution (Python):
X, Y = map(int, input().split())

result = 0

if X == 1:
    result = 300000
elif X == 2:
    result = 200000
elif X == 3:
    result = 100000

if Y == 1:
    result += 300000
elif Y == 2:
    result += 200000
elif Y == 3:
    result += 100000

if X == 1 and Y == 1:
    result += 400000

print(result)