AtCoder Beginner Contest 075 - One out of Three

You are given three integers, A, B and C.

Among them, two are the same, but the remaining one is different from the rest.

For example, when A=5,B=7,C=5, A and C are the same, but B is different.

Find the one that is different from the rest among the given three integers.  

-----Constraints-----
 - -100 \leq A,B,C \leq 100 
 - A, B and C are integers.
 - The input satisfies the condition in the statement.

-----Input-----
Input is given from Standard Input in the following format:  
A B C

-----Output-----
Among A, B and C, print the integer that is different from the rest.

-----Sample Input-----
5 7 5

-----Sample Output-----
7

This is the same case as the one in the statement.

Difficulty: EASY

Starter code:

Solutions:
X = list(map(int, input().split()))
X.sort()
print(sum(X) - X[1] * 2)


(A, B, C) = list(map(int, input().split()))
if (-100 <= A and A <= 100) and (-100 <= B and B <= 100) and (-100 <= C and C <= 100):
	if A == B:
		print(C)
	elif B == C:
		print(A)
	elif C == A:
		print(B)


(a, b, c) = input().split(' ')
if a == b:
	print(c)
elif b == c:
	print(a)
else:
	print(b)


(a, b, c) = list(map(int, input().split()))
print(a * (b == c) + b * (a == c) + c * (b == a))


A = list(map(int, input().split()))
for i in A:
	if A.count(i) == 1:
		print(i)


l = input().split()
for i in range(3):
	if l.count(l[i]) == 1:
		print(l[i])


print(eval(input().replace(' ', '^')))


(a, b, c) = sorted(map(int, input().split()))
print(c if a == b else a)


al = list(map(int, input().split()))
al.sort()
print(sum(al) - al[1] * 2)


def main():
	a = list(map(int, input().split()))
	if a[0] == a[1]:
		print(a[2])
	elif a[1] == a[2]:
		print(a[0])
	else:
		print(a[1])

def __starting_point():
	main()
__starting_point()


a = list(map(int, input().split()))
a.sort()
print(a[0] if a[1] == a[2] else a[2])


(A, B, C) = map(int, input().split())
print(({A} ^ {B} ^ {C}).pop())


s = list(map(int, input().split()))
print(2 * min(s) + 2 * max(s) - sum(s))


l = list(map(int, input().split()))
mid = sum(l) - max(l) - min(l)
print(sum(l) - mid * 2)


a = list(input().split())
for i in range(3):
	if a.count(a[i]) == 1:
		b = a[i]
print(b)


(A, B, C) = map(int, input().split())
if A == B:
	print(C)
elif A == C:
	print(B)
elif B == C:
	print(A)


(a, b, c) = map(int, input().split())
if a == b:
	print(c)
elif b == c:
	print(a)
else:
	print(b)


a = list(map(int, input().split()))
b = set(a)
for i in b:
	if a.count(i) == 1:
		print(i)


(lambda a: [x if a.count(x) - 1 else print(x) for x in a])(list(map(int, input().split())))


a = sorted([int(i) for i in input().split()])
print(a[0] if a.count(a[0]) == 1 else a[2])


a = input().split()
if a[0] == a[1]:
	print(a[2])
elif a[1] == a[2]:
	print(a[0])
else:
	print(a[1])


l = list(map(int, input().split()))
l = sorted(l)
print(l[0] if l[0] != l[1] else l[2])


(A, B, C) = [int(i) for i in input().split()]
if A == B:
	print(C)
elif A == C:
	print(B)
elif B == C:
	print(A)


import math
(a, b, c) = map(int, input().split())
print(a if b == c else b if a == c else c)


from collections import Counter
ABC = list(map(int, input().split()))
cnt = Counter(ABC)
(values, counts) = zip(*cnt.most_common(2))
print(values[1])


lst = input().split()
for i in range(3):
	if lst.count(lst[i]) == 1:
		print(lst[i])
		break


l = list(map(int, input().split()))
from collections import Counter
l = list(Counter(l).most_common())
print(l[1][0])


(A, B, C) = map(int, input().split())
ans = A if B == C else B if A == C else C
print(ans)


(a, b, c) = map(int, input().split())
ans = a if b == c else b if c == a else c
print(ans)


(A, B, C) = input().split()
if A == B:
	print(C)
elif B == C:
	print(A)
elif A == C:
	print(B)


a = [int(x) for x in input().split()]
if a[0] == a[1]:
	print(a[2])
elif a[1] == a[2]:
	print(a[0])
else:
	print(a[1])


s = list(map(int, input().split()))
i = set(s)
print(sum(i) - (sum(s) - sum(i)))


ABC = list(map(int, input().split()))
print(2 * sum(set(ABC)) - sum(ABC))


a = [int(_) for _ in input().split()]
print(a[0] ^ a[1] ^ a[2])


a = list(map(int, input().split()))
print(sum(a) - 2 * (sum(a) - max(a) - min(a)))


array = input().split()
for _ in array:
	if array.count(_) == 1:
		print(_)
		break


(x, y, z) = input().split()
if x == y:
	print(z)
elif x == z:
	print(y)
elif y == z:
	print(x)


l = input().split()
print([e for e in set(l) if l.count(e) == 1][0])


(a, b, c) = map(int, input().split())
print(sum({a, b, c}) * 2 - a - b - c)


A = list(map(int, input().split()))
print(A[0] ^ A[1] ^ A[2])


a = list(input().split())
a.sort()
if a[0] == a[1]:
	print(a[2])
else:
	print(a[0])


ls = list(input().split())
print(sorted(ls, key=lambda x: ls.count(x))[0])


import bisect, collections, copy, heapq, itertools, math, string
import sys

def I():
	return int(sys.stdin.readline().rstrip())

def LI():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def S():
	return sys.stdin.readline().rstrip()

def LS():
	return list(sys.stdin.readline().rstrip().split())
xs = LI()
if xs[0] == xs[1]:
	print(xs[2])
elif xs[0] == xs[2]:
	print(xs[1])
else:
	print(xs[0])


(a, b, c) = input().split()
print([[b, a][b == c], c][a == b])


l = input().split()
print(min(l, key=lambda x: l.count(x)))


a = [int(i) for i in input().split(' ')]
a.sort()
print(sum(a) - 2 * a[1])


s = sorted(input().split())
print([s[0], s[2]][s[0] == s[1]])


a = input().split(' ')
for i in a:
	if a.count(i) == 1:
		print(i)


l = list(map(int, input().split()))
print(list((x for x in l if l.count(x) == 1))[0])


(A, B, C) = sorted(map(int, input().split()))
print(A if B == C else C)


L1 = list(map(int, input().split()))
L2 = list(set(L1))
print(2 * sum(L2) - sum(L1))


def iroha():
	(a, b, c) = list(map(int, input().split()))
	if a == b:
		print(c)
	elif a == c:
		print(b)
	else:
		print(a)

def __starting_point():
	iroha()
__starting_point()


(x, y, z) = map(int, input().split())
print(x if y == z else y if x == z else z)


import sys, collections
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20

def I():
	return int(input())

def F():
	return float(input())

def S():
	return input()

def LI():
	return [int(x) for x in input().split()]

def LI_():
	return [int(x) - 1 for x in input().split()]

def LF():
	return [float(x) for x in input().split()]

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

def resolve():
	ABC = LI()
	cnt = collections.Counter(ABC)
	ans = [k for (k, v) in list(cnt.items()) if v == 1]
	print(ans[0])

def __starting_point():
	resolve()
__starting_point()


(A, B, C) = list(map(int, input().split()))
if A == B:
	print(C)
elif A == C:
	print(B)
else:
	print(A)


(integer1, integer2, integer3) = map(int, input().split())
if integer2 == integer3:
	print(integer1)
elif integer1 == integer3:
	print(integer2)
else:
	print(integer3)


x = sorted(map(int, input().split()))
print(x[2] if x[0] == x[1] else x[0])


a = [int(_) for _ in input().split()]
for i in a:
	if a.count(i) == 1:
		print(i)


a = list(map(int, input().split()))
print(a[0] ^ a[1] ^ a[2])


(A, B, C) = sorted(input().split())
print(C if A == B else A)


(a, b, c) = map(int, input().split())
if a == b:
	print(c)
if a == c:
	print(b)
if b == c:
	print(a)


(a, b, c) = map(int, input().split())
s = (a, b, c)
for i in s:
	if s.count(i) == 1:
		print(i)


N = input().split()
N.sort()
print(N[2] if N[0] == N[1] else N[0])


l = sorted(map(int, input().split()))
print(l[-1] if l[0] == l[1] else l[0])


l = sorted(list(map(int, input().split())))
print([l[2], l[0]][l.count(l[0]) == 1])


x = list(map(int, input().split()))
print(x[0] ^ x[1] ^ x[2])


a = list(map(int, input().split()))
b = sorted(a)
print(b[0] if b[0] != b[1] else b[-1])


print((lambda x: sum(x) - 2 * x[1])(sorted(list(map(int, input().split())))))


l = input().split()
l.sort()
if l[0] == l[1]:
	print(l[2])
else:
	print(l[0])


l = list(map(int, input().split()))
n = [n for n in l if l.count(n) == 1]
for i in n:
	print(i)


a = sorted(map(int, input().split()))
print(a[0] if a[1] == a[2] else a[-1])


a = input().split()
a = sorted(a)
if a.count(a[0]) == 1:
	print(a[0])
else:
	print(a[2])


ABC = list(input().split())
print([x for x in set(ABC) if ABC.count(x) == 1][0])


(x, y, z) = map(int, input().split())
print(x ^ y ^ z)


(a, b, c) = input().split()
print(a if a != b and a != c else b if b != c and b != a else c)


(*S,) = map(int, input().split())
S.sort()
print(S[0] if S[1] == S[2] else S[2])


(a, b, c) = list(map(int, input().split()))
result = 0
if a == b:
	result = c
elif b == c:
	result = a
elif a == c:
	result = b
else:
	result = 'Error'
print(result)


s = list(map(int, input().split()))
ss = sorted(s)
print(sum(s) - ss[1] * 2)


def main():
	import sys
	input = sys.stdin.readline
	sys.setrecursionlimit(10 ** 7)
	from collections import Counter, deque
	from collections import defaultdict
	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, pi, factorial
	from operator import itemgetter

	def I():
		return int(input())

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

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

	def LI2():
		return [int(input()) for i in range(n)]

	def MXI():
		return [[LI()] for i in range(n)]

	def SI():
		return input().rstrip()

	def printns(x):
		print('\n'.join(x))

	def printni(x):
		print('\n'.join(list(map(str, x))))
	inf = 10 ** 17
	mod = 10 ** 9 + 7
	(a, b, c) = MI()
	if a == b:
		print(c)
	elif b == c:
		print(a)
	else:
		print(b)

def __starting_point():
	main()
__starting_point()


L = sorted(map(int, input().split()))
if L[0] == L[1]:
	print(L[2])
else:
	print(L[0])


(a, b, c) = sorted(map(int, input().split()))
print(a + c - b)


(n, m, k) = map(int, input().split())
if n == m:
	print(k)
elif n == k:
	print(m)
else:
	print(n)


a = [int(i) for i in input().split()]
a.sort()
print(a[0] if a[1] == a[2] else a[2])


n = list(map(int, input().split()))
dummy = set(n)
print(sum(dummy) - (sum(n) - sum(dummy)))


li = sorted(map(int, input().split()))
print(li[0] if li[1] == li[2] else li[2])


(A, B, C) = [int(i) for i in input().split()]
print(A ^ B ^ C)


numlist = list(input().split())
print(sorted(numlist, key=lambda x: numlist.count(x))[0])


(A, B, C) = input().split()
print(A * (B == C) or B * (A == C) or C)


arr = list(map(int, input().split()))
print(sum(arr) - sorted(arr)[1] * 2)


(a, b, c) = map(int, input().split())
print(a if b - c == 0 else b if a - c == 0 else c)


l = sorted([int(i) for i in input().split()])
print(l[0] if l[0] != l[1] else l[2])


l = list(map(int, input().split()))
for ll in l:
	if l.count(ll) == 1:
		print(ll)
		break


(A, B, C) = (int(T) for T in input().split())
print(A ^ B ^ C)


(a, b, c) = (i for i in input().split())
print(a if b == c else b if a == c else c)


(a, s, d) = map(int, input().split())
if a == s:
	print(d)
elif a == d:
	print(s)
else:
	print(a)


(*a,) = input().split()
for i in range(len(a)):
	if a.count(a[i]) == 1:
		print(a[i])
		exit()


x = input().split()
y = list(set(x))
print(y[x.count(y[0]) - 1])


a = sorted(list(map(int, input().split())))
print(a[0] if a[0] not in a[1:] else a[-1])


import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):

	def assertIO(self, input, output):
		(stdout, stdin) = (sys.stdout, sys.stdin)
		(sys.stdout, sys.stdin) = (StringIO(), StringIO(input))
		resolve()
		sys.stdout.seek(0)
		out = sys.stdout.read()[:-1]
		(sys.stdout, sys.stdin) = (stdout, stdin)
		self.assertEqual(out, output)

	def test_入力例_1(self):
		input = '5 7 5'
		output = '7'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = '1 1 7'
		output = '7'
		self.assertIO(input, output)

	def test_入力例_3(self):
		input = '-100 100 100'
		output = '-100'
		self.assertIO(input, output)

def resolve():
	(A, B, C) = list(map(int, input().split()))
	if A == B:
		print(C)
	elif A == C:
		print(B)
	else:
		print(A)

def __starting_point():
	resolve()
__starting_point()


from collections import Counter
print(Counter(input().split()).most_common(2)[1][0])


x = list(map(int, input().split()))
print(x[[x.count(i) for i in x].index(1)])


[A, B, C] = list(map(int, input().split()))
print(A ^ B ^ C)


a = list(map(int, input().split()))
a.sort(key=int)
print(a[0] ^ a[1] ^ a[2])


num = input().split()
for i in num:
	if num.count(i) == 1:
		print(i)


A = list(map(int, input().split()))
print(min(A, key=A.count))


(A, B, C) = list(input().split())
if A == B:
	print(C)
elif B == C:
	print(A)
else:
	print(B)


def mapt(fn, *args):
	return tuple(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	abc = sorted(Input())
	if abc[0] == abc[1]:
		print(abc[2])
	else:
		print(abc[0])
main()


ls = list(map(int, input().split()))
if ls[1] != ls[2] and ls[2] == ls[0]:
	print(ls[1])
if ls[0] != ls[1] and ls[1] == ls[2]:
	print(ls[0])
if ls[2] != ls[1] and ls[1] == ls[0]:
	print(ls[2])


l = sorted(map(int, input().split()))
print(sum(l) - l[1] * 2)


li = list(map(int, input().split()))
uni = list(set(li))
print(sum(uni) * 2 - sum(li))


(a, b, c) = list(map(int, input().split()))
if a == b:
	ans = c
elif b == c:
	ans = a
else:
	ans = b
print(ans)


(l1, l2, l3) = map(int, input().split())
print(l1 ^ l2 ^ l3)


def main():
	(A, B, C) = map(int, input().split())
	print(A ^ B ^ C)
main()


L = list(input().split())
L = sorted(L)
if L[0] == L[1]:
	print(L[2])
else:
	print(L[0])