Problem:
 Score : 100 points    Problem Statement Takahashi is a user of a site that hosts programming contests. When a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows:   Let the current rating of the user be a .  Suppose that the performance of the user in the contest is b .  Then, the new rating of the user will be the avarage of a and b .   For example, if a user with rating 1 competes in a contest and gives performance 1000 , his/her new rating will be 500.5 , the average of 1 and 1000 .  Takahashi's current rating is R , and he wants his rating to be exactly G after the next contest. Find the performance required to achieve it.      Constraints  0 \leq R, G \leq 4500  All input values are integers.         Input Input is given from Standard Input in the following format:  R  G       Output Print the performance required to achieve the objective.        Sample Input 1 2002
2017      Sample Output 1 2032  Takahashi's current rating is 2002 . If his performance in the contest is 2032 , his rating will be the average of 2002 and 2032 , which is equal to the desired rating, 2017 .       Sample Input 2 4500
0      Sample Output 2 -4500  Although the current and desired ratings are between 0 and 4500 , the performance of a user can be below 0 .

Solution (Python):
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def inpm(line):
    return [inp() for _ in range(line)]


def inpfm(line):
    return [inpf() for _ in range(line)]


def inpsm(line):
    return [inps() for _ in range(line)]


def inlm(line):
    return [inl() for _ in range(line)]


def inlfm(line):
    return [inlf() for _ in range(line)]


def inlsm(line):
    return [inls() for _ in range(line)]


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


r, g = inpm(2)
print(r + (g - r) * 2)

Solution (Python):
r = int(input())
g = int(input())   
print(2 * g -r)

Solution (Python):
A=int(input())

B=int(input())

print(2*B-A)

Solution (Python):
R = int(input())
G = int(input())
print(G*2-R)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):

r, g= list(map(int, [input().rstrip() for _ in range(2)]))
print(g * 2 - r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r=int(input())
g=int(input())

print(2*g-r)

Solution (Python):
R=int(input())
G=int(input())
b=2*G-R
print(b)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
a=int(input())
b=int(input())
print(2*b-a)

Solution (Python):
r = int(input())
d = int(input())
print(2 * d - r)

Solution (Python):
a = int(input())
b = int(input())

print(int((b - (a / 2)) * 2))

Solution (Python):
r, g = eval("int(input())," * 2)
print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())
print(G + (G - R))

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
a = int(input())
b = int(input())
print(b*2-a)

Solution (Python):
R = int(input())
G = int(input())

print(2*G- R)

Solution (Python):
r=int(input())
g=int(input())
print(g*2-r)

Solution (Python):
R,G=[int(input()) for i in range(2)]
print(2*G-R)

Solution (Python):
R, G = map(int, open(0).read().split())
print(G + (G - R))

Solution (Python):
R, G = int(input()), int(input())
print(G * 2 - R)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
current_rate = int(input())
target = int(input())

print(target * 2 - current_rate)

Solution (Python):
r=int(input())
g=int(input())
print((g-r)*2+r)

Solution (Python):
r = int(input())
g = int(input())
print((g-r)*2 + r)

Solution (Python):
r,g=map(int,open(0));print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(G * 2 - R)

Solution (Python):
r = int(input())
g = int(input())

print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())

print(2*G - R)

Solution (Python):
n = int(input())
m = int(input())

print(2 * m - n)

Solution (Python):
r=int(input())
g=int(input())
print(r+(g-r)*2)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())
X = (G -R) * 2
print(R + X)

Solution (Python):
r=int(input())
g=int(input())

print(2*g-r)

Solution (Python):


R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
t = (g * 2 - r)
print(t)

Solution (Python):
r = int(input())
g = int(input())

print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):

R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
def solve(string):
    r, g = map(int, string.split())
    return str(2 * g - r)


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Solution (Python):
R = int(input())
G = int(input())

print(G*2 - R)

Solution (Python):
n=int(input())
m=int(input())
l=m*2-n
print(l)

Solution (Python):
R=int(input());G=int(input());print(2*G-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())

p = (g * 2) - r
print(p)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print( 2 * g - r )

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):


r = int(input())
g = int(input())

print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
r=int(input())
g=int(input())
print(g*2-r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):



import itertools
import collections
import bisect

def main():
    R = int(input())
    G = int(input())

    print(2*G-R)

if __name__ == '__main__':
    main()

Solution (Python):
R=int(input())
G=int(input())

print(G*2-R)

Solution (Python):
R = int(input())
G = int(input())

print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())
print(G*2-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):

r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
def rating_goal(R: float, G: float)->float:
    return 2*G - R


if __name__ == "__main__":
    R = int(input())
    G = int(input())
    ans = rating_goal(R, G)
    print(ans)

Solution (Python):
print(-int(input())+int(input())*2)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R=int(input())
G=int(input())
print(G*2-R)

Solution (Python):
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_list_of_int():
    return [int(i) for i in input().split()]


def get_list_of_float():
    return [float(f) for f in input().split()]


def get_list_of_char():
    return list(input().strip())


def get_data(n, order=None, **kwargs):
    if not order:
        order = range(len(kwargs))
    it = iter(order)
    var, fn = zip(*sorted(sorted(kwargs.items()), key=lambda _: next(it)))

    rows = []
    for _ in range(n):
        rows.append(input().split())
    columns = zip(*rows)
    exec("global "+", ".join(var)+"\n"+"\n".join(
        v+"=list(map(fn[{}], data[{}]))".format(i, i)
        for i, v in enumerate(var)),
        globals(),
        {"fn": list(fn), "data": list(columns)}
    )
    return



R, G = 0, 0


def set_inputs():
    global R, G
    R = get_int()
    G = get_int()
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    print((G - R) * 2 + R)
    return


if __name__ == '__main__':
    main()

Solution (Python):
def getlist():
    a = input().split()
    b = [int(i) for i in a]
    return b

r = int(input())
g = int(input())

print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
Now = int(input())
Goal = int(input())
print(Goal*2-Now)

Solution (Python):
a,b=[int(input()) for _ in range(2)]
print(b*2-a)

Solution (Python):
print(-1*int(input())+int(input())*2)

Solution (Python):
R = int(input())
G = int(input())
print(G + (G - R))

Solution (Python):
R=int(input())
G=int(input())
print(str(2*G-R))

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):



def func(r, g):
    result = 2 * g - r
    return result


r = int(input())
g = int(input())

print(func(r, g))

Solution (Python):



def main():
    r = int(input())
    g = int(input())
    print(2 * g - r)


if __name__ == '__main__':
    main()

Solution (Python):
print(-int(input())+int(input())*2)

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    R = int(input())
    G = int(input())

    print(2*G - R)


if __name__ == '__main__':
    main()

Solution (Python):

r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(g * 2 - r)

Solution (Python):
R = int(input())
G = int(input())
print(G * 2 - R)

Solution (Python):
R = int(input())
G = int(input())
print(R+(G-R)*2)

Solution (Python):
a = int(input())
b = int(input())
print(b*2 - a)

Solution (Python):

from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import itertools
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return list(sys.stdin.readline())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
mod = 1000000007


r = I()
g = I()
print(2*g-r)

Solution (Python):
a = int(input())
b = int(input())
print(a + 2 * (b - a))

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007


def A():
    r,g = IR(2)
    print(2*g-r)


def B():
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == "__main__":
    A()

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print((G*2)-R)

Solution (Python):
a = int(input())
b = int(input())
print(int(b*2-a))

Solution (Python):
a=int(input())
b=int(input())
print(2*b-a)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
r = int(input())
print(int(input())*2 - r)

Solution (Python):
a = int(input())

b = int(input())

print(a + 2*(b - a))

Solution (Python):
def main():
    R = int(input())
    G = int(input())
    print(G*2-R)


if __name__ == "__main__":
    main()

Solution (Python):
R = int(input())
G = int(input())

print(G*2-R)

Solution (Python):
a = int(input())
b = int(input())
print(b*2-a)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
A=int(input())
B=int(input())
print(2*B-A)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
ans = G * 2 - R
print(ans)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
print(-1*int(input())+2*int(input()))

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):

R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
from sys import stdin
r = int(stdin.readline().rstrip())
g = int(stdin.readline().rstrip())
print(g*2-r)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
a=[int(input()) for i in range(2)]
print(2*a[1]-a[0])

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
R = int( input() )
G = int( input() )

print( 2*G-R )

Solution (Python):
r,g=[int(input()) for i in range(2)]
print(r+(g-r)*2)

Solution (Python):
r = int(input())
g = int(input())
print(r + (g - r) * 2)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())

print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())

print(2 * g - r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
ans = R+(G-R)*2
print(ans)

Solution (Python):
r, g = [int(input()) for _ in range(2)]
print(2*g-r)

Solution (Python):
import sys

a = []
for line in sys.stdin:
    a.append(int(line))
print(a[1] * 2 - a[0])

Solution (Python):
R = int(input())
G = int(input())
print(G * 2 - R)

Solution (Python):
R = int(input())
G = int(input())

ans = 2 * G - R

print(ans)
print()

Solution (Python):
R = int(input())
G = int(input())

print((2*G)-R)

Solution (Python):
r = int(input())
g = int(input())

print(g*2 - r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())

print(G+G-R)

Solution (Python):
import math
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

R = I()
G = I()

print(G*2-R)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
s=int(input())
t=int(input())
print((t-s)*2+s)

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g - r)

Solution (Python):
r=int(input())
g=int(input())
print(r+2*(g-r))

Solution (Python):
r,g=int(input()),int(input())
print(g*2-r)

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(g*2 - r)

Solution (Python):
a=int(input())
b=int(input())
print(b*2-a)

Solution (Python):
a = int(input())
b = int(input())
b=b*2
print(b-a)

Solution (Python):
r = int(input())
g = int(input())
print(g*2-r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
a = int(input())
b = int(input())
print(b + b - a)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
a=int(input())
b=int(input())
print(2*b-a)

Solution (Python):
r = int(input())
g = int(input())
ans = 2*g-r
print(ans)

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
r = int(input())
g = int(input())

print(2*g -r)

Solution (Python):
r = int(input())
g = int(input())
p = g + g - r
print(p)

Solution (Python):
int_r = int(input())
int_g = int(input())

p = (int_g - int_r) + int_g
print(p)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
x = int(input())
y = int(input())
print(2*y-x)

Solution (Python):
r,g = [int(input()) for i in range(2)]
print(2*g-r)

Solution (Python):
a = int(input())
b = int(input())
print(b*2-a)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
print(-1*int(input())+2*int(input()))

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R=int(input())
G=int(input())

print(G*2-R)

Solution (Python):
""" AtCoder """

R = int(input())
G = int(input())

print(2*G - R)

Solution (Python):


r = int(input())        
g = int(input())        

b = (2 * g) - r
print(b)

Solution (Python):
R=int(input())
G=int(input())
print(G*2-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
r = int(input())
g = int(input())

print(g + (g - r))

Solution (Python):
R=int(input())
G=int(input())

print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())




print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())
print(G*2-R)

Solution (Python):
r = int(input())
g = int(input())

print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
r=int(input())
g=int(input())
print(g*2-r)

Solution (Python):
a=int(input())
b=int(input())
print(2*b-a)

Solution (Python):
R=int(input())
G=int(input())
P=2*G-R
print(P)

Solution (Python):
a= int(input())
b= int(input())
print(2*b-a)

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
lst = []

R = int(input())
G = int(input())


ans = G - R + G
print(ans)

Solution (Python):
import numpy as np
lst = []

R = int(input())
G = int(input())


ans = G - R + G
print(ans)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
R = int(input())
G = int(input())
P = 2*G-R
print(P)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())
ans = 2 * G - R
print(ans)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
a=int(input())
b=int(input())
print(2*b-a)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g -r)

Solution (Python):
R= int(input())
G = int(input())

print(G*2-R)

Solution (Python):
a=int(input())
b=int(input())
print(b+(b-a))

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
def abc076_a():
    r = int(input())
    g = int(input())
    print(r + 2 * (g - r))


abc076_a()

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
def main():
    r = int(input())
    g = int(input())
    print(g + (g - r))


if __name__ == '__main__':
    main()

Solution (Python):
r = int(input())
g = int(input())

print(2 * g - r)

Solution (Python):
r, g = [int(input()) for _ in range(2)]
print(int(g * 2 - r))

Solution (Python):
r=int(input())
g=int(input())

print(2*g-r)

Solution (Python):
a = int(input())
print(int(input())*2-a)

Solution (Python):
import sys

def solve(a,b):
    return b+(b-a)

def readQuestion():
    a = sys.stdin.readline().strip()
    b = sys.stdin.readline().strip()
    
    return (int(a),int(b))

def main():
    a ,b  = readQuestion()
    answer = solve(a ,b)
    print(answer)

if __name__ == '__main__':
    main()

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
import sys

def solve(r, g):
    ans = g * 2 - r
    print(ans)

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    r = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    g = int(ws[0])
    return (r, g,)

def main():
    solve(*readQuestion())

main()

Solution (Python):
R = int(input())
G = int(input())

print(2 * G - R)

Solution (Python):
import sys

def solve(r, g):
    print(2*g-r)

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    r = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    g = int(ws[0])
    return (r, g,)

def main():
    solve(*readQuestion())


main()

Solution (Python):
print(-1*int(input())+2*int(input()))

Solution (Python):

R = int(input())
G = int(input())
print("{}".format(2 * G - R))

Solution (Python):



def main():
    """Function."""
    r = int(input())
    g = int(input())
    print(g*2 - r)


if __name__ == "__main__":
    main()

Solution (Python):
from statistics import mean, median,variance,stdev
import sys
import math

a = int(input())
b = int(input())

print(b+(b-a))

Solution (Python):
a=int(input(''))
b=int(input(''))
c=2*b-a
print(c)

Solution (Python):
R=int(input())
G=int(input())
a=2*G-R
print(a)

Solution (Python):
a=int(input())
b=int(input())
c=b*2-a
print(c)

Solution (Python):
r=int(input())
g=int(input())
print(g*2-r)

Solution (Python):
r = int(input());g = int(input()); print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
ans = (G * 2) - R
print(ans)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
a = int(input())
b = int(input())
c = b - a
print(b + c)

Solution (Python):
r = int(input())
g = int(input())

ans = 2*g - r

print(ans)

Solution (Python):
R = int(input())
G = int(input())
print(G * 2 - R)

Solution (Python):
r = int(input())
g = int(input())

print(2*g - r)

Solution (Python):
r = int(input())
g = int(input())

print( 2*g - r )

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R=int(input())
G=int(input())


print(G*2-R)

Solution (Python):
R = int(input())
G = int(input())
print(R+2*(G-R))

Solution (Python):
r = int(input())
g = int(input())

print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())

print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())

ans = G + (G - R)
print(ans)

Solution (Python):


R = int(input().rstrip())
G = int(input().rstrip())

P = G * 2 - R
print(P)

Solution (Python):
R = int(input())
G = int(input())

print(R + 2 * (G - R))

Solution (Python):
a = [int(input()) for i in range(2)]
print(a[1]*2 - a[0])

Solution (Python):
print(eval(input()+'*-1+2*'+input()))

Solution (Python):
r,g=int(input()),int(input())
print(g+g-r)

Solution (Python):


a=int(input())
b=int(input())

s=2*b-a

print(s)

Solution (Python):
r = int(input())
g = int(input())
print(g*2-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
R, G = input(), input()
print 2 * G - R

Solution (Python):
A = int(input())
G = int(input())
 
print(A+(G-A)*2)

Solution (Python):
R = int(input())
G = int(input())
print(G*2-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())

print(r + (g - r) * 2)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())

P = 2 * G - R
print(P)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r=int(input())
g = int(input())

print(2*g-r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
a = int(input())
b = int(input())
ans = b * 2 - a
print(ans)

Solution (Python):
R = int(input())
G = int(input())

A = G + (G - R)
print(A)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())

print(2*g-r)

Solution (Python):
R,G = [int(input()) for i in range(2)]
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())

print(2*G - R)

Solution (Python):
r = int(input())
g = int(input())

print(2*g - r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):

print(-int(input()) + 2 * int(input()))

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
r, g = int(input()), int(input())
print(g * 2 - r)

Solution (Python):
R = int(input())
G = int(input())

W = G+G-R

print(W)

Solution (Python):
r = int(input())
g = int(input())

print(2*g - r)

Solution (Python):
r = int(input())
g = int(input())
print((g*2)-r)

Solution (Python):


r  = int( input())
g  = int( input())

print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())

print(g * 2 - r)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())
print(g + (g-r))

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
R = int(input())
G = int(input())
ans = (G * 2) - R
print(ans)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
a = int(input())
b = int(input())
print((b*2) - a)

Solution (Python):
r = int(input())
g = int(input())

print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
a=int(input())
b=int(input())
print(2*b-a)

Solution (Python):
a=int(input());b=int(input());print(b+b-a)

Solution (Python):
A=int(input())
B=int(input())
print(2*B-A)

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    R = int(input())
    G = int(input())
    print(2 * G - R)


if __name__ == '__main__':
    main()

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())

ans = 2*G - R
print(ans)

Solution (Python):
r = int(input())
g = int(input())

print(2*g - r)

Solution (Python):
x=int(input())
y=int(input())


print(2*y-x)

Solution (Python):
N = int(input())
G = int(input())

print(2*G-N)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(G * 2 - R)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())
print(G*2-R)

Solution (Python):

r=int(input())
g=int(input())
x = 2*(g-r)
print(r+x)

Solution (Python):
R=int(input())
G=int(input())

print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
r = int(input())
g = int(input())

print(2*g - r)

Solution (Python):
n = 2
Data = []
for i in range(n):
    Data.append(int(input()))
print(2 * Data[1] - Data[0])

Solution (Python):
r = int(input())
g = int(input())
print(g * 2 - r)

Solution (Python):

r=int(input())
g=int(input())

print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
r, g = [int(input()) for s in range(2)]
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(g * 2 - r)

Solution (Python):
R = int(input())
G = int(input())
print(R + (G-R)*2)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):


def main():
    r = int(input())
    g = int(input())

    print(2 * g - r)


if __name__ == '__main__':
    main()

Solution (Python):
R=int(input())
G=int(input())
print(2*G - R)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
r=int(input())
print(int(input())*2-r)

Solution (Python):
r = int(input())
g = int(input())

print(2*g - r)

Solution (Python):
R=int(input())
G=int(input())
ans = G * 2 - R
print(ans)

Solution (Python):
R = int(input())
G = int(input())

print((G-R)*2 + R)

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
num = [int(input()) for i in range(2)]
print(num[1] *2 - num[0])

Solution (Python):
print(-int(input()) + 2*int(input()))

Solution (Python):
nr = int(input())
p = int(input())
print((p-nr)+p)

Solution (Python):
r=int(input())
g=int(input())
print(g+(g-r))

Solution (Python):
R = int(input())
G = int(input())

print(2*G -R)

Solution (Python):
R = int(input())
G = int(input())
print(R + 2 * (G - R))

Solution (Python):
r=int(input())
g=int(input())

print(2*g - r)

Solution (Python):
r = int(input())
g = int(input())

print(2*g - r)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):

def main():
    R = int(input())
    G = int(input())


    print(R+(G-R)*2)

if __name__ == "__main__":
        main()

Solution (Python):
R = int(input())
G = int(input())

print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())

print(2 * G - R)

Solution (Python):
r=int(input())
g=int(input())
print(g+(g-r))