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

print (n-1) * (m-1)


n, m = (int(i) for i in input().split())
print((n-1)*(m-1))


l = list(map(int, input().split()))
print((l[0]-1)*(l[1]-1))


n, m = [int(x) for x in input().split()]
print((n - 1) * (m - 1))


n, m = map(int, input().split())
print((n-1)*(m-1))


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

n, m = read()
print((n - 1) * (m - 1))


import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
gosa = 1.0 / 10**9
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def main():
    n,m = LI()

    return (n-1)*(m-1)

print(main())


n, m = map(int, raw_input().split())
print (n-1) * (m-1)


n, m = map(int, input().split())
print((n - 1) * (m - 1))


temp_arr = input().split(' ')
n = int(temp_arr[0])
m = int(temp_arr[1])

print(str((n-1) * (m-1)))


n, m = list(map(int, input().split()))
print((n-1)*(m-1))


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


n, m = input().split()
n = int(n)
m = int(m)
print((n-1)*(m-1))


# -*- coding: utf-8 -*-

n, m = [int(x) for x in input().split()]
cities = (n-1) * (m-1)
print(cities)


#! /usr/bin/env python3

N, M = map(int, input().split())
print((N-1) * (M-1))


#! -*- coding:utf-8 -*-
n,m = map(int,input().split())
print((m-1)*(n-1))


def main():
    n, m = map(int, input().split())
    print((n-1)*(m-1))

if __name__ == "__main__":
    main()


n,m = map(int,input().split())
print((n-1)*(m-1))


def read_int_list():
    return (int(i) for i in input().split())

n, m = read_int_list()
print((n-1)*(m-1))


n, m = list(map(int, input().split()))
print (str((n-1)*(m-1)))


n, m = list(map(int, input().split()))
print((n - 1) * (m - 1))


n, m =map(int, input().split())
print((n-1) * (m-1))


import sys

def main():
    args = sys.stdin.readline().split()
    n = int(args[0])
    m = int(args[1])

    print((n - 1) * (m - 1))

main()


from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10

def main():
    n, m = map(int, input().split())
    print((n - 1) * (m - 1))

if __name__ == '__main__':
    main()


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

print((n-1)*(m-1))


#coding:utf-8

n, m = map(int, input().split())
#print('\n')

result = (n - 1) * (m - 1)

print("{0}".format(result))


# -*- coding: utf-8 -*-

n,m = map(int, input().split())
print((n-1)*(m-1))


n, m = map(int, input().split())
print((n - 1) * (m - 1))


# -*- coding:utf-8 -*-
s = list(input())
a = s.pop(0)
b = s.pop()
print(a+str(len(s))+b)


s = input()
print(s[0] + str(len(s)-2) + s[-1])


'''input
xyz
'''
s = raw_input()
print s[0]+str(len(s[1:-1]))+s[-1]


S = input()
print(S[0]+str(len(S)-2)+S[-1])


import sys

def main():
    word = sys.stdin.readline().strip()
    print(word[0] + str(len(word) - 2) + word[len(word) - 1])

main()


s = raw_input()
print(s[0] + str(len(s)-2) + s[len(s)-1])


s = input()
print(s[0] + str(len(s) - 2) + s[-1])


#!usr/bim/python
#! -*- coding: utf-8 -*-

s = raw_input()

n = len(s)

ans = s[0] + str(n-2) + s[n-1]

print ans


S = input()

res = S[0] + str(len(S) - 2) + S[-1]

print(res)


s = input()

n=len(s) - 2
print(s[0], end="")
print(n, end="")
print(s[-1])


def main():
    S = input()
    #print(S)
    len_S = len(S)
    print(S[0] + str(len_S - 2) + S[len_S - 1])

if __name__=="__main__":
    main()


#! -*- coding:utf-8 -*-
s = str(input())
x = list(s)

e = x.pop()
a = x.pop(0)

print(a,len(x),e,sep='')


s = input()
N = len(s)
print(s[0] + str(N - 2) + s[N - 1])


s = str(input())
print(s[0]+str(len(s)-2)+s[len(s)-1])


s = input()

print(s[0] + str(len(s) - 2) + s[-1])


s = input()
s_s = s[0]
s_e = s[-1]
s = s[1:-1]

nw = s_s + str(len(s)) + s_e
print(nw)


s = input()

ans = s[0]
ans += str(len(s) - 2)
ans += s[len(s) - 1]

print(ans)


import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
gosa = 1.0 / 10**9
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def main():
    s = S()

    return s[0] + str(len(s)-2) + s[-1]

print(main())


# -*- coding: utf-8 -*-

word = input()

print(word[0] + str(len(word)-2) + word[-1])


def main():
    S = input()

    num = len(S) - 2
    ans = S[0] + str(num) + S[-1]
    print(ans)

main()


s=input()
l=len(s)-2
print(s[0] + str(l) + s[-1])


s = input()

print (s[0] + str(len(s) - 2) + s[len(s)-1])


s = input()

init = s[0]
last = s[-1]
l = len(s) - 2

print(init + str(l) + last)


nm = input()
l = len(nm)
print(nm[0] + str(l - 2) +nm[-1])


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import re
import math
import collections
import itertools
import functools

DEBUG = True
DEBUG = False

def dbg(*args):
    if DEBUG:
        print("DBG: ", file=sys.stderr, end="")
        print(*args, file=sys.stderr)

def main():
    s = input()
    print(s[0] + str(len(s)-2) + s[-1])

if __name__ == "__main__": main()


sen = raw_input()
length = len(sen)
print(sen[0:1] + str(length - 2) + sen[length-1:length])


n = input()
returnStr = n[0] + str(len(n)-2) + n[-1]
print(returnStr)


s = input()
print(s[0] + str(len(s[1:len(s) - 1])) + s[len(s) - 1])


s = input()
l = len(s)

head = s[0]
tail = s[len(s)-1]
an = l - 2
print(head + str(an) + tail)


import sys

# sys.stdin = open('b1.in')

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

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

def read_int():
    return int(input())

def read_str():
    return input()

def main():
    s = read_str()
    l = len(s)
    res = s[0] + str(l - 2) + s[-1]
    print(res)

main()


ls = list(input())
print(ls[0] + str(len(ls)-2) + ls[-1])


s = raw_input()

st = s[0]
en = s[len(s) - 1]

ans = ""
ans += st
ans += str(len(s) - 2)
ans += en
print ans


chars=input()

f=chars[0]
l=chars[len(chars)-1]

n=str(len(chars)-2)

print(f+n+l)


st = input()
length = len(st[1:-1])
print(st[0] + str(length) + st[-1])


s = input()
print(s[0]+str(len(s)-2)+s[-1])


s = input()
print(s[0] + str(len(s) - 2) + s[-1])


s = input()
print(s[0], end="")
print(len(s)-2, end="")
print(s[-1])


S = input()

print(S[0],len(S)-2,S[len(S)-1], sep='')


s = input()
strlen = len(s)
print(s[0:1] + str(strlen-2) + s[-1])


S = list(input())
N = len(S)
ans = S[0] + str(N - 2) + S[-1]
print(ans)


s = input()

print (s[0] + str(len(s) - 2) + s[len(s) - 1])


#!/usr/bin/python

import sys

def main(argv):
    for line in sys.stdin:
        s = line.rstrip("\n")
        print("{0}{1}{2}".format(s[0], len(s) - 2, s[-1]))

if __name__ == "__main__":
    main(sys.argv)


#ABc069B

s=raw_input()
print s[0]+str(len(s)-2)+s[-1]


# -*- coding: utf-8 -*-
"""
http://abc069.contest.atcoder.jp/tasks/abc069_b

"""

def solve(text):
    text_length = len(text)
    return text[0] + str(text_length-2) + text[-1]

def main():
    S = input()
    result = solve(S)
    print(result)

if __name__ == '__main__':
    main()


a = input()
print(a[0] + str(len(a) - 2) + a[-1])


s = input()

length = len(s)
ans = s[0] + str(length - 2) + s[-1]
print(ans)


s = raw_input()
print s[0] + str(len(s)-2) + s[-1]


st=input()
x=st[0]
y=st[len(st)-1]
n=str(len(st)-2)
ans=x+n+y
print(ans)


a = input()

a_len = len(a)
f = a[0]
e = a[-1]

print(f+str(a_len-2)+e)


l=raw_input()
n=len(l)-2
print l[0]+str(n)+l[-1]


# encoding:utf-8

def main():
	s = input()
	out = s[0] + str(len(s) - 2) + s[-1]
	print(out)

if __name__ == '__main__':
	main()


s=input()

L=len(s)-2
M=str(L)

A=s[0]+M+s[-1]
print(A)


s = input()
print (s[0] + str(len(s) - 2) + s[-1])


temp = input()
l = len(temp)
print(temp[0]+str(l-2)+temp[l-1])


a = raw_input()
print a[0] + str(len(a)-2) + a[-1]


def omit(s):
    """
    @param: 元の文字列
    @return: 最初の文字 + 最初の文字と最後の文字にはさまれた文字列の流さ
    + 最後の文字

    >>> omit("internationalization")
    'i18n'

    >>> omit("smiles")
    's4s'

    >>> omit("xyz")
    'x1z'
    """

    s2 = list(s)

    (first,last) = (s2.pop(0), s2.pop(-1))
    return first + str(len(s2)) + last

print(omit(input()))


word = input()
lists = list(word)
a = int(len(lists) -1)
print(lists[0]+str((int(len(lists))-2))+lists[a])


# -*- coding: utf-8 -*-
S = input()
length = len(S)
st = length - 2
print(S[0:1] + str(st) + S[-1])


s=input()
n=len(s)
ans=s[0]+str(n-2)+s[n-1]
print(ans)


s = list(raw_input())
print s[0] + str(len(s) - 2) + s[len(s) - 1]


S=input ()
p=S[0]
p+=str(len(S)-2)
p+=S[-1]
print (p)


x = input()
b = len(x) - 2
n =x[0] + str(b) + x[b+1]
print (n)


s = input()
print(s[0] + str(len(s)-2) + s[-1])


s = input()
print( s[0]+ str(len(s)-2) + s[-1])


chr = input()
chr_list = list(chr)
length = len(chr_list)

a, z =  chr_list[0], chr_list[length - 1]

print(a, length - 2, z, sep = '')


s = str(input())
print(s[0] + str(len(s) - 2) + str(s[len(s) - 1]))


s = input()
print(s[0]+str(len(s)-2)+s[-1])


S = input()
memo = S[1:-1]
print(S[0],end = "")
print(len(memo),end = "")
print(S[-1])


from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10

def main():
    s = input()
    print(s[0] + str(len(s) - 2) + s[-1])

if __name__ == '__main__':
    main()


s = raw_input().rstrip()
print s[0] + str(len(s)-2)+s[-1]


a=input()
b=str(len(a[1:-1]))
c=str(a[:1])
d=str(a[-1])
print(c+b+d)


s=input()
l=len(s)
anser=s[0]+str(l-2)+s[l-1]
print(anser)


#!/usr/bin/env python
# -*- coding: utf-8 -*-

s = raw_input()
ans = s[0] + str(len(s)-2) + s[-1]
print ans


words = input()
l = len(words)
output = words[0] + str(l-2) + words[l-1]
print(output)


s = input()
ans = s[0] + str(len(s)-2) + s[-1]
print(ans)


s = raw_input()

print s[0]+str(len(s)-2)+s[-1]


s = input()

out = s[0]
out += str(s.__len__()-2)
out += s[s.__len__()-1]

print(out)


a=input().split()
b=list(a[0])
c=b[0]
d=b[-1]
l=len(b)-2
l=str(l)
print(c+l+d)


def b():
    s = input()
    print(s[0] + str(len(s) - 2) + s[-1])

b()


word = raw_input().strip()
print word[0] + str(len(word)-2) + word[-1]


# coding: utf-8

s = input()
print(s[0] + str(len(s) - 2) + s[-1])


#! /usr/bin/env python3

S = input()
print(S[0] + str(len(S)-2) + S[-1])


s = raw_input()
s = s[0] + str(len(s)-2) + s[-1]
print(s)


def main():
    s = input()
    print(s[0] + str(len(s) - 2) + s[-1])

if __name__ == '__main__':
    main()


s = str(input())

print( s[0] + str(len(s)-2) + s[-1] )


S = input()

S_list = list(S)
Len= len(S)
queue = []

queue.append(S_list[0])
queue.append(str(Len-2))
queue.append(S_list[Len-1])

print("".join(queue))


s = input()
print(s[0] + str(len(s)-2) + s[-1])


a = input()
print (a[0] + str((len(a) - 2)) + a[len(a) - 1])


#!/usr/bin/py

s = input()
first = s[0]
last = s[-1]
num = str(len(s[1:-1]))

print(first+num+last)


s = input()
print(s[0] + str(len(s) - 2) + s[-1])


temp= input()
l = len(temp)
srted = temp[0] + str(len(temp)-2) +temp[-1]
print(srted)


S = input()
ans = ""
ans += S[0]
ans += str(len(S[1:-1]))
ans += S[-1]
print(ans)


string=input('')
first=string[0]
last=string[len(string)-1]
mid=str(len(string[1:len(string)-1]))
print(first+mid+last)


s = input().rstrip()
print(s[0] + str(len(s) - 2) + s[-1])


# coding: utf-8

s = raw_input()
print s[0] + str(len(s[1:-1])) + s[-1]


N = input()
if N == N[-1::-1]:
    print('Yes')
else:
    print('No')


N = input()
if N[0] == N[2]:
    print("Yes")
else:
    print("No")


num = input()
if num[0] == num[2]:
    print('Yes')
else:
    print('No')


N = int(input())
n100 = int(N/100)
n1 = N - int(N/10) * 10
if n100 == n1:
    print("Yes")
else:
    print("No")


n = input()
if(n[0]==n[2]):
    print("Yes")
else :
    print("No")


N = input()
if N == N[::-1]:
    print('Yes')
else:
    print('No')


n = input()

if n == n[::-1]:
    print("Yes")
else:
    print("No")


N=input()
a=list(N)
b=[]
n=len(a)
for i in range(n):
 b.append(0)
count=0

for i in range(n):
  b[i]=a[n-1-i]

for i in range(n):
  if(a[i]==b[i]):
    count +=1

if(count==n):
  print("Yes")
else:
  print("No")


n = list(input())
r = n[::-1]

if(n==r):
    print("Yes")
else:
    print("No")


a = raw_input()
print "Yes" if a == a[-1:-1-len(a):-1] else "No"


def getInput():
    separator = ' '
    ret_array = []
    while True:
        try:
            row = input().split(sep=separator)
            ret_array.append(row)
        except EOFError:
            break
    return ret_array

inp = getInput()
i = inp[0][0]

if i[0] == i[2]:
    print('Yes')
else:
    print('No')


n=list(input())
if n[::-1]==n:
 print("Yes")
else:
 print("No")


n = input()
s = []
for i in range(len(n)):
    s.append(n[len(n)-1-i])
if(n=="".join(s)):
    print("Yes")
else:
    print("No")


N=input()
if N[0]==N[2]:print('Yes')
else:
  print('No')


N = raw_input()

if N == N[::-1]:
    print "Yes"
else:
    print "No"


n = input()
if n == n[::-1]:
    print('Yes')
else:
    print('No')


n = input().rstrip()
if n[0]==n[2]:
	print("Yes")
else:
	print("No")


s = input()
if(s == s[::-1]) :
	print('Yes')
else:
	print('No')


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

if l[0]//100 == l[0]%10:
    print("Yes")
else:
    print("No")


kaibun = input()
if "".join(reversed(kaibun)) == kaibun:
    print("Yes")
else:
    print("No")


S = input()
print('Yes' if S == S[::-1] else 'No')


S=input()
print('Yes' if S[0]==S[2] else 'No')


if __name__ == '__main__':
    STR = input()
    if STR[0:1] == STR[2:3]:
        print('Yes')
    else:
        print('No')


def kaibun(s):
    for i in range((len(s)+1)//2):
        if s[i] != s[-(i+1)]:
            return "No"
    return "Yes"

s = input()
print(kaibun(s))


N = input()

if N[0] == N[2]:
    print("Yes")
else:
    print("No")


a=input()
if a[:1]==a[-1]:
	print("Yes")
else:
	print("No")


N = input()
if N[0] == N[2]:
    print ('Yes')
else:
    print ('No')


N = input()
if N[0] == N[-1]:
    print("Yes")
else:
    print("No")


N = str(input())

if N == N[::-1]:
    print("Yes")
else:
    print("No")


def isPal(n):
    sum = 0
    while(n>0):
        rem = n % 10
        sum = (sum * 10) + rem
        n = n//10

    return sum

n = int(input().strip())

if(n == isPal(n)):print('Yes')
else:print('No')


x=str(int(input()))
if x[0]==x[-1]:
    print("Yes")
else:
    print("No")


s = raw_input()
if s[0] == s[2]:
  print 'Yes'
else:
  print 'No'


#ABC070A

n=raw_input()
if n[0]==n[-1]:
 print 'Yes'
else:
 print 'No'


N = input()

for i in range(int(len(N) / 2 + 1)):
    if N[i] != N[len(N) - 1 - i]:
        print('No')
        exit()

print('Yes')


a=input()
if a[0]==a[2]:
    print("Yes")
else:print("No")


def Q1(x):
    value_reverse = int(str(x)[::-1])
    if x == value_reverse:
        return 'Yes'
    else:
        return 'No'

x=int(input())
print(Q1(x))


n = input()
msg = "Yes" if n == n[::-1] else "No"
print(msg)


a = list(input())
rev_a = list(a)
rev_a.reverse()

if a == rev_a:
    print("Yes")
else:
    print("No")


N = input()
if N == N[::-1]:
    print("Yes")
else:
    print("No")


n = input()
if n == n[::-1]:
    print('Yes')
else:
    print('No')


# -*- coding:utf-8 -*-

A = int(input())

if(int(A/100) == int(A%10)):
    print("Yes")
else:
    print("No")


n = input()
print("Yes" if n[0] == n[2] else "No")


n = []
msg = "Yes"
n += input()
for i in range(len(n)//2):
  if n[i] != n[-(i+1)]:
    msg = "No"
    break
print(msg)


n = input()
if n == n[::-1]:
	print("Yes")
else:
	print("No")


N = input()
rev_N = list(N)[::-1]
if N == "".join(rev_N):
    print("Yes")
else:
    print("No")


#!usr/bim/python
#! -*- coding: utf-8 -*-

n = raw_input()

length = len(n)

status = 0

for i in range(length/2):
    if n[i] == n[length-1-i]:
        pass
    else:
        status = 1
        break

if status == 0:
    print 'Yes'
else:
    print 'No'


n = str(int(input()))

print("Yes" if n == n[::-1] else "No")


def main():
	n = int(input())
	a = n // 100
	b = n - (n // 10) * 10
	if a == b:
		print("Yes")
	else:
		print("No")

if __name__ == '__main__':
	main()


def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))
def plis(a): return " ".join(list(map(str, a)))

N = input()
if(N[0] == N[2]):
    print("Yes")
else:
    print("No")


num=list(raw_input())
#print num
#print num[::-1]
if num==num[::-1]:
    print "Yes"
else:
    print "No"


n = str(input())
print("Yes" if n == n[::-1] else "No")


n = input()
m = int(str(n)[::-1])
if(n == m):
  print 'Yes'
else:
  print 'No'


N = input()
if N[0] == N[2]:
    print('Yes')
else:
    print('No')


s = str(input())
if s == s[::-1]:
	print("Yes")
else:
	print("No")


def main():
    N_str = input().strip()
    if N_str == N_str[::-1]:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()


s=raw_input()
print 'Yes' if s==s[::-1] else 'No'


a = input()
print('Yes' if a[0]==a[2] else 'No')


d = input()
print('Yes' if d == d[::-1] else 'No')


N = input()
if N[0] == N[-1]:
    print("Yes")
else:
    print("No")


import sys

# sys.stdin = open('a1.in')

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

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

def read_int():
    return int(input())

def read_str():
    return input()

def main():
    n = read_int()
    if str(n)[0] == str(n)[-1]:
        res = 'Yes'
    else:
        res = 'No'
    print(res)

main()


str=input()
if str[0]==str[2]:
    print("Yes")
else:
    print("No")


def main():
    n = int(input())

    if n // 100 == n % 10:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()


n = input()

a = [i for i in n]
b = [i for i in reversed(n)]

if a == b:
    print('Yes')
else:
    print('No')


n = input()
if n[0] == n[-1]:
    print('Yes')
else:
    print('No')


import sys
import scipy as sp
import numpy

N = input()

a=N/100
a1=N%100
b=a1/10
c=a1%10

if(a==c):
    print "Yes"
else:
    print "No"


# -*- coding: utf-8 -*-
s = input()

print("Yes" if s[0] == s[2] else "No")


S=list(map(int, input()))

if S[0]==S[2]:
    print('Yes')
else:
    print('No')


import sys

N = int(sys.stdin.readline())

firstD = N / 100
lastD = N % 10
if firstD == lastD:
	print 'Yes'
else:
	print 'No'


N = input()

if N[0] == N[2]:
    print('Yes')
else:
    print('No')


num = input()
if num == num[::-1]:
	print("Yes")
else:
	print("No")


N = input()
if N[:1] == N[-1]:
    print("Yes")
else:
    print("No")


s = input()
if s[0] == s[2]:
    print('Yes')
else:
    print('No')


N = input()

if N[0] == N[-1]:
    print("Yes")
else:
    print("No")


N = input()
revN = N[::-1]

if int(N) == int(revN):
    print("Yes")
else:
    print("No")


N=input()
print('Yes' if N==N[::-1] else 'No')


N = input()
if N == N[::-1]:
	print("Yes")
else:
	print("No")


n = str(input())
print("Yes" if n == n[::-1] else "No")


n = input()
print("Yes" if n[0] == n[2] else "No")


n = str(input())
if n[0] == n[2]:
    print("Yes")
else:
    print("No")


N = input()
if N[0] == N[-1]:
    print("Yes")
else:
    print("No")


N =input('')

if (N % 10) == (N / 100):
	print 'Yes'
else:
	print 'No'


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import re
import math
import collections
import itertools
import functools

DEBUG = True
DEBUG = False

def dbg(*args):
    if DEBUG:
        print("DBG: ", file=sys.stderr, end="")
        print(*args, file=sys.stderr)

def main():
    N = int(input())
    s = str(N)
    print("Yes" if s == "".join(reversed(s)) else "No")

if __name__ == "__main__": main()


s=raw_input()
for i in range(len(s)/2):
    if s[i]!=s[len(s)-i-1]:
        print "No"
        exit()
print "Yes"

print


import sys

for inp in map(str, [line.strip() for line in sys.stdin]):
	lenip = len(inp)
	if lenip%2==0:
		print "Yes" if inp[:lenip/2] == inp[lenip/2:][::-1] else "No"
	else:
		print "Yes" if inp[:lenip/2] == inp[(lenip+1)/2:][::-1] else "No"


import sys

# sys.stdin = open('a1.in')

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

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

def read_int():
    return int(input())

def read_str():
    return input()

def main():
    n = read_str()
    if n == ''.join(list(reversed(n))):
        res = 'Yes'
    else:
        res = 'No'
    print(res)

main()


N = input()
A = int(N[0])
B = int(N[1])
C = int(N[2])
if A==C:
 print("Yes")
else:
 print("No")


s=input()
if s==s[::-1]:
  print("Yes")
else:
  print("No")


a=input()
b=''.join(reversed(a))
if(a==b):
  print('Yes')
else:
  print('No')


n = int(input())
if n//100 == n%10:
    print('Yes')
else:
    print('No')


N=raw_input()
if N[0]==N[-1] :
    print 'Yes'
else :
    print 'No'


n = list(input())

if n==n[::-1]:
    print("Yes")
else:
    print("No")


def f():
    n=(input())
    if (n[0]==n[2]):
        print("Yes")
    else:
        print('No')
f()


s = input()
if s[0:1] == s[2:3]:
    print('Yes')
else:
    print('No')


import sys

N = input()

for i in range(len(N)):
  if N[i] != N[len(N)-1-i]:
    print("No")
    sys.exit()

print("Yes")


N = str(input())
M = N[::-1]

if N == M:
    print('Yes')
else:
    print('No')


# coding: utf-8
def II(): return int(input())
def ILI(): return list(map(int, input().split()))

def read():
    N = input()
    return (N, )

def solve(N):
    rev = str(int("".join(reversed(N))))
    if N == rev:
        ans = "Yes"
    else:
        ans = "No"
    return ans

def main():
    params = read()
    print(solve(*params))

if __name__ == "__main__":
    main()


N = raw_input()
print "Yes" if N==N[::-1] else "No"


n = input()
r = n[::-1]
if n == r:
    print("Yes")
else:
    print("No")


nm = int(input())
if str(nm) == str(nm)[::-1]:
    print('Yes')
else:
    print('No')


n = list(input())
if n[0]==n[2]:
    print("Yes")
else:
    print("No")


N = input()

n = len(N)
result="Yes"

for i in range(n//2):
    if N[i] != N[n-i-1]:
        result="No"
        break

print(result)


k = int(input())
if int(k / 100) == k % 10:
	print("Yes")
else:
	print("No")


n = int(raw_input())
if n / 100 == n % 10:
    print 'Yes'
else:
    print 'No'


a = raw_input()
if a[0] == a[2]:
	print('Yes')
else:
	print("No")


a = input()
b = a[::-1]

if a == b:
	print("Yes")
else :
	print("No")


num = input()

print ('Yes' if num[0:1]==num[2:3] else 'No')


#Palindromic Number

N = int(input())

if ( N == int(str(N)[::-1]) ):
    print("Yes")
else:
    print("No")


n = raw_input()
if n[0] == n[2]: print "Yes"
else: print "No"


n = input()
if n[0] == n[2]:
    print('Yes')
else:
    print('No')


# -*- coding:utf-8 -*-
N = list(input())
if ''.join(N) == ''.join(reversed(N)):
    print('Yes')
else:
    print('No')


def main():
    a = input()

    for i in range(len(a)//2):
        if a[i] != a[-i-1]:
            print('No')
            return
    print('Yes')
    return

if __name__ == '__main__':
    main()


# coding: utf-8
# Here your code !
import sys
a=input()
if a==a[::-1]:
    print("Yes")
else:
    print("No")


n = int(input())
a = 0
for i in range(1,10):
	if 100 * i <= n:
		a += 1
if a == n % 10:
	print('Yes')
else:
	print('No')


na = list(input())
nb = na[:]
nb.reverse()
if na == nb:
    print('Yes')
else:
    print('No')


# coding: utf-8

n = raw_input()

if n[0] == n[-1]:
    print "Yes"
else:
    print "No"


s = raw_input()
print "Yes" if s == s[::-1] else "No"


def main():
    N = input()

    if N == N[::-1]:
        ans = 'Yes'
    else:
        ans = 'No'

    print(ans)

main()


n = input()
if n == n[::-1]:
    print("Yes")
else:
    print("No")


N=str(input())
if N[0]==N[2]:
  print("Yes")
else:
  print("No")


def main():
    n = input()

    flag = True
    s, e = 0, len(n)
    while (s < e//2):
        if n[s] != n[e-s-1]:
            flag=False
            break
        s += 1
    if flag:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()


N=input()
if N==N[::-1]:
 print('Yes')
else:
 print('No')


a = map(int,raw_input().split())
count = 0
for i in range(0,101):
 if a[0] <= i and i < a[1] and a[2] <= i and i < a[3]:
  count += 1
print count


# Two Switches

A,B,C,D = list(map(int, input().split()))

if (A>C):
    A,B,C,D = C,D,A,B

if ( C<B ):
    print( min(B-C, D-C) )
else:
    print(0)


A, B, C, D = map(int, input().split())
ans = min(B,D) - max(A,C)

if ans > 0:
    print(ans)
else:
    print(0)


a, b, c, d = map(int, input().split())
if b <= c or d <= a:
	print(0)
elif b <= d:
	if a <= c:
		print(b - c)
	else:
		print(b - a)

else:
	if a <= c:
		print(d - c)
	else:
		print(d - a)


a, b, c, d = map(int, input().split())
if a>=c:
    if b>=d:
        if d<=a:
            print(0)
        else:
            print(d-a)
    else:
        print(b-a)
elif a<c:
    if b>=d:
        print(d-c)
    elif b<=c:
        print(0)
    else:
        print(b-c)


a, b, c, d = map(int, input().split())
r = min(b, d) - max(a, c)
if r < 0:
    print(0)
else:
    print(r)


a, b, c, d = map(int, raw_input().split())
print max(0, min(b, d) - max(a, c))


def solve():
    a, b, c, d = map(int, input().split())
    ans = [0] * 101
    for i in range(a, b):
        ans[i] += 1
    for i in range(c, d):
        ans[i] += 1
    print(ans.count(2))

if __name__=="__main__":
    solve()


a,b,c,d = map(int,input().split())
ans =min(b,d)-max(a,c)
print(0 if ans<0 else ans)


timestr = input().split()
time = []
for x in timestr:
    time.append(int(x))
l = min([time[1], time[3]])
s = max([time[0], time[2]])
d = l - s
if d < 0:
    print(0)
else:
    print(d)


a, b, c, d = map(int, input().split())
print(max(0, min(b, d) - max(a, c)))


a = map(int, raw_input().strip().split())
b = max(a[0],a[2])
c = min(a[1],a[3])
if c > b:
	ans = c-b
else:
	ans = 0
print(ans)


A, B, C, D = map(int, input().split())
t = 0
if A > C:
    A, B, C, D = C, D, A, B
if B <= C:
    print(t)
else:
    t = min(B, D) - C
    print(t)


A, B, C, D = input().split()
A = int(A)
B = int(B)
C = int(C)
D = int(D)

def solve(A, B, C, D):
    if A < C:
        if B < C:
            return 0
        elif A <= C and D <= B:
            return (D - C)
        else:
            return (B - C)
    else:
        if D < A:
            return 0
        elif C <= A and B <= D:
            return (B - A)
        else:
            return (D - A)

print(solve(A, B, C, D))


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

if c>b  or a>d:
    print("0")
else:
    print(b+d-a-c-(max(a,b,c,d)-min(a,b,c,d)))


a, b, c, d= [int(i) for i in input().strip().split(' ')]
if c>=b or d<=a:
  print(0)
elif c>=a and c<=b:
  if d<=b:
    print(d-c)
  else:
    print(b-c)
elif d>=a:
  if d<=b:
    print(d-a)
  else:
      print(b-a)


A, B, C, D = list(map(int, input().split()))

f = set([i for i in range(A, B)])
g = set([i for i in range(C, D)])
print(len(list(f.intersection(g))))


a, b, c, d = map(int, raw_input().split())

s = 0
on_a = 0
on_b = 0
for i in range(101):
    if i == a:
        on_a = 1
    if i == b:
        on_a = 0
    if i == c:
        on_b = 1
    if i == d:
        on_b = 0
#    print(i, on_a, on_b)
    if on_a and on_b:
        s += 1

print(s)


a, b, c, d = map(int, input().split())
t = min(b, d) - max(a, c)
print(t if t > 0 else 0)


a_s, a_f, b_s, b_f = [int(x) for x in input().rstrip().split()]
result = min(a_f, b_f) - max(a_s, b_s)
if result > 0:
	print(result)
else:
	print("0")


a = input().split()
ast = int(a[0])
aen = int(a[1])
bst = int(a[2])
ben = int(a[3])
if ast > ben or bst > aen:
    print("0")
elif ast < bst and aen < ben:
    print(aen - bst)
elif ast < bst and aen > ben:
    print(ben - bst)
elif bst < ast and ben < aen:
    print(ben - ast)
elif bst < ast and ben > aen:
    print(aen - ast)
elif ast == bst and aen < ben:
    print(aen - ast)
elif ast == bst and aen > ben:
    print(ben - ast)
elif ast < bst and aen == ben:
    print(ben - bst)
elif ast > bst and aen == ben:
    print(aen - ast)
elif ast == bst and aen == ben:
    print(aen - ast)
else:
    print("0")


def main():
    a, b, c, d = [int(x) for x in input().split()]

    xs = [0] * 101
    xs[a] += 1
    xs[b] -= 1
    xs[c] += 1
    xs[d] -= 1

    cursum = 0
    t = 0
    for x in xs:
        cursum += x
        if cursum == 2:
            t += 1

    print(t)

if __name__ == "__main__":
    main()


[A, B, C, D] = map(int, input().split())
X = max(A, C)
Y = min(B, D)
if Y-X >= 0:
    print(Y-X)
else:
    print(0)


sp=list(map(int,input().split()))
time=min(sp[1],sp[3])-max(sp[0],sp[2])
if time >= 0:
	print(time)
else:
	print(0)


A, B, C, D = map(int, input().split())
ans = min(B,D) - max(A,C)

if ans > 0:
    print(ans)
else:
    print(0)


line = raw_input()
A, B, C, D = line.split()
A = int(A)
B = int(B)
C = int(C)
D = int(D)

if C > B:
    print 0
elif A > D:
    print 0
elif A > C:
    if B > D:
        print D - A
    else:
        print B - A
else:
    if B > D:
        print D - C
    else:
        print B - C


import sys

N = sys.stdin.readline()

N = N.split()
N = map(int, N)

if N[2] > N[1] or N[0] > N[3]:
	print 0

else:
	least = max(N[0], N[2])
	most = min(N[1], N[3])

	print abs(most- least)


A, B, C, D = map(int, input().split())
if A > C:
    tmpA = A
    tmpB = B
    A = C
    B = D
    C = tmpA
    D = tmpB
if D > B:
    if C > B:
        print(0)
    else:
        print(B-C)
else:
    print(D-C)


A, B, C, D = map(int, input().split())

print(max(0, min(B, D) - max(A, C)))


def f(a, b, c, d):
    if a <= c:
        if b <= c:
            return 0
        if b <= d:
            return b - c
        else:
            return d - c
    else:
        return f(c, d, a, b)

a, b, c, d = [int(x) for x in input().strip().split()]
print(f(a, b, c, d))


import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**1
gosa = 1.0 / 10**9
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def main():
    a,b,c,d = LI()
    t = min(b,d) - max(a,c)
    if t > 0:
        return t

    return 0

print(main())


# coding: utf-8
a, b, c, d = list(map(int, input().split()))
s1 = set([x for x in range(a, b + 1)])
s2 = set([x for x in range(c, d + 1)])
print(max(len(s1 & s2) - 1, 0))


a, b, c, d = map(int, input().split())
ans = 0
for i in range(101):
    if a <= i < b and c <= i < d:
        ans += 1
print(ans)


A,B,C,D = map(int, input().split())
if B <= C:
    print("0")
else:
    print(max(0, min(B,D) - max(A,C)))


A, B, C, D = map(int, raw_input().split())

print max(min(B, D) - max(A, C), 0)


A, B, C, D = [int(n) for n in input().split()]

end = min(B, D)
start = max(A, C)
print (max(0,end-start))


a,b,c,d=map(int,input().split())
s=max(a,c)
f=min(b,d)
if f-s<=0:
    print(0)
else:
    print(f-s)


A, B, C, D = list(map(int, input().split(" ")))

print(max(min(B, D) - max(A, C), 0))


A, B, C, D = map(int, input().split())

st = max(A, C)
ed = min(B, D)

print(max(ed - st, 0))


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

if(b<c or d<a):print(0)
##elif(b==c or d==a):
##    if(b == 0 or d==0):print(0)
##    else:print(1)
else:
    start = a if a>c else c
    end = b if b<d else d
    print(end - start)


a,b,c,d=map(int,input().split())
count=0
for i in range(101):
    if i>=a and i<=b and i>= c and i<=d:
        count +=1

print(max(0,count-1))


(a, b, c, d) = tuple(map(int, input().split(" ")))

mm = max(a, c)
nn = min(b, d)

print(max(0, nn - mm))


def compute(a, b, c, d):
    return max(0, min(b, d) - max(c, a))

def main():
    a, b, c, d = (int(x) for x in input().split())
    print(compute(a, b, c, d))

if __name__ == '__main__':
    main()


a,b,c,d = map(int,raw_input().split())
t = [0 for _ in xrange(101)]
t[a] += 1
t[b] -= 1
t[c] += 1
t[d] -= 1
for i in xrange(len(t)):
  if(i > 0): t[i] += t[i-1]
count = 0
for i in xrange(len(t)):
  if(t[i] == 2): count += 1
print count


a,b,c,d=[int(i) for i in input().strip().split(' ')]

'''
入力は他の人のを見た
'''

max=0
min=0

if a < c :
    max=c
else :
    max=a

if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
else :
    print(0)


A, B, C, D = map(int, input().split(' '))
i = (B - A + D - C - abs(D-A))
if A<C and D<B:
    print(abs(D-C))
elif C<A and B<D:
    print(abs(B-A))
elif A<=C and C <=B:
    print(B-C)
elif C <= A and A<=D:
    print(D-A)
else:
    print(0)


a, b, c, d = map(int, input().split())
if b <= c or d <= a:
    print('0')
else:
    if a < c:
            print(min(b-c, d-c))
    else:
        print(min(d-a, b-a))


A,B,C,D = map(int,input().split())
lower = max(A,C)
upper = min(B,D)

print(max(0,upper-lower))


a, b, c, d = map(int, input().split())
print(max(0, min(b, d) - max(a, c)))


A, B, C, D = map(int, raw_input().split(" "))

answer = 0
for i in xrange(101):
  if A <= i < B and C <= i < D:
    answer += 1

print answer


arr=[int(x) for x in input().split()]
if(arr[0]< arr[2]):
    if(arr[2]<=arr[1]<=arr[3]):
        print(arr[1]-arr[2])
    elif(arr[1]<arr[2]):
        print('0')
    else:
        print(arr[3]-arr[2])
else:
    if(arr[0]<=arr[3]<=arr[1] ):
        print(arr[3]-arr[0])
    elif(arr[3]<arr[0]):
        print('0')
    else:
        print(arr[1]-arr[0])


A,B,C,D = map(int,input().split())
print(max(0,min(D,B)-max(C,A)))


A,B,C,D = map(int, raw_input().split())

start=max(A,C)
end=min(B,D)

sec=end-start

if sec<0:
  print 0
else:
  print sec


a,b,c,d = map(int,input().split())
if a <= c <= b <= d:
    print(b - c)
elif c <= a <= d <= b:
    print(d - a)
elif a <= c <= d <= b:
    print(d - c)
elif c <= a <= b <= d:
    print(b - a)
else:
#elif b <= c or d <= a:
    print(0)


A,B,C,D = list(map(int,input().split()))

if A < C:
  a = C
else:
  a = A

if B < D:
  b = B
else:
  b = D

if B <= C or D <= A:
  res = 0
else:
  res = (b-a)

print(res)


def main():
    lst = list(map(int, input().split(' ')))
    left = max(lst[0], lst[2])
    right = min(lst[1], lst[3])
    print(max(right-left, 0))

if __name__ == '__main__':
    main()


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

    sw = [0] * 101
    sw[A] = 1
    sw[B] = -1
    sw[C] += 1
    sw[D] += -1
    for i in range(1, 101):
        sw[i] = sw[i-1] + sw[i]

    ans = sw.count(2)
    print(ans)

main()


[a,b,c,d]=[int(i) for i in input().split()]
if a<c:
  x1=a
  x2=c
  y1=b
  y2=d
else:
  x1=c
  x2=a
  y1=d
  y2=b
if y1<x2:
   c=0
elif x2<=y1<=y2:
   c=y1-x2
else:
   c=y2-x2
print(c)


# -*- coding:utf-8 -*-
a,b,c,d = map(int, input().split())
if min(b,d) >= max(a,c):
    print(min(b,d)-max(a,c))
else:
    print(0)


a, b, c, d = map(int,input().split())
print(max(0, min(b, d)-max(a, c)))


#ABC070B

a,b,c,d=map(int,raw_input().split())
if a<=c<=b<=d:
 print b-c
elif c<=a<=d<=b:
 print d-a
elif a<=c<=d<=b:
 print d-c
elif c<=a<=b<=d:
 print b-a
else:
 print 0


n = [0] * 100
a, b, c, d = map(int, input().split())
while a < b:
    n[a] += 1
    a += 1
while c < d:
    n[c] += 1
    c += 1
print(n.count(2))


if __name__ == '__main__':
    A, B, C, D = map(int, input().split())

    if B <= C or D <= A:
        print(0)
    else:
        if A < C:
            if B < D:
                print(B-C)
            else:
                print(D-C)
        elif A > C:
            if B < D:
                print(B-A)
            else:
                print(D-A)
        else:
            if B < D:
                print(B-A)
            else:
                print(D-A)


A,B,C,D = map(int,input().split())

if A > C:
    A,B,C,D = C,D,A,B

if C >= B:
    print("0")
elif C < B and D > B:
    print(B - C)
else:
    print(D - C)


xa, ya, xb, yb = map(int, input().split())

if xa > xb:
    x = xa
else:
    x = xb
if ya > yb:
    y = yb
else:
    y = ya
ans = y - x
if ans <= 0:
    print(0)
else:
    print(ans)


A,B,C,D = [int(i) for i in input().split()]
print(max(0,min(B,D) - max(A,C)))


A, B, C, D = input().split(' ')
A = int(A)
B = int(B)
C = int(C)
D = int(D)
ab = set([ x for x in range(A, B)])
cd = set([ x for x in range(C, D)])
#print(ab, cd)
print(len(ab & cd))
#print(A,B,C,D)
#print(abs((B-A) - C + ( D-C )))


# -*- coding:utf-8 -*-

A,B,C,D = map(int,input().split())

if(B<C or D<A):
    print("0")
else:
    if(A>=C):
        begin = A
    else:
        begin = C
    if(D<=B):
        end = D
    else:
        end = B
    print(end-begin)


A,B,C,D = list(map(int, input().split()))

if A > D or C > B:
    print(0)
else:
    print(min(B,D)-max(A,C))


A,B,C,D = map(int,input().split())
tmp_A = [i for i in range(A,B)]
tmp_B = [j for j in range(C,D)]
print(len(set(tmp_A)&set(tmp_B)))


def create_set(a, b, out):
    for i in range(a, b):
        out.add(i)

param = input()
a, b, c, d = param.split(' ')
a = int(a)
b = int(b)
c = int(c)
d = int(d)

alice = set()
bob = set()
create_set(a, b, alice)
create_set(c, d, bob)

total = alice & bob

time_total = 0
for i in total:
    time_total += 1

print(time_total)


cnt=0
a,b,c,d=map(int,raw_input().split())
t=[0 for i in range(101)]
for i in range(a,b+1):
    t[i]=1
for j in range(c,d+1):
    t[j]=t[j]+1
for i in range(101):
    if t[i]==2: cnt=cnt+1
if cnt==0:
    print 0
else:
    print cnt-1


a, b, c, d = map(int, raw_input().split())

if a >= c:
    tmpa = a
else:
    tmpa = c

if b >= d:
    tmpb = d
else:
    tmpb = b

ans = tmpb - tmpa

if ans < 0:
    print 0
else:
    print ans


press = 0
a, b, c, d = map(int,input().split())
for i in range(101):
    if a<=i<b and c<=i<d: press+= 1
print(press)


import sys
a, b, c, d = (int(i) for i in input().split())
if b-c<=0 or d-a<=0 or b-a<=0 or d-c<=0:
    print(0)
    sys.exit()
else:
    an = min(b-a,d-c,b-c,d-a)
    print(an)


s = raw_input()
abcd = map(int, s.split())
if abcd[0] > abcd[2]:
	begin = abcd[0]
else:
	begin = abcd[2]
if abcd[1] > abcd[3]:
	end = abcd[3]
else:
	end = abcd[1]

if (end - begin) >= 0:
	print(end - begin)
else:
	print(0)


a = list(map(int,input().split()))
counter = 0
for i in range (101):
  if a[0] <= i <= a[1] and a[2] <= i <= a[3]:
    counter += 1
if counter > 0:
  print ('{0}'.format(counter - 1))
else:
  print ('{0}'.format(0))


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

s = max(a,c)
t = min(b,d)
d = t-s
print(d if d > 0 else 0)


a,b,c,d = map(int, input().split())
if a==c and b==d:
    print(abs(a-b))
elif a==d or c==b:
    print(0)
elif a==c:
    print(abs(b-a) if b<d else abs(d-c))
elif b==d:
    print(abs(b-a) if a>c else abs(d-c))
elif a>c:
    if a>d:
        print(0)
    elif a<d<b:
        print(abs(a-d))
    else:
        print(abs(a-b))
else:
    if c>b:
        print(0)
    elif c<b<d:
        print(abs(c-b))
    else:
        print(abs(c-d))


alice = [False for _ in range(100)]
bob = [False for _ in range(100)]

a,b,c,d = map(int,input().split(" "))
for i in range(a,b):
    alice[i] = True

for i in range(c,d):
    bob[i] = True

count = 0
for i in range(100):
    if alice[i] and bob[i]:
        count += 1

print(count)


a,b,c,d = map(int, input().split())
if a < c:
    start = c
else:
    start = a
if b < d:
    end = b
else:
    end = d
if start >= end:
    print(0)
else:
    print(end - start)


A,B,C,D = map(int, raw_input().split())
print max(0, min(B,D)-max(A,C))


A, B, C, D = map(int, input().split())
X = set(range(A, B))
Y = set(range(C, D))
print(len(X.intersection(Y)))


def Q2(x):
    A, B, C, D = x[0], x[1], x[2], x[3]
    if B <= C or D <= A:
        return 0
    else:
        if A <= C:
            return min(B, D) - C
        else:
            return min(B, D) - A

l = [int(i) for i in input().split()]
print(Q2(l))


A, B, C, D = map(int, raw_input().split())
print max(0, min(B,D)-max(A,C))


abcd = [int(i) for i in input().split()]

total = (abcd[1] - abcd[0]) + (abcd[3] - abcd[2])
gap = max(abcd) - min(abcd)

if gap>=total:
	print(0)
else:
	print(total-gap)


a, b, c, d = map(int, input().split())
s = max(a, c)
e = min(b, d)
print(max(e-s, 0))


N=input().split()
A=int(N[0])
B=int(N[1])
C=int(N[2])
D=int(N[3])

t=0
if(C<A):
 if(D<=A):
  t=0
 if(A<D<=B):
  t=D-A
 if(B<D):
  t=B-A

if(A<C):
 if(B<=C):
  t=0
 if(C<B<=D):
  t=B-C
 if(D<B):
  t=D-C

if(A==C):
 if(B<=D):
  t=B-A
 else:
  t=D-A

print(t)


a,b,c,d = map(int,input().split())
s=0
for i in range(a,b):
    for j in range(c,d):
        if i == j:
            s+=1
print(s)


# your code goes here
A,B,C,D=(int(i) for i in input().split())
if A<C:
    A=C
if B>D:
    B=D
B-=A
if B<0:
  print(0)
else:
  print(B)


import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

a,b,c,d = na()
print(max(0,min(b,d)-max(a,c)))


a, b, c, d = [int(x) for x in input().split()]

res = 0

for i in range(101) :
    if (a <= i and i < b) and (c <= i and i < d):
        res += 1

print(res)


a,b,c,d = map(int, raw_input().split())
init = max(a,c)
term = min(b,d)
if term-init <= 0:
  print "0"
else:
  print (term-init)


A, B, C, D = list(map(int, input().split()))
if A < C:
    if B < D:
        if B < C:
            ans = 0
        else:
            ans = B-C
    else:
        ans = D-C
else:
    if B < D:
        ans = B-A
    else:
        if A < D:
            ans = D-A
        else:
            ans = 0
print(ans)


a,b,c,d=map(int,input().split())
if a>=c and b>=d and d>a:
    print(d-a)
elif a<=c and b<=d and b>c:
    print(b-c)
elif a<c and d<b:
    print(d-c)
elif c<a and b<d:
    print(b-a)
else:
    print(0)


a,b,c,d = map(int,input().split())
if b<=c or d<=a:
    print(0)
else:
    print(min(b,d)-max(a,c))


a,b,c,d = map(int, input().split())
Alice = set(range(a,b))
Bob = set (range(c,d))
print(len(Alice & Bob))


A, B, C, D = [int(i) for i in input().split()]
print(max(0, min(B,D) - max(A, C)))


a,b,c,d = map(int, input().split())
Al = list(range(a,b))
Bo = list(range(c,d))
print(len(set(Al) & set(Bo)))


A,B,C,D=map(int,input().split())
a=[0]*101
for i in range(A,B):
  a[i]+=1
for i in range(C,D):
  a[i]+=1
print( sum([ 1 for x in a if x >= 2]) )


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

m = [0 for i in range(101)]
n = [0 for i in range(101)]

i = a
while(True):
    m[i] = 1
    if(i == b):
        break
    i+=1
i = c
while(True):
    n[i] = 1
    if(i == d):
        break
    i+=1

ans = 0
for i in range(101):
    if(m[i] * n[i] == 1):
        ans+=1

if(ans!=0):
    ans-=1

print(ans)


A,B,C,D = map(int,input().split())
print(max(0,min(B,D)-max(A,C)))


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

    if A <= D and B >= C:
        print(min(B,D) - max(A,C))
    else:
        print(0)

if __name__ == "__main__": main()


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import re
import math
import collections
import itertools
import functools

DEBUG = True
DEBUG = False

def dbg(*args):
    if DEBUG:
        print("DBG: ", file=sys.stderr, end="")
        print(*args, file=sys.stderr)

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

    alice = [A <= t < B for t in range(100)]
    bob   = [C <= t < D for t in range(100)]

    cnt = 0
    for t in range(100):
        if alice[t] and bob[t]:
            cnt += 1

    print(cnt)

if __name__ == "__main__": main()


A, B, C, D = map(int, input().split())
if A > C:
    start = A
else:
    start = C
if B < D:
    end = B
else:
    end = D
if end - start >= 0:
    print(end - start)
else:
    print(0)


A,B,C,D = map(int,input().split())
print(max(0, min(B,D) - max(A,C)))


a,b,c,d=map(int,raw_input().split())
a=max(a,c)
b=min(b,d)
print max(0,b-a)


#! -*- coding:utf-8 -*-
a,b,c,d = map(int,input().split())
if d <= a or b <= c:
    print(0)
elif c <= a and (a <= d and d <= b):
    print(d-a)
elif (a <= c and c <= b) and (a <= d and d <= b):
    print(d-c)
elif (a <= c and c <= b) and b <= d:
    print(b-c)
else:
    print(b-a)


a,b,c,d = [int(i) for i in input().split()]

ans = 0
for i in range(101):
    if i in range(a,b) and i in range(c,d):
        ans += 1

print(ans)


A, B, C, D = map(int,input().split())

if(B < C or D < A):
	print(0)

else:
	if(A > C):
		E = A
	else:
		E = C

	if(B > D):
		F = D
	else:
		F = B

	print(F - E)


nums = [int(x) for x in input().split()]
nums = [ [nums[0],nums[1]] ,
         [nums[2],nums[3]] ]
N = 100
imos = [0 for i in range(N+2)]

for num in nums:
    a,b = num[0],num[1]-1
    imos[a] += 1
    imos[b+1] -= 1

ans = []
j = 0
for i in imos:
    ans.append(j+i)
    j += i

print(ans.count(2))


a, b, c, d = map(int, input().split())
e = max(a, c)
f = min(b, d)
print(max(f-e,0))


a,b,c,d = map(int, raw_input().split())
s = max(a,c)
e = min(b,d)
if s < e:
    print e-s
else:
    print 0


a,b,c,d = map(int,input().split())
ans = min(b,d) - max(a,c)
if ans > 0:
    print(ans)
else:
    print("0")


def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))
def plis(a): return " ".join(list(map(str, a)))

a, b, c, d = rli()
print(max(0, b-c-max(0, a-c) - max(0, b-d)))


a,b,c,d = list(map(int, input().split()))

if a < c:
    if d <= b:
        print(d - c)
    elif c <= b:
        print(b - c)
    else:
        print(0)
else:
    if b <= d:
        print(b - a)
    elif a <= d:
        print(d - a)
    else:
        print(0)


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

if a<c:
    if b>c:
        if b>d:
            print(d-c)
        else:
            print(b-c)
    else:
        print(0)
else:
    if d>a:
        if d>b:
            print(b-a)
        else:
            print(d-a)
    else:
        print(0)


def Q2(x):
    A, B, C, D = x[0], x[1], x[2], x[3]
    time_lower = max(A, C)
    time_upper = min(B, D)
    return max(0, time_upper - time_lower)

l = [int(i) for i in input().split()]
print(Q2(l))


# -*- coding: utf-8 -*-
"""
http://abc070.contest.atcoder.jp/tasks/abc070_b
"""

def solve(A, B, C, D):
    start = max(A, C)
    end = min(B, D)
    duration = end - start
    if duration < 0:
        return 0
    else:
        return duration

def main():
    A, B, C, D = [int(x) for x in input().strip().split(' ')]
    result = solve(A, B, C, D)
    print(result)

if __name__ == '__main__':
    main()


a, b, c, d = map(int,input().split())
print(max(0, min(b, d)-max(a, c)))


A, B, C, D = map(int, input().split())
S1 = set()
S2 = set()
for i in range(A, B):
  S1.add(i)
for i in range(C, D):
  S2.add(i)
print(len(S1.intersection(S2)))


# encoding:utf-8

def main():
	a, b, c, d = list(map(int, input().split()))
	st = max(a, c)
	en = min(b, d)
	dr = max(en - st, 0)
	print(dr)

if __name__ == '__main__':
	main()


l=list(map(int,input().strip().split(' ')))
a=l[0]
b=l[1]
c=l[2]
d=l[3]
l1=[x for x in range(a,b+1)]
l2=[x for x in range(c,d+1)]
l3=[]
ans=0
for i in l2:
    if i in l1:
        ans+=1
print(max(0,ans-1))


def gcd(a, b):
    if a < b:
        a,b = b,a
    while b > 0:
        r = a % b
        a,b = b,r
    return a

def lcm(a, b):
    if a == 0 or b == 0:
        print("Error")
        return 0
    return int(a * b // gcd(a, b))

def arrlcm(a):
    alen = len(a)
    if alen == 3:
        return lcm(a[0], lcm(a[1], a[2]))
    elif alen == 2:
        return lcm(a[0], a[1])
    elif alen == 1:
        return a[0] # 最初から1つ
    elif alen == 0:
        return 0
    else:
        return lcm(arrlcm(a[:alen//2]), arrlcm(a[alen//2:]))

def solve():
    n = int(input())
    print(arrlcm([int(input()) for _ in range(n)]))

if __name__=="__main__":
    solve()


N = input();

from fractions import gcd

ans = 1
for i in range(N):
    t = input()
    g = gcd(ans, t)
    ans = (t * ans) / g

print ans


import sys
import scipy as sp
import numpy
import math
from fractions import Fraction
from fractions import gcd

N = input()
t = []
for i in range(N):
    t.append(input())

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

a=1
for j in range(N):
    b=t[j]
    c=lcm(a,b)
    a=lcm(c,b)

print c


def gcd(a, b):
  if b == 0:
    return a
  return gcd(b, a % b)

n=int(input())
p=1
for i in range(n):
  m=int(input())
  p=p*m//gcd(p,m)
print(int(p))


def lcm(a, b):
    ax = a
    bx = b
    if a<b:
        ax, bx = (bx, ax)
    while True:
        if ax%bx == 0:
            gcd = bx
            break
        else:
            c = bx
            bx = ax%bx
            ax = c
    return a*b // gcd

n = int(input())
lst = []
lst2 = []
for i in range(n):
    a = int(input())
    lst.append(a)

while True:
    if n==1:
        print(lst[0])
        break
    lst2.append(lcm(lst[0], lst[1]))
    lst.pop(0)
    lst.pop(0)
    lst2.extend(lst)
    if len(lst2)==1:
        print(lst2[0])
        break
    lst.clear()

    lst.append(lcm(lst2[0], lst2[1]))
    lst2.pop(0)
    lst2.pop(0)
    lst.extend(lst2)
    if len(lst)==1:
        print(lst[0])
        break
    lst2.clear()


#!usr/bim/python
#! -*- coding: utf-8 -*-

n = raw_input()
n = int(n)

t = []

for i in range(n):
    temp = raw_input()
    temp = int(temp)
    t.append(temp)

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

x = 1
for i in range(n):
    y = t[i]
    gcdxy = gcd(x,y)
    lcm = x*y/gcdxy
    x = lcm

print x


def gcd(a, b):
  if b == 0:
    return a
  else:
    return gcd(b, a % b)

N=int(input())
A = [ int(input()) for _ in range(N) ]
ans = A[0]
for x in A[1:]:
  ans = ans * x // gcd(ans, x)
print(ans)


def HCF(a,b):
    if a==0:
        return b
    return HCF(b%a,a)
N = long(raw_input())
x = long(raw_input())
for i in range(1,N):
    y = long(raw_input())
    x = (x*y)/HCF(x,y)
print x


def gcd(a,b):
    if a > b:
        t = a
        a = b
        b = t
    if b % a == 0:
        return a
    else:
        return gcd(b % a, a)

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

n = int(raw_input())
l = [int(raw_input()) for _ in range(n)]
print reduce(lcm, l)


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

r = 1
nbClock = int(input())
for i in range(nbClock):
   c = int(input())
   g = gcd(r,c)
   r = r * (c//g)
print(r)


def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))
def plis(a): return " ".join(list(map(str, a)))

import fractions

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

N = ri()
t = ri()
for i in range(N-1):
  t = lcm(t, ri())
print(t)


N = input()
T = [input() for _ in range(N)]

def gcd(a, b):
    if b==0:
        return a
    else:
        return gcd(b, a%b)

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

ans = 1
for t in T:
    ans = lcm(ans, t)
print ans


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

def lcm(a,b):
    return a*b//gcd(a,b)
T=[]
N=int(input())
for i in range(N):
    T.append(int(input()))

ans=1
for t in T:
    ans=lcm(ans, t)

print(int(ans))


# encoding:utf-8
from functools import reduce

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

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

def main():
	n = int(input())
	nums = [int(input()) for _ in range(n)]

	out = reduce(lcm, nums)
	print(out)

if __name__ == '__main__':
	main()


def gcd(a,b):
    while True:
        r=a%b
        if r==0:
            return b
        a, b = b, r

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

N=int(input())
ans=1
for _ in range(N):
    t=int(input())
    ans=gcf(ans,t)
print(ans)


N = int(input())

a_list = []
for _ in range(N):
    a_list.append(int(input()))

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

res = 1
for i in range(N):
    d = gcd(res, a_list[i])
    res = res // d
    res = res * a_list[i]

print(res)


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

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

N = int(input())						# 5

a = int(input())
for _ in range(N-1):
	a = lcm(a, int(input()))

print(a)


import sys

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

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

N = int(input())
if(N==1):
    print(int(input()))
    sys.exit()

T=[]
T.append(int(input()))

for i in range(N-1):
    T.append(int(input()))
    T[i+1]=lcm(T[i+1],T[i])
print(T[N-1])


from fractions import gcd
def lcm(a, b):
    return a * b // gcd (a, b)
def f():
    n = int(input())
    a=[]
    l=1
    for i in range(n):
        s=(int(input()))
        l=lcm(l,s)
    print(l)
f()


def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)

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

n=int(raw_input(''))
x=int(raw_input(''))
lcm=x

for i in range(1,n,1):
    x=int(raw_input(''))
    lcm=getlcm(lcm,x)
print lcm


N = int(input())
t_list = [int(input()) for i in range(N)]

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

a = t_list[0]
for c in range(N-1):
	b = t_list[c+1]
	a =a*b//gcd(a,b)

print(a)


def GCD(a, b):
    if a > b:
        A = a
        B = b
    elif b > a:
        A = b
        B = a
    else:
        return a

    r = A % B
    while r != 0:
        A = B
        B = r
        r = A % B

    return B

def LCM(a, b):
    g = GCD(a, b)
    return a*b // g

def solve(): # ABC070C- Multiple Clocks
    while 1:
        try:
            n = int(input())
            T = []
            for _ in range(n):
                T.append(int(input()))

            l = T[0]
            for i in range(1, n):
                l = LCM(l, T[i])

            print(l)
        except:
            break

solve()


import fractions
n = int(input())
t = [int(input()) for i in range(n)]

for i in range(n - 1):
    t[i + 1] = t[i] * t[i + 1] // fractions.gcd(t[i], t[i + 1])

print(t[n - 1])


n = int(input())
T = []
for i in range(n):
    T.append(int(input()))

T = sorted(T)
def gcd(a, b):
    while b > 0:
        t = a
        a = b
        b = t%b
    return(a)

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

LCM = T[0]
for i in range(n-1):
    LCM = lcm(LCM, T[i+1])

print(LCM)


n=int(raw_input())
def gcd(a,b):
  if b==0 :
    return a
  return gcd(b,a%b)
y=1
for i in range(n) :
  x=int(raw_input())
  z=gcd(x,y)
  y=x*y/z
print y


def gcd(a, b):
    if a < b: b, a = a, b
    if b == 0: return a
    return gcd(b, a % b)

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

N = int(input())

ret = 1

for _ in range(N):
    ret = lcm(ret, int(input()))

print(ret)


def gcd(x, y):
    y, x = sorted([x, y])
    while y > 0:
        t = y
        y = x % y
        x = t
    return x

n = int(input())
t = [int(input()) for i in range(n)]

lcm = 1
for i in range(n):
    lcm = lcm * t[i] // gcd(lcm, t[i])

print(lcm)


import fractions
import functools

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

n=int(input())
t=[]
for i in range(n):
	t.append(int(input()))
ans=functools.reduce(lcm,t)
print(ans)


def gcd(a, b):
    """Return greatest common divisor using Euclid's Algorithm."""
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    """Return lowest common multiple."""
    return a * b // gcd(a, b)

N = int(input())
T = int(input())
for i in range(1, N):
    T = lcm(int(input()), T)
print(T)


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

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

def main():
    N = int(input())
    T = []

    for i in range(N):
        T.append(int(input()))

    while len(T) > 1:
        T_tmp = []
        for i in range(1, len(T)):
            tmp = lcm(T[i-1], T[i])
            T_tmp.append(tmp)
        T = T_tmp

    print(T[0])

if __name__=="__main__":
    main()


N = int(input())
Ts = [int(input()) for i in range(N)]

# 最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# 最大公倍数
def lcm(a, b):
    return a * b // gcd (a, b)

def solve(Ts):
    if len(Ts) == 1:
        print(Ts[0])

    else:
        Ts_temp = []
        for i in range(len(Ts)-1):
            Ts_temp.append(lcm(Ts[i], Ts[i+1]))
        solve(Ts_temp)

solve(Ts)


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

n = int(input())

res = 1
for i in range(n):
    a = int(input())
    g = gcd(res, a)
    res = (res // g) * a

print(res)


import fractions;n=int(input());g=int(input())
for i in range(n-1):t=int(input());g=g*t//fractions.gcd(g,t)
print(g)


def gcd(a,b) :
	if a % b == 0 :
		return b
	return gcd(b,a%b)

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

N = int(input())
res = 1
for i in range(N) :
	res = lcm(res, int(input()))
print(res)


import fractions

N = int(raw_input())
T = [int(raw_input()) for _ in xrange(N)]

ans = 1

for i in T:
    ans = ans / fractions.gcd(ans, i) * i

print ans


from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10

# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a // g * b

def main():
    N = int(input())
    t_list = list(sorted([int(input()) for _ in range(N)]))
    ans = 1
    for t in t_list:
        ans = lcm(ans, t)

    print(ans)

if __name__ == '__main__':
    main()


#! /usr/bin/env python3

def gcd(a, b):
    if a < b : return gcd(b, a)
    while b != 0:
        t = a % b
        a = b
        b = t
    return a

N = int(input())
T = sorted(set([int(input()) for x in range(N)]))
a = T[-1]
for i in T[:-1]:
    a = (a * i) // gcd(a, i)

print(a)


N = int(input())
result = 1

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

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

for i in range(0, N):
    num = int(input())
    result = lcm(result, num)
print(int(result))


from fractions import gcd
n = int(raw_input())
a = []
for i in range(n):
    a.append(int(raw_input()))
result = a[0]
for i in range(1, n):
    result = result * a[i] / gcd(result, a[i])
print result


n = int(input().strip())
ts = []
for _ in range(n):
    ts.append(int(input().strip()))

def gcd(m, n):
    while 1:
        mod = m % n
        if mod == 0:
            return n
        m, n = n, mod

def lcm(m, n):
    return m * n // gcd(m, n)

from functools import reduce

print(reduce(lcm, ts))


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
a = [int(input()) for i in range(n)]
ans = 1
for i in a:
	ans = ans * i // gcd(ans, i)
print(ans)


def gcd(a, b):
    """最大公約数(Greatest Common divisor)を求める.

    ユークリッドの互除法の実装.
    ああああ

    Parameters
    ----------
    a : int
        自然数.
    b : int
        自然数.

    Returns
    -------
    int
        最大公約数
    """
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    """最小公約数(least common multiple)を求める.

    Parameters
    ----------
    a : int
        自然数.
    b : int
        自然数.

    Returns
    -------
    int
        最小公倍数
    """
    return a * b // gcd(a, b)

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
ans = 1
for t in T:
    ans = lcm(ans, t)
print(ans)


# -*- coding: utf-8 -*-
"""
"""
#

def gcd(x, y):
    if x < y:
        temp = x
        x = y
        y = temp
    while y > 0:
        r = x % y
        x = y
        y = r
    return x

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

def solve(clocks):
    temp_lcm = clocks[0]
    for n in clocks[1:]:
        temp_lcm = lcm(temp_lcm, n)
    return temp_lcm

def main():
    N = int(input())
    clocks = [int(input()) for _ in range(N)]
    result = solve(clocks)
    print(result)

if __name__ == '__main__':
    main()


from fractions import gcd

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

n = int(input())
ts = {int(input()) for _ in range(n)}
a = ts.pop()
for b in ts:
    a = lcm(a, b)
print(a)


# -*- coding: utf-8 -*-

def gcd(m, n):
    return m if n == 0 else gcd(n, m % n)

def lcm(m, n):
    return m * n // gcd(m,n)

def main():
    n = int(input())
    t = []
    for i in range(n):
        tmp = int(input())
        t.append(tmp)
    ans = t[0]
    for i in t:
        ans = lcm(ans, i)
    print(ans)

if __name__ == "__main__":
    main()


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

total = int(input())
param_list = [int(input()) for i in range(total)]

result = param_list[0]
for i in range(1, total):
    result = lcm(result, param_list[i])

print(result)


#! -*- coding:utf-8 -*-
def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a

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

n = int(input())
k = []
for i in range(n):
    k.append(int(input()))

if n == 1:
    print(k[0])
else:
    p = lcm(k[0],k[1])
    for i in range(n):
        p = lcm(p,k[i])
    print(int(p))


def func(a,b):
    return a if b==0 else func(b,a%b)
n = int(input())
num = int(input())
for i in range(n-1):
    d = int(input())
    num = num*d//func(num,d)
print(num)


N=input()
T = [input() for i in range(N)]
#print T

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

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

ans=1
for i in range(len(T)):
	ans=lcm(ans,T[i])
	#print "ans::"+str(ans)

print ans


n = int(input())

lcm = 0
gcd = 0

for i in range(n):
    t = int(input())
    if(i == 0):
        lcm, gcd = t, t
        continue
    lcm = t
    r = gcd % t
    while(r!=0):
        lcm = r
        r = t % r
    gcd *= t
    gcd //= lcm
print(gcd)


n = int(input())

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

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

a, b = 1, 1
for i in range(n):
    a = b
    b = lcm(a, int(input()))
print(b)


import fractions
N = int(input())
lcm = 1
for i in range(N):
    t = int(input())
    lcm = lcm * t // fractions.gcd(lcm,t)
print(lcm)


from fractions import gcd
from functools import reduce

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

N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))
print(reduce(lcm, T))


n = int(input())
t = [ int(input()) for i in range(n)]
def gcd(a,b):
    if a<b:a,b = b,a
    if b==0:return a
    else : return gcd(b,a%b)

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

def lcm(b):
    ans = b[0]
    for i in b:
        ans = lc(ans,i)
    return ans
print(lcm(t))


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

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

now = 0
time = int(input())
fi = 1
ans = 1
while now < time:
    thi = int(input())
    ans = lcm(ans, thi)
    now += 1
print(ans)


def gcd(x, y):
    if y==0:
        return x
    else:
        return gcd(y, x%y)

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

n = int(input())
a = [int(input()) for i in range(n)]
r = 1
for i in a:
    r = lcm(r, i)
print(r)


from sys import stdin

def gcd(a, b):
  return a if b == 0 else gcd(b, a % b)

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

N = int(input())
T = [int(t) for t in stdin]

answer = 1
for t in T:
  answer = lcm(answer, t)

print(answer)


#coding=UTF-8
#import math
import fractions

N=int(input())
ans=1
for idx in range(0,N,1):
    T=int(input())
    ans=ans*T// fractions.gcd(ans,T)

print(ans)


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

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

if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))
    tmp = T[0]
    for j in range(N - 1):
        tmp = lcm(tmp, T[j+1])
    print(tmp)


def gcd(x,y):
    a=max(x,y)
    b=min(x,y)
    return b if a%b==0 else gcd(b,a%b)
def lcm(x,y):
    return x*y//gcd(x,y)

N=int(input())
ans=1
for _ in range(N):
    ans=lcm(ans,int(input()))
print (ans)


def gcd(x,y):
    if y==0:
        return x
    return gcd(y, x % y)
g = 1
for i in xrange(int(raw_input())):
    w = int(raw_input())
    g = g * w / gcd(g, w)
print g


def euclid(a,b):
	if b == 0:
		return a
	else:
		return euclid(b,a % b)

n = int(input())
t = []
for i in range(n):
	x = int(input())
	t.append(x)

for i in range(0,n-1):
	t[i+1] = t[i] * t[i+1] // euclid(t[i],t[i+1])

print(int(t[n-1]))


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

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

N = int(input())

ans = 1
for i in range(N):
    ans = lcm(ans, int(input()))

print(ans)


n=input()

a=[0 for i in range(n)]
def gcd(num1,num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2,num1%num2)

def lcm(num1,num2):
    tmp = gcd(num1,num2)
    return num1*num2/tmp

for i in range(n):
    a[i]=input()
ans=a[0]
for i in range(1,n):
    ans=lcm(ans,a[i])
print ans


import math as m
from functools import reduce
n,T= int(input()),[]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
for i in range(n):
    T.append(int(input()))
tmp = max(T)
for i in range(n):
    if tmp % T[i] != 0:
        tmp = T[i]//gcd(tmp, T[i])*tmp

print(tmp)


n = int(input())
li = []

for i in range(n):
    a = int(input())
    li.append(a)

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

while len(li) > 1:
    a = li[0]
    b = li[1]
    li.pop(1)
    li.pop(0)
    ans = a * b // gcd(a, b)
    li.append(ans)

print(li[0])


#!/usr/local/bin/python3.5 -tt

import fractions
import random
import sys

if __name__ == '__main__':
    def _(f):
        for l in f:
            for i in l.split():
                yield int(i)

    g = _(sys.stdin)

    N = next(g)

    lcm = 1

    for i in range(N):
        T = next(g)

        lcm = lcm * T // fractions.gcd(lcm, T)

    print(lcm)


def gcd(a,b):
	if b==0:return a
	return gcd(b,a%b)
ans=1
for i in range(int(input())):
	h=int(input())
	ans = ans*h // gcd(ans,h)
print(ans)


def __gcd(x,y):
    while(y!=0):
        x,y=y,x%y
    return x

def __lcm(x,y):
    g = __gcd(x,y)
    return (x//g)*y

n = int(input())
L = []
for i in range(n):
    L.append(int(input()))

#print(L)
a = L[0]
for i in range(1,n):
    a = __lcm(a,L[i])

print(a)


def gcd(a,b):
    if(a == 0):
        return b
    else:
        return gcd(b % a, a)

def lcmm(l,m):

    prod = l * m

    gcD = gcd(l,m)

    return (prod // gcD)

n = int(input().strip())

lcm = 1
for i in range(n):
    num = int(input().strip())
    lcm = lcmm(lcm,num)
    #print(lcm)

print(lcm)


def gcd(a, b):
    return b if a % b == 0 else gcd(b, a % b)

N = input()
T = [input() for i in range(N)]
ans = 1
for i in range(N):
    v = gcd(max(ans, T[i]), min(ans, T[i]))
    ans = ans * (T[i] / v)
print ans


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

N=int(input())
T=[int(input()) for i in range(N)]
T.sort()
G=T[0]
for i in range(N):
  G=lcm(G,T[i])
print(G)


# -*- coding: utf-8 -*-

n = int(input())
t = [int(input()) for i in range(n)]

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

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

tmplcm = t[0]
for i in range(1,n):
    tmplcm = lcm(tmplcm,t[i])
print(tmplcm)


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

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

N = int(input())
T = [int(input()) for i in range(N)]

T.sort(reverse=True)
ans = 1
for i in T:
    ans = lcm(ans, i)
print(ans)


from fractions import gcd

N = int(input())
T = []
for i in range(N):
  T.append(int(input()))

res = 1
for t in T:
  res = res // gcd(res, t) * t
print(res)


def gcd(a,b):
    if b==0:return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b/gcd(a,b)
n=int(raw_input())
ans=-1
while n>0:
    n-=1
    if ans==-1:
        ans=int(raw_input())
    else:
        x=int(raw_input())
        ans=lcm(ans,x)
print ans


from functools import reduce

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

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

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

N = int(input())
Ts = []
c = 1
for i in range(N):
    c = lcm(c, int(input()))

print(int(c))


def main():
    N = int(input())
    T = tuple(int(input()) for _ in range(N))

    lcm_ = T[0]
    for i in T:
        lcm_ = lcm(i, lcm_)

    print(lcm_)

def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    else:
        a = b
        b = r
        return gcd(a, b)

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

main()


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

#def gcd(m, n):
#    r = m % n
#    return gcd(n, r) if r else n

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

N = int(input())
Ts = []
c = 1
for i in range(N):
    c = lcm(c, int(input()))

print(int(c))


def gcd(m,n):
  if n == 0:
    return m
  else:
    r = m % n
    return gcd(n,r)

def LCM(num1,num2):
  return (num1/gcd(num2,num1))*num2

N = input()
l = []
for i in range(N):
  l.append(input())
l.sort()
lcm = l[N-1]
for i in range(N-1):
  lcm = LCM(l[N-2-i],lcm)
print lcm


def gcd(a, b):
	while b:
		a, b = b, a%b
	return a
def lcm(a, b):
	return a*b // gcd(a, b)
n = int(input())
ls = []
for i in range(n):
    ls.append(int(input()))
result = ls[0]
for i in ls[1:]:
    result = lcm(i,result)
print(result)


def Q3(x):
    def gcd(a, b):
        if b > a:
            a, b = b, a
        while b > 0:
            a, b = b, a % b
        return a

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

    N = x[0]
    lst = x[1:]
    if N == 1:
        return lst[0]
    else:
        l = lcm(lst[0], lst[1])
        for x in lst:
            l = lcm(l, x)
        return l

n = int(input())
t = [int(input()) for i in range(n)]
t.insert(0,n)
print(Q3(t))


from fractions import gcd

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
# 最小公倍数が欲しい
ans = 1
for i in T:
    ans = int(ans * i //gcd(ans, i))
print(ans)


import fractions

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

n = int(input())
ans = 1
for _ in range(n):
    t = int(input())
    ans = lcm(ans,t)

print(ans)


N=int(input())
T=[]
for i in range(N):
    T.append(int(input()))
def gcd(a,b):
    if b>a:
        a,b=b,a
    while b>0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
if N==1:
    print(T[0])
elif N==2:
    print(lcm(T[0],T[1]))
else:
    l=[T[0]]
    for i in range(N-1):
      l.append(lcm(l[i],T[i+1]))
    print(l[-1])


def gcd(a, b):
    if a < b:
        c = a
        a = b
        b = c

    r = a % b

    while r > 0:
        a = b
        b = r
        r = a % b

    return b

    # ll gcd(ll a, ll b) {
    #   if (a < b)
    #     swap(a, b);
    #   ll r = a % b;
    #
    #   while (r) {
    #     a = b;
    #     b = r;
    #     r = a % b;
    #   }
    #
    #   return b;
    # }

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))
# a = list(map(int, input().split()))

ans = a[0]

for i in range(N):
    if i == 0:
        continue

    g = gcd(ans, a[i])
    ans = ans * a[i] // g

print(ans)


from functools import reduce

def gcd(a, b):
    while b != 0:
        a, b = b, a % b

    return a

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

def main():
    n = int(input())

    ts = []
    for _ in range(n):
        ts.append(int(input()))

    print(reduce(lcm, ts))

if __name__ == "__main__":
    main()


# -*- coding: utf-8 -*-
from functools import reduce
N = int(input())
ary = []
for i in range(N):
    tmp = input()
    ary.append(int(tmp))

def GCD(a, b):
    if a < b:
        a, b = b, a

    while b > 0:
        a, b = b, a % b
    return a

def LCM(a, b):
    return a * b // GCD(a, b)

print(reduce(LCM, ary))


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

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

n = int(input())
l = int(input())

i = 1

while i < n:
    l = lcm(l, int(input()))
    i = i + 1

print(l)


from functools import reduce

def gcd(a, b):
  if b == 0:
    return a
  return gcd(b, a%b)

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

n = int(input())
t = [int(input()) for i in range(n)]

ans = reduce(lcm, t)
print(ans)


def calc(A,B):
    C = A * B
    while B != 0:
        A,B = B, A % B
    return C // A

N = int(input())
ans = 1
for i in range(N):
    ans = calc(ans, int(input()))
print(ans)


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

ret = 1
N = int(input())
for _ in range(N):
  T = int(input())
  p = pgcd(ret,T)
  ret *= (T//p)

print(ret)


import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def gcd(a, b):
    while(b > 0):
        c = a % b
        a = b; b = c
    return a

n = ni()
g = 0
for i in range(n):
    v = ni()
    if g == 0:
        g = v
    else:
        g = g//gcd(g,v)*v
print(g)


n = int(input())

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

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

ans = 1

for _ in range(n):
    ans = lcm(ans, int(input()))

print(ans)


def gcd(*numbers):
    """Return the greatest common divisor of the given integers"""
    from fractions import gcd
    return reduce(gcd, numbers)

# Least common multiple is not in standard libraries? It's in gmpy, but this is simple enough:

def lcm(*numbers):
    """Return lowest common multiple."""
    def lcm(a, b):
        return (a * b) // gcd(a, b)
    return reduce(lcm, numbers, 1)
l = []
for x in range(int(raw_input())):
	l.append(int(raw_input()))
ans = 1
for x in l:
	ans = lcm(ans,x)
print(ans)


import sys
from collections import deque
import copy

from math import *
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

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

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

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    T = []
    for i in range(N):
        input_raw = read_func().strip().split()
        T.append(int(input_raw[0]))

    T.sort()

    lcm_data = T[0]
    for i in range(1, N):
        lcm_data = lcm(lcm_data, T[i])
    print lcm_data

if __name__ == '__main__':
    main()


N = int(input())

def lcm(x, y):
    M = x * y
    if x < y:
        x, y = y, x
    while y > 0:
        x, y = y, x % y
    return M // x
num = []
for _ in range(N):
    num.append(int(input()))
M = num[0]
for i in range(N):
    M = lcm(M, num[i])
print(M)


def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

N = int(input())

a = int(input())
b = 0
for i in range(N-1):
    b = int(input())
    a = (a*b) // gcd(a,b)

print(a)


N = int(input())
from fractions import gcd
from functools import reduce

def lcm(a, b):
    return abs(a * b) // gcd(a,b)
I = [int(input()) for n in range(N)]
print(int(reduce(lcm, I, 1)))


def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n
def lcm(m, n):
    return m*n//gcd(m, n)
n = int(input())
ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))
print("%d" % ans)


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

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

n = int(input())
n_set = set([])

for i in range(n):
    tmp = int(input())
    n_set.add(tmp)

ans = 1
for i in range(len(list(n_set))):
    ans = lcm(ans, list(n_set)[i])

print(ans)


def gcd(a,b):
    if b==0:
        return(a)
    else:
        return(gcd(b,a%b))
def lcm(a,b):
    return a*b//gcd(a,b)

n=int(input())
cur=0
if n==1:
    cur=int(input())
else:
    cur=lcm(int(input()),int(input()))
    for _ in range(n-2):
        cur = lcm(int(input()),cur)
print(cur)


def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

S = set(T)
res = 1
for j in S:
    res = res * j // gcd(res, j)

print(int(res))


#Multiple Clocks
N = int(input())

T = []
for i in range(N):
    T.append(int(input()))

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

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

a = T[0]

for Ti in T[1:]:
    a = lcm(a, Ti)

print(a)


#ABC070C

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

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

n=int(raw_input())
res=1
for i in xrange(n):
 temp=int(raw_input())
 res=lcm(res,temp)
print res


import decimal

def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a % b)

def lcm(a, b):
    g = euclid(a, b)
    # print(g)
    # print(a * b)

    return a * b // g

if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(N):
        T = int(input())
        ans = lcm(ans, T)

    print(ans)


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

n = int(input())
res = 1
for i in range(n):
    t = int(input())
    res = lcm(res, t)
print(res)


def gcd(x, y):
    while y != 0:
        x, y = y, x%y
    return x

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

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
temp = T[0]
for i in range(N-1):
    temp = lcm(temp, T[i+1])
print(temp)


n = int(input())
li = []

for i in range(n):
    a = int(input())
    li.append(a)

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

while len(li) > 1:
    a = li[0]
    b = li[1]
    li.pop(1)
    li.pop(0)
    ans = a * b // gcd(a, b)
    li.append(ans)

print(li[0])


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

n = int(input())
x = int(input())
for _ in range(n-1):
    i = int(input())
    x = (x * i) // gcd(x,i)

print(x)


N = int(raw_input())

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

T = int(raw_input())
if N == 1:
    print T
else:
    f = T
    for i in xrange(1, N):
        T = int(raw_input())
        g = gcd(f, T)
        f = f / g * T
    print f


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

n = int(input())
t = [int(input()) for i in range(n)]

for i in range(n - 1):
    t[i + 1] = t[i] * t[i + 1] // gcd(t[i], t[i + 1])

print(t[n - 1])


N=int(input())
arr=[]
for a in range(N):
    a=int(input())
    if a in arr:
        continue
    arr.append(a)

def gcf(a,b):
    if b==0:return a
    return gcf(b,a%b)
def lcm(a,b):
    return a*b//gcf(a,b)

temp=1
for i in range(len(arr)):
    temp=lcm(temp,arr[i])
print(temp)


def ggt(a, b):
    if b == 0:
        return a

    return ggt(b, a % b)

N = int(input())

erg = int(input())

for i in range(N-1):
    t = int(input())

    g = ggt(erg, t)
    erg = (erg // g) * t

print(erg)


def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

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

N = int(input())

result = 1
for i in range(N):
    result = lcm(result,int(input()))

print(result)


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

def lcm(a, b):
    return a * b // gcd(a,b)
N=int(input())
Ts=[]
c=1
for i in range(N):
 c=lcm(c,int(input()))
print(int(c))


N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))

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

tmp = max(T)
for i in range(N):
    if tmp % T[i] != 0:
        tmp = T[i]//gcd(tmp, T[i])*tmp

print(int(tmp))


import fractions

def lcm(a,b):
    g = fractions.gcd(a,b)
    return (a * b)//g

n = int(input())

ans = 1
for i in range(n):
    t = int(input())
    ans = lcm(ans,t)

print(ans)


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

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

N = int(input())
Ts = []
c = 1
for i in range(N):
    c = lcm(c, int(input()))

print(int(c))


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

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

N = int(raw_input())
T = [int(raw_input()) for i in xrange(N)]

print reduce(lcm, T)


import fractions

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

n = int(input())

ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))

print(ans)


N = int(input())
T = [int(input()) for _ in range(N)]

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

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

l = 1

for i in T:
    l = lcm(l, i)

print(l)


N = int(input())
Ts = [int(input()) for i in range(N)]

# 最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# 最大公倍数
def lcm(a, b):
    return a * b // gcd (a, b)

def solve(Ts):
    if len(Ts) == 1:
        print(Ts[0])

    else:
        Ts_temp = []
        for i in range(len(Ts)-1):
            Ts_temp.append(lcm(Ts[i], Ts[i+1]))
        solve(Ts_temp)

solve(Ts)


from fractions import gcd

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

def nlcm(nums):
    d = 1
    for num in nums:
        d = lcm(d,num)
    return d

if __name__ == '__main__':
    N = int(input())
    nums = []
    for i in range(N):
        nums.append(int(input()))

    print(nlcm(nums))


import sys

def scp(a, b):
    if b > a:
        tmp_a = a
        a = b
        b = tmp_a
    while b:
        r = a % b
        a = b
        b = r
    return a
    #for i in xrange(100000, 2, -1):
    #    if a % i == b % i == 0:
    #        return a * b / i
    #return a * b

N = int(raw_input())
array = []
for i in range(N):
    array.append(int(raw_input()))

array.sort()

#if array[-1] > pow(10, 9):
#    print array[-1]
#    sys.exit(0)

result = array[0]
for i in array[1:]:
    result = result / scp(result, i) * i
print result


# -*- coding:utf-8 -*-
def euc(a,b):
    if b == 0:
        return a
    else:
        return euc(b, a%b)

N = int(input())
T = [ int(input()) for tmp in range(N) ]
if len(T) > 1:
    a = T.pop()
    b = T.pop()
    lcm = a*b//euc(a,b)
    for tmp in T:
        lcm = tmp*lcm//euc(tmp,lcm)
    print(lcm)
else:
    print(T.pop())


n = int(input())
res = 1
def gcd(x, y):
    if x % y == 0:
        return y
    return gcd(y, x %y)
for i in range(n):
    x = int(input())
    res = res * x // gcd(res, x)
print(res)


from fractions import gcd
n = int(input())
x = 1

for i in range(n):
  t = int(input())
  g = gcd(t,x)
  t //= g
  x *= t

print(x)


import fractions
n = int(raw_input())
t = list()
for _ in range(n):
    t.append(int(raw_input()))
result = t[0]
for i in range(1, n):
    result = ((t[i] * result) / fractions.gcd(t[i], result))
print(result)


import math
x,a,b = map(int,input().split())
if (abs(x-a)>abs(x-b)):
    print("B")
else:
    print("A")


x, a, b = [int(x) for x in input().split()]

if abs(x-a) < abs(x-b):
    print('A')
else:
    print('B')


x,a,b = map(int, raw_input().split())
if abs(x-a) < abs(x-b):
    print 'A'
else:
    print 'B'


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

ax_length = abs(location_list[0] - location_list[1])
bx_length = abs(location_list[0] - location_list[2])

if ax_length < bx_length:
    print('A')
else:
    print('B')


import math

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

if(math.fabs(x[1]-x[0])-math.fabs(x[2]-x[0]) > 0):
    print('B')
    quit()
else:
    print('A')
    quit()

quit()


x,a,b = list(map(int,input().strip().split()))

disA = abs(x-a)
disB = abs(x-b)

res = 'A' if disA<disB else 'B'
print(res)


import numpy as np

l = map(int, raw_input().split())
x=l[0]
a=l[1]
b=l[2]

p=abs(x-a)
q=abs(x-b)

if(p<=q):
    print "A"
else:
    print "B"


x, a, b = (int(i) for i in input().split())
if abs(x-a) < abs(x-b):
    print('A')
else:
    print('B')


x,a,b=map(int,input().split())
A=abs(x-a)
B=abs(x-b)
if A<B: print("A")
else: print("B")


x, a, b = map(int, input().split())
print('A' if abs(x-a)<abs(x-b) else 'B')


x, a, b = map(int, input().split())
if abs(a-x) < abs(x-b):
	print("A")
else:
	print("B")


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

print("A" if abs(a-x) < abs(b-x) else "B")


x, a, b = map(int, input().split())
print("A" if abs(x-a) < abs(x-b) else "B")


x, a, b = map(int, input().split())
if (abs(a - x) < abs(b - x)):
    print("A")
else:
    print("B")


# -*- coding:utf-8 -*-

x,a,b = map(float,input().split())

if(abs(x-a)<abs(x-b)):
    print("A")
else:
    print("B")


x, a, b = [int(x) for x in input().strip().split()]

if abs(x-a) < abs(x-b):
    print("A")
else:
    print("B")


def main():
    x, a, b = map(int, input().split())
    if abs(x - a) < abs(x - b):
        print("A")
    else:
        print("B")

if __name__ == '__main__':
    main()


x,a,b = map(float, input().split())

print("AB"[abs(x-a) > abs(x-b)])


x, a, b = map(int, input().split())
if abs(x - a) < abs(x - b):
    print ("A")
else:
    print ("B")


x,a,b = map(int, input().split())
a=abs(x-a)
b=abs(b-x)
print("A" if a < b else "B")


# -*- coding: utf-8 -*-
"""
"""
#

def main():
    x, a, b = [int(x) for x in input().split(' ')]
    dist_A = abs(x - a)
    dist_B = abs(x - b)
    if dist_A > dist_B:
        print('B')
    else:
        print('A')

if __name__ == '__main__':
    main()


X,A,B = [int(i) for i in input().split()]
if abs(A-X) <= abs(B-X):
    print("A")
else:
    print("B")


import math

x,a,b=list(map(int,input().split()))
if(math.fabs(x-a)>math.fabs(x-b)):
    print("B")
else:
    print("A")


print((lambda x:"A" if abs(x[0]-x[2]) > abs(x[0]-x[1]) else "B")([int(i) for i in input().split()]))


x,a,b = map(int,input().split())
if abs(x - a) < abs(x - b):
    print("A")
else:
    print("B")


x,a,b=map(int,input().split())
a=abs(x-a)
b=abs(x-b)
if a>b: print("B")
else: print("A")


x, a, b = map(int, input().split())
if (x-a)**2 > (x-b)**2:
  print("B")
else:
  print("A")


x, a, b = map(int, input().split())
if abs(x - a) < abs(x - b):
    print("A")
elif abs(x - a) > abs(x - b):
    print("B")


xab=(input()).split(' ')
print('A' if abs((int)(xab[0])-(int)(xab[1]))< abs((int)(xab[0])-(int)(xab[2]))else 'B')


x, a, b = map(int, input().split())		# 5 7 2

if abs(a-x) < abs(b-x):
	print("A")
else:
	print("B")


def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

x, a, b = read_line(int, int, int)

print('A' if abs(x - a) < abs(x - b) else 'B')


a = list(map(int, input().split()))
if abs(a[0] - a[1]) > abs(a[0] - a[2]):
    print("B")
else:
  	print("A")


x,a,b=[int(x) for x in input().split()]
if abs(a-x) > abs(b-x):
	print("B")
else:
	print('A')


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

if abs(x-a) > abs(x-b):
    print("B")
else:
    print("A")


x,a,b= map(int, input().split())
if abs(x-a) < abs(x-b):
    print("A")
else:
    print("B")


# -*- coding: utf-8 -*-
x, a, b = map(int, input().split(' '))

if abs(x - a) < abs(x - b):
    print("A")
else:
    print("B")


# Meal Delivery
x,a,b, = list(map(int, input().split()))

if ( abs(a-x) < abs(b-x) ):
    print("A")
else:
    print("B")


x, a, b = map(int, input().split())
if abs(x - a) < abs(x - b):
    print('A')
else:print('B')


import math
#x a bを設定する
x,a,b = map(int,input().split())
#x からaまでの距離とxからbまでの距離を計算する

a_distant = a - x
b_distant = b - x
if a_distant < 0:
    a_distant = a_distant*(-1)
if b_distant < 0:
    b_distant = b_distant*(-1)
#aまでとbまでを比較して短い方を出力する
if a_distant > b_distant:
    print("B")
else:
    print("A")


x, a, b = [int(i) for i in input().split()]
if abs(a-x) < abs(b-x):
  print("A")
else:
  print("B")


x,a,b=list(map(int,input().split()))
if abs(x-a) > abs(x-b):
    print("B")
else:
    print("A")


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

if abs(x-a) > abs(x-b):
    print('B')
else:
    print('A')


def solve(): # 071A - Meal Delivery
    x, A, B = list(map(int, input().split(" ")))
    da = abs(x - A)
    db = abs(x - B)
    if da > db:
        print("B")
    else:
        print("A")

solve()


x,a,b = list(map(int, input().split()))
if abs(x - a) > abs(x - b):
    print ("B")
else:
    print ("A")


x, a, b = map(int, input().split())
if x < a and x < b:
    if a < b:
        print("A")
    else:
        print("B")
elif x > a and x > b:
    if a > b:
        print("A")
    else:
        print("B")
else:
    if abs(x - a) < abs(x - b):
        print("A")
    else:
        print("B")


x, a, b = list(map(int, input().split()))
if abs(x-a) < abs(x-b):
    print('A')
else:
    print('B')


import sys
inp = lambda t: t(sys.stdin.readline().strip())
inpm = lambda t: map(t, sys.stdin.readline().split())
inpl = lambda t: list(map(t, sys.stdin.readline().split()))
print = lambda x, end='\n': sys.stdout.write(str(x) + end)

x, a, b = inpm(int)
if abs(a - x) < abs(b - x):
	print('A')
else:
	print('B')


x,a,b = map(int,input().split())
ansa = (abs(x-a)< abs(x-b))
print("A" if ansa  else "B")


if __name__ == '__main__':
    x, a, b = map(int, input().split())
    if abs(x-a) < abs(x-b):
        print('A')
    else:
        print('B')


x,a,b = map(int, input().split())
ans = 'A' if abs(a-x) < abs(b-x) else 'B'
print(ans)


x,a,b = [int(i) for i in input().split()]
if (x-a)**2 < (x-b)**2:
	print("A")
else:
	print("B")


x,a,b = (int(i) for i in input().split())

a = a-x if a>x else x-a
b = b-x if b>x else x-b

ans = "A" if a<b else "B"

print(ans)


l = input().split()
x = float(l[0])
a = float(l[1])
b = float(l[2])

if abs(x-a) < abs(x-b):
	print("A")
else:
	print("B")


l = list(map(int, input().split()))
a = abs(l[0] - l[1])
b = abs(l[0] - l[2])

if a<b:
    print('A')
else:
    print('B')


#! -*- coding:utf-8 -*-
x,a,b = map(int,input().split())
import math

if(math.copysign(x-a,0) < math.copysign(x-b,0)):
    print('A')
else:
    print('B')


x, a, b = map(int, raw_input().split())

if abs(x - a) < abs (x - b):
    print "A"
else:
    print "B"


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

x = lst[0]
a = lst[1]
b = lst[2]

if abs(b-x) > abs(a-x):
    print("A")
else:
    print("B")


from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10

def main():
    x, a, b = map(int, input().split())
    print("A" if abs(x - a) < abs(x - b) else "B")

if __name__ == '__main__':
    main()


def A_MealDelivery(lst):
    x, a, b = lst[0], lst[1], lst[2]
    if abs(x - a) < abs(x - b):
        return 'A'
    else:
        return 'B'

l = [int(i) for i in input().split()]
print(A_MealDelivery(l))


import math
x,a,b = map(int,input().split())
if abs(x-a)<abs(x-b):
    print("A")
else:
    print("B")


x,a,b = [int(i) for i in input().split()]
if abs(x-a) < abs(x-b):
	print("A")
else:
	print("B")


x,a,b = [int(x) for x in input().split()]
if abs(x-a)<abs(x-b):
    print("A")
else:
    print("B")


x, a, b = map(int,input().split())
if abs(x - a) < abs(x - b):
    print('A')
else:
    print('B')


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

if abs(x-a) > abs(x-b):
  print("B")
else:
  print("A")


x,a,b=map(int, input().split())
if abs(a-x)>abs(b-x):
 print('B')
else:
 print('A')


def main():
    x, a, b = [int(i) for i in input().split()]

    if(abs(x-a) < abs(x-b)):
        print("A")
    else:
        print("B")

if __name__=="__main__":
    main()


a,b,c=map(int,raw_input().split())
print "A" if abs(b-a)<=abs(c-a) else "B"


a = map(int, raw_input().strip().split())
da = max(a[1],a[0])-min(a[1],a[0])
db = max(a[0],a[2])-min(a[0],a[2])
if da > db:
	print('B')
else:
	print('A')


line = raw_input()
x, a, b = line.split()
x = int(x)
a = int(a)
b = int(b)

if abs(x-a) < abs(x-b):
    print 'A'
else:
    print 'B'


x,a,b=map(float,raw_input().split())
AX=abs(a-x)
BX=abs(b-x)
if AX>BX:
    print "B"
else:
    print "A"


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

if abs(a-x) > abs(b-x):
    print("B")
else:
    print("A")


x,a,b = map(int, input().split())
a=abs(x-a)
b=abs(b-x)
print("A" if a < b else "B")


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

if abs(x - a) < abs(x - b):
    print("A")
else:
    print("B")


#from time import time
#t = time()
nvm = input().split(' ')
if abs(int(nvm[0]) - int(nvm[1])) < abs(int(nvm[0]) - int(nvm[2])):
    print('A')
else:
    print('B')

#print(mn[0] * mm[1])
#tt= time()
#print(tt-t)


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

if abs(x-a) <= abs(x-b):
    print("A")
else:
    print("B")


from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10

def main():
    x, a, b = map(int, input().split())
    print("A" if abs(x - a) < abs(x - b) else "B")

if __name__ == '__main__':
    main()


x, a, b = [int(i) for  i in input().split()]
if abs(x-a) < abs(x-b):
    print('A')
else:
    print('B')


#!usr/bim/python
#! -*- coding: utf-8 -*-

nab = raw_input()
nab = nab.split()
n,a,b = map(int,nab)

if abs(n-a) < abs(n-b):
    print 'A'
else:
    print 'B'


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

a = l[1] - l[0]
b = l[2] - l[0]
list = []
list.append(abs(a))
list.append(abs(b))
if list[0] > list[1]:
    print("B")
else:
    print("A")


x, a, b = map(int, input().split())
if abs(x-a) > abs(x-b):
    print("B")
else:
    print("A")


n = input().split()
xab = []
for i in n:
    xab.append(int(i))
xa = abs(xab[0] - xab[1])
xb = abs(xab[0] - xab[2])
if xa < xb:
    print('A')
elif xa > xb:
    print('B')


x, a, b = [int(n) for n in input().split()]
if abs(x-a) < abs(x-b):
  print ("A")
else:
  print("B")


x, a, b = map(int, input().split())
if abs(x-a) < abs(x-b):
  print("A")
else:
  print("B")


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

if (x-a)**2 >(x-b)**2:
    print("B")
else:
    print("A")


def abs(x):
	if x >= 0:
		return x
	else:
		return -1 * x

ls = list(map(int,input().split()))
if abs(ls[0] - ls[1]) < abs(ls[0] - ls[2]):
	print ('A')
else:
	print ('B')


x,a,b = map(int,input().split())
print('A' if abs(x-a)<abs(x-b) else 'B')


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

if abs(x - a) < abs(x - b):
    print("A")
else:
    print("B")


x, a, b = map(int, input().split())
if abs(a-x) < abs(b-x):
    print("A")
else:
    print("B")


x,a,b = map(int,input().split(' '))
c = a-x
d = b-x

if c<0:
	e = -c
else:
	e = c

if d<0:
	f = -d
else:
	f = d

if e<f:
	print('A')
else:
	print('B')


import math
x,a,b = input().split()
x = int(x,10)
a = int(a,10)
b = int(b,10)

alpha = math.fabs(x-a)
beta = math.fabs(x-b)

if alpha>beta:
	print('B')
else:
	print('A')


x, a, b = map(int, raw_input().split())
print "A" if abs(a - x) < abs(b - x) else "B"


#ABC071A

x,a,b=map(int,raw_input().split())
if abs(a-x)>=abs(b-x):
 print 'B'
else:
 print 'A'


x, a, b = map(int,raw_input().split())
if abs(x-a)>abs(x-b):
    print "B"
if abs(x-a)<abs(x-b):
    print "A"


x, a, b = map(int, input().split())
disA = abs(x-a)
disB = abs(x-b)
if disA < disB:
    print("A")
else:
    print("B")


x, a, b = map(int, input().split())
if abs(x-a)<abs(x-b): print("A")
else: print("B")


n,a,b = map(int,input().split())
a=abs(n-a)
b=abs(n-b)
print("A" if a<b else "B")


L=list(map(int, input().split()))
a=abs(L[1]-L[0])
b=abs(L[2]-L[0])
if a>b:
    print("B")
else:
    print("A")


import math

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

if math.fabs(x-a) < math.fabs(x-b):
    print('A')
else:
    print('B')


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

if abs(x - a) < abs(x - b):
    print('A')
else:
    print('B')


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

if abs(a-x)  > abs(b-x):
    print('B')
else:
    print('A')


x,a,b=map(int, input().split())
if abs(x-b) > abs(x-a):
  print('A')
else:
  print('B')


x, A, B = map(int, input().split())
if abs(x - A) < abs(x - B):
    print('A')
else:
    print('B')


def read_int_list():
    return (int(i) for i in input().split())
x,a,b = read_int_list()
if abs(x-a) < abs(x-b):
    print("A")
else:
    print("B")


if __name__ == '__main__':
    X, A, B = [int(i) for i in input().split()]
    if abs(X - A) < abs(X - B):
        print('A')
    else:
        print('B')


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

if abs(x - a) < abs(x - b):
    print("A")
else:
    print("B")


import sys

# sys.stdin = open('a1.in')

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

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

def read_int():
    return int(input())

def read_str():
    return input()

def main():
    x, a, b = read_int_list()
    if abs(a - x) < abs(b - x):
        print('A')
    else:
        print('B')

main()


import math
x,a,b = list(map(int, input().split()))
print('A' if math.fabs(x-a) < math.fabs(x-b) else 'B')


#! /bin/python
# coding:utf-8

(x, a, b) = map(int, raw_input().split())

if (abs(x - a) < abs(x - b)):
	print "A"
else:
	print "B"


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

if abs(x-a) > abs(x-b):
    print('B')
else:
    print('A')


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

if abs(x-a) > abs(x-b):
    print('B')
else:
    print('A')


# -*- coding: utf-8 -*-

tmp = input()
x, a, b = [int(a) for a in tmp.split()]

d1 = abs(x - a)
d2 = abs(x - b)

print("A" if d1 < d2 else "B")


place = map(int, input().split())

X, A, B = [i for i in place]

X_A = abs(X - A)
X_B = abs(X - B)

if X_A <= X_B:
  print('A')
else:
  print('B')


import sys

x, a, b = map(int, sys.stdin.readline().strip().split(" "))

if abs(x-a) < abs(x-b):
    print("A")
else:
    print("B")


# coding: utf-8
x,a,b=map(int,input().split())
print('A' if abs(x-a)<abs(x-b) else 'B')


x, a, b = map(int, raw_input().split())
print "A" if abs(x-a) < abs(x-b) else "B"


x, a, b = [int(i) for i in input().split(' ')]
print('A' if abs(x-a) < abs(x-b) else 'B')


x, a, b = map(int, input().split())
print("A" if abs(x - a) < abs(x - b) else "B")


x,a,b=map(int,raw_input().split())
a=abs(x-a)
b=abs(x-b)
if a<b :
    print 'A'
else :
    print 'B'


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

A = abs(x-a)
B = abs(x-b)
if A < B:
    print("A")
else:
    print("B")


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

if abs(a-x) < abs(b-x):
    print("A")
else:
    print("B")


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

dis_a = abs(x - a)
dis_b = abs(x - b)

if dis_a < dis_b:
    print("A")
else:
    print("B")


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

if abs(x-a) < abs(x-b):
    print('A')
else:
    print('B')


x,a,b = [int(i) for i in input().split()]
if abs(x-a) < abs(x-b):
    print("A")
else:
    print("B")


input_value = input().split()
x = int(input_value[0])
a = int(input_value[1])
b = int(input_value[2])

distance_from_x_to_a = abs(x-a)
distance_from_x_to_b = abs(x-b)

if distance_from_x_to_a < distance_from_x_to_b:
	print("A")
else:
	print("B")


x,a,b = map(int, input().split())
if abs(x-a) < abs(x-b):
    print('A')
else :
    print('B')


x, a, b = map(int, input().split())
if abs(x-a) > abs(x-b):
    print('B')
else:
    print('A')


#Not Found
s = list(input())

c = [chr(i) for i in range(97, 97+26)]
ans = "None"
for ci in c:
    if( ci not in list(s) ):
        ans = ci
        break
print(ans)


import string
s = list(input())
flag = 0

for a in string.ascii_lowercase:
    if a not in s:
        print(a)
        flag = 1
        break

if flag == 0:
    print("None")


S = input()

X = 'abcdefghijklmnopqrstuvwxyz'

for x in X:
    if x not in S:
        print(x)
        exit()

print('None')


S = list(input())

alphabets = ["a", "b", "c", "d", "e", "f", "g", "h",
"i", "j", "k", "l", "m", "n", "o", "p","q", "r", "s",
"t", "u", "v", "w", "x", "y", "z"]

i = 0
while i in range(len(alphabets)):
    if alphabets[i] in S:
        i += 1
    else:
        print(alphabets[i])
        break
else:
    print ("None")