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):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


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


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count




X,Y = IL()
ans = 0
if X==Y==1:
  ans += 400000
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
print(ans)

Solution (Python):

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

ans = max(4-X,0)* 100000 + max(4-Y,0)* 100000
if (X == Y) *  (Y== 1):
  ans += 400000
print(ans)

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

if x == 1 and y == 1:
    print(1000000)
    exit()

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)

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

sys.setrecursionlimit(10**7)

ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

x, y = na()
x -= 1
y -= 1
c = [300000, 200000, 100000]
ans = 0
if x < 3:
    ans += c[x]
if y < 3:
    ans += c[y]
if x == 0 and y == 0:
    ans += 400000

print(ans)

Solution (Python):
x,y = map(int,input().split())
ans = 0
for i in range(1,4):
    for j in [x,y]:
        if j == i:
            ans += (4-i)*10**5
print(ans+400000 if x*y == 1 else ans)

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

money = [3*10**5,2*10**5,10**5]

ans = 0
if X == 1 and Y == 1:
    ans = 2*money[0] + 4*10**5
    print(ans)
else:
    if X <= 3:
        ans += money[X-1]
    if Y <= 3:
        ans += money[Y-1]
    print(ans)

Solution (Python):


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

l1 = [1,2,3]
l2 = [300000,200000,100000]

ans = 0
if x in l1:
    ans += l2[l1.index(x)]
    
if y in l1:
    ans += l2[l1.index(y)]

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

print(ans)

Solution (Python):
from statistics import median


from fractions import gcd
from itertools import combinations 
from collections import deque
from collections import defaultdict
import bisect










import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
x,y = readInts()
a = [300000,200000,100000] + [0] * 2000
print(a[0] + a[0] + 400000 if x == y == 1 else a[x-1] + a[y-1])

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
l = LI()
ans = 0
for i in l:
    if i == 1:
        ans += 300000
    elif i == 2:
        ans += 200000
    elif i == 3:
        ans += 100000
if l[0] == l[1] == 1:
    ans += 400000
print(ans)

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

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]





X, Y = mi()

l = [0, 300000, 200000, 100000]

for i in range(205):
    l.append(0)
    
ans = l[X] + l[Y]
if X==Y==1:
    print(ans + 400000)
else:
    print(ans)

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

ans = max(0, (4 - X) * 100000)
ans+= max(0, (4 - Y) * 100000)

if X == Y == 1:
    ans += 100000 * 4

print (ans)

Solution (Python):
X, Y = map(int, input().split())
price = [0, 300000, 200000, 100000] + [0]*300
ans = price[X] + price[Y] + 400000*(X == Y == 1)

print(ans)

Solution (Python):
h = list(map(int,input().split()))
mo = 0
for x in h:
  if x == 1:
    mo += 300000
  elif x == 2:
    mo += 200000
  elif x == 3:
    mo += 100000
if h[0] == h[1] == 1:
  mo += 400000
print(mo)

Solution (Python):
import heapq
from sys import stdin
input = stdin.readline




x = list(map(int, input().split()))








 
def main():
    sal = {1:(3*10**5),2:2*(10**5),3:10**5}
    ans = 0
    for i in x:
        if i not in sal:
            continue
        ans+=sal[i]
    if x[0]==1 and x[1]==1:
        ans+=4*(10**5)
    print(ans)

if __name__ == '__main__':
    main()

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

ans=0
if X==1 and Y==1:
    print(1000000)
    quit()
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):
x,y = map(int,input().split())
if x==1 and y==1:
    print(1000000)
else:
    print(100000*(max(4-x,0)+max(4-y,0)))

Solution (Python):
a = input().split()
x = 0
if a[0] == "1" and a[1] == "1":
    x = 1000000
elif a[0] == "1":
    x = x + 300000
elif a[1] == "1":
    x = x + 300000
if a[0] == "2":
    x = x + 200000
if a[0] == "3":
    x = x + 100000
if a[1] == "2":
    x = x + 200000
if a[1] == "3":
    x = x + 100000
print(x)

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

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

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

Solution (Python):
X,Y=map(int, input().split())
v = [300000, 200000, 100000]
x = 0
y = 0
if X <= 3:
    x = int(v[X-1])
if Y <= 3:
    y = int(v[Y-1])
print(int(x + y + ((X==1) & (Y==1)) * 400000))

Solution (Python):
X,Y=map(int, input().split())
v1 = [300000, 200000, 100000]
v2 = [300000, 200000, 100000]
x = 0
y = 0
if X <= 3:
    x = int(v1[X-1])
if Y <= 3:
    y = int(v2[Y-1])
if ((X==1) & (Y==1)):
    print(int(x + y + 400000))
else:
    print(int(x + y))

Solution (Python):
A,B = list(map(int,input().split()))
N={1:300000,2:200000,3:100000}
if A ==1 and B==1:
    print(1000000)
else:
    try:
        A=N[A]
    except KeyError:
        A=0
    try:
        B=N[B]
    except KeyError:
        B=0
    print(A+B)

Solution (Python):
XY=list(map(int,input().split()))
prize=0
for xy in XY:
    if xy==1:
        prize+=300000
    elif xy==2:
        prize+=200000
    elif xy==3:
        prize+=100000
if sum(XY)==2:
    prize+=400000
print(prize)

Solution (Python):
X, Y = map(int, input().split())
ans = 0
for z in [X,Y]:
  if z == 3:
    ans += 10**5
  elif z == 2:
    ans += 2*10**5
  elif z == 1:
    ans += 3*10**5
if X == Y == 1:
  ans += 4*10**5
print(ans)

Solution (Python):
x, y = map(int, input().split())
ans = 0
m = [300000, 200000, 100000]
if x <= 3:
    ans += m[x - 1]
if y <= 3:
    ans += m[y - 1]
if x == 1 and y == 1:
    ans += 400000

print(ans)

Solution (Python):
x,y = input().split()
d = {"1":300000,"2":200000,"3":100000}
if x=="1" and y=="1":
    print(d.get(x,0)+d.get(y,0)+400000)
else:
    print(d.get(x,0)+d.get(y,0))

Solution (Python):
X,Y = map(int,input().split())
ans = max(4-X, 0) + max(4-Y, 0)
print(ans * 10**5 if ans != 6 else 10**6)

Solution (Python):
x, y = map(int, input().split())
ans = max(4 - x, 0) + max(4 - y, 0)
print(ans * 10**5 if ans != 6 else 10**6)

Solution (Python):
x, y = map(int, input().split())
ans = max(-x + 4, 0) + max(-y + 4, 0)
print(ans * 10**5 if ans != 6 else 10**6)

Solution (Python):
from collections import defaultdict
X,Y = list(map(int,input().split()))
M = defaultdict(int)
M[3] = 100000
M[2] = 200000
M[1] = 300000
sm = 0
sm += M[X]
sm += M[Y]
if X == Y == 1:
    sm += 400000
print(sm)

Solution (Python):
x,y = map(int,input().split())
c = 0
for i in [x,y]:
  if i < 4:
    c += [3*10**5,2*10**5,10**5][i-1]
if x == y == 1:
  c += 4*10**5
print(c)

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

r=0

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

print(r)

Solution (Python):
X, Y = map(int, input().split())
award = [300000, 200000, 100000]
ans = 0

if X <= 3:
    ans += award[X-1]

if Y <= 3:
    ans += award[Y-1]

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

print(ans)

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

def main():
    x,y = map(int, readline().split())

    ans = 0

    d = {}
    d[1] = 300000
    d[2] = 200000
    d[3] = 100000

    if x in d:
        ans += d[x]
    
    if y in d:
        ans += d[y]

    if x == 1 and y == 1:
        ans += 400000
    
    print(ans)
    

if __name__ == "__main__":
    main()

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

def main():
    x,y = map(int, readline().split())

    ans = 0

    d = {}
    d[1] = 300000
    d[2] = 200000
    d[3] = 100000

    if x in d:
        ans += d[x]
    
    if y in d:
        ans += d[y]

    if x == 1 and y == 1:
        ans += 400000
    
    print(ans)
    

if __name__ == "__main__":
    main()

Solution (Python):
x, y = map(int,input().split())
ans = 400000 if x == y ==1 else 0

for i in [x,y]:
    if i > 3:
        continue
    ans += (4-i)*100000
print(ans)

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

def f(x):
  if x==3:
    return 100000
  elif x==2:
    return 200000
  elif x== 1:
    return 300000
  else:
    return 0

ans = f(x)+f(y)
if x == y== 1:
  ans += 400000
print(ans)

Solution (Python):
x,y = map(int,input().split())
a = 300000
b = 200000
c = 100000

if x == 1:
    if y==1:
        print(1000000)
    elif y==2:
        print(a+b)
    elif y==3:
        print(a+c)
    else:
        print(a)
if x == 2:
    if y==1:
        print(a+b)
    elif y==2:
        print(b+b)
    elif y==3:
        print(b+c)
    else:
        print(b)
if x == 3:
    if y==1:
        print(a+c)
    elif y==2:
        print(c+b)
    elif y==3:
        print(c+c)
    else:
        print(c)
if x>3 and y>3:
    print(0)
if x>3 and y == 1:
    print(a)
if x>3 and y == 2:
    print(b)
if x>3 and y == 3:
    print(c)

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))

def resolve():
    X,Y=pin()
    t=10**5
    a=[0,t*3,t*2,t*1]+[0]*1000
    print(a[X]+a[Y]+4*t*(X==Y and X==1))

resolve()

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

Solution (Python):
x = list(map(int, input().split()))
top_count = 0
ans = 0
for i in x:
  if i == 1:
    ans += 300000
    top_count += 1

  elif i == 2:
    ans += 200000

  elif i == 3:
    ans += 100000

if top_count == 2:
  print(ans + 400000)
else:
  print(ans)

Solution (Python):
X, Y = map(int, input().split())
ans = 0
if X == 1 and Y == 1:
    ans = 1000000
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)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n, m = map(int, input().split())

aa = [0, 300000, 200000, 100000]
ans=0
if n <4:
    ans += aa[n]
if m <4:
    ans += aa[m]


if n == 1 and m ==1:
    ans += 400000

print(ans)

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    x,y=map(int, input().split())
    ans=0
    if x<=3:
        ans+=100000
        if x<=2:
            ans+=100000
            if x==1:
                ans+=100000
    if y<=3:
        ans+=100000
        if y<=2:
            ans+=100000
            if y==1:
                ans+=100000
    if x==1 and y==1:
        ans+=400000
    print(ans)

resolve()

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

total = 0
if X <= 3:
    total += 100000 * (4 - X)
if Y <= 3:
    total += 100000 * (4 - Y)
if X == 1 and Y == 1:
    total += 400000

print(total)

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

p = 0
pr = [300000,200000,100000]

if(x <= 3):p += pr[x-1]
if(y <= 3):p += pr[y-1]

if(x == y and x == 1):p += 400000

print(p)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

resolve()

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

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

    for i in [x,y]:
        if i==1:
            ans+=300000
        elif i ==2:
            ans+=200000
        elif i==3:
            ans+=100000
    if x==1 and y==1:
        ans+=400000
    print(ans)


resolve()

Solution (Python):
x,y = map(int, input().split())
p = [300000,200000,100000]
ot = [0]*205
dt = p+ot

if x * y == 1:
  print(dt[x-1]+dt[y-1]+400000)
else:
  print(dt[x-1]+dt[y-1])

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

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

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)

Solution (Python):
X, Y = map(int, input().split())
s = [300000, 200000, 100000]
if X == 1 and Y == 1:
    print(s[0]*2 + 400000)
else:
    if X <= 3 and Y <= 3:
        print(s[X-1] + s[Y-1])
    elif X <= 3 and Y > 3:
        print(s[X-1])
    elif X > 3 and Y <= 3:
        print(s[Y-1])
    else:
        print(0)

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

    x,y = map(int, input().split())
    a = 0
    b = 0
    if x==1:
        a += 300000
    if x==2:
        a += 200000
    if x==3:
        a += 100000
    if y==1:
        b += 300000
    if y==2:
        b += 200000
    if y==3:
        b += 100000
    if a+b == 600000:
        print(1000000)
    else:
        print(a+b)

if __name__ == '__main__':
    main()

Solution (Python):
x,y=map(int,input().split())
a=[300000,200000,100000]
b=[0]*300
a=a+b
add=0
if x*y==1:
    add=400000
print(a[x-1]+a[y-1]+add)

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

ans = 300000 if x == 1 else (200000 if x == 2 else (100000 if x == 3 else 0))
ans += 300000 if y == 1 else (200000 if y == 2 else (100000 if y == 3 else 0))
ans += 400000 if x == 1 and y == 1 else 0


print(ans)

Solution (Python):
x, y = (max(4 - int(i), 0) for i in input().split())
print((x + y + 4*(x==y==3)) * 10**5)

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

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

money = {3: 100000, 2: 200000, 1: 300000}
if X <= 3:
    ans += money[X]
if Y <= 3:
    ans += money[Y]

print(ans)

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

prize = [300000, 200000, 100000]

ans = 0

if 1 <= X <= 3:
    ans += prize[X-1]
if 1 <= Y <= 3:
    ans += prize[Y-1]

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

print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    X=[int(_) for _ in input().split()]
    sum=0
    for x in X:
        if x == 1:sum+=300000
        elif x==2:sum+=200000
        elif x==3:sum+=100000
    if X[0]==X[1] and X[0]==1:
        sum+=400000
    print(sum)

if __name__=='__main__':
    main()

Solution (Python):
x,y=map(int,input().split())
l=[0,300000,200000,100000]
if x==y==1:
 print(l[x]+l[y]+400000)
else:
    if y > 3:
        y=0
    if x>3:
        x=0
    print(l[x]+l[y])

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

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

if X == Y == 1:
  ans += 400000
print(ans)

Solution (Python):
X, Y = map(int, input().split())
tmp=0
if X==1 and Y==1:
    tmp+=400000

for i in (X, Y):
    if i==1:
        tmp+=300000
    elif i==2:
        tmp+=200000
    elif i==3:
        tmp+=100000
print(tmp)

Solution (Python):
x,y=map(int,input().split())
lis=[0,300000,200000,100000]
lis=lis+[0]*1000
ans=lis[x]+lis[y]
if x==y==1:
  ans+=400000
print(ans)

Solution (Python):
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

def main():
    x, y = map(int, input().split())
    a = max(0, (4 - x) * 100000)
    b = max(0, (4 - y) * 100000)
    c = 400000 if x == y == 1 else 0
    print(a + b + c)

main()

Solution (Python):
X, Y = map(int, input().split())
tmp=0
if X==1 and Y==1:
    tmp+=400000

for i in (X, Y):
    if i==1:
        tmp+=300000
    elif i==2:
        tmp+=200000
    elif i==3:
        tmp+=100000
print(tmp)

Solution (Python):
import sys
input = sys.stdin.readline

x, y = [int(x) for x in input().split()]
ans = 0

for i in [x, y]:
    if i == 1:
        ans += 300000
    elif i == 2:
        ans += 200000
    elif i == 3:
        ans += 100000
    
if x == 1 and y == 1:
    ans += 400000

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

x, y = [int(x) for x in input().split()]
ans = 0

for i in [x, y]:
    if i == 1:
        ans += 300000
    elif i == 2:
        ans += 200000
    elif i == 3:
        ans += 100000
    
if x == 1 and y == 1:
    ans += 400000

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

x, y = [int(x) for x in input().split()]
ans = 0

for i in [x, y]:
    if i == 1:
        ans += 300000
    elif i == 2:
        ans += 200000
    elif i == 3:
        ans += 100000
    
if x == 1 and y == 1:
    ans += 400000

print(ans)

Solution (Python):
from collections import defaultdict
money = defaultdict(int)
for i, m in enumerate([300000, 200000, 100000]):  
    money[i] = m
    
X, Y = map(int, input().split())
X -= 1; Y -= 1
ans = money[X] + money[Y]
if X + Y:
    print(ans)
else:
    print(ans + 400000)

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 a == 1 and b == 1:
  ans += 400000

print(ans)

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

check = list(map(int, readline().split()))
prize = [3 * 10 ** 5, 2 * 10 ** 5, 10 ** 5]
ans = 0
if check.count(1) == 2:
    ans = 10 ** 6
else:
    if check[0] <= 3:
        ans += prize[check[0] - 1]
    if check[1] <= 3:
        ans += prize[check[1] - 1]
print(ans)

Solution (Python):
a = list(map(int, input().split()))
ans = 0
prise = {1: 300000, 2: 200000, 3: 100000}
for i in a:
  if i not in prise:
    continue
  ans += prise[i]
if a[0] == a[1] == 1:
  ans += 400000
print(ans)

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

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    count =0

    if a[0] ==1:
        count+=300000
    if a[1] ==1:
        count+=300000
    if a[0] ==2:
        count+=200000
    if a[1] ==2:
        count+=200000
    if a[0] ==3:
        count+=100000
    if a[1] ==3:
        count+=100000
    if a[0] == a[1]==1 :
        count+=400000
    print(count)

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())
print(max(0, (4-X)*100000) + max(0, (4-Y)*100000) + max(0, (3-X-Y)*400000))

Solution (Python):
X,Y=map(int,input().split())
if X==Y==1: print(10**6)
else: print((max(0,4-X)+max(0,4-Y))*10**5)

Solution (Python):
X,Y=map(int,input().split())
M=[0]*206
M[0],M[1],M[2]=300000,200000,100000
if X+Y==2:
    print(1000000)
else:
    print(M[X-1]+M[Y-1])

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10


def solve():
    x, y = LI()
    d = defaultdict(int)
    d[3] = 100000
    d[2] = 200000
    d[1] = 300000
    print(d[1] * 2 + 400000 if x == y == 1 else d[x] + d[y])
    return



if __name__ == '__main__':
    solve()

Solution (Python):
a, b = map(int, input().split())
print(1000000 if a==b==1 else max((4-a)*100000, 0)+max((4-b)*100000, 0))

Solution (Python):
a, b = map(int, input().split())
if a==b==1:
    print(1000000)
else:
    print(max((4-a)*100000, 0)+max((4-b)*100000, 0))

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

ans = 0

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

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

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

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

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

print(ans)

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

def cos(c):
  if c==1:
    return 300000
  elif c==2:
    return 200000
  elif c==3:
    return 100000
  else:
    return 0
  
print(cos(X)+cos(Y)+ ( 400000 if X==1 and Y==1 else 0))

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

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

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

if max(X,Y) == 1 :
    ans += 400000

print(ans)

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

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

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

if x == 1 and y == 1:
    print(sum(s))
elif x <= 3 and y <= 3:
    print(s[x] + s[y])
elif x <= 3:
    print(s[x])
elif y <= 3:
    print(s[y])
else:
    print(0)

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

ans = 0
if x + y == 2:
    ans += 400000

ans += ((4-min(4, x)) + (4-min(4, y))) * 100000

print(ans)

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

ans = 0
p = [300000, 200000, 100000]
if 1 <= x <= 3:
    ans += p[x-1]
if 1 <= y <= 3:
    ans += p[y-1]

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

print(ans)

Solution (Python):
x = list(map(int,input().split()))
ans = 0
for y in x:
    if y == 1:
        ans+=3
    elif y == 2:
        ans+=2
    elif y == 3:
        ans+=1
if sum(x)==2:
    ans += 4
print(ans * 100000)

Solution (Python):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7


X, Y = MI()

w = [0, 300000, 200000, 100000]
ans = 0
ans += w[X] if X <= 3 else 0
ans += w[Y] if Y <= 3 else 0
if X == 1 and Y == 1:
    ans += 400000
print(ans)

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

if x > 3 and y > 3:
	print(0)
elif x == 1 and y == 1:
	print(1000000)
elif x <= 3 and y <= 3:
	print(a[x-1] + a[y-1])
elif x <= 3 and y > 3:
	print(a[x-1])
elif y <= 3 and x > 3:
	print(a[y-1])

Solution (Python):


(x,y) = map(int, input().rstrip().split(" "))

ans = sum([max(0, 400000 - (i * 100000)) for i in [x,y]])
if x == 1 and y == 1:
    ans += 400000
print(ans)

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

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

Solution (Python):
X, Y = map(int, input().split())
print(400000*(X==1)*(Y==1) + max(0, 400000-100000*X) + max(0, 400000-100000*Y))