Ilya is a very clever lion, he lives in an unusual city ZooVille. In this city all the animals have their rights and obligations. Moreover, they even have their own bank accounts. The state of a bank account is an integer. The state of a bank account can be a negative number. This means that the owner of the account owes the bank money.

Ilya the Lion has recently had a birthday, so he got a lot of gifts. One of them (the gift of the main ZooVille bank) is the opportunity to delete the last digit or the digit before last from the state of his bank account no more than once. For example, if the state of Ilya's bank account is -123, then Ilya can delete the last digit and get his account balance equal to -12, also he can remove its digit before last and get the account balance equal to -13. Of course, Ilya is permitted not to use the opportunity to delete a digit from the balance.

Ilya is not very good at math, and that's why he asks you to help him maximize his bank account. Find the maximum state of the bank account that can be obtained using the bank's gift.


-----Input-----

The single line contains integer n (10 ≤ |n| ≤ 10^9) — the state of Ilya's bank account.


-----Output-----

In a single line print an integer — the maximum state of the bank account that Ilya can get. 


-----Examples-----
Input
2230

Output
2230

Input
-10

Output
0

Input
-100003

Output
-10000



-----Note-----

In the first test sample Ilya doesn't profit from using the present.

In the second test sample you can delete digit 1 and get the state of the account equal to 0.

Difficulty: EASY
Tags: Number theory

Implementation
Expected Time Complexity: O(1)

Starter code:

Solutions:
n = int(input())
if n >= 0:
	pass
elif n <= -10:
	n = max(int(str(n)[:-1]), int(str(n)[:-2] + str(n)[-1]))
else:
	n = 0
print(n)


t = input()
if t[0] == '-':
	if len(t) == 2:
		print(0)
	else:
		print(int(t[:-2] + min(t[-2], t[-1])))
else:
	print(t)


t = input()
print(max(map(int, (t, t[:-1], t[:-2] + t[-1]))))


n = input()
l = list(n)
if int(n) >= 0:
	print(n)
elif n == '-10' or n == '-20' or n == '-30' or (n == '-40') or (n == '-50') or (n == '-60') or (n == '-70') or (n == '-80') or (n == '-90') or (n == '-0'):
	print(0)
elif l[-2] > l[-1]:
	for i in range(len(l)):
		if i != len(l) - 2:
			print(l[i], end='')
else:
	for i in range(len(l)):
		if i != len(l) - 1:
			print(l[i], end='')


x = int(input())
if x < 0:
	y = list(str(x))
	v1 = y[:]
	v1.pop(0)
	v1.pop(len(v1) - 1)
	v2 = y[:]
	v2.pop(0)
	v2.pop(len(v2) - 2)
	if int(''.join(v1)) > int(''.join(v2)):
		if int(''.join(v2)) == 0:
			print(int(''.join(v2)))
		else:
			print('-' + str(''.join(v2)))
	elif int(''.join(v2)) == 0:
		print(int(''.join(v2)))
	else:
		print('-' + str(''.join(v1)))
else:
	print(x)


n = input()
if int(n) >= 0:
	print(n)
else:
	x = int(n[:-1])
	y = int(n[:-2] + n[-1])
	if x < y:
		print(y)
	else:
		print(x)


check = input()
if check[0] == '-':
	check = check[:-1] if int(check[-1]) > int(check[-2]) else check[:-2] + check[-1]
print(check if check != '-0' else '0')


x = int(input())
if x > -1:
	print(x)
else:
	x = str(x)
	if int(x[-1]) >= int(x[-2]):
		print(x[:-1])
	else:
		z = x[:-2] + x[-1]
		if z == '-0':
			print('0')
		else:
			print(z)


str_in = input().strip()
if str_in[0] == '-':
	print(max(int(str_in[:-1]), int(str_in[:-2] + str_in[-1])))
else:
	print(str_in)


n = int(input())
if n >= 0:
	print(n)
else:
	s = str(abs(n))
	s = s[:-1]
	s = int(s)
	q = str(abs(n))
	q = q[:-2] + q[-1]
	q = int(q)
	if min(s, q) == 0:
		print(min(s, q))
	else:
		print('-', end='')
		print(min(s, q))


n = input()
print(max(map(int, (n, n[:-1], n[:-2] + n[-1]))))


st = input()
n = int(st)
ans = 0
if n >= 0:
	ans = n
else:
	ln = len(st)
	if ln == 2:
		ans = 0
	else:
		s1 = int(st[1:ln - 1])
		s2 = int(st[1:ln - 2] + st[ln - 1:])
		ans = -1 * min(s1, s2)
print(ans)


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

def finalString(s, n):
	if n > 0:
		return s
	elif int(s[-1]) > int(s[-2]):
		return s[:-1]
	else:
		newS = s[:-2] + s[-1]
		return '0' if newS == '-0' else newS
print(finalString(s, n))


x = int(input())
if x <= -10:
	if abs(x) // 10 < abs(x) // 100 * 10 + abs(x) % 10:
		print(-(abs(x) // 10))
	else:
		print(-(abs(x) // 100 * 10 + abs(x) % 10))
else:
	print(x)


n = int(input())
if n >= 0:
	print(n)
else:
	s = str(n)
	s = max(int(s[:-1]), int(s[:-2] + s[-1]))
	print(s, end='')


x = input()
if int(x) < 0:
	if int(x[:len(x) - 1]) < int(x[:len(x) - 2] + x[len(x) - 1:]):
		print(int(x[:len(x) - 2] + x[len(x) - 1:]))
	else:
		print(int(x[:len(x) - 1]))
else:
	print(int(x))


def solve(n):
	if n >= 0:
		return n
	x = str(n)
	return max(int(str(n)[:-1]), int(str(n)[:-2] + str(n)[-1]))
n = int(input())
print(solve(n))


s = int(input())
if s > 0:
	print(s)
else:
	m = -s
	s1 = m // 10
	s2 = m // 100 * 10 + m % 10
	m = min(s1, s2)
	if m == 0:
		print(0)
	else:
		print('-' + str(m))


from sys import stdin, stdout
input = stdin.readline
n = input()[:-1]
stdout.write(str(max(int(n[:-1]), int(n[:-2] + n[-1]), int(n))))


a = input()
print(max(map(int, (a, a[:-1], a[:-2] + a[-1]))))


bank_account_state = input()
if bank_account_state[0] != '-':
	solution = bank_account_state
else:
	if bank_account_state[-1] > bank_account_state[-2]:
		solution = bank_account_state[:-1]
	else:
		solution = bank_account_state[:-2] + bank_account_state[-1]
	if len(solution) == 2 and solution[1] == '0':
		solution = '0'
print(solution)


s = str(input())
if s[0] != '-':
	print(int(s))
else:
	L = []
	for i in range(len(s) - 2, len(s)):
		t = s[0:i] + s[i + 1:]
		L.append(int(t))
	print(max(L))


n = int(input())
if n < 0:
	n = abs(n)
	a = n % 10
	n = n // 10
	b = n % 10
	n = n // 10
	n = n * 10 + min(a, b)
	n = -1 * n
print(n)


a = input()
if int(a) >= 0:
	print(a)
elif len(a) == 2:
	print(0)
elif int(a[:-1]) > int(a[:-2] + a[-1]):
	print(int(a[:-1]))
else:
	print(int(a[:-2] + a[-1]))


n = input()
x = len(n)
if n[0] != '-':
	print(n)
elif int(n) >= -10:
	print('0')
elif x > 2:
	if n[x - 1] > n[x - 2]:
		print(str(int(n[:x - 1])))
	else:
		print(str(int(n[:x - 2] + n[x - 1])))


a = input()
if int(a) > 0:
	print(a)
elif int(a[-1]) >= int(a[-2]):
	print(abs(int(a)) // 10 * -1)
else:
	print(abs(int(a)) // 100 * -10 - int(a[-1]))


n = int(input())
if n >= 0:
	print(n)
elif abs(n) // 10 > abs(n) // 100 * 10 + abs(n) % 10:
	print(-(abs(n) // 100 * 10 + abs(n) % 10))
else:
	print(-(abs(n) // 10))


n = input()
if int(n) >= 0:
	print(n)
else:
	l = len(n)
	a1 = n[1:l - 1]
	a2 = n[1:l - 2] + n[l - 1]
	if int(a1) > int(a2):
		if a2 == '0':
			print(0)
		else:
			print('-' + a2)
	elif a1 == '0':
		print(0)
	else:
		print('-' + a1)


n = int(input())
if n > 0:
	print(n)
else:
	n = n * -1
	b = n
	print(min(n // 10, (n - b % 100) // 10 + b % 10) * -1)


n = int(input())
s = str(n)
x = len(s)
y = ''
if n < 0:
	if int(s[x - 1]) > int(s[x - 2]):
		y += s[:x - 1]
	else:
		y += s[:x - 2] + s[x - 1:]
	if y == '-0':
		print('0')
	else:
		print(y)
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	n = str(n)
	f = int(str(n)[0:-2] + str(n)[-1])
	g = int(str(n)[0:-1])
	print(max(f, g))


n = input()
last_digit = n[-1]
before_last = n[-2]
if int(n) >= 0:
	print(n)
elif last_digit >= before_last:
	print(int(n[:len(n) - 1]))
elif before_last > last_digit:
	print(int(n[:len(n) - 2] + n[-1]))


import math
n = int(input())
if n > 0:
	print(n)
else:
	t = math.ceil(n / 10)
	t1 = -(abs(n) % 10) + math.ceil(n / 100) * 10
	print(max(n, t, t1))


n = list(map(str, input()))
if int(''.join(n)) > 0:
	print(int(''.join(n)))
else:
	a = n.pop()
	a1 = ''.join(n)
	n.pop()
	n.append(a)
	a2 = ''.join(n)
	if int(a1) > int(a2):
		print(int(a1))
	else:
		print(int(a2))


bnk = int(input())
if bnk >= 0:
	print(bnk)
elif bnk >= -10:
	print(0)
else:
	print(max(int(bnk / 10), int(bnk / 100) * 10 - abs(bnk) % 10))


n = int(input())
if n >= 0:
	print(n)
else:
	f = -1 * n % 10
	s = -1 * n % 100 // 10
	if s < f:
		print((n + -1 * n % 10) // 10)
	else:
		print((n + -1 * n % 100) // 10 - f)


__author__ = 'myduomilia'
s = input()
arr = [int(s[:-1]), int(s[:]), int(s[:-2] + s[-1:])]
print(max(arr))


x = int(input())
if x >= 0:
	print(x)
else:
	y = str(x)
	z = list(y)
	e = z[len(z) - 1]
	z1 = list(y)
	z2 = list(y)
	z.pop()
	s = int(''.join(z))
	z.pop()
	z.append(e)
	s1 = int(''.join(z))
	if s1 > s:
		print(s1)
	else:
		print(s)


n = int(input())
if n > 0:
	print(n)
elif n == -10:
	print(0)
else:
	lst1 = list(str(n))
	lst2 = lst1[:]
	del lst1[-1]
	del lst2[-2]
	a = ''.join(lst1)
	b = ''.join(lst2)
	print(max(int(a), int(b)))


n = int(input())
if n >= 0:
	print(n)
else:
	n = str(n)
	n = n[1:]
	l = []
	for i in n:
		l.append(i)
	n1 = len(l)
	if l[n1 - 1] >= l[n1 - 2]:
		ans = '-'
		for i in range(n1 - 1):
			ans += l[i]
	else:
		ans = '-'
		for i in range(n1):
			if i == n1 - 2:
				continue
			else:
				ans += l[i]
	if int(ans) == 0:
		print(int(ans[1:]))
	else:
		print(int(ans))


state = input()
if int(state) >= 0:
	print(state)
else:
	s = list(state)
	(s1, s2) = (s[:], s[:])
	s1.pop(-1)
	s2.pop(-2)
	(s_1, s_2) = (int(''.join(s1)), int(''.join(s2)))
	print(max(s_1, s_2))


n = int(input())
if n > 0:
	print(n)
else:
	n = abs(n)
	n = str(n)
	if len(n) > 2 or (len(n) == 2 and n[0] != '0' and (n[1] != '0')):
		print('-' + n[:len(n) - 2] + min(n[-1], n[-2]))
	else:
		print(0)


n = input()
l = len(n)
print(max(int(n[:l - 1]), int(n[:l - 2] + n[l - 1])) if int(n) < 0 else n)


nn = input()
n = int(nn)
if n > 0:
	print(n)
elif len(nn) == 1:
	print(0)
else:
	x = nn[-1]
	y = nn[-2]
	if y > x:
		p = nn[:-2] + nn[-1]
		if p == '-0':
			p = '0'
		print(p)
	else:
		print(nn[:-1])


n = int(input())
if n >= 0:
	print(n)
else:
	s = list(str(n))
	fir = s[1:-1]
	j = ''.join(fir)
	fir = int(j)
	k = s.copy()
	sec = k[1:-2]
	thir = k[-1]
	sec = ''.join(sec)
	thir = ''.join(thir)
	last = sec + thir
	lst = int(last)
	if lst >= fir:
		if fir == 0:
			print(0)
		else:
			print('-' + str(fir))
	elif lst == 0:
		print(0)
	else:
		print('-' + str(lst))


n = int(input())
st = str(n)
s = ''
if n > 0:
	print(n)
elif n > 9 and n < 100 and (n % 10 == 0):
	print(0)
else:
	n = abs(n)
	last = abs(n % 10)
	n = abs(n)
	sec_last = n % 100
	if sec_last // 10 == 0:
		sec_last = 0
	else:
		sec_last = sec_last // 10
	if last <= sec_last:
		s = s + st[0:len(st) - 2]
		s = s + str(last)
	else:
		s = s + st[0:len(st) - 2]
		s = s + str(sec_last)
	print(int(s))


n = int(input())
if n >= 0:
	print(n)
else:
	a = int(str(n)[:-1])
	b = int(str(n)[:-2] + str(n)[-1])
	print(max(a, b))


s = int(input())
if s < 0:
	d = str(s)
	first = d[0:len(d) - 1]
	second = d[0:len(d) - 2] + d[len(d) - 1:len(d)]
	if int(first) > int(second):
		print(int(first))
	else:
		print(int(second))
else:
	print(s)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict as dd, deque as dq
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7
from bisect import bisect_left

def solve():
	N = getInt()
	if N >= 0:
		return N
	x = str(N)
	if len(x) == 1:
		return 0
	return max(int(x[:-1]), int(x[:-2] + x[-1]), int(x))
print(solve())


n = int(input())
if n <= -10:
	n *= -1
	tmp = n % 10
	n = int(n / 10)
	tmp2 = n % 10
	n = int(n / 10)
	replace = min(tmp, tmp2)
	n *= 10
	n += replace
	n *= -1
print(n)


n = input()
l = len(n)
n1 = int(n[:l - 1])
n2 = int(n[:l - 2] + n[l - 1])
print(max(int(n), n1, n2))


n = input()
if int(n) >= 0:
	print(int(n))
else:
	a = list(n)
	a1 = ''.join(a[:len(n) - 1])
	a1 = int(a1)
	a2 = ''.join(a[:len(n) - 2])
	a2 = int(a2 + a[len(n) - 1])
	if a1 >= a2:
		print(a1)
	else:
		print(a2)


s = int(input())
if s == -10:
	print(0)
	exit(0)
a = s
b = int(s / 10)
s = str(s)
c = int(s[:len(s) - 2] + s[-1])
print(max(a, b, c))


a = input()
if int(a) >= 0:
	t = a
else:
	line = list(a)
	if len(line) < 3:
		t = 0
	else:
		if int(line[-1]) > int(line[-2]):
			del line[-1]
		else:
			del line[-2]
		t = ''.join(line)
		if t == '-0':
			t = 0
print(t)


balanceS = input()
balance = int(balanceS)
if balance >= 0:
	print(balance)
	quit()
choice1S = balanceS[0:-1]
choice2S = balanceS[0:-2] + balanceS[-1]
print(max(int(choice1S), int(choice2S)))


n = input()
if int(n) >= 0:
	print(n)
else:
	n = n[1:]
	if len(n) == 1:
		print(0)
	elif len(n) == 2:
		print(-1 * int(min(n[0], n[1])))
	else:
		print(-1 * min(int(n[:-1]), int(n[:-2] + n[-1])))


n = int(input())
if n > 0:
	print(n)
else:
	n *= -1
	if n // 10 < n // 100 * 10 + n % 10:
		print(-1 * (n // 10))
	elif n // 100 * 10 + n % 10 == 0:
		print(0)
	else:
		print(-1 * (n // 100 * 10 + n % 10))


n = int(input())
if n < 0:
	n *= -1
	x = n % 10
	a = n // 10
	y = a % 10
	b = a // 10
	b *= 10
	b += x
	a *= -1
	b *= -1
	print(max(a, b))
else:
	print(n)


n = input()
if int(n) >= 0:
	print(n)
	exit()
c1 = n[:-1]
c2 = n[:-2] + n[-1]
if int(c1) >= int(c2):
	print(int(c1))
else:
	print(int(c2))


n = input()
if int(n) >= 0:
	print(n)
else:
	n1 = int(n[:-1])
	n2 = int(n[:-2] + n[-1])
	if n1 >= n2:
		print(n1)
	else:
		print(n2)


n = input()
m = int(n)
a = len(n)
p = int(m / 10)
q = int(m / 100)
c = 0
if m >= 0:
	print(n)
else:
	c = abs(m) % 10
	if q * 10 - c > p:
		print(q * 10 - c)
	else:
		print(p)


strA = input()
account = int(strA)
if account >= 0:
	print(strA)
else:
	strB = strA[:-1]
	strC = strA[:-2] + strA[-1]
	if int(strB) >= int(strC):
		print(int(strB))
	else:
		print(int(strC))


n = int(input())
n1 = int(str(n)[0:len(str(n)) - 1])
n2 = int(str(n)[0:len(str(n)) - 2] + str(n)[len(str(n)) - 1])
print(max(n1, n2, n))


n = input()
a = n[:-1]
b = n[:-2] + n[-1]
print(max(map(int, [a, b, n])))


n = int(input())
if n >= 0:
	print(n)
else:
	x = str(n)
	x = x[1:]
	if len(x) == 1:
		print(0)
	else:
		a = list(x)
		b = list(x)
		del a[-1]
		del b[-2]
		a = ''.join((str(i) for i in a))
		b = ''.join((str(i) for i in b))
		a = int(a)
		b = int(b)
		a = a * -1
		b = b * -1
		print(max(a, b))


n = int(input())
if n >= -9:
	print(n)
else:
	t = []
	p = n
	m = abs(p)
	while m != 0:
		yusu = abs(p) % 10
		t.append(yusu)
		m = m // 10
		p = -m
	if t[0] >= t[1]:
		ciemo = abs(n) // 10
		print(-ciemo)
	else:
		ciecimo = abs(n) // 100 * 10 + abs(n) % 10
		print(-ciecimo)


n = input()
if int(n) > 9:
	print(n)
else:
	print(max(int(n[:-1]), int(n[:-2] + n[-1])))


bal = int(input())
if bal >= 0:
	print(bal)
else:
	bal = -bal
	l = []
	l.append(bal // 10 * -1)
	l.append((bal // 100 * 10 + bal % 10) * -1)
	print(max(l))


X = int(input())
if X > 0:
	print(X)
else:
	X = str(X)
	N1 = X[0:-1]
	N2 = X[0:-2] + X[-1]
	print(max([int(N1), int(N2)]))


n = int(input())
if n > 0:
	print(n)
else:
	last = -(abs(n) // 10)
	pen = -(abs(n) // 100 * 10 + abs(n) % 10)
	if last > pen:
		print(last)
	else:
		print(pen)


from sys import stdin

def readInt():
	return int(stdin.readline())
N = readInt()
if N < 0:
	a = int(str(N)[:-1])
	b = int(str(N)[:-2] + str(N)[-1:])
	print(a if a > b else b)
else:
	print(N)


isDebug = False
v = int(input())
if v >= 0:
	print(f'{v}')
else:
	v = abs(v)
	v1 = str(int(v / 10))
	v2 = str(int(v / 100)) + str(int(v % 10))
	print(f'v1={v1}, v2={v2}') if isDebug else ''
	v1 = int(v1) * -1
	v2 = int(v2) * -1
	print(f'{(v1 if v1 > v2 else v2)}')


mainState = input('')
mainStateList = list(mainState)

def listToString(_list):
	newString = ''
	for i in range(int(len(_list))):
		newString = str(newString) + str(_list[i])
	return newString
if int(mainState) < 0:
	stateTemp_1 = list()
	for num in range(int(len(mainStateList)) - 1):
		stateTemp_1.append(mainStateList[num])
	stateTemp_1 = listToString(stateTemp_1)
	if str(stateTemp_1) == '-0':
		stateTemp_1 = 0
	stateTemp_2 = list(mainState)
	stateTemp_2.pop(int(len(stateTemp_2)) - 2)
	stateTemp_2 = listToString(stateTemp_2)
	if str(stateTemp_2) == '-0':
		stateTemp_2 = 0
	if int(stateTemp_1) > int(stateTemp_2):
		print(stateTemp_1)
	else:
		print(stateTemp_2)
else:
	mainStateList = listToString(mainStateList)
	print(mainStateList)


n = int(input())
if n >= 0:
	print(n)
else:
	A = [str(i) for i in str(n) if i != '-']
	B = []
	for i in range(len(A) - 2, len(A)):
		t = A[i]
		del A[i]
		B.append(''.join(A))
		A.insert(i, t)
	B.sort()
	if '-' + B[0] == '-0':
		print(0)
	else:
		print('-' + B[0])


a = input()
c = []
if int(a) > -10:
	print(a)
else:
	b = int(a[:len(a) - 1])
	d = int(a[:len(a) - 2] + a[len(a) - 1])
	print(max(b, d))


num = int(input())
if num > 0:
	print(num)
else:
	cpy1 = abs(num)
	cpy2 = abs(num)
	cpy3 = abs(num)
	last_digit = cpy1 % 10
	t1 = int((cpy2 - last_digit) / 10)
	last_t1 = t1 % 10
	t2 = int((cpy3 - last_digit) / 10 + last_digit - last_t1)
	if t1 == 0 or t2 == 0:
		print(0)
		exit()
	if abs(t2) > abs(t1):
		print('-', t1, sep='')
	else:
		print('-', t2, sep='')


n = int(input())
num = n
ct = 0
x = []
if num > 0:
	print(num)
else:
	num = abs(n)
	while num != 0:
		a = num % 10
		ct = ct + 1
		x.append(a)
		num = num // 10
	x = x[::-1]
	if x[ct - 1] > x[ct - 2]:
		x.pop(ct - 1)
	else:
		x.pop(ct - 2)
	leng = len(x)
	str1 = str(x.pop(0))
	i = 0
	while i < leng - 1:
		str1 = str1 + str(x.pop(i))
		leng = leng - 1
	n1 = int(str1)
	print(-n1)


def acc(n):
	if n >= 0:
		return n
	s = str(-n)
	a = s[:-1]
	b = s[:-2] + s[-1]
	a = int(a)
	b = int(b)
	if a > b:
		return -b
	else:
		return -a
n = int(input())
print(acc(n))


n = int(input())
if n >= 0:
	print(n)
else:
	m = str(n)
	t = list(m)
	l = len(m)
	if l == 2:
		print('0')
	else:
		if int(m[l - 1]) > int(m[l - 2]):
			del t[l - 1]
		else:
			del t[l - 2]
		fi = ''.join(t)
		print(int(fi))


num = int(input())
if num >= 0:
	print(num)
else:
	if len(str(num)) == 2:
		print(0)
	(d1, d2) = str(num)[-2:]
	rest = str(num)[:-2]
	if rest == '-' and (d1 == '0' or d2 == '0'):
		print(0)
	elif d1 > d2:
		print(rest + d2)
	else:
		print(rest + d1)


A = input()
if int(A) >= 0:
	print(A)
elif int(A[len(A) - 1]) > int(A[len(A) - 2]):
	print(int(A[:len(A) - 1]))
else:
	print(int(A[:len(A) - 2] + A[len(A) - 1]))


a = input()
if int(a) < 0:
	if int(a[1:-1]) > int(a[1:-2] + a[-1]):
		print(int(a[0:-2] + a[-1]))
	else:
		print(a[0:-1])
else:
	print(a)


n = int(input())
if n < 0:
	n = abs(n)
	last = n % 10
	minus_last = n // 10 % 10
	if last >= minus_last:
		n = n // 10
	else:
		n = n // 100 * 10 + last
	n *= -1
print(n)


n = int(input())
if n >= 0:
	print(n)
elif n < 0:
	m = str(-n)
	m1 = m[0:-1]
	m11 = int(m1)
	m2 = m[0:-2] + m[-1]
	m22 = int(m2)
	output = -min(m11, m22)
	print(output)


n = input()
if int(n) > 0:
	print(n)
elif len(n) == 1:
	print('ERROR')
else:
	digits = list(n)[1:]
	if digits[-1] > digits[-2]:
		digits[-1] = ''
	else:
		digits[-2] = ''
	n = '-'
	for x in digits:
		n += x
	if int(n) == 0:
		print(0)
	else:
		print(n)


import copy
import math
n = input()

def fbs(data, i):
	a = copy.copy(data)
	del a[len(data) - i]
	a = ''.join(a)
	a = int(a)
	b = math.fabs(a)
	return [a, b]
if '-' not in n:
	print(n)
else:
	data = []
	for i in range(len(n)):
		data.append(n[i])
	(a, fa) = fbs(data, 1)
	(b, fb) = fbs(data, 2)
	if fa > fb:
		print(b)
	elif fa <= fb:
		print(a)


n = int(input())
if n >= 0:
	print(n)
else:
	m = str(n)[::-1]
	if int(m[0]) >= int(m[1]):
		m = m.replace(m[0], '', 1)
	else:
		m = m.replace(m[1], '', 1)
	print(int(m[::-1]))


s = input()
if s[0] != '-':
	print(s)
else:
	y = ''
	n = len(s)
	for i in range(n):
		if i == n - 1:
			continue
		y += s[i]
	z = ''
	for i in range(n):
		if i == n - 2:
			continue
		z += s[i]
	z = int(z)
	y = int(y)
	if y > z:
		print(y)
	else:
		print(z)


n = input()
if int(n) > 0:
	print(n)
else:
	n = list(n)
	l = len(n)
	n[-2] = min(int(n[-1]), int(n[-2]))
	if n == ['-', 0, '0']:
		print('0')
	else:
		for i in range(l - 1):
			print(n[i], end='')


a1 = input()
a2 = a1[:-1]
a3 = a1[0:-2] + a1[-1:]
a1 = int(a1)
a2 = int(a2)
a3 = int(a3)
if a1 > a2 and a1 > a3:
	print(a1)
elif a2 > a1 and a2 > a3:
	print(a2)
else:
	print(a3)


import math
n = int(input())
if n >= 0:
	print(n)
elif n < 0:
	a = math.ceil(n / 10)
	b = math.ceil(n / 100) * 10 + (n - a * 10)
	print(max(a, b))


n = int(input())
otv = 0
if n < 0:
	nstr = str(abs(n))
	if int(nstr[0:-1]) < int(nstr[0:-2] + nstr[-1]):
		otv = int(nstr[0:-1])
		if otv != 0:
			otv = otv * -1
	else:
		otv = int(nstr[0:-2] + nstr[-1])
		if otv != 0:
			otv = otv * -1
else:
	otv = n
print(otv)


inp = input()
num = int(inp)
if num >= 0:
	print(num)
elif num > -10:
	print(0)
elif inp[-2] < inp[-1]:
	print(inp[:-1])
else:
	print(int(inp[:-2] + inp[-1]))


n = int(input())
if n >= 0:
	print(n)
elif n >= -10:
	print(0)
else:
	n1 = int(str(n)[:-1])
	n2 = int(str(n)[:-2] + str(n)[-1])
	print(n1 if n1 > n2 else n2)


line = list(input())
value = ''.join(line)
if int(value) < 0:
	num1 = line[:-1]
	num2 = line[:-2] + line[-1:]
	num1 = ''.join(num1)
	num2 = ''.join(num2)
	MAX = max(int(num1), int(num2))
	print(MAX)
else:
	print(value)


n = int(input())
if n > 0:
	print(n)
else:
	n = str(n)
	t = n[:len(n) - 1]
	k = n[:len(n) - 2] + n[len(n) - 1:]
	if int(t) > int(k):
		print(t)
	elif int(k) >= 0:
		print(abs(int(k)))
	else:
		print(k)


n = int(input())
if n >= 0:
	print(n)
else:
	a = int(n / 10)
	b = int(n / 100) * 10 - abs(n) % 10
	print(max(a, b))


n = input().strip()
if n[0] != '-':
	print(n)
elif len(n) <= 2:
	print(0)
else:
	print(max(int(n[0:-1]), int(n[0:-2] + n[-1])))


n = int(input())
if n < 0:
	s = str(n)
	l = list(s)
	if l[-1] > l[-2]:
		l.pop(-1)
		if len(l) == 2 and l[1] == 0:
			l.pop(0)
	else:
		l.pop(-2)
		if len(l) == 2 and l[1] == '0':
			l.pop(0)
	print(''.join((str(e) for e in l)))
else:
	print(n)


bank_account = int(input())
if bank_account >= 0:
	print(bank_account)
else:
	bank_account = bank_account * -1
	acc_list1 = []
	acc_list2 = []
	account_string = str(bank_account)
	for x in account_string:
		acc_list1.append(x)
		acc_list2.append(x)
	account_string1 = ''
	account_string2 = ''
	acc_list1.pop(-1)
	acc_list2.pop(-2)
	for x in acc_list1:
		account_string1 = account_string1 + x
	for x in acc_list2:
		account_string2 = account_string2 + x
	if int(account_string1) < int(account_string2):
		if int(account_string1) == 0:
			print(account_string1)
		else:
			print('-' + account_string1)
	elif int(account_string2) == 0:
		print(account_string2)
	else:
		print('-' + account_string2)


n = input()
if -10 < int(n) <= 0:
	print(0)
else:
	print(n if int(n) >= 0 else max(int(n[:-1]), int(n[:-2] + n[-1])))


def solve(n):
	if n >= 0:
		return n
	else:
		n *= -1
		a = n // 10
		b = 10 * (n // 100) + n % 10
		return -a if -a > -b else -b

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


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
sys.setrecursionlimit(10 ** 5)

def mod():
	return 10 ** 9 + 7

def i():
	return sys.stdin.readline().strip()

def ii():
	return int(sys.stdin.readline())

def li():
	return list(sys.stdin.readline().strip())

def mii():
	return map(int, sys.stdin.readline().split())

def lii():
	return list(map(int, sys.stdin.readline().strip().split()))

def solve():
	a = i()
	if int(a) >= 0:
		print(a)
	else:
		print(max(int(a[:-1]), int(a[:-2] + a[-1])))
for _ in range(1):
	solve()


n = int(input())
x = x1 = x1 = a1 = a2 = a3 = 0
if n >= 0:
	print(n)
else:
	n = n * -1
	a1 = n // 100
	a2 = n % 100 // 10
	a3 = n % 10
	x1 = a1 * 10 + a2
	x2 = a1 * 10 + a3
	x = min(x1, x2)
	print(x * -1)


s = input()
if int(s) >= 0:
	print(s)
	exit()
c1 = s[:-1]
c2 = s[:-2] + s[-1]
if c1 == '-0' or c2 == '-0':
	print(0)
	exit()
if int(c1) < int(c2):
	print(c2)
else:
	print(c1)


import sys
import math

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def sinp():
	return sys.stdin.readline().strip()

def iinp():
	return int(input())

def ninp():
	return map(int, sys.stdin.readline().strip().split())

def linp():
	return list(map(int, sys.stdin.readline().strip().split()))

def p(a):
	print(a)
n = iinp()
b = abs(n)
if n >= 0:
	print(n)
else:
	n = abs(n)
	l = n % 10
	n = n // 10
	sl = n % 10
	if l <= sl:
		print(-1 * (b // 10 - sl + l))
	else:
		print(-1 * (b // 10))


ls = list(input())
actual = int(''.join(ls))
number1 = int(''.join(ls[0:-1]))
lastNum = ls[-1]
ls.pop()
ls.pop()
ls.append(lastNum)
number2 = int(''.join(ls))
print(max(actual, number1, number2))


n = int(input())
if n >= 0:
	print(n)
else:
	n1 = -(-n // 100 * 10 + -n % 10)
	n2 = -(-n // 10)
	print(max(n, n1, n2))


n = int(input())
if n < 0:
	if len(str(n)) == 3 and n % 10 == 0:
		print(0)
	else:
		s = str(n)
		if int(s[-1]) > int(s[-2]):
			print(s[:len(s) - 2] + s[-2])
		else:
			print(s[:len(s) - 2] + s[-1])
else:
	print(n)


ac = input()
if ac[0] != '-':
	print(int(ac))
elif len(ac) == 2:
	print(0)
else:
	r1 = int(ac[0:-1])
	r2 = int(ac[0:-2] + ac[-1])
	print(max([r1, r2]))


t = input()
if t[0] == '-':
	if len(t) == 2:
		t = '0'
	elif len(t) >= 3 and int(t[-1]) < int(t[-2]):
		t = t[:-2] + t[-1]
	else:
		t = t[:-1]
if t == '-0':
	t = '0'
print(t)


n = int(input())
if n >= 0:
	print(n)
else:
	n *= -1
	a = n % 10
	n = int(n / 10)
	b = n % 10
	n = int(n / 10)
	print(int('-' + str(n) + str(min(a, b))))


n = input()
x = int(n)
y = int(n[:-1])
z = int(n[:len(n) - 2] + n[len(n) - 1:len(n)])
print(max(x, y, z))


n = int(input())
if n > 0:
	print(n)
else:
	s = str(n)
	l = len(s)
	if int(s[len(s) - 1]) > int(s[len(s) - 2]):
		s = s[:len(s) - 1]
	else:
		s = s[:len(s) - 2] + s[len(s) - 1:]
	r = int(s)
	print(r)


n = int(input())
if n > 0:
	print(n)
elif n * -1 % 10 == 0 and n * -1 <= 90:
	print(0)
else:
	first = n * -1 % 10
	n2 = n * -1 // 10
	second = n2 % 10
	maxi = max(first, second)
	if maxi == second:
		n2 = n2 // 10
		if n2 == 0:
			print(first * -1)
		else:
			n2 = n2 * -1
			print(str(n2) + str(first))
	else:
		print(n2 * -1)


n = input()
if n[0] != '-':
	print(n)
else:
	(last, sec_last) = (int(n[-1]), int(n[-2]))
	if last > sec_last:
		print(int(n[:-1]))
	else:
		print(int(n[:-2] + n[-1]))


n = input()
m = int(n)
if m < 0:
	a = int(n[:len(n) - 1])
	b = int(n[:len(n) - 2] + n[len(n) - 1:])
	if a > b:
		print(a)
	else:
		print(b)
else:
	print(m)


n = input()
a = n[:-1]
b = n[:-2] + n[-1]
if int(n) < 0:
	if int(a) > int(b):
		print(int(a))
	else:
		print(int(b))
else:
	print(n)


n = int(input())
if n < 0:
	s = str(n)
	if s[-1] > s[-2]:
		s = s[0:-1]
	else:
		s = s[0:-2] + s[-1]
	n = int(s)
print(n)


n = input()
if int(n) < 0 and len(n) > 2:
	a = n[:-1]
	b = n[:-2] + n[-1]
	if int(a) > int(b):
		if a == '-0':
			print('0')
		else:
			print(a)
	elif b == '-0':
		print('0')
	else:
		print(b)
elif int(n) < 0 and len(n) == 2:
	print('0')
	exit()
else:
	print(n)


inp = str(input())
if int(inp) < 0:
	inp = max(int(inp[:-1]), int(inp[:-2] + inp[-1:]))
print(inp)


n = input()
maxi = max(int(n[0:len(n) - 1]), int(n[0:len(n) - 2] + n[len(n) - 1]), int(n))
print(maxi)


f = lambda : map(int, input().split())
s = input()
if int(s) >= 0:
	print(s)
else:
	print(int(s[::-1].replace(max(s[-1], s[-2]), '', 1)[::-1]))


n = int(input())
if n >= 0:
	print(n)
else:
	a = int(n / 10)
	if n % 10 != 0:
		b = n % 10 - 10
	else:
		b = n % 10
	c = int(n / 100) * 10 + b
	if c >= a:
		print(c)
	else:
		print(a)


mon = int(input())
if mon >= 0:
	print(mon)
else:
	st = str(mon)
	ls = list(st)
	if ls[-1] > ls[-2]:
		ls.pop(-1)
	else:
		ls.pop(-2)
	if ls[-1] == '0' and len(ls) == 2:
		print('0')
	else:
		st = ''.join(ls)
		print(st)


n = input()
last = int(n[-1])
blast = int(n[-2])
first = n[0]
second = int(n[1])
if first != '-':
	print(n)
elif first == '-' and last == 0 and (second == blast):
	print('0')
elif first == '-' and last == 0 and (second != blast):
	n = n[0:-2]
	last = str(last)
	print(n + last)
elif last >= blast:
	n = n[0:-1]
	print(n)
elif blast > last:
	n = n[0:-2]
	last = str(last)
	print(n + last)


import itertools

def main():
	n = int(input())
	s = str(n)
	vals = [n]
	if s[-1].isdigit():
		vals.append(int(s[0:-1]))
	if len(s) > 1 and s[-2].isdigit():
		vals.append(int(s[0:-2] + s[-1]))
	print(max(vals))
main()


N = int(input())
if N > 0:
	print(N)
	exit()
A1 = int(N / 100) * 10 - abs(N) % 10
A2 = int(N / 100) * 10 - int(abs(N) / 10) % 10
print(A1 if A1 > A2 else A2)


n = int(input())
word = str(n)
m = len(word)
if n >= 0:
	print(n)
elif int(word[-1]) >= int(word[-2]):
	print(word[:m - 1])
elif m == 3 and word[-1] == '0':
	print('0')
elif m == 2 and word[0] == '-':
	print('0')
else:
	print(word[:m - 2] + word[-1])


n = int(input())
if n > 0:
	print(n)
else:
	s = -n
	a = -int(s / 10)
	b = -(int(s / 100) * 10 + s % 10)
	t = [a, b, n]
	print(max(t))


n = int(input())
if n >= 10:
	print(n)
else:
	n = str(n)
	l = n[-1]
	sl = n[-2]
	if int(l) >= int(sl):
		n = n[:-2] + sl
	else:
		n = n[:-2] + l
	if n == '-0':
		print(0)
	else:
		print(n)


__author__ = 'Bian'
n = input()
if int(n) > 0:
	print(n)
	exit()
a = n[:-1]
b = n[:-2] + n[-1]
print(max(int(a), int(b), int(n)))


n = int(input())
x = str(n)
a = len(x)
b = x[0:a - 1]
c = x[0:a - 2] + x[a - 1:]
if n >= 0:
	print(n)
elif -100 < n < 0 and int(c) == 0:
	print('0')
elif b < c:
	print(b)
else:
	print(c)


n = int(input())
s = str(n)
if n >= 0:
	print(n)
else:
	s = str(abs(n))
	print(max(-1 * int(s[:len(s) - 1]), -1 * int(s[:len(s) - 2] + s[len(s) - 1:])))


account = int(input())
if account >= 0:
	print(account)
else:
	account_1 = str(account)[0:-1]
	account_2 = str(account)[0:-2] + str(account)[-1]
	print(max(int(account_1), int(account_2)))


n = input()
x = ['-10', '-20', '-30', '-40', '-50', '-60', '-70', '-80', '-90']
if n in x:
	print('0')
elif n > '0':
	print(n)
elif n[-1] > n[-2]:
	print(n[:len(n) - 1])
else:
	print(n[:len(n) - 2] + n[-1])


n = input()
a = int(n)
b = int(n[0:-1])
c = int(n[0:-2] + n[-1])
print(max(a, b, c))


def main():
	n = list(input())
	print(max(getStates(n)))

def getStates(n):
	return map(lambda x: int(''.join(x)), [n, n[:-2] + n[-1:], n[:-1]])
main()


n = input()
s = int(n)
d = int(n[0:-1])
f = int(n[0:-2] + n[len(n) - 1])
print(max(s, d, f))


a = int(input())
b = abs(a) // 10
c = abs(a) // 10 + abs(a) % 10 - b
if a >= 0:
	print(a)
elif a < 0 and a > -10:
	print(a)
elif a < 0 and a > -100 and (a % 10 == 0):
	print(0)
elif a < 0 and a > -100:
	if b >= c:
		print(-c)
	else:
		print(-b)
elif a <= -100:
	if c >= b % 10:
		print(-b)
	else:
		print(-(b - b % 10 + c))


s = input()
print(max(list(map(int, [s, s[0:-1], s[0:-2] + s[-1]]))))


n = input()
x = len(n)
if '-' in n:
	if int(n[-1]) > int(n[-2]):
		x = int(n[:x - 1])
	else:
		x = int(n[:x - 2] + n[-1])
	print(x)
else:
	print(n)


n = input()
pp = n[:-2] + n[-1:]
p = n[:-1]
print(max(int(n), int(pp), int(p)))


n = int(input())
if n >= 0:
	print(n)
else:
	a = str(n)
	p = a[:-1]
	q = a[:-2] + a[-1]
	if p == '-0' or q == '-0':
		print(0)
	else:
		print(max(int(p), int(q)))


n = int(input())
s = str(n)
d = len(s)
a = [x for x in s]
b = [x for x in s]
if n >= 0:
	print(n)
else:
	del a[d - 1]
	del b[d - 2]
	x = int(''.join(a))
	y = int(''.join(b))
	print(max(x, y))


n = input()
if n[0] != '-':
	print(n)
else:
	if n[-1] >= n[-2]:
		n = n[:-1]
	else:
		n = n[:-2] + n[-1]
	if n == '-0':
		n = n[1:]
	print(n)


import math
num = int(input())
if num >= 0:
	print(num)
else:
	num = 0 - num
	num1 = math.floor(num / 10)
	num2 = math.floor(num / 100) * 10 + (num - num1 * 10)
	if num1 >= num2:
		print(0 - num2)
	else:
		print(0 - num1)


n = list(input())
if n[0] == '-':
	m = n[-1]
	n.pop(-1)
	s = ''.join(n)
	n.append(m)
	g = n[len(n) - 2]
	n.pop(-2)
	l = ''.join(n)
	if int(l) >= int(s):
		print(int(l))
	elif int(s) > int(l):
		print(int(s))
else:
	y = ''.join(n)
	print(y)


n = int(input())
if n >= 0:
	print(n)
else:
	n = -1 * n
	n = str(n)
	li = [int(i) for i in n]
	list1 = [int(i) for i in li]
	list2 = [int(i) for i in li]
	list1.pop()
	list2.pop(-2)
	n1 = ''.join((str(i) for i in list1))
	n2 = ''.join((str(i) for i in list2))
	if n1 == '0' or n2 == '0':
		print('0')
	elif n1 < n2:
		print('-' + n1)
	else:
		print('-' + n2)


bal = int(input())
if bal >= 0:
	print(bal)
else:
	bals = str(-bal)
	dig = [int(char) for char in bals]
	if len(dig) == 1:
		print('0')
	else:
		if dig[-1] >= dig[-2]:
			del dig[-1]
		else:
			del dig[-2]
		if len(dig) == 1 and dig[0] == 0:
			print('0')
		else:
			print('-', end='')
			for i in range(len(dig)):
				print(dig[i], end='')
			print()


n = int(input())
if n >= 0:
	print(n)
else:
	num = -n
	s = str(num)
	if len(s) == 1:
		print(0)
	else:
		print(-min(int(s[:-1]), int(s[:-2] + s[-1])))


n = int(input())
tmp = n
temp1 = abs(n) % 10
tmp = int(tmp / 10)
temp2 = abs(tmp) % 10
tmp = tmp + temp2 - temp1
tmp1 = n
tmp1 = int(tmp1 / 10)
if n >= 0:
	print(n)
elif n < 0 and n > -11:
	print('0')
else:
	print(max(tmp1, tmp))


n = input()
l = len(n)
if n[0] != '-':
	print(n)
elif l == 2:
	print(0)
else:
	a = int(n[l - 1])
	b = int(n[l - 2])
	ans = n[:l - 2] + str(min(a, b))
	print(0 if int(ans) == 0 else ans)


def main():
	balance = int(input())
	result = 0
	if balance >= 0:
		result = balance
	elif balance >= -10:
		result = 0
	else:
		x = -balance
		last_digit = x % 10
		before_last_digit = x // 10 % 10
		if last_digit >= before_last_digit:
			result = -(x // 10)
		else:
			result = -(x // 100 * 10 + last_digit)
	print(result)
main()


n = int(input())
n5 = []
if n > 0:
	print(n)
else:
	n1 = int(n / 10)
	n2 = abs(n) % 10
	n3 = int(n / 100)
	n4 = n3 * 10 - n2
	print(max(n1, n4))


n = int(input())
if n >= 0:
	print(n)
else:
	n *= -1
	d = n % 100
	if d // 10 > d % 10:
		print(-1 * (n // 100 * 10 + d % 10))
	else:
		print(-1 * (n // 10))


s = input()
if s[0] == '-':
	if s[-1] > s[-2]:
		ans = s[:-1]
	else:
		ans = s[:-2] + s[-1]
	if ans == '-0':
		ans = '0'
else:
	ans = s
print(ans)


n = list(input())
if n[0] == '-':
	if n[len(n) - 1] > n[len(n) - 2]:
		del n[len(n) - 1]
	else:
		del n[len(n) - 2]
	if len(n) == 2 and n[1] == '0':
		n = [0]
for i in n:
	print(i, end='')


a = int(input())
(b, c) = (int(str(a)[:-1]), int(str(a)[:-2] + str(a)[-1]))
if a > 0:
	print(a)
elif b > c:
	print(b)
else:
	print(c)


a = int(input())
x = abs(a)
b = x % 10
c = x // 10 % 10
d = x // 100
e = d
f = 10
g = 0
if a < 0:
	while e != 0:
		e = e % 10
		d = d // 10
		g += e * f
		f *= 10
		e = d
if a >= 0:
	print(a)
elif g + b < g + c:
	print(-(g + b))
else:
	print(-(g + c))


n = int(input())
if n >= 0:
	print(n)
elif n < 0 and n >= -9:
	print(0)
else:
	s = str(-n)
	a = int(s[len(s) - 1])
	b = int(s[len(s) - 2])
	if a >= b:
		s = s[:len(s) - 1]
	else:
		s = s[:len(s) - 2] + str(a)
	print(-int(s))


from sys import stdin

def readLine():
	return stdin.readline().strip()

def readInt():
	return int(readLine())

def readInts():
	return list(map(int, readLine().split()))

def main():
	N = readLine()
	A = int(N)
	B = int(N[:-1])
	C = int(N[:-2] + N[-1:])
	print(max(A, B, C))
main()


amount = int(input())
maximum = 0
first_option = 0
second_option = 0
temp_amount = 0
if amount >= 0:
	maximum = amount
	print(maximum)
elif amount < 0:
	temp_amount = -amount
	first_option = round((temp_amount - temp_amount % 10) / 10)
	second_option = round((temp_amount - temp_amount % 100) / 10 + temp_amount % 10)
	if first_option > second_option:
		print(-second_option)
	else:
		print(-first_option)


n = int(input())
if n >= 0:
	print(n)
else:
	ns = str(n)
	if len(ns) == 2:
		print('0')
	elif len(ns) == 3 and int(ns[-1]) == 0:
		print('0')
	elif int(ns[-1]) >= int(ns[-2]):
		print(ns[:-1])
	else:
		print(ns[:-2] + ns[-1])


s = input()
if len(s) == 2 and int(s) < 0:
	print(0)
elif int(s) > 0:
	print(int(s))
elif s[-1] > s[-2]:
	s = s[0:len(s) - 1]
	print(int(s))
else:
	s = s[0:len(s) - 2] + s[len(s) - 1]
	print(int(s))


x = int(input())
if x >= 0:
	print(x)
else:
	x = str(x)
	m = list(x)
	n = list(x)
	m.pop()
	n.pop(len(n) - 2)
	a = ''.join(m)
	b = ''.join(n)
	if int(a) > int(b):
		print(int(a))
	else:
		print(int(b))


n = input()
if int(n) >= 0:
	print(n)
else:
	n = list(n)
	z = n[:-1]
	x = n[::-1]
	del x[1]
	x = x[::-1]
	x = ''.join(x)
	z = ''.join(z)
	if int(x) < int(z):
		print(int(z))
	else:
		print(int(x))


s = int(input())
if s >= 0:
	print(s)
else:
	l = [i for i in str(s)]
	r = [i for i in str(s)]
	del r[-1]
	del l[-2]
	g = ''.join(r)
	q = ''.join(l)
	if int(g) >= int(q):
		print(int(g))
	else:
		print(int(q))


import math
import os
import random
import re
import sys
a = int(input())
if a >= 0:
	print(a)
else:
	b = str(a)
	length = len(b)
	d = b[:length - 1]
	e = b[:length - 2] + b[length - 1]
	d = int(d)
	e = int(e)
	if d == 0 or e == 0:
		print(0)
	elif d > e:
		print(d)
	else:
		print(e)


n = int(input())
if n >= 0:
	print(n)
else:
	n = str(n)
	print(max(int(n[:-1]), int(n[:-2] + n[-1])))


n = int(input())
if n > 0:
	x1 = n // 10
	div = str(n % 10)
	x2 = str(n // 100)
	x2 = int(x2 + div)
else:
	p = -1 * n
	x1 = p // 10
	div = str(p % 10)
	x2 = str(p // 100)
	x2 = int(x2 + div)
	x2 *= -1
	x1 *= -1
print(max(x1, x2, n))


n = input()
o = int(n)
n1 = int(n[:-1])
n2 = int(n[:-2] + n[-1])
print(max(o, n1, n2))


s = input()
print([int(s), max(int(s[:-2] + s[len(s) - 1]), int(s[:-2] + s[len(s) - 2]))][int(s) < 0])


s = input()
n = int(s[0:len(s) - 1])
m = int(s[0:len(s) - 2] + s[-1])
if int(s) > 0:
	print(s)
else:
	print(max(n, m))


a = int(input())
if a > 0:
	print(a)
elif a < 0:
	if abs(a) // 10 % 10 > abs(a) % 10:
		a = str(a)
		a = ''.join(a.rsplit(a[-2], 1))
		print(int(a))
	else:
		a = abs(a) // 10
		print(-a)


n = int(input())
if n >= 0:
	print(n)
else:
	k = list(str(abs(n)))
	if k[-1] >= k[-2]:
		del k[-1]
	else:
		del k[-2]
	if len(k) == 1 and '0' in k:
		print(0)
	else:
		print('-', end='')
		for elem in k:
			print(elem, end='')


s = input()
n1 = int(s[:-1])
n2 = int(s[:-2] + s[-1])
if int(s) < 0:
	print(max(n1, n2))
else:
	print(int(s))


n = int(input())
if n >= 0:
	print(n)
else:
	b = str(n)
	f = len(b) - 1
	a = b[:f] + b[f + 1:]
	w = len(b) - 2
	c = b[:w] + b[w + 1:]
	ai = int(a)
	ci = int(c)
	print(max(n, ai, ci))


n = int(input())
if n > 0:
	print(n)
else:
	n = abs(n)
	n1 = n // 10
	n2 = n // 100 * 10 + n % 10
	print(0 - min(n, n1, n2))


def findmax(a):
	n = len(a)
	if n == 2:
		print('0')
	elif n == 3 and (a[1] == '0' or a[2] == '0'):
		print('0')
	else:
		if a[-1] > a[-2]:
			del a[-1]
		else:
			del a[-2]
		print(''.join(a))
a = list(input())
if a[0] == '-':
	findmax(a)
else:
	print(''.join(a))


a = input()
if a[0] != '-':
	print(a)
else:
	x = [int(a[i]) for i in range(1, len(a))]
	t = x[-1]
	u = x[-2]
	g = max((t, u))
	if t == g:
		x.pop(-1)
		x[0] = -x[0]
		for i in x:
			print(i, end='')
	else:
		x.pop(-2)
		x[0] = -x[0]
		for i in x:
			print(i, end='')


res = bal = int(input().strip())
if bal < 0:
	bal -= 2 * bal
	(n1, n2) = (bal % 10, bal % 100 // 10)
	if n1 > n2:
		res = bal // 10
	else:
		res = bal // 100 * 10 + n1
	res = -res
print(res)


a = input()
b = a
k = len(a)
a = int(a)
if a >= 0:
	print(a)
else:
	c = int(b[0:k - 1])
	d = int(b[:k - 2] + b[k - 1:])
	if c > d:
		print(c)
	else:
		print(d)


n = input()
m = int(n)
if m >= 0:
	print(m)
else:
	p = n[:-1]
	q = n[:-2] + n[-1]
	t = max(int(p), int(q))
	print(t)


a = int(input())
if a >= 0:
	print(a)
else:
	h1 = 0 - abs(a) // 10
	h2 = int(str(a)[:-2] + str(a)[-1])
	print(max(h1, h2))


n = list(input())
if n[0] == '-':
	del n[0]
	l = n[:]
	m = int(''.join(n))
	del n[len(n) - 1]
	if int(''.join(n)) < m:
		m = int(''.join(n))
	n = l[:]
	del n[len(n) - 2]
	if int(''.join(n)) < m:
		m = int(''.join(n))
	print(-m)
else:
	print(int(''.join(n)))


s = input()
if s[0] != '-':
	print(s)
elif s[-1] < s[-2]:
	e = int(s[:len(s) - 2] + s[-1])
	print(e)
else:
	e = int(s[:len(s) - 1])
	print(e)


n = int(input())
if n > 0:
	print(n)
	exit()
elif len(str(n)) == 3 and str(n)[2] == '0':
	print(str(n)[2])
elif len(str(n)) == 3 and int(str(n)[1]) < int(str(n)[2]) and (int(str(n)[2]) != 0):
	print('-' + str(n)[1])
elif int(str(n)[-1]) > int(str(n)[-2]):
	opacha = list(str(n))
	kek = str(n).rfind(str(n)[-1])
	del opacha[kek]
	for i in opacha:
		print(i, end='')
else:
	opacha = list(str(n))
	kek = str(n).rfind(str(n)[-2])
	del opacha[kek]
	for i in opacha:
		print(i, end='')


n = input()
if n[0] != '-':
	print(n)
elif n[-1] >= n[-2]:
	print(n[:len(n) - 1])
elif n[-1] == '0' and n[-3] == '-':
	print(0)
else:
	print(n[:len(n) - 2], n[len(n) - 1:], sep='')


n = int(input())
if n >= 0:
	print(n)
else:
	c = -n
	if c % 10 > c % 100 // 10:
		c = str(n)
		c = list(c)
		del c[len(c) - 1]
	else:
		c = str(n)
		c = list(c)
		del c[len(c) - 2]
	c = ''.join(c)
	c = str(c)
	c = int(c)
	print(c)


n = input()
if int(n) < 0:
	if n[-1] > n[-2]:
		if n[1:-1] == '0':
			print('0')
		else:
			print(n[:-1])
	elif n[1:-2] + n[-1] == '0':
		print('0')
	else:
		print(n[:-2] + n[-1])
else:
	print(n)


n = str(input())
if int(n) < 0:
	n = list(n)
	if int(n[-1]) > int(n[-2]):
		del n[-1]
		print(int(''.join(map(str, n))))
	else:
		del n[-2]
		print(int(''.join(map(str, n))))
else:
	print(int(n))


n = input()
if n[0] == '-':
	n = n[::-1]
	if int(n[0]) > int(n[1]):
		n = n.replace(n[0], '', 1)
	else:
		n = n.replace(n[1], '', 1)
else:
	n = n[::-1]
n = n[::-1]
if n == '-0':
	print('0')
else:
	print(n)


act = int(input())
if act >= 0:
	prt = act
else:
	act = abs(act)
	a1 = int(act / 10)
	a2 = int(act / 100) * 10 + act % 10
	prt = -min(a1, a2)
print(prt)


st = list(input())
if st[0] != '-':
	print(''.join(st))
elif len(st) == 2:
	print('0')
else:
	if st[-1] > st[-2]:
		st.pop(-1)
	else:
		st.pop(-2)
	if len(st) == 2 and st[1] == '0':
		st = ['0']
	print(''.join(st))


num = input()
if int(num) >= 0:
	print(num)
elif num[-2] > num[-1]:
	print(int(num[0:-2] + num[-1]))
else:
	print(int(num[0:-1]))


n = input()
if int(n) > 0:
	print(int(n))
else:
	a = int(n)
	b = (int(n) + int(n[len(n) - 1])) / 10
	c = (int(n) + int(n[len(n) - 1]) + 10 * int(n[len(n) - 2])) / 10 - int(n[len(n) - 1])
	print(int(max(a, b, c)))


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	a = n // 10
	b = n // 100 * 10 + n % 10
	print(-min(a, b))


n0 = str(input())
n1 = n0[:-1]
n2 = n0[:-2] + n0[-1:]
n0 = int(n0)
n1 = int(n1)
n2 = int(n2)
print(max(n1, n2, n0))


__author__ = 'Dilshod'
n = int(input())
if n >= 0:
	print(n)
else:
	n = str(n)
	if n[-1] >= n[-2]:
		n = n[:-1]
	else:
		n = n[:-2] + n[-1]
	print(int(n))


s = input()
if int(s) >= 0:
	print(s)
else:
	print(max(int(s[:-2] + s[-1]), int(s[:-1])))


n = int(input())
if n > 0 or n == 0:
	print(n)
else:
	n = n * -1
	n1 = int(n / 10)
	r = n % 10
	n2 = int(n1 / 10) * 10 + r
	if n1 > n2:
		n2 = n2 * -1
		print(n2)
	else:
		n1 = n1 * -1
		print(n1)


s = int(input())
if s > 0:
	print(s)
else:
	s = str(abs(s))
	a1 = int(s[:-1]) * -1
	a2 = int(s[0:len(s) - 2] + s[-1:]) * -1
	print(max(a1, a2))


n = int(input())
if n >= 0:
	print(n)
else:
	n = -1 * n
	b = int(n % 100 / 10)
	c = int(n % 100 % 10)
	if b > c:
		print(-1 * (int(n / 100) * 10 + c))
	else:
		print(-1 * (int(n / 100) * 10 + b))


n = int(input())
if n >= 0:
	print(n)
else:
	n = abs(n)
	largon = len(str(n))
	if n % 100 != 0:
		minimo = min(round(n % 100 / 10 - n % 10 / 10), n % 10)
		resultado = minimo
		i = 1
		while i + 2 <= largon:
			resultado = int(str(n)[largon - i - 2]) * 10 ** i + resultado
			i = i + 1
		resultadofinal = -int(resultado)
		print(resultadofinal)
	else:
		resultado = 0
		i = 1
		while i + 2 <= largon:
			resultado = int(str(n)[largon - i - 2]) * 10 ** i + resultado
			i = i + 1
		resultadofinal = -int(resultado)
		print(resultadofinal)


n = input()
if int(n) >= 0:
	print(n)
elif int(n) >= -10 or (int(n) > -100 and int(n) % 10 == 0):
	print(0)
else:
	m = list(n)
	if m[-1] > m[-2]:
		m[-1] = ''
	else:
		m[-2] = ''
	print(''.join((str(i) for i in m)))


origin_money = input()
if int(origin_money) >= 0:
	changed_money = origin_money
else:
	money_list = list(origin_money)
	possibilities = []
	for n in range(2):
		list_copy = money_list[:]
		del list_copy[-n - 1]
		if list_copy[1] != '0' or len(list_copy) == 2:
			possibilities.append(int(''.join(list_copy)))
	changed_money = max(possibilities)
print(changed_money)


n = int(input())
if n >= 0:
	print(n)
elif n >= -10:
	print(0)
else:
	n = -n
	k = str(n)
	x = k[:-1]
	c = [k[:-2], k[-1]]
	y = ''.join(c)
	x = -int(x)
	y = -int(y)
	print(max(x, y))


n = input()
if int(n) < 0:
	if n[-1] > n[-2]:
		k = n[:len(n) - 1]
	else:
		k = n[:len(n) - 2] + n[-1]
else:
	k = n
if int(k) == 0:
	k = 0
print(k)


def Bank(r):
	if int(r) >= 0:
		return r
	else:
		n = len(r)
		s = r[0:n - 1]
		s1 = r[0:n - 2] + r[n - 1]
		if int(s) == -0 or int(s1) == -0:
			return 0
		elif int(s) > int(s1):
			return s
		else:
			return s1
n = input()
print(Bank(n))


n = input()
if n != '0':
	n1 = n[:len(n) - 1]
	n2 = n[:len(n) - 2] + n[-1]
	print(max(map(int, (n, n1, n2))))
else:
	print('0')


n = int(input())
if n < 0:
	S = str(n)
	k = len(S)
	if S[k - 1] > S[k - 2]:
		S1 = S[0:k - 1]
	else:
		S1 = S[0:k - 2]
		S1 = S1 + S[k - 1]
	if S1[0] == '-' and S1[1] == '0':
		print(0)
	else:
		print(S1)
else:
	print(n)


import itertools

def solve(n):
	if n >= 0:
		return n
	else:
		s = str(n)
		xs = list(s)
		a = int(''.join(xs[:-1]))
		b = int(''.join(xs[:-2] + [xs[-1]]))
		return max(a, b)

def main():
	n = int(input())
	result = solve(n)
	print(result)
main()


nechet = input()
chet = list(nechet)
if chet[0] == '-':
	del chet[0]
	v1 = []
	for i in range(0, len(chet) - 1):
		v1.append(chet[i])
	v2 = []
	for i in range(0, len(chet)):
		if i == len(chet) - 2:
			continue
		else:
			v2.append(chet[i])
	if v1 >= v2:
		if '-' + ''.join(v2) == '-0':
			print(0)
		else:
			print('-' + ''.join(v2))
	elif '-' + ''.join(v1) == '-0':
		print(0)
	else:
		print('-' + ''.join(v1))
else:
	print(nechet)


a = input()
if int(a) >= 0:
	print(a)
else:
	b = list(a)
	if len(b) == 2 or (len(b) == 3 and b[2] == '0'):
		print('0')
	else:
		c = b[:]
		del c[len(b) - 1]
		d = b[:]
		del d[len(b) - 2]
		if c < d:
			for i in range(len(c)):
				print(c[i], end='')
		else:
			for i in range(len(c)):
				print(d[i], end='')


n = int(input())
if n >= 0:
	print(n)
else:
	n = str(n)
	n = list(n[1:])
	a = int(n[-1])
	b = int(n[-2])
	if a > b:
		del n[-1]
	else:
		del n[-2]
	n = ''.join(n)
	n = int(n)
	if n == 0:
		print(0)
	else:
		print('-', n, sep='')


n = input()
if n[0] != '-':
	print(n)
elif n[0] == '-':
	last = n[:-1]
	beforelast = n[:-2] + n[-1]
	nlast = int(last)
	nbeforelast = int(beforelast)
	if abs(nlast) < abs(nbeforelast):
		print(last)
	elif beforelast == '-0':
		print(0)
	else:
		print(beforelast)


n = int(input())
if n > 0:
	print(n)
else:
	n_neg = -n
	print(-(n_neg // 100 * 10 + min(n_neg % 10, n_neg // 10 % 10)))


n = input()
if int(n) >= 0:
	print(n)
	exit(0)
d = len(n)
if d == 2:
	print(0)
	exit(0)
if d >= 3:
	tmp1 = n[0:-1]
	tmp2 = n[0:-2] + n[-1:]
	val = max(int(tmp1), int(tmp2))
	print(val)


n = int(input())
if n > 0:
	print(n)
else:
	n = list(str(n))
	if len(n) == 3 and n[2] == '0':
		print(0)
		exit(0)
	if n[-1] > n[-2]:
		del n[-1]
	else:
		del n[-2]
	for i in n:
		print(i, end='')


import sys
import math
import bisect

def solve(n):
	if n >= 0:
		return n
	n = abs(n)
	s = str(n)
	if len(s) == 1:
		return -n
	min_val = 10 ** 18
	min_val = min(min_val, int(s[:-1]))
	min_val = min(min_val, int(s[:-2] + s[-1]))
	return -min_val

def main():
	n = int(input())
	ans = solve(n)
	print(ans)
main()


n = input()
L = []
if int(n) >= 0:
	print(n)
elif int(n) > -11:
	print(0)
else:
	l = len(n)
	i = 0
	while i < l:
		L.append(n[i])
		i += 1
	if int(L[l - 2]) > int(L[l - 1]):
		del L[l - 2]
	else:
		del L[l - 1]
	a = ''.join(L)
	print(int(a))


l = input()
if int(l) >= 0:
	a = l
	print(int(a))
	exit()
elif int(l) <= 0:
	a = int(l[0:-2] + l[-1])
	b = int(l[0:-1])
	c = int(l)
	print(max(max(a, b), c))


def delLast(n):
	return (n[:-1], int(n[-1]))

def delSecLast(n):
	last = n[-1]
	return (n[:-2] + last, int(n[-2]))
n = input()
if int(n) > 0:
	print(int(n))
else:
	(a, b) = delLast(n)
	(p, q) = delSecLast(n)
	a = int(a)
	p = int(p)
	print(max(a, p))


n = int(input())
if n > 0:
	print(n)
elif n > -10:
	print(n)
else:
	s = str(n)
	if s[-1] > s[-2]:
		print(int(s[:-1]))
	else:
		print(int(s[:-2] + s[-1]))


balance = int(input())
if balance >= 0:
	print(balance)
else:
	balance = str(balance)
	s = str(balance[0:len(balance) - 2])
	b = balance[len(balance) - 2:len(balance)]
	for i in b:
		if b.count(i) != 2:
			if i != max(b):
				s += i
		else:
			s += i
			break
	if s == '-0':
		print('0')
	else:
		print(s)


n = int(input())
if n >= 0:
	print(n)
else:
	s = str(n)
	l = len(s)
	x1 = int(s[-1])
	x2 = int(s[-2])
	if x1 > x2:
		s = s[:l - 1]
	else:
		s = s[:l - 2] + s[l - 1:]
	print(int(s))


import sys
x = int(input())
k = 0
if x >= 0:
	k = x
else:
	a = abs(x)
	l = a // 10
	b = a % 10
	j = a // 100 * 10 + b
	k = -1 * min(l, j)
sys.stdout.write(str(k))


n = input()
res = int(n)
res = max(res, int(n[:-2] + n[-1]))
res = max(res, int(n[:-1]))
print(res)


n = input('')
result = ''
if int(n) < 0:
	if int(n[-1]) > int(n[-2]):
		result = n[:len(n) - 1]
	else:
		result = n[:len(n) - 2] + n[-1]
else:
	result = n
if result == '-0':
	result = '0'
print(result)


n = input()
if int(n) >= 0:
	print(n)
else:
	(a, b) = (list(n), list(n))
	le = len(n) - 1
	a[le] = ''
	fn = ''.join(a)
	b[le - 1] = ''
	sn = ''.join(b)
	if int(fn) > int(sn):
		if fn == '-0':
			print(0)
		else:
			print(fn)
	elif sn == '-0':
		print(0)
	else:
		print(sn)


import math
n = int(input())
if n >= 0:
	print(n)
else:
	l = abs(n) % 10
	sl = int(abs(n) % 100 / 10)
	if l >= sl:
		print(int(n / 10))
	else:
		diff = sl - l
		print(int(n / 10 + diff))


n = input()
print(max([int(x) for x in [n, n[:-1], n[:-2] + n[-1]]]))


n = int(input())
if n > 0:
	print(n)
else:
	n = n * -1
	ans = n
	a = n % 10
	tmp = n / 10
	b = tmp % 10
	if a > b:
		print(int(-ans / 10))
	else:
		ans = int(ans / 100)
		print(-(ans * 10 + a))


num = int(input())
numarr = [i for i in str(num)]

def remove_digit(index):
	if num >= 0:
		return num
	arr = numarr[:]
	del arr[index]
	return int(''.join(arr))
lst_digit = remove_digit(len(numarr) - 1)
prev_digit = remove_digit(len(numarr) - 2)
if lst_digit > prev_digit:
	print(lst_digit)
else:
	print(prev_digit)


input_s = input()
if input_s[0] != '-':
	print(input_s)
else:
	a = int(input_s[:-1])
	b = int(input_s[:-2] + input_s[len(input_s) - 1:len(input_s)])
	print(max(a, b))


s = input()
if int(s) >= 0:
	print(s)
elif len(s) == 1:
	print(0)
else:
	a = s[:-1]
	b = s[:-2] + s[-1]
	n = int(a)
	m = int(b)
	l = max(n, m)
	print(l)


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)
from math import ceil, floor, log, sqrt, factorial

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
n = int(input())
if n >= 0:
	print(n)
	exit()
nw = str(n)[1:]
st = min(int(nw[:-1]), int(nw[:-2] + nw[-1]))
print(st * -1)


n = input()
if int(n) >= 0:
	print(n)
	exit()
if int(n) > -10:
	print('0')
	exit()
r1 = n[:-1]
r2 = n[:-2] + n[-1]
if r1 == '-0' or r2 == '-0':
	print('0')
	exit()
if int(r1) < int(r2):
	print(r2)
else:
	print(r1)


balance = int(input())
if balance > 0:
	print(balance)
else:
	rm_last = int(str(balance)[:len(str(balance)) - 1])
	rm_last_last = int(str(balance)[:len(str(balance)) - 2] + str(balance)[-1])
	print(max(rm_last, rm_last_last))


a = input()
if int(a) >= 0:
	result = a
else:
	last = int(a[:-1])
	penult = int(a[:-2] + a[-1])
	result = last if last > penult else penult
print(result)


line = input()
print(max(int(line), int(line[:-1]), int(line[:-2] + line[-1])))


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
N = get_string()
print(max(map(int, [N, N[:-1], N[:-2] + N[-1]])))


n = input()
nl = list(n)
if int(n) < 0:
	a = nl.pop()
	b = nl.pop()
	nl.append(min(a, b))
	n = ''.join(nl)
print(n.replace('-', '') if n == '-0' else n)


n = input()
if int(n) >= 0:
	print(n)
elif len(n) == 2:
	print('0')
else:
	c = min(int(n[-1]), int(n[-2]))
	l = (int(n) + int(n[-1]) + int(n[-2]) * 10) / 10 - c
	print(int(l))


n = list(input())
if n[0] == '-':
	if len(n) == 2:
		print(0)
	else:
		if int(n[len(n) - 1]) >= int(n[len(n) - 2]):
			del n[len(n) - 1]
		else:
			del n[len(n) - 2]
		if len(n) == 2:
			if int(n[1]) == 0:
				print(0)
			else:
				for i in range(2):
					print(n[i], end='')
		else:
			for i in range(len(n)):
				print(n[i], end='')
else:
	for i in range(len(n)):
		print(n[i], end='')


n = input()
z = 1
if n[0] == '-':
	z = -1
	n = n[1:]
x = z * int(n[:-1])
y = z * int(n[:-2] + n[-1])
n = int(n) * z
if n > x and n > y:
	print(n)
elif x < y:
	print(y)
else:
	print(x)


a = int(input())
if a >= 0:
	print(a)
else:
	b = str(a)
	if a >= -9:
		print(0)
	elif b[-1] >= b[-2]:
		c = b[0:-1]
		print(c)
	elif len(b) == 3 and int(b[-1]) == 0:
		print(0)
	else:
		print('{d}{e}'.format(d=b[0:-2], e=b[-1]))


from sys import stdin
import math
n = int(stdin.readline().rstrip())
if n >= 10:
	print(n)
else:
	lst = -n % 10
	snd = -n // 10 % 10
	cur = -n // 100
	keep_lst = lst <= snd
	num = lst if keep_lst else snd
	cur_pow = 10
	while cur:
		num += cur % 10 * cur_pow
		cur_pow *= 10
		cur //= 10
	print(-num)


n = input()
ane = int(n)
num = ''
other = []
if int(n) >= 0:
	print(n)
else:
	n = list(n)
	if len(n) > 3:
		l = n[len(n) - 1]
		lind = len(n) - 1
		l2 = n[len(n) - 2]
		l2ind = len(n) - 2
		dele = max(l2, l)
		if dele == l2:
			del n[l2ind]
			for i in range(len(n)):
				num += n[i]
			print(num)
		else:
			del n[lind]
			for i in range(len(n)):
				num += n[i]
			print(num)
	else:
		anse = max(n)
		del n[n.index(anse)]
		anse = ''
		if '0' in n:
			for i in range(1, len(n), 1):
				anse += n[i]
		else:
			for i in range(len(n)):
				anse += n[i]
		print(anse)


s = input()
a = int(s[:-2] + s[-1])
b = int(s[:-1])
print(max([a, b, int(s)]))


n = input()
p = int(n)
if p > 0:
	print(p)
elif len(n) != 3 or p % 10 == 0:
	if p % 10 == 0 and abs(p) < 100:
		print('0')
	else:
		f = int(n[:len(n) - 1])
		s = int(n[:len(n) - 2]) * 10 - int(n[-1])
		if f > s:
			print(f)
		else:
			print(s)
elif len(n) == 3:
	x = int(n[-1])
	y = int(n[-2])
	if x < y:
		print('-', x, sep='')
	else:
		print('-', y, sep='')


n = int(input())
if n > 0:
	n1 = n // 10
	n2 = n // 100 + n % 10
elif n == 0:
	n1 = 0
	n2 = 0
else:
	n1 = -1 * (abs(n) // 10)
	n2 = -1 * (abs(n) // 100 * 10 + abs(n) % 10)
print(max(n, n1, n2))


n = int(input())
if n >= 0:
	print(n)
elif int(str(n)[len(str(n)) - 1]) > int(str(n)[len(str(n)) - 2]):
	print(str(n)[:len(str(n)) - 1])
elif n % 10 == 0 and n > -100:
	print(0)
else:
	print(str(n)[:len(str(n)) - 2] + str(n)[len(str(n)) - 1])


n = int(input())
a = []
if n >= 0:
	print(n)
else:
	n = str(n)
	for i in n:
		a.append(i)
	if int(a[len(a) - 1]) > int(a[len(a) - 2]):
		a.pop(int(len(a) - 1))
	else:
		a.pop(int(len(a) - 2))
	b = ''.join(a)
	print(int(b))


import sys

class MyReader:

	def __init__(self):
		filename = 'file.in'
		if self.isLocal():
			self.file = open(filename)
		self.str = ['']
		self.ind = 1

	def isLocal(self):
		return len(sys.argv) > 1 and sys.argv[1] == 'SCHULLZ'

	def nextString(self):
		if self.isLocal():
			return self.file.read()
		else:
			return input()

	def nextInt(self):
		return int(self.nextToken())

	def nextToken(self):
		if self.ind >= len(self.str):
			self.ind = 0
			self.str = self.nextString().split()
		self.ind += 1
		return self.str[self.ind - 1]
rdr = MyReader()
x = rdr.nextInt()
if x >= 0:
	print(x)
elif x >= -9:
	print(0)
else:
	s = str(x)
	a = list(s)
	n = len(a)
	if 3 == n and 0 == int(a[2]):
		print(0)
	else:
		d = n - 1
		if a[n - 2] > a[n - 1]:
			d = n - 2
		for i in range(0, n):
			if i != d:
				sys.stdout.write(a[i])
sys.stdout.write('\n')
sys.stdout.flush()


s = input()
if '-' in s:
	a = int(s[len(s) - 1])
	b = int(s[len(s) - 2])
	if len(s) == 3 and '0' in s:
		print(0)
	elif a > b:
		print(s[:-2] + str(b))
	else:
		print(s[:-2] + str(a))
else:
	print(s)


s = input()
if int(s) >= 0:
	print(s)
elif s[len(s) - 1] == '0' or int(s[len(s) - 1]) < int(s[len(s) - 2]):
	s = s[0:len(s) - 2] + s[len(s) - 1]
	print(int(s))
else:
	s = s[0:len(s) - 1]
	print(int(s))


a = int(input())
if a >= 0:
	print(a)
else:
	a = abs(a)
	a1 = a // 10
	b1 = a // 100
	a2 = b1 * 10
	a2 += a % 10
	if a1 < a2:
		print(-1 * a1)
	else:
		print(-1 * a2)


a = int(input())
if a >= 0:
	print(a)
else:
	z = abs(a) % 10
	r = abs(a) // 10 % 10
	m = -(abs(a) // 100 * 10 + min(z, r))
	print(m)


number = int(input())

def del_last(number):
	str_num = str(number)
	return str_num[:len(str_num) - 1]

def del_sec_last(number):
	str_num = str(number)
	return str_num[:len(str_num) - 2] + str_num[-1]
print(max(number, int(del_last(number)), int(del_sec_last(number))))


def solution():
	n = input()
	if int(n) >= 0:
		print(n)
	elif len(n) == 2:
		print(0)
	elif int(n[:-1]) > int(n[:-2] + n[-1]):
		print(n[:-1])
	else:
		print(int(n[:-2] + n[-1]))
solution()


n = int(input())
if n > 0:
	print(n)
else:
	n = -n
	n1 = n // 10
	n2 = n // 100 * 10 + n % 10
	if n1 < n2:
		ans = -n1
	else:
		ans = -n2
	print(ans)


n = input()
if int(n) < 0:
	a = n[-2:-1]
	b = n[-1:]
	n = n[:-2] + min(a, b)
if n == '-0':
	n = 0
print(n)


A = list(input())
B = [A[i] for i in range(0, len(A) - 1)]
C = [A[i] for i in range(0, len(A) - 2)]
C.append(A[-1])
a = ''
b = ''
c = ''
for i in A:
	a = a + i
for i in B:
	b = b + i
for i in C:
	c = c + i
a = int(a)
b = int(b)
c = int(c)
print(max(a, b, c))


n = int(input())
if n >= 0:
	print(n)
else:
	o = abs(n)
	a = list(map(int, str(o)))
	if a[-1] > a[-2]:
		del a[-1]
	else:
		del a[-2]
	t = ''
	for i in range(len(a)):
		t += str(a[i])
	print(-1 * int(t))


N = input()
if abs(int(N)) == int(N):
	print(N)
	exit()
elif int(N[:-1]) > int(N[:-2] + N[-1]):
	if N[:-1] == '-0':
		print('0')
		exit()
	else:
		print(N[:-1])
		exit()
elif N[:-2] + N[-1] == '-0':
	print('0')
	exit()
else:
	print(N[:-2] + N[-1])
	exit()


n = input()
if int(n) >= 0:
	print(n)
else:
	s1 = int(n[0:-2] + n[-1])
	s2 = int(n[0:-1])
	print(max(s1, s2))


t = int(input())
if t >= 0:
	print(t)
elif t >= -99:
	k = abs(t)
	c1 = k // 10
	c1 = c1 * -1
	c2 = k % 10
	c2 = c2 * -1
	print(f'{max(c1, c2)}')
else:
	c1 = abs(t) // 10
	c2 = c1 // 10 * 10 + abs(t) % 10
	print(f'-{min(c1, c2)}')


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	i = 1
	b = []
	while i <= 2:
		a = n % 10 ** i
		b.append(a)
		i = i + 1
	n1 = b[0]
	n2 = (b[1] - b[0]) / 10
	if n1 >= n2:
		n = -(n - n1) / 10
	else:
		n = -((n - b[1]) / 10 + n1)
	print(int(n))


x = int(input())
z = 0
c = ''
if x >= 0:
	print(x)
else:
	x = list(str(x))
	for i in x[len(x) - 2:len(x)]:
		if int(i) > z:
			z = int(i)
	x.reverse()
	x.remove(str(z))
	x.reverse()
	for j in x:
		c = c + j
	print(int(c))


n = int(input())
if n >= 0:
	print(n)
	exit()
n = list(str(n))
if n[-1] > n[-2]:
	n.pop()
else:
	n.pop(-2)
print(int(''.join(map(str, n))))


n = input()
if n[0] != '-':
	print(n)
elif int(n[-1]) > int(n[-2]):
	print(n[0:-1])
elif len(n) == 3:
	if int(n[-1]) == 0:
		print(n[-1])
	else:
		print(n[0:-2] + n[-1:])
else:
	print(n[0:-2] + n[-1:])


n = int(input())
if n >= 0:
	print(n)
else:
	k = len(str(n))
	l = list(str(n))
	a = l
	if l[k - 2] > l[k - 1]:
		del a[k - 2]
		if ''.join(a) == '-0':
			print('0')
		else:
			print(''.join(a))
	else:
		del a[k - 1]
		if ''.join(a) == '-0':
			print('0')
		else:
			print(''.join(a))


import math
import os
import sys
import re
import string
import itertools
import functools
import operator
from collections import Counter
wealth = input()
if wealth[0] != '-':
	print(wealth)
else:
	print(max(int(wealth[0:-1]), int(wealth[0:-2] + wealth[-1])))


n = input()
if int(n) >= 0:
	print(n)
elif int(n) < 0 and int(n) > -11:
	print('0')
else:
	l = len(n)
	a = n[:l - 1]
	b = n[:l - 2] + n[l - 1:]
	if int(a) > int(b):
		print(int(a))
	else:
		print(int(b))


k = int(input())
num = ''
if k > 0:
	print(k)
else:
	k = -k
	if k // 100 * 10 + k % 10 < k // 10:
		print(-int(k // 100 * 10 + k % 10))
	else:
		print(-int(k // 10))


from sys import stdin
num = stdin.readline()[:-1]
last = b4last = num
if num[-2] != '-':
	last = num[:-1]
	b4last = num[:-2] + num[-1]
print(max(int(num), int(last), int(b4last)))


n = input()
if int(n) >= 0:
	print(n)
else:
	n = n[1:]
	n = list(n)
	x = n[0:len(n) - 2]
	y = n[len(n) - 2:]
	y.remove(max(y))
	q = ''.join(x) + ''.join(y)
	if q == '0':
		print(0)
	else:
		print('-', q, sep='')


A = input()
if int(A) >= 0:
	print(A)
else:
	A = list(A)
	output = ''
	n = len(A)
	if A[n - 1] > A[n - 2]:
		del A[n - 1]
	else:
		del A[n - 2]
	for i in range(n - 1):
		output += A[i]
	if output == '-0':
		print('0')
	else:
		print(output)


x = input()
n = len(x)
if int(x) >= 0:
	print(x)
elif n >= 3:
	a = int(x[0:n - 1])
	b = int(x[0:n - 2] + x[n - 1])
	print(max(a, b))
else:
	print('0')


n = input()
if int(n) > 0:
	print(n)
else:
	check1 = n[:-1]
	check1 = int(check1)
	check2 = n[:-2] + n[-1]
	check2 = int(check2)
	if check1 > check2:
		print(check1)
	else:
		print(check2)


hat = int(input())
if hat >= 0:
	print(hat)
else:
	num = list(str(abs(hat)))
	l = num[-1]
	bl = num[-2]
	if l > bl:
		num.pop(-1)
	else:
		num.pop(-2)
	print(int('-' + ''.join(num)))


n = int(input())
if n >= 0:
	print(n)
	exit()
s = str(n)
print(max(int(s[:len(s) - 1]), int(s[:len(s) - 2] + s[-1])))


import sys
num = input()
tok = num[0]
num = num[1:]
if tok == '-':
	num1 = int(num[:len(num) - 1])
	num2 = int(num[:len(num) - 2] + num[len(num) - 1:])
	if num1 < num2:
		if num1 == 0:
			print(0)
		else:
			print(tok + str(num1))
	elif num2 == 0:
		print(0)
	else:
		print(tok + str(num2))
else:
	print(tok + num)


a = int(input())
if a > 0:
	print(a)
elif int(str(a)[-1]) > int(str(a)[-2]):
	print(str(a)[:-1])
elif str(a)[:-2] + str(a)[-1] == '-0':
	print(0)
else:
	print(str(a)[:-2], str(a)[-1], sep='')


n = input()
m = int(n)
y = []
if m == 0:
	print('0')
if m > 0:
	print(m)
if m < 0:
	x = -m
	p = list(str(x))
	q = []
	for i in p:
		q.append(int(i))
	if q[-1] >= q[-2]:
		del q[-1]
		for a in range(len(q)):
			q[a] = str(q[a])
			y.append(q[a])
		print('-' + ''.join(y))
	elif q[-1] < q[-2]:
		del q[-2]
		for a in range(len(q)):
			q[a] = str(q[a])
			y.append(q[a])
		if q == ['0']:
			print('0')
		elif q[-1] == '0' and q[0] != '0':
			print('-' + ''.join(y))
		else:
			print('-' + ''.join(y))


n = input()
if n[0] == '-':
	(l, p) = (n[-1], n[-2])
	if l > p:
		print(int(n[:-1]))
	else:
		print(int(n[:-2] + l))
else:
	print(n)


n = input()
if n[0] != '-':
	print(n)
else:
	nn = min(n[:-1], n[:-2] + n[-1])
	print('0') if len(nn) == 2 and nn[1] == '0' else print(nn)


datos = list(input())
num = ''
for numero in datos:
	num = num + numero
if datos[0] != '-':
	print(num)
else:
	(L1, num1) = ([], '')
	(L2, num2) = ([], '')
	for indice in range(len(datos)):
		if indice == len(datos) - 2:
			L2.append(datos[indice])
			num2 = num2 + datos[indice]
		elif indice == len(datos) - 1:
			L1.append(datos[indice])
			num1 = num1 + datos[indice]
		else:
			L2.append(datos[indice])
			L1.append(datos[indice])
			(num1, num2) = (num1 + datos[indice], num2 + datos[indice])
	print(max(int(num1), int(num2)))


a = input()
if a[0] != '-':
	print(a)
elif a[-1] >= a[-2]:
	b = a[:-1]
	print(b)
elif a[-2] > a[-1]:
	c = a[:-2] + a[-1]
	if c == '-0':
		print(0)
	else:
		print(c)


x = str(int(input('')))
n = x[:-1]
m = x[:-2] + x[-1]
if int(n) >= int(m) and int(x) < 0:
	print(int(n))
elif int(m) > int(n) and int(x) < 0:
	print(int(m))
else:
	print(x)


n = int(input())
if n >= 0:
	print(n)
else:
	a = (n + -n % 10) / 10
	c = -a % 10
	n = max((n + -n % 10) / 10, a + c - -n % 10)
	print('%d' % n)


a = [int(input())]
temp1 = str(a[0])
temp2 = temp1[0:len(temp1) - 1]
temp3 = temp1[0:len(temp1) - 2] + temp1[-1]
a.append(int(temp2))
a.append(int(temp3))
a.sort()
print(a[-1])


n = int(input(''))
if n > 0:
	print(n)
else:
	n = -n
	a = n % 10
	a = (n - a) / 10
	b = n % 100
	c = n - b
	d = b % 10
	e = d * 10
	f = c + e
	f = f / 10
	g = min(n, a, f)
	print(-int(g))


value = input()
size = len(value)
if value[0] != '-':
	print(value)
elif size == 1:
	print(0)
elif int(value[:-2] + value[-1]) < int(value[:-1]):
	print(int(value[:-1]))
else:
	print(int(value[:-2] + value[-1]))


number = input()
if int(number) >= 0:
	print(number)
else:
	x = int(number[:-1])
	y = int(number[:-2] + number[-1])
	print(max(x, y))


n = input()
k = n[-1]
m = n[-2]
if int(n) < 0:
	if k > m:
		print(int(n[:-1]))
	else:
		x = int(n[:-2] + n[-1])
		if x == 0:
			print(abs(x))
		else:
			print(x)
else:
	print(int(n))


n = int(input())
if n >= 0:
	print(n)
else:
	sn = str(n)
	if int(sn[-2]) > int(sn[-1]):
		ans = sn[:-2] + sn[-1]
	else:
		ans = sn[:-1]
	if int(ans) == 0:
		print(0)
	else:
		print(ans)


n = int(input())
if n >= 0:
	print(n)
	exit(0)
n = '0000000000000000000000000000' + str(abs(n))
if int(n[:-2] + n[-1]) == 0:
	print(0)
	exit(0)
if int(n[:-1]) < int(n[:-2] + n[-1]):
	print('-' + str(int(n[:-1])))
else:
	print('-' + str(int(n[:-2] + n[-1])))


n = int(input())
if n < 0:
	s = str(n)
	n = max(int(s[:-1]), int(s[:-2] + s[-1]))
print(n)


n = input()
y = ''
x = int(n)
m = 0
n = list(n)
if n[len(n) - 1] > n[len(n) - 2]:
	m = len(n) - 1
else:
	m = len(n) - 2
if x > 0:
	print(x)
else:
	for i in range(1, len(n)):
		if i != m:
			y = y + n[i]
	if int(y) != 0:
		print('-', end='')
		print(*y, sep='')
	else:
		print(*y, sep='')


n = input()
a = max(map(int, (n[0:-2] + n[-1], n[0:-1], n)))
print(a)


s = input()
if int(s) >= 0:
	print(s)
else:
	r = ''
	if int(s[len(s) - 2]) > int(s[len(s) - 1]):
		r += s[:-2]
		r += s[len(s) - 1]
	else:
		r += s[:-1]
	print(int(r))


a = input()
mas = list(a)
if int(a) >= 0:
	n = a
elif int(mas[len(mas) - 1]) > +int(mas[len(mas) - 2]):
	del mas[len(mas) - 1]
	n = ''.join(mas)
else:
	del mas[len(mas) - 2]
	n = ''.join(mas)
if n == '-0':
	print(0)
else:
	print(n)


n = input()
if int(n) > 0:
	print(n)
if n == '0':
	print(0)
elif int(n) < 0:
	list0 = []
	for i in n:
		list0.append(i)
	list1 = list(reversed(list0))
	list1.remove(str(max(int(n[len(list0) - 1]), int(n[len(list0) - 2]))))
	list2 = list(reversed(list1))
	m = ''.join(list2)
	if m == '-0':
		print(0)
	else:
		print(''.join(list2))


n = int(input())
z = []
if n >= 0:
	print(n)
else:
	d = str(n)
	if d[0] == '-':
		x = d.replace('-', ' ')
		xd = x[1:]
		a = xd[:-1]
		b = xd[:-2] + xd[-1]
		z.append(int(a) * -1)
		z.append(int(b) * -1)
		print(max(z))


number = str(input())
n = int(number)
if n >= 0:
	print(n)
else:
	n = len(number)
	if n > 2:
		x1 = int(number[n - 1])
		x2 = int(number[n - 2])
		if x1 >= x2:
			k = int(number[0:n - 1])
			print(k)
		else:
			x = int(number[0:n - 2] + str(x1))
			print(x)
	if n == 2:
		print(number)


n = input()
if n[0] == '-':
	print(int(n[:-2] + min(n[-1], n[-2])))
else:
	print(int(n))


n = int(input())
if n < 0:
	n *= -1
	option_1 = n // 10
	option_2 = n // 100 * 10 + n % 10
	print(-1 * min(option_1, option_2))
else:
	print(n)


state = int(input())
if state < 0:
	ss = str(state)
	longth = len(ss)
	a = int(ss[0:longth - 1])
	b = int(ss[0:longth - 2] + ss[longth - 1])
	if a >= b:
		print(a)
	else:
		print(b)
else:
	print(state)


Money = int(input())
if Money < 0:
	Money = str(Money)
	Money = Money[1:]
	Now_Money = list(map(int, list(Money)))
	if len(Now_Money) > 1:
		if Now_Money[-1] < Now_Money[-2]:
			Now_Money.pop(-2)
		else:
			Now_Money.pop(-1)
		wew = '-' + ''.join(list(map(str, Now_Money)))
		if wew == '-0':
			print(0)
		else:
			print(wew)
	else:
		print(0)
else:
	print(Money)


n = input()
bal = int(n)
ans = 0
if bal > 0:
	ans = bal
else:
	n = n.replace('-', '')
	a = n[0:len(n) - 2] + n[len(n) - 2]
	b = n[0:len(n) - 2] + n[len(n) - 1]
	i = int('-' + a)
	j = int('-' + b)
	if i >= j:
		ans = i
	elif i < j:
		ans = j
print(ans)


s = input()
if int(s) >= 0:
	print(s)
elif len(s) == 2:
	print(0)
else:
	print(max(int(s[:len(s) - 1]), int(s[:len(s) - 2] + s[-1])))


n = input()
if n[0] == '-':
	b = int(n[-1])
	c = int(n[-2])
	if b > c:
		n = n[0:-1]
	else:
		n = n[0:-2] + n[-1]
	if int(n) == 0 or len(n) == 1:
		print(0)
	else:
		print(n)
else:
	print(n)


n = int(input())
if n >= 0:
	r = n
else:
	m = str(-1 * n)
	r = ''
	if m[-1] > m[-2]:
		r = m[:len(m) - 1]
	else:
		r = m[:len(m) - 2] + m[len(m) - 1:]
	r = int(r)
	r = -1 * r
print(r)


n = int(input())
if n >= 0:
	print(n)
else:
	b = [int(i) for i in list(str(-n))]
	if b[-1] > b[-2]:
		del b[-1]
	else:
		del b[-2]
	b = [str(k) for k in b]
	print(-int(''.join(b)))


n = int(input())
if n >= 0:
	print(n)
else:
	inter = list(str(n))
	for i in range(1, len(inter)):
		inter[i] = int(inter[i])
	if abs(n) < 10:
		print(0)
		exit()
	if abs(n) < 100:
		if inter[2] == 0:
			print(0)
			exit()
		else:
			inter[1] = min(inter[1], inter[2])
			inter.pop(2)
			for i in inter:
				print(i, end='')
			exit()
	else:
		if inter[len(inter) - 2] > inter[len(inter) - 1]:
			inter[len(inter) - 2] = inter[len(inter) - 1]
			inter.pop(len(inter) - 1)
		else:
			inter.pop(len(inter) - 1)
		for i in inter:
			print(i, end='')


amount = input()
iamount = int(amount)
if iamount >= 0:
	print(iamount)
else:
	iamount = -1 * iamount
	print(-1 * min(iamount // 10, iamount // 100 * 10 + iamount % 10))


n = int(input())
if n >= 0:
	ans = n
else:
	string = str(n)
	if int(string[len(string) - 1]) < int(string[len(string) - 2]):
		ans = string[0:len(string) - 2] + string[len(string) - 1]
	else:
		ans = string[0:len(string) - 1]
ans = int(ans)
print(ans)


money = int(input())
if money >= 0:
	print(money)
elif money >= -10:
	print(0)
elif money == -20:
	print(0)
elif money == -30:
	print(0)
elif money == -40:
	print(0)
elif money == -50:
	print(0)
elif money == -60:
	print(0)
elif money == -70:
	print(0)
elif money == -80:
	print(0)
elif money == -90:
	print(0)
else:
	money = str(money)
	if int(money[-1]) > int(money[-2]):
		print(money[:-1])
	else:
		print(money[:-2] + money[-1])


n = input()
if int(n) < 0:
	if len(n) > 2:
		n = n[:-2] + str(min([n[-1], n[-2]]))
		if n[1] == '0':
			n = 0
print(n)


def mod(n, base):
	if n >= 0:
		return n % base
	else:
		return -1 * (-1 * n % base)
n = int(input())
if n >= 0:
	print(n)
	exit(0)
sv = int(n)
sv = int(sv / 10)
if mod(n, 10) < mod(sv, 10):
	print(int(n / 10))
else:
	print(int(n / 100) * 10 + mod(n, 10))


n = int(input())
if n >= 0:
	print(n)
else:
	st = str(n)
	st = st[1:]
	lst = '-' + str(min(int(st[:len(st) - 1]), int(st[:len(st) - 2] + st[len(st) - 1:])))
	if lst == '-0':
		print('0')
	else:
		print(lst)


i = int(input())
if i >= 0:
	print(i)
else:
	j = str(i)
	(c1, c2) = (j[:len(j) - 1], j[:len(j) - 2] + j[len(j) - 1:])
	if c2 == '-0':
		c2 = '0'
	print({True: c1, False: c2}[int(c1) > int(c2)])


def removeLastDigit(n):
	return -(n // 10)

def removeSecondLastDigit(n):
	i = n % 10
	return -(n // 100 * 10 + i)
n = int(input())
if n >= 0:
	print(n)
else:
	x = removeLastDigit(-n)
	y = removeSecondLastDigit(-n)
	if x > y:
		print(x)
	else:
		print(y)


a = input()
b = int(a)
c = int(a[:-1])
d = int(a[:-2] + a[-1])
if max(b, c, d) == b:
	print(b)
elif max(b, c, d) == c:
	print(c)
else:
	print(d)


n = int(input())
if n >= 0:
	print(n)
else:
	print(max(int(n / 10), int(n / 100) * 10 - -n % 10))


n = int(input())
if n < 0:
	s = str(n)
	p = int(s[:-1])
	q = int(s[:-2] + s[-1])
	print(max(p, q))
else:
	print(n)


s = input()
y = int(s)
for i in [1, 2]:
	t = s[:len(s) - i] + s[len(s) - i + 1:]
	if len(t) and t != '-':
		x = int(t)
		y = max(x, y)
print(y)


line = input()
if int(line) > 0:
	print(line)
else:
	l1 = list(line)
	l2 = l1[:]
	del l1[-1]
	del l2[-2]
	a = ''
	b = ''
	for i in l1:
		a += i
	for j in l2:
		b += j
	if int(a) >= int(b):
		print(int(a))
	else:
		print(int(b))


n = int(input())
if n > 0:
	print(n)
else:
	m = str(-n)
	q = min(int(m[-1]), int(m[-2]))
	o = '-' + m[:-2] + str(q)
	if o == '-0':
		print('0')
	else:
		print(o)


n = int(input())
if n < 0:
	m = -n
	if m > 9:
		a = 10 * (m // 100) + m - 10 * (m // 10)
		b = m // 10
	if a > b:
		n = -b
	else:
		n = -a
print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	m = -n
	m = str(m)
	a = list(m)
	a1 = a[:]
	d = len(a)
	d1 = len(a1)
	del a[d1 - 2]
	del a1[d1 - 1]
	H = ''.join(a)
	HH = ''.join(a1)
	H = int(H)
	HH = int(HH)
	z = min(H, HH)
	print(-z)


t = input()
if int(t) >= 0:
	print(t)
else:
	k1 = int(t[:len(t) - 1])
	k2 = int(t[:len(t) - 2] + t[len(t) - 1])
	print(max(k1, k2))


n = int(input().strip())
if n < 0:
	n *= -1
	n1 = n // 10
	n2 = n // 100 * 10 + n % 10
	print(min(n, n1, n2) * -1)
else:
	n1 = n // 10
	n2 = n // 100 * 10 + n % 10
	print(max(n1, n2, n))


s = input()
if s[0] == '-':
	print(int(s[:-2] + str(min(int(s[-1]), int(s[-2])))))
else:
	print(s)


state = input()
if '-' not in state:
	print(state)
else:
	temp1 = int(state[:len(state) - 1])
	temp2 = int(state[:len(state) - 2] + state[len(state) - 1])
	if temp1 < temp2:
		print(temp2)
	else:
		print(temp1)


s = input().split()[0]
if s[0] == '-':
	if int(s[len(s) - 2]) > int(s[len(s) - 1]):
		s = s[:len(s) - 2] + s[len(s) - 1]
	else:
		s = s[:len(s) - 1]
if s == '-0':
	print(0)
else:
	print(s)


n = int(input())
if n >= 0:
	print(n)
else:
	m = -n
	cl = list(str(m))
	print(-min(int(''.join(cl[:-1])), int(''.join(cl[:-2] + cl[-1:])), m))


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase
from fractions import *

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

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

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = int(input())
if n >= 0:
	print(n)
else:
	n *= -1
	n1 = n % 10
	n //= 10
	n2 = n % 10
	n //= 10
	n = n * 10 + min(n1, n2)
	print(-1 * n)


money = list(input())
x = int(''.join(money))
num = []
if int(''.join(money)) < 0:
	del money[-2]
	num.append(int(''.join(money)))
	money = list(str(x))
	del money[-1]
	num.append(int(''.join(money)))
	print(max(num))
else:
	print(int(''.join(money)))


a = int(input())
if a >= 0:
	print(a)
else:
	n = a * -1
	if n // 10 >= n // 100 * 10 + n % 10:
		print(-1 * (n // 100 * 10 + n % 10))
	else:
		print(n // 10 * -1)


n = input()
if not n[0] == '-':
	print(n)
elif n[len(n) - 1] < n[len(n) - 2]:
	x = n[:len(n) - 2] + n[len(n) - 1]
	print('{}'.format(int(x)))
else:
	print('{}'.format(int(n[:len(n) - 1])))


bank = int(input())

def dellast(num):
	if num < 0:
		num = -num
		return -int((num - num % 10) / 10)
	else:
		return int((num - num % 10) / 10)

def delprelast(num):
	if num < 0:
		num = -num
		return -int((num - num % 100) / 10 + num % 10)
	else:
		return int((num - num % 100) / 10 + num % 10)
print(max(bank, dellast(bank), delprelast(bank)))


n = input()
m = int(n)
x = len(n)
if m > 0:
	y = n
elif n[x - 2] > n[x - 1]:
	y = n[0:x - 2] + n[-1]
else:
	y = n[0:x - 1]
if y == '-0':
	print('0')
else:
	print(y)


n = input()
if '-' not in n:
	print(n)
else:
	n = list(n)
	if int(n[-1]) > int(n[-2]):
		n.pop()
	elif int(n[-1]) < int(n[-2]) or n[-1] == n[-2]:
		n.pop(-2)
	n = ''.join((i for i in n))
	if n == '-0':
		print(0)
	else:
		print(n)


import math
m = int(input())
if m > 0:
	print(m)
else:
	n = math.ceil(m / 10)
	k = math.ceil(n / 10) * 10 - abs(m) % 10
	if n > k:
		print(n)
	else:
		print(k)


import sys
a = input()
b = ''
if int(a) >= 0:
	print(a, end='')
	sys.exit(0)
if int(a[len(a) - 1]) >= int(a[len(a) - 2]) or a[len(a) - 1] == 0:
	for i in range(len(a) - 1):
		b += a[i]
else:
	for i in range(len(a) - 2):
		b += a[i]
	b += a[len(a) - 1]
print(int(b))


n = input()
if n[0] != '-':
	print(n)
elif len(n) == 3 and n[2] == '0':
	print(0)
else:
	t = -1
	for i in range(-2, -1):
		if n[i] > n[i + 1]:
			t = len(n) + i
			break
	if t == -1:
		t = len(n) - 1
	print('-', end='')
	for i in range(1, len(n)):
		if i != t:
			print(n[i], end='')


s = str(input())
x = s[:-1]
y = s[:-2] + s[-1]
print(max(int(s), int(x), int(y)))


s = input()
s = list(s)
k = len(s)
sp = '-10'
if len(s) == 3 and s[0] == '-' and (s[2] == '0'):
	print('0')
elif s[0] == '-':
	if s[k - 1] > s[k - 2]:
		print(''.join(s[0:k - 1]), sep='')
	else:
		print(''.join(s[0:k - 2]), s[k - 1], sep='')
else:
	print(''.join(s))


n = input()
if int(n) >= 0:
	print(n)
	exit()
c1 = n[:-1]
c2 = n[:-2] + n[-1]
n1 = int(c1)
n2 = int(c2)
l = max(n1, n2)
print(l)


n = int(input())
ans = n
if n < 0:
	n = str(abs(n))
	x = min(n[:-2] + n[-1], n[:-1])
	if x == '0':
		ans = 0
	else:
		ans = '-' + x
print(ans)


n = int(input())
l = []
if n > 0:
	print(n)
else:
	a = str(n)
	l.append(a[:-1])
	l.append(a[:-2] + a[-1:])
	if '-0' in l:
		print(0)
	else:
		print(min(l))


num = int(input())
if num >= 0:
	print(num)
else:
	num = 0 - num
	div = num // 10
	mod = num % 10
	divagain = div // 10
	anothermod = mod + divagain * 10
	div = -div
	anothermod = -anothermod
	print(div if div > anothermod else anothermod)


n = input()
if int(n) >= 10:
	print(n)
else:
	a = n[:-2] + n[-1]
	b = n[:-1]
	print(max(map(int, [a, b])))


n = input()
l1 = list(n)
l2 = list(n)
del l1[-1]
del l2[-2]
n1 = ''
n2 = ''
for i in l1:
	n1 = n1 + i
for i in l2:
	n2 = n2 + i
n1 = int(n1)
n2 = int(n2)
n = int(n)
L3 = [n, n1, n2]
print(max(L3))


s = input()
if s[0] == '-':
	n1 = int(s[1:len(s) - 1])
	if len(s) >= 3:
		n2 = int(s[1:len(s) - 2] + s[len(s) - 1])
	else:
		n2 = int(s[len(s) - 1])
	if min(n1, n2) == 0:
		print(0)
	else:
		print('-' + str(min(n1, n2)))
else:
	print(s)


n = input()
if int(n) >= 0:
	print(n)
	exit(0)
else:
	if int(n) > -10:
		print(0)
		exit(0)
	n = list(n)
	if int(n[-1]) >= int(n[-2]):
		n.pop(-1)
	else:
		n.pop(-2)
	print(int(''.join(n)))


num = int(input())
if num < 0:
	num = num * -1
	x = num // 10
	y = num // 100 * 10 + num % 10
	print(-min(num, x, y))
else:
	print(num)


n = int(input())
if n >= 0:
	print(n)
else:
	n *= -1
	a = n % 10
	b = n // 10 % 10
	if a == b:
		print(-1 * (n // 10))
	elif a > b:
		print(-1 * (n // 10))
	else:
		n //= 100
		n *= 10
		print(-1 * (n + a))


n = input()
if not n.startswith('-'):
	print(n)
else:
	n = n[1:]
	if len(n) == 1:
		print('-' + n)
	elif len(n) == 2:
		if (n[0] if int(n[0]) < int(n[1]) else n[1]) == '0':
			print(0)
		else:
			print('-' + (n[0] if int(n[0]) < int(n[1]) else n[1]))
	elif len(n) > 2:
		m = int(n)
		if int(n[:len(n) - 2] + n[len(n) - 1:]) < int(n[:len(n) - 1]):
			print('-' + n[:len(n) - 2] + n[len(n) - 1:])
		else:
			print('-' + n[:len(n) - 1])


n = int(input())
if n < 0:
	n = max(n, int(n / 10), int(n / 100) * 10 - abs(n) % 10)
print(n)


s = input('')
if int(s) == 0:
	print(0)
	exit()
n = s
p = int(s)
n = list(n)
s = list(s)
m = len(s)
del s[m - 1]
del n[m - 2]
s = ''.join(s)
n = ''.join(n)
s = int(s)
n = int(n)
if s < 0 and s >= n:
	print(s)
elif s < 0 and s < n:
	print(n)
else:
	print(p)


n = int(input())
if n == abs(n):
	print(n)
else:
	n1 = int(str(n)[:-1])
	n2 = int(str(n)[:-2] + str(n)[-1])
	if n1 > n2:
		print(n1)
	else:
		print(n2)


n = input()
p = n
if n[0] == '-':
	k = n[:-1]
	j = n[:-2]
	j = j + p[-1]
	if int(j[1:]) == 0:
		print(0)
	elif j > k:
		print(k)
	else:
		print(j)
else:
	print(int(n))


x = input()
if x[0] == '-':
	x = x.replace('-', '')
	l = len(x)
	s = x[:l - 1]
	y = x[:l - 2] + x[l - 1]
	t = int(s)
	z = int(y)
	reS = min(t, z)
	if reS == 0:
		print(0)
	else:
		print('-' + str(reS))
else:
	print(x)


n = list(input())
num = int(''.join(n))
if num >= 0:
	print(num)
elif num <= -1 and num >= -10:
	print(0)
elif num % 10 == 0 and abs(num) < 100:
	print(0)
else:
	last = n[-1]
	second = n[-2]
	if int(last) > int(second):
		indx = len(n) - 1
	else:
		indx = len(n) - 2
	i = 0
	while i < len(n):
		if i != indx:
			print(n[i], end='')
		i += 1
	print()


print((lambda x: x if int(x) >= 0 else int(x[:len(x) - 2] + min(list(x[len(x) - 2:]))))(input()))


n = input()
if int(n) >= 0:
	n0 = int(n)
	print(n0)
else:
	n = n.replace('-', '')
	nn = list(n)
	l = []
	for i in range(len(nn) - 2, len(nn)):
		del nn[i]
		nd = ''.join(nn)
		m = int(nd)
		l.append(m)
		nn = list(n)
	ma = min(l)
	if ma == 0:
		print(ma)
	else:
		print('-', end='')
		print(ma)


string = input()
tam = len(string)
p1 = string[:-1]
p2 = string[:tam - 2] + string[tam - 1]
if int(string) >= int(p1) and int(string) >= int(p2):
	print(int(string))
elif int(p1) >= int(p2):
	print(int(p1))
else:
	print(int(p2))


s = input()
s3 = int(s)
s1 = int(s[:len(s) - 1])
s2 = int(s[:len(s) - 2] + s[len(s) - 1:])
print(max(s2, s1, s3))


n = input()
b = []
if int(n) >= 0:
	print(n)
else:
	m = list(n)
	del m[0]
	if len(m) == 2 and m[1] == '0':
		print(0)
	else:
		l = m[:-1]
		if l[0] != '0':
			b.append(int('-' + ''.join(l)))
		if len(m) > 1:
			l = m[:-2] + m[-1:]
			if l[0] != '0':
				b.append(int('-' + ''.join(l)))
		print(max(b))


i = int(input())
j = str(i)
x = j
k = []
for a in j:
	k.append(a)
if i > 0:
	print(i)
else:
	n1 = j[:len(j) - 1]
	n2 = j[:len(j) - 2] + j[len(j) - 1:]
	i1 = int(n1)
	i2 = int(n2)
	print(max(i1, i2))


n = int(input())
if n >= 0:
	print(n)
elif n > -11:
	print(0)
else:
	my_list = list(str(n))
	if int(my_list[-2]) >= int(my_list[-1]):
		answer = my_list[:-2] + my_list[-1:]
	else:
		answer = my_list[:-1]
	print(int(''.join(answer)))


n = list(input())
if n[0] == '-' and n[-1] >= n[-2]:
	n = n[:-1]
elif n[0] == '-' and n[-1] < n[-2]:
	n[-2] = ''
n = ''.join(n)
if n == '-0':
	n = '0'
print(n)


x = input()
a = int(x)
n = list(x)
n1 = n[:]
n1.pop()
a1 = int(''.join(n1))
n2 = n[:]
n2.pop(-2)
a2 = int(''.join(n2))
print(max(a, a1, a2))


def func(m):
	m_1 = m // 10
	if m > 9:
		m_2 = m // 100 * 10 + m % 10
		return (max(m, m_1, m_2), min(m, m_1, m_2))
	else:
		return (max(m, m_1), min(m, m_1))
account = int(input())
if account > 0:
	print(func(account)[0])
elif account < 0:
	print(-func(-account)[1])
else:
	print(0)


line = input()

def Max(one, two):
	return one if one > two else two

def Compare():
	length = len(line)
	return Max(int(line), Max(int(line[0:length - 1]), int(line[0:length - 2] + line[length - 1:length])))
print(Compare())


num = int(input())
if num > 0:
	print(num)
elif num < 0:
	num = str(num)
	num = num[::-1]
	if int(num[0]) > int(num[1]):
		num = num.replace(num[0], '', 1)
		print(int(num[::-1]))
	elif num[0] < num[1]:
		num = num.replace(num[1], '', 1)
		print(int(num[::-1]))
	elif num[0] == num[1]:
		num = num.replace(num[1], '', 1)
		print(int(num[::-1]))
else:
	print(0)


s = input()
print(max(int(s), max(int(s[:-1]), int(s[:-2] + s[-1]))))


n = str(input())
if n[0] == '-':
	a = int(n[-2:-1])
	b = int(n[-1:])
	t = n[:-2] + str(min(a, b))
	if t == '-0':
		print(0)
	else:
		print(t)
else:
	print(n)


def __starting_point():
	data = input()
	if int(data) >= 0:
		print(data)
	elif len(data) == 2:
		print('0')
	else:
		n = data[1:]
		l1 = n[:len(n) - 1]
		l2 = n[:len(n) - 2] + n[len(n) - 1:]
		ans = min(int(l1), int(l2))
		ans *= -1
		print(ans)
__starting_point()


n = int(input())

def getRest(val):
	val = val % 10
	if val:
		return val - 10
	return val

def getVal(n):
	if n >= 0:
		return n
	m1 = int(n / 10)
	m2 = int(n / 100) * 10 + getRest(n)
	return max(m1, m2)
print(getVal(n))


def main():
	num = str(input())
	val = int(num)
	if val >= 10:
		print(val)
		return
	else:
		a = list(num)
		b = list(num)
		a.pop()
		b.pop(len(b) - 2)
		res_a = ''
		res_b = ''
		for i in a:
			res_a += i
		for i in b:
			res_b += i
		print(max(int(res_a), int(res_b)))
		return
main()


x = input()
z = len(x)
y = [None] * z
for i in range(z):
	y[i] = x[i]
if int(x) < 0:
	if y[z - 1] < y[z - 2]:
		del y[z - 2]
	else:
		del y[z - 1]
	if len(y) == 2 and y[1] == '0':
		for i in range(1, len(y)):
			print(y[i], end='')
	else:
		for i in range(z - 1):
			print(y[i], end='')
else:
	for i in range(z):
		print(y[i], end='')


n = input()
if '-' in n:
	if n[::-1][0] > n[::-1][1]:
		print(int(n[:len(n) - 1]))
	else:
		print(int(n[:len(n) - 2] + n[len(n) - 1]))
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	print(-min(abs(n) // 10, abs(n) // 100 * 10 + abs(n) % 10))


s = input()
n = int(s)
if n >= 0:
	print(n)
else:
	t = s
	t = t[::-1]
	if int(t[0]) >= int(t[1]):
		t = t.replace(t[0], '', 1)
		t = t[::-1]
		tt = int(t)
	else:
		t = t.replace(t[1], '', 1)
		t = t[::-1]
		tt = int(t)
	print(tt)


n = int(input())
if n >= 0:
	print(n)
else:
	n = abs(n)
	if n < 10:
		print(0)
	else:
		t1 = n // 10
		t2 = n % 10 + n // 100 * 10
		res = min(t1, t2)
		print('-%d' % res if res != 0 else 0)


import math
n = input()
if int(n) < 0:
	l = len(n)
	a = n[:l - 1]
	b = n[:l - 2]
	b = ''.join((b, n[l - 1]))
	print(max(int(a), int(b)))
else:
	print(n)


s = input()
if int(s) > 0:
	print(s)
else:
	a = s[:-1]
	b = s[:-2] + s[-1]
	print(max(int(a), int(b)))


n = int(input())
if n > 0:
	print(n)
else:
	n = str(n)
	sb1 = n[0:-1]
	sb2 = n[0:-2] + n[-1]
	print(max(int(sb1), int(sb2)))


bankAccountBalance = int(input())
bankAccountBalanceStr = str(bankAccountBalance)
if bankAccountBalance < 0:
	strLen = len(bankAccountBalanceStr) - 1
	if bankAccountBalanceStr[strLen] > bankAccountBalanceStr[strLen - 1]:
		bankAccountBalanceStr = bankAccountBalanceStr[:strLen]
	else:
		bankAccountBalanceStr = bankAccountBalanceStr[:strLen - 1] + bankAccountBalanceStr[strLen:]
print(int(bankAccountBalanceStr))


n = int(input())
if n >= 0:
	print(n)
else:
	s = list(str(n))
	if int(s[-1]) > int(s[-2]):
		s.pop(-1)
	else:
		s.pop(-2)
	print(int(''.join(s)))


n = int(input().strip())
if n < 0:
	s = str(n)
	n1 = int(s[:-2] + s[-1])
	n2 = int(s[:-1])
	if n1 > n2:
		print(n1)
	else:
		print(n2)
else:
	print(n)


n = input()
a = int(n)
if a >= 0:
	print(a)
else:
	b = list(n)
	if int(b[-1]) >= int(b[-2]):
		b.pop(-1)
	else:
		b.pop(-2)
	c = ''.join(b)
	if int(c) == 0:
		print(0)
	else:
		print(c)


account = input()
if int(account) < 0:
	n = len(account)
	a = list(account)
	if account[n - 1] > account[n - 2]:
		a.pop()
	else:
		del a[n - 2]
	b = ''.join(a)
	if b == '-0':
		print(0)
	else:
		print(b)
else:
	print(int(account))


v2 = input()
n = list((x for x in v2))
v = n[:len(n) - 1]
v1 = n[:len(n) - 2] + list(n[-1])
print(max(int(''.join(v)), int(''.join(v1)), int(v2)))


n = int(input())
if n >= 0:
	print(n)
else:
	k = str(n)
	if k[-1] >= k[-2]:
		k = k[:-1]
	else:
		k = k[:-2] + k[-1]
	print(int(k))


def solve(n):
	if n >= 0:
		return n
	else:
		l = list(str(n))
		if len(l) > 2:
			if int(l[-1]) > int(l[-2]):
				l.pop(-1)
			else:
				l.pop(-2)
			if len(l) == 2 and l[-1] == '0':
				return 0
			return ''.join(l)
		elif len(l) <= 2:
			return 0

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


n = str(input())
if n[0] == '-':
	if n[-1] < n[-2]:
		k = n[:-2] + n[-1]
	else:
		k = n[:-1]
	if len(k) == 2 and k[1] == '0':
		print(k[1])
		exit()
else:
	k = n
print(k)


state = input()
if int(state) >= 0:
	print(state)
else:
	a = state[0:-1]
	b = state[0:-2] + state[-1]
	print(max(int(a), int(b)))


n = input()
a = int(n[:len(n) - 1])
b = int(n[:len(n) - 2] + n[len(n) - 1:])
n = int(n)
print(max(a, b, n))


def sol():
	n = input()
	print(max(int(n), int(n[:len(n) - 1]), int(n[:len(n) - 2] + n[len(n) - 1])))
sol()


n = int(input())
p1 = int(n / 10)
p2 = int(p1 / 10) * 10 - -n % 10
if n >= 0:
	print(n)
elif p1 > p2:
	print(p1)
else:
	print(p2)


a = list(input())
s = ''.join(a)
if int(s) >= 0:
	print(int(s))
else:
	b = list(a)
	b.pop(len(a) - 1)
	c = ''.join(b)
	a.pop(len(a) - 2)
	d = ''.join(a)
	if int(c) > int(d):
		print(int(c))
	else:
		print(int(d))


n = int(input())
print(max(n, int(str(n)[:-1]), int(str(n)[:-2] + str(n)[-1])))


n = input()
nn = int(n)
nnn = list(n)
mmm = list(n)
if nn >= 0:
	print(nn)
else:
	nnn.pop()
	del mmm[-2]
	nnn = ''.join(nnn)
	mmm = ''.join(mmm)
	print(max(int(nnn), int(mmm)))


n = int(input())
if n >= 0:
	print(n)
else:
	n1 = abs(n)
	x = n1 % 10
	n1 = n1 // 10
	n2 = n1 // 10
	n3 = n2 * 10 + x
	if n3 > n1:
		print(-n1)
	else:
		print(-n3)


state = int(input())
if state >= 0:
	print(state)
else:
	n1 = int(-state % 10)
	n2 = int((-state % 100 - n1) // 10)
	if n2 <= n1:
		print(int((state + n1) // 10))
	else:
		print(int(-(-state // 100) * 10 - n1))


def delete_digit(balance):
	str_balance = str(balance)
	if balance >= 0:
		return balance
	elif str_balance[-1] > str_balance[-2]:
		return int(str_balance[0:-1])
	else:
		return int(str_balance[0:-2] + str_balance[-1])
result = delete_digit(int(input()))
print(result)


import math
m = input()
n = int(m)
if n >= 0:
	S = n
elif n >= -10:
	S = 0
elif n < -10:
	k = n * -1
	A = [int(i) for i in str(k)]
	a = A[-2]
	b = A[-1]
	if a > b:
		del A[-2]
	if b >= a:
		del A[-1]
	S = int(''.join(map(str, A)))
	S = S * -1
print(S)


num = int(input())
if num > 0:
	print(num)
else:
	l_num = list(str(num))
	if l_num[-1] > l_num[-2]:
		del l_num[-1]
	else:
		del l_num[-2]
	if l_num == ['-', '0']:
		print('0')
	else:
		print(''.join(l_num))


N = int(input())
if N >= 0:
	print(N)
else:
	N = abs(N)
	X = N % 10
	Y = int(N % 100 / 10)
	N = int(N / 100) * 10
	if X > Y:
		N = N + Y
	else:
		N = N + X
	print(-N)


import math
x = int(input())
if x > 0:
	print(x)
else:
	a = math.floor(abs(x) / 10)
	b = math.floor(abs(x) / 100) * 10 + abs(x) % 10
	if x < 0:
		a *= -1
		b *= -1
	print(max(a, b))


n = list(input())
if n[0] != '-':
	x = ''.join(n)
	print(x)
else:
	if n[-1] > n[-2]:
		n.pop(len(n) - 1)
	else:
		n.pop(len(n) - 2)
	if n == ['-', '0']:
		print(0)
	else:
		x = ''.join(n)
		print(x)


def main():
	n = input()
	num1 = n[:-1]
	num2 = n[:-2] + n[-1]
	num1 = int(num1)
	num2 = int(num2)
	n = int(n)
	print(max(num1, num2, n))
main()


n = input()
if n[0] == '-':
	if len(n) < 3:
		print(0)
	else:
		a = n[-1]
		b = n[-2]
		if a > b:
			print(n[:-1])
		else:
			ans = n[1:-2] + n[-1:]
			if ans == '0':
				print('0')
			else:
				print(n[:-2] + n[-1:])
else:
	print(n)


a = input()
n = len(a)
if int(a) >= 0:
	print(a)
else:
	a = list(a)
	x = a[:len(a) - 1]
	l = a[:len(a) - 2] + a[-1:]
	x = ''.join(x)
	l = ''.join(l)
	if int(x) > int(l):
		if int(x) == 0:
			print(0)
		else:
			print(x)
	elif int(l) == 0:
		print(0)
	else:
		print(l)


s = input()
s1 = list(s)
s2 = list(s)
if s[0] == '-':
	s1.pop(-2)
	s2.pop(-1)
	str1 = ''.join((str(e) for e in s1))
	str2 = ''.join((str(e) for e in s2))
	if str1[1] == '0':
		print('0')
		exit(0)
	if int(str1) > int(str2):
		print(str1)
	else:
		print(str2)
else:
	print(s)


x = eval(input())
if x < 0:
	a = x
	x = str(x)
	x = list(x)
	x.pop(-2)
	count1 = ''
	for i in range(0, len(x)):
		count1 += str(x[i])
	count1 = int(count1)
	if int(a / 10) < count1:
		print(count1)
	else:
		print(int(a / 10))
else:
	print(x)


value = int(input())
if value >= 0:
	print(value)
else:
	positive = -1 * value
	a = positive // 10
	b = positive % 10
	c = positive // 100 * 10 + b
	a *= -1
	c *= -1
	if a != 0 and c != 0:
		print(max(a, c))
	else:
		print(0)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = input()
if int(n) >= 0:
	print(n)
else:
	(a, b) = (list(n), list(n))
	le = len(n) - 1
	a[le] = ''
	fn = ''.join(a)
	b[le - 1] = ''
	sn = ''.join(b)
	if int(fn) > int(sn):
		if fn == '-0':
			print(0)
		else:
			print(fn)
	elif sn == '-0':
		print(0)
	else:
		print(sn)


n = int(input())
if n >= 0:
	print(n)
else:
	n = abs(n)
	d = n % 10
	n = n // 10
	d1 = n % 10
	m = n // 10
	m = m * 10 + d
	m = min(m, n)
	print(-m)


n = str(input())
o1 = int(n[0:len(n) - 1])
o2 = int(n[0:len(n) - 2] + n[len(n) - 1])
n = int(n)
if n > 0:
	print(n)
else:
	print(max(o1, o2))


n = input()
100003
10003
10000
if n[0] != '-':
	print(n)
else:
	if len(n) == 3 and n[2] == '0':
		print(0)
		exit()
	print(n[:len(n) - 2], end='')
	if n[len(n) - 2] < n[len(n) - 1]:
		print(n[len(n) - 2])
	else:
		print(n[len(n) - 1])


n = int(input())
if n < 0:
	last_digit = -n % 10
	second_last = -n / 10 % 10
	if last_digit > second_last:
		n = n / 10
	else:
		n = -1 * (-n / 10 - second_last + last_digit)
print(int(n))


n = int(input())
if n < 0:
	n1 = str(n)
	n2 = ''
	n3 = ''
	for i in range(0, len(n1)):
		if i != len(n1) - 2:
			n2 = n2 + n1[i]
		if i != len(n1) - 1:
			n3 = n3 + n1[i]
	if int(n2) > int(n3):
		print(int(n2))
	else:
		print(int(n3))
else:
	print(n)


from sys import stdin, stdout
state = int(stdin.readline())
if state >= 0:
	stdout.write(str(state))
else:
	lst = list(str(state))
	state_1 = int(''.join(lst[:-1]))
	lst.pop(-2)
	state_2 = int(''.join(lst))
	stdout.write(str(max(state_1, state_2)))


s = input()
if '-' not in s:
	print(s)
else:
	(s1, s2) = (s[:-1], s[:-2] + s[-1])
	print('-' + str(min(int(s1[1:]), int(s2[1:]))) if str(min(int(s1[1:]), int(s2[1:]))) != '0' else str(min(int(s1[1:]), int(s2[1:]))))


n = int(input())
if n > 0:
	print(n)
else:
	n1 = abs(n)
	d_pp = n1 // 10 % 10
	d_p = n1 % 10
	if d_pp == 0:
		print(-(n1 // 10))
	elif d_p > d_pp:
		print(-(n1 // 10))
	else:
		n2 = str(n1)
		n3 = n2[::-1]
		n3 = n3.replace(n3[1], '', 1)
		n3 = n3[::-1]
		print(-int(n3))


s = input()
n = int(s)
if n >= 0:
	print(n)
else:
	s = list(s)
	s.remove('-')
	if max(s[-1], s[-2]) == s[-1]:
		s1 = s[::-1]
		s1.remove(s[-1])
		s = s1[::-1]
	else:
		s1 = s[::-1]
		s1.remove(s[-2])
		s = s1[::-1]
	if ''.join(s) == '0':
		print(0)
	else:
		print('-' + ''.join(s))


c = list(input())
res = []
if c[0] == '-':
	if len(c) >= 3:
		if c[len(c) - 1] > c[len(c) - 2]:
			del c[len(c) - 1]
		else:
			del c[len(c) - 2]
	else:
		c = 0
res = ''
for sym in c:
	res += sym
res = int(res)
print(res)


n = input()
if int(n) >= 0:
	print(n)
	exit()
else:
	a = n[:-1]
	b = n[:-2] + n[-1]
	if a == '-0' or b == '-0':
		print(0)
		exit()
	if int(a) > int(b):
		print(a)
	else:
		print(b)


n = int(input())
if n > 0:
	print(n)
else:
	n = str(n)
	na = n[:len(n) - 2] + n[len(n) - 1]
	nb = n[:len(n) - 1]
	na = int(na)
	nb = int(nb)
	print(max(na, nb))


n = int(input())
s1 = n
if s1 >= 0:
	s2 = n // 10
	s3 = n // 100 * 10 + n % 10
else:
	s2 = n // -10
	s3 = n // -100 * -10 + n % -10
	s2 = -s2
print(max(s1, s2, s3))


n = list(input())
if n[0] == '-':
	if int(n[-1]) > int(n[-2]):
		n[-1] = ''
	else:
		n[-2] = ''
print(int(str(n).replace('[', '').replace(']', '').replace(', ', '').replace("'", '')))


def solve(n):
	if n >= 0:
		return n
	n *= -1
	num_without_last_digit = -(n // 10)
	num_without_second_last_digit = -(n // 100 * 10 + n % 10)
	return max(num_without_last_digit, num_without_second_last_digit)
n = int(input())
print(solve(n))


x = input()
l = len(x)
if int(x) > 0:
	print(x)
else:
	num1 = x[:l - 1]
	num2 = x[:l - 2] + x[-1]
	print(int(min(num1, num2)))


x = int(input())
if x < 0:
	m = abs(x)
	if m % 10 > int(m / 10) % 10:
		print(int(-1 * m / 10))
	else:
		print(-1 * (int(m / 100) * 10 + m % 10))
else:
	print(x)


n = int(input())
if n >= 0:
	print(n)
else:
	c1 = abs(n) // 10
	c2 = abs(n) // 100 * 10 + abs(n) % 10
	if c1 < c2:
		print(-c1)
	else:
		print(-c2)


n = int(input())
a = []
if n >= 0:
	print(n)
else:
	s = str(n)
	s = list(s)
	if int(s[-1]) >= int(s[-2]):
		s = ''.join(s[:-1])
		print(int(s))
	else:
		del s[-2]
		s = ''.join(s)
		print(int(s))


top = input()
test = list(top)
if int(top) < 0:
	(last, before_last) = (int(test[-1]), int(test[-2]))
	get_one = max(last, before_last)
	if get_one == last:
		del test[-1]
	else:
		del test[-2]
result = int(''.join(test))
print(result)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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 pf(s):
	return print(s, flush=True)

def main():
	s = S()
	r = int(s)
	for i in range(max(len(s) - 2, 0), len(s)):
		if s[i] == '-':
			continue
		t = int(s[:i] + s[i + 1:])
		if r < t:
			r = t
	return r
print(main())


import math
n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	if n < 10:
		print(0)
	else:
		nn = n
		tmp = n // 100
		a = int(n % 10)
		b = nn / 10 % 10
		print(int(max(-(tmp * 10 + a), -(tmp * 10 + b))))


n = int(input())
if n >= 0:
	print(n)
else:
	s = str(n)
	if len(s) == 1:
		print(s)
	else:
		t = s[-1]
		p = s[-2]
		if t >= p:
			k = s[:len(s) - 1]
			if int(k) >= 0:
				print(k)
			else:
				print(k)
		else:
			k = s[:len(s) - 2] + str(s[-1])
			if int(k) >= 0:
				print(int(k))
			else:
				print(k)


a = input()
if a[0] == '-':
	a = [a[:-1], a[:-2] + a[-1]][a[-1] < a[-2]]
if a == '-0':
	a = 0
print(a)


n = int(input())
if n >= 0:
	print(n)
else:
	m = str(-n)
	a = len(m)
	m1 = int(m[0:a - 1])
	dd = m[0:a - 2] + m[a - 1]
	m2 = int(dd)
	f = min(m1, m2)
	d = -f
	print(d)


n = int(input())
if n > 0:
	print(n)
else:
	s = list(str(n))
	if s[len(s) - 1] > s[len(s) - 2]:
		del s[len(s) - 1]
		if len(s) == 2 and s[0] == '-' and (s[1] == '0'):
			print('0')
		else:
			print(''.join(s))
	else:
		del s[len(s) - 2]
		if len(s) == 2 and s[0] == '-' and (s[1] == '0'):
			print('0')
		else:
			print(''.join(s))


d = int(input())
if d > 0:
	print(d)
else:
	d = abs(d)
	ara = [int(i) for i in str(d)]
	l = len(ara) - 1
	if ara[l] > ara[l - 1]:
		ara.pop(l)
	else:
		ara.pop(l - 1)
	s = [str(i) for i in ara]
	res = -int(''.join(s))
	print(res)


a = int(input(''))
if a >= 0:
	print(a)
else:
	a = -a
	first_last = a % 10
	second_last = a // 10 % 10
	if first_last > second_last:
		a /= 10
	else:
		a /= 10
		a += first_last - second_last
	a = -int(a)
	print(a)


s = input()
b = int(s)
if b < 0:
	l = len(s)
	n1 = int(s[l - 1])
	n2 = int(s[l - 2])
	if n1 > n2:
		if int(s[1:l - 1]) == 0:
			print('0')
		else:
			print(s[:l - 1])
	elif int(s[1:l - 2] + str(n1)) == 0:
		print('0')
	else:
		print(s[:l - 2] + str(n1))
else:
	print(b)


num = input()
if int(num) >= 0:
	print(num)
else:
	balance = list(num)
	last1 = int(balance[-1])
	last2 = int(balance[-2])
	if last1 > last2:
		del balance[-1]
	else:
		del balance[-2]
	if balance == ['-', '0']:
		print(0)
	else:
		print(''.join(balance))


def test(t):
	if t > 0:
		return t
	else:
		t = t * -1
		a = t // 10
		b = t % 10 + t // 100 * 10
		return max(-a, -b, -t)
t = int(input())
print(test(t))


n = int(input())
if n >= 0:
	print(n)
else:
	str1 = str(n)
	str2 = str(n)
	if len(str1) == 2:
		print(0)
	else:
		str1 = int(str1[:len(str1) - 1])
		str2 = int(str2[:len(str2) - 2] + str2[-1])
		print(max(str1, str2))


n = int(input())
if int(n) > 0:
	print(n)
elif int(n) == 0:
	print(n)
elif int(n) < 0:
	s = int(abs(n) / 10)
	f = abs(n) % 10 + int(abs(n) / 100) * 10
	if s < f:
		print(-s)
	else:
		print(-f)


account = input()
penultimateRemoved = int(account[:-2] + account[-1])
lastRemoved = int(account[:-1])
account = int(account)
if account > penultimateRemoved and account > lastRemoved:
	print(account)
elif penultimateRemoved > account and penultimateRemoved > lastRemoved:
	print(penultimateRemoved)
else:
	print(lastRemoved)


n = int(input())
if n >= 0:
	print(n)
else:
	n = str(n)
	a = list(n.strip())
	b = a[:]
	del a[-1]
	a = int(''.join(a))
	del b[-2]
	b = int(''.join(b))
	print(max(a, b))


n = input()
if n >= '0':
	print(n)
elif len(n) > 2:
	if n[len(n) - 2] >= n[len(n) - 1]:
		t = n[:len(n) - 2] + n[len(n) - 1:]
		if t != '-0' and t != '0':
			print(t)
		else:
			print('0')
	else:
		t = n[:len(n) - 1]
		if t != '-0' and t != '0':
			print(t)
		else:
			print('0')
if len(n) == 2 and n < '0':
	print('0')


x = input()
l = len(x)
a = ''
b = ''
d = 0
if int(x) >= 0:
	print(x)
	d = 1
if d == 0:
	for n in range(0, l):
		if n == l - 1:
			continue
		else:
			a = a + x[n]
	for n in range(0, l):
		if n == l - 2:
			continue
		else:
			b = b + x[n]
	c = int(a)
	d = int(b)
	if c >= d:
		print(c)
	else:
		print(d)


a = str(input())
print(max(int(a), int(a[0:-1]), int(a[0:-2] + a[-1])))


n = input()
if int(n) >= 0:
	print(n)
else:
	a = list(n)
	b = list(n)
	a.pop(-1)
	b.pop(-2)
	a = int(''.join(map(str, a)))
	b = int(''.join(map(str, b)))
	print(a if a > b else b)


n = int(input())
if n > 0:
	print(n)
else:
	n = str(n)
	num = n[0:len(n) - 1]
	num1 = n[0:len(n) - 2] + n[len(n) - 1]
	num = int(num)
	num1 = int(num1)
	if num > num1:
		print(num)
	else:
		print(num1)


import sys
for line in sys.stdin:
	n = line.strip()
	pen = n[-2]
	last = n[-1]
	m = int(n)
	div = abs(int(n)) // 10
	aux = abs(int(n)) // 100
	aux *= 10
	aux += int(last)
	if m < 0:
		div *= -1
		aux *= -1
	if int(n) >= 0:
		print(n)
	elif div > aux:
		print(div)
	else:
		print(aux)


import math
import sys

def main():
	n = int(input())
	if n > 0:
		return n
	elif n == 0:
		return 0
	elif -10 < n <= -1:
		return 0
	else:
		a = int(str(n)[:len(str(n)) - 1])
		b = int(str(n)[:len(str(n)) - 2] + str(n)[-1])
		return max(a, b)
print(main())


s = int(input())
if s >= 0:
	print(s)
else:
	a = str(s)
	n = len(a)
	k = max(int(a[:n - 1]), int(a[:n - 2] + a[-1]))
	print(k)


n = int(input())
if n > 0:
	print(n)
elif len(str(n)) == 2:
	print(n)
else:
	m = [i for i in str(n)]
	k = [j for j in str(n)]
	m.pop()
	k.pop(len(k) - 2)
	print(max(int(''.join(k)), int(''.join(m))))


x = input()
if x[0] == '-':
	n = len(x) - 1
	if x[n] > x[n - 1]:
		x = x[:n]
	else:
		x = x[:n - 1] + x[n]
x = int(x)
print(x)


n = int(input())
count1 = n
count2 = int(float(n) / 10)
count3 = n
count3 = str(count3)
count4 = count3[0:-2]
count4 += count3[-1]
count4 = int(count4)
print(max(count4, count1, count2))


n = int(input())
if n >= 0:
	print(n)
elif n < 0:
	a = list(str(n))
	b = a[:]
	del a[-1]
	del b[-2]
	A = ''
	B = ''
	for i in a:
		A = A + i
	for i in b:
		B = B + i
	a = int(A)
	b = int(B)
	print(max(a, b))


import sys
import math
import heapq
from collections import defaultdict, deque
input = sys.stdin.readline

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
a = input()
if int(a) >= 0:
	print(int(a))
elif a[-2] >= a[-3]:
	print(int(a[:-2]))
else:
	print(int(a[:-3] + a[-2]))


n = int(input())
if n > 0:
	print(n)
else:
	x = list(str(-1 * n))
	if x[-1] > x[-2]:
		x.pop(-1)
	else:
		x.pop(-2)
	s = ''
	for i in x:
		s += i
	print(int(s) * -1)


s = input()
if int(s) >= 0:
	print(int(s))
elif 0 > int(s) >= -10:
	print(0)
elif int(s) < -10:
	l1 = list(s)
	if l1[-1] > l1[-2]:
		l1.pop(-1)
	else:
		l1.pop(-2)
	print(int(''.join(l1)))


n = int(input())

def lep(n):
	if n > 0:
		return n
	r = abs(n)
	rem1 = r % 10
	rem2 = int(r % 100 / 10)
	if rem1 > rem2:
		ans = int(r / 10)
	elif rem2 >= rem1:
		ans = int(r / 10) - rem2 + rem1
	return -ans
print(lep(n))


n = int(input())
if n < 0:
	n = abs(n)
	s = str(n)
	l = len(s)
	s1 = s[:l - 1]
	s1 = int(s1)
	s2 = s[:l - 2] + s[l - 1]
	s2 = int(s2)
	if s1 > s2:
		print(-s2)
	else:
		print(-s1)
else:
	print(n)


x = input()
s = ''
if int(x) >= 0:
	print(x)
else:
	x = list(x)
	a = x.pop(0)
	if x[-1] >= x[-2]:
		x.pop(-1)
	else:
		x.pop(-2)
	for i in x:
		s += i
	if s[0] == '0':
		print(s)
	else:
		print(a + s)


n = int(input())
if n >= 0:
	print(n)
if n <= -100:
	n = abs(n)
	a = n % 10
	b = n % 100
	b = b // 10
	if a > b:
		print('-', end='')
		print(n // 100, end='')
		print(b)
	else:
		print('-', end='')
		print(n // 100, end='')
		print(a)
if n < 0 and n > -100:
	n = abs(n)
	a = n % 10
	b = n // 10
	if a > b:
		print(-b)
	else:
		print(-a)


n = input()
if n[0] != '-':
	print(n)
else:
	last = n[-1]
	sec = n[-2]
	if last > sec:
		print(n[:-1])
	else:
		ans = n[:-2] + last
		if ans[1:] == '0':
			print('0')
		else:
			print(ans)


def myfun(n):
	if n >= 0:
		return n
	else:
		n1 = int(n / 10)
		s = str(n)
		s1 = s[0:len(s) - 2] + s[len(s) - 1]
		n2 = int(s1)
		return max(n1, n2)
n = int(input())
print(myfun(n))


balance = input()
balance_copy = list(balance)
del balance_copy[len(balance) - 2]
first_bal = balance[:-1]
second_bal = balance_copy
int1 = int(first_bal)
int2 = int(''.join(second_bal))
if int(balance) >= 0:
	print(balance)
elif int1 > int2:
	print(int1)
else:
	print(int2)


x = list(input())
print(max(int(''.join(x)), int(''.join(x[:-1])), int(''.join(x[:-2] + x[-1:]))))


money = int(input())
money_str = str(money)
if money > 0:
	print(money)
elif money_str[0:].find('00') > -1:
	print(money_str[0:-1])
elif money % 10 >= 0:
	if money_str[-1] < money_str[-2]:
		print(int(money_str[0:-2] + money_str[-1]))
	else:
		print(int(money_str[0:-1]))


a = int(input())
if a >= 0:
	print(a)
else:
	a = -1 * a
	a = str(a)
	ans = []
	ans.append(a[0:-1])
	if len(a) >= 2:
		ans.append(a[0:-2] + a[-1])
	ans = [int(i) for i in ans]
	a = min(ans)
	if ans.count(0) >= 1:
		print(0)
	else:
		print(-a)


n = input()
a = []
b = []
if int(n) >= 0:
	print(int(n))
elif int(n) <= -10:
	for i in str(n):
		a.append(i)
	c = (int(n) + int(a[len(n) - 1])) // 10
	a.pop(len(n) - 2)
	d = int(''.join(a))
	print(max(c, d))
else:
	print(0)


n = int(input())
if n >= 0:
	print(n)
elif len(str(n)) > 2:
	abs_n = -n
	abs_n_1 = str(abs_n)[:-1]
	abs_n_2 = str(abs_n)[:-2] + str(abs_n)[-1]
	print(-1 * min(int(abs_n_1), int(abs_n_2)))
else:
	print(0)


n = int(input())
if n >= 0:
	print(n)
else:
	a = list(str(n))
	if len(a) <= 2:
		print('0')
	else:
		s = ''
		t = ''
		for i in range(len(a) - 1):
			s += a[i]
		for i in range(len(a) - 2):
			t += a[i]
		t += a[len(a) - 1]
		(s, t) = (int(s), int(t))
		if s > t:
			print(s)
		else:
			print(t)


s = input()
ans = -1000000000
for i in range(len(s) - 2, len(s)):
	if s[i] == '-':
		continue
	s1 = ''
	for j in range(0, len(s)):
		if j == i:
			continue
		s1 += s[j]
	ans = max(ans, int(s1))
print(max(ans, int(s)))


n = input()
a1 = int(n)
a2 = int(n[:len(n) - 1])
a3 = int(n[:len(n) - 2] + n[len(n) - 1])
print(max(a1, a2, a3))


penazi = input()
if int(penazi) < 0:
	nove = penazi[:-2] + min(penazi[-1], penazi[-2])
else:
	nove = penazi
print(int(nove))


n = int(input())
if n >= 0:
	print(n)
else:
	a = str(n)
	a = a[1:]
	if len(a) > 2:
		a = a[::-1][1:][::-1]
		num1 = int(a)
		a = str(n)
		a = a[1:]
		b = a[::-1]
		p1 = b[0]
		p2 = b[2:]
		p = p1 + p2
		p = p[::-1]
		num2 = int(p)
		small = min(num1, num2)
		print(-1 * small)
	elif len(a) == 2:
		m = a[0]
		n = a[1]
		small = min(int(m), int(n))
		print(-1 * small)


import sys
n = int(sys.stdin.readline())
ans = n
if n < 0:
	strN = str(n)
	if strN[len(strN) - 2] != '0':
		lstN = list(strN)
		a = int(lstN[len(strN) - 2])
		b = int(lstN[len(strN) - 1])
		if a > b:
			del lstN[len(strN) - 2]
		else:
			del lstN[len(strN) - 1]
		ans = int(''.join(lstN))
	else:
		lstN = list(strN)
		del lstN[len(strN) - 1]
		ans = int(''.join(lstN))
print(ans)


stra = input()
inta = int(stra)
intb = int(stra[:len(stra) - 1])
intc = int(stra[:len(stra) - 2] + stra[len(stra) - 1])
print(max(inta, intb, intc))


n = int(input())
if n < 0:
	k = list(str(n))
	l = k.copy()
	k.pop(-2)
	k.pop(0)
	l.pop(-1)
	l.pop(0)
	m = ''.join(k)
	o = ''.join(l)
	u = min(m, o)
	print(-int(u))
else:
	print(n)


n = int(input())
sign = n / abs(n)
n = abs(n)
n1 = n // 10
n2 = n // 100 * 10 + n % 10
print(max(int(n * sign), int(n1 * sign), int(n2 * sign)))


ip = int(input())
if ip > 0:
	print(ip)
else:
	st = str(ip)
	first = int(st[:-1])
	second = int(st[:-2] + st[-1])
	if first > second:
		print(first)
	else:
		print(second)


def parse_input() -> int:
	return int(input())

def solve(n: int) -> int:
	if n > 0:
		return n
	if n < 0 and len(str(n)) == 2:
		return 0
	if n < 0:
		last_removed = int(str(n)[:-1])
		penultimate_removed = int(str(n)[:-2] + str(n)[-1])
		return max(last_removed, penultimate_removed)
print(solve(parse_input()))


TN = 1

def solution():
	n = int(input())
	if n >= 0:
		print(n)
	else:
		print(max(int(str(n)[:-1]), int(str(n)[:-2] + str(n)[-1])))
while TN != 0:
	solution()
	TN -= 1


a = int(input())
if a > 0:
	print(a)
else:
	yo = str(a)
	p = int(yo[-1])
	q = int(yo[-2])
	if p > q:
		ans = yo[:-1]
		print(int(ans))
	else:
		ans = yo[:-2] + yo[-1]
		print(int(ans))


n = int(input())
if n > 0:
	print(n)
else:
	s = str(n)
	s = s[1:]
	s = list(s)
	try:
		maxi = max(s[-1], s[-2])
		if maxi == s[-1]:
			s = s[0:-1]
		else:
			t = s.pop()
			s.pop()
			s.append(t)
	except:
		pass
	if s[0] == '0':
		print(''.join(s))
	else:
		print('-' + ''.join(s))


s = input()
n = int(s)
x = len(s)
a = s[:-1]
b = s[:-2] + s[-1]
x = int(a)
y = int(b)
if n > 0:
	print(n)
elif x > y:
	print(x)
else:
	print(y)


from math import *
n = int(input())
if n >= 0:
	print(n)
	return
n = -n
S = str(n)
L = []
L.append(n)
if len(S) >= 2:
	S1 = S[:len(S) - 1]
	L.append(S1)
if len(S) >= 2:
	S1 = S[:len(S) - 2] + S[len(S) - 1]
	L.append(S1)
for i in range(len(L)):
	L[i] = int(L[i])
print(-1 * min(L))


import sys
x = int(input())
if x >= 0:
	print(x)
elif x >= -9:
	print(0)
else:
	x = str(x)
	a = int(x[0:-1])
	b = int(x[0:-2] + x[-1])
	print(max(a, b))


x = input()
a = ''
b = ''
i = int(0)
if int(x) <= 0:
	while i < x.__len__() - 1:
		if i != x.__len__() - 2:
			b += x[i]
		a += x[i]
		i = i + 1
	b += x[x.__len__() - 1]
	print(max(int(a), int(b)))
else:
	print(x)


n = int(input())
h = str(n)
x = len(h)
a = int(h[:x - 1])
b = int(h[:x - 2] + str(h[-1]))
if a >= n and a >= b:
	print(a)
elif b >= n and b >= a:
	print(b)
else:
	print(n)


n = int(input())
l = []
n = str(n)
l.append(int(n[:-1]))
a = n[:-2] + n[-1]
l.append(int(a))
n = int(n)
if max(l) > n:
	print(max(l))
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	n = str(n)
	if n[-1] > n[-2]:
		n = n[:len(n) - 1]
	else:
		n = n[:len(n) - 2] + n[-1]
	print(int(n))


def mb(ns):
	n = int(ns)
	if n >= 0:
		return n
	return max(int(ns[:-1]), int(ns[:-2] + ns[-1]))
print(mb(input()))


n = int(input())
if n > 0:
	print(n)
else:
	account = str(n)
	account = min(account[:-1], account[:-2] + account[-1])
	print(int(account))


A = int(input())
sign = -1 if A < 0 else 1
A = abs(A)
print(max(sign * A, sign * (A // 10), sign * (A // 100 * 10 + A % 10)))


num = int(input())
if num > 0:
	print(num)
	exit()
else:
	num1 = int(str(num)[:-1])
	num2 = int(str(num)[:-2] + str(num)[len(str(num)) - 1])
print(max(num1, num2))


s = input()
if int(s) < 0:
	a = int(s[-1])
	b = int(s[-2])
	if a > b:
		s = s[:len(s) - 1]
	else:
		s = s[:len(s) - 2] + s[-1]
s = int(s)
print(s)


n = int(input())
if n >= 0:
	print(n)
else:
	n = str(n)
	s1 = int(n[-1])
	s2 = int(n[-2])
	if s1 < s2:
		n = n[:-2] + n[-1]
	else:
		n = n[:-1]
	if n == '-0':
		print(0)
	else:
		print(n)


def func(n):
	if n > 0:
		print(n)
	else:
		l = [x for x in str(n)]
		temp1 = l.copy()
		temp2 = l.copy()
		temp1.pop()
		temp2.pop(-2)
		if ''.join(temp1) == '-0':
			print(0)
			return
		elif ''.join(temp2) == '-0':
			print(0)
			return
		if int(''.join(temp1)) > int(''.join(temp2)):
			print(''.join(temp1))
		else:
			print(''.join(temp2))
n = int(input())
func(n)


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	p = n % 10
	pp = n // 10 % 10
	if p >= pp:
		n = n // 10
		n = -n
		print(n)
	else:
		n = n // 100 * 10 + n % 10
		n = -n
		print(n)


n = input()
if int(n) < 0:
	n = max(int(n[:-1]), int(n[:-2] + n[-1]))
print(int(n))


bank_bal = input()
len_bal = len(bank_bal)
print(max(int(bank_bal), int(bank_bal[:len_bal - 2] + bank_bal[len_bal - 1]), int(bank_bal[:len_bal - 1])))


s = input()
if s[0] == '-':
	if len(s) == 3:
		print(max(int(s[:len(s) - 1]), int('-' + s[-1])))
	else:
		print(max(int(s[:len(s) - 1]), int(s[:len(s) - 2] + s[-1])))
else:
	print(s)


n = int(input())
if n > -1:
	print(n)
else:
	s = str(n)[1:]
	(x, y) = (int(s[:-2] + s[-1]), int(s[:-1]))
	z = min(x, y)
	if z > 0:
		print('-' + str(min(x, y)))
	else:
		print(str(min(x, y)))


account = input()
print(max(int(account[:-1]), int(account[:-2] + account[-1]), int(account)))


n = int(input())
if n >= 0:
	print(n)
else:
	foo = -n % 100
	n += foo
	foo = min(foo // 10, foo % 10)
	n = n // 10
	n -= foo
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	sn = str(n)
	nn = list(sn)
	if nn[-2] == '-':
		print(0)
	else:
		if int(nn[-1]) > int(nn[-2]):
			nn.pop(-1)
		else:
			nn.pop(-2)
		k = len(nn)
		n = 0
		for i in range(1, k):
			n = n * 10
			n = n + int(nn[i])
		n = n * -1
		print(n)


x = input()
val1 = 0
val2 = 0
str1 = None
if int(x) > 0:
	print(x)
else:
	val1 = int(x[:len(x) - 1])
	str1 = x[:len(x) - 2]
	str1 += x[len(x) - 1]
	val2 = int(str1)
	if val1 >= val2:
		print(val1)
	else:
		print(val2)


def IiyaAndBankAccount(balance):
	if balance >= 0:
		return balance
	else:
		lastDigit = abs(balance) % 10
		balance = int(abs(balance) / 10)
		lastSecondDigit = abs(balance) % 10
		balance = int(abs(balance) / 10)
		result = ''
		if abs(balance) == 0:
			if min(lastDigit, lastSecondDigit) == 0:
				return 0
		else:
			result = str(balance)
		return '-' + result + str(min(lastDigit, lastSecondDigit))
n = int(input())
print(IiyaAndBankAccount(n))


n = input()
list1 = list(n)
if list1[0] == '-':
	if list1[-1] > list1[-2]:
		list1.pop(-1)
	else:
		list1.pop(-2)
	list1 = ''.join(list1)
	num = int(list1)
	if not num:
		print(0)
	else:
		print(num)
else:
	print(n)


a = int(input())
b = a * -1
b10 = b % 10
b100 = b % 100 // 10
if a >= 0:
	print(a)
elif a > -10:
	print(0)
elif b10 == b100:
	print(a // -10 * -1)
elif a > -100:
	print(min(b10, b // 10) * -1)
elif b100 > b10:
	print((b // 100 * 10 + b10) * -1)
else:
	print(a // -10 * -1)


n = input()
ans = 0
str1 = n
str2 = n[:-1]
str3 = n[:-2] + n[-1]
m = max(int(str1), int(str2), int(str3))
print(m)


n = int(input())
if n >= 0:
	print(n)
else:
	n1 = list(str(n))
	n1.pop(len(n1) - 1)
	n1 = int(''.join(n1))
	n2 = list(str(n))
	n2.pop(len(n2) - 2)
	n2 = int(''.join(n2))
	print(max(n1, n2))


j = input()
s = int(j)
if s >= 0:
	print(s)
elif len(j) == 2:
	print(0)
else:
	result = j[:-2] + j[-2:].replace(max(j[-1], j[-2]), '', 1)
	print(result if result != '-0' else result[1:])


N = input()
A = list(N)
B = list(N)
del A[-1]
del B[-2]
C = int(''.join(A))
D = int(''.join(B))
if int(N) > 0:
	print(int(N))
elif C > D:
	print(C)
else:
	print(D)


a = int(input())
if a < 0:
	b = 0 - a
	if b >= 10:
		b1 = b % 10
		b2 = (b % 100 - b1) / 10
		c = b - b1 - b2 * 10
		bmin = min(b1, b2)
		ans = 0 - (c / 10 + bmin)
	else:
		ans = 0
else:
	ans = a
print(int(ans))


s = input()
if s[0] == '-':
	a1 = int(s[:-1])
	a2 = int(s[:-2] + s[-1])
	if a1 > a2:
		print(a1)
	else:
		print(a2)
else:
	print(s)


x = input()
c = []
c1 = []
re = ''
re1 = ''
if int(x) == 0 or int(x) > 0:
	print(x)
else:
	for i in range(1, len(x)):
		c.append(x[i])
		c1.append(x[i])
	del c[-1]
	for i in c:
		re = re + i
	del c1[-2]
	for i in c1:
		re1 = re1 + i
	p = int(re)
	p1 = int(re1)
	if p > p1:
		if re1 == '0':
			print('0')
		else:
			print('-' + re1)
	elif re == '0':
		print('0')
	else:
		print('-' + re)


def f():
	string = input()
	x = int(string)
	if x >= 0:
		print(x)
	else:
		string = list(string)
		a = string[-1]
		b = string[-2]
		if a > b:
			string.pop(-1)
		elif a < b:
			string.pop(-2)
		else:
			string.pop(-2)
		if len(string) == 2 and string[1] == '0':
			print('0')
			return
		print(*string, sep='')
f()


n = int(input())
if n == abs(n):
	print(n)
else:
	p = abs(n)
	a = [int(x) for x in str(p)]
	if a[-1] > a[-2]:
		a.pop(-1)
	else:
		a.pop(-2)
	for i in range(len(a)):
		a[i] = str(a[i])
	if a[0] == '0':
		print(0)
	else:
		print('-' + ''.join(a))


a = int(input())
if a >= 0:
	print(a)
	exit()
a = abs(a)
ans = a
b = a // 10
if b < ans:
	ans = b
c = int(str(a // 100) + str(a % 10))
if c < ans:
	ans = c
print(ans * -1)


n = input()
n_last = n[0:len(n) - 1]
n_prelast = n[0:len(n) - 2] + n[len(n) - 1:len(n)]
ns = [int(n), int(n_last), int(n_prelast)]
print(max(ns))


balance = int(input())
if balance >= 0:
	print(balance)
else:
	balance_str = str(balance)
	len_balance_str = len(balance_str)
	number_1 = int(balance_str[:len_balance_str - 1])
	number_2 = int(balance_str[:len_balance_str - 2] + balance_str[-1])
	if number_1 > number_2:
		print(number_1)
	else:
		print(number_2)


s = input()
a = []
for i in range(len(s)):
	a.append(s[i])
s = ''
for i in range(len(a)):
	s += a[i]
max = int(s)
i = 0
s = ''
while i < len(a) - 1:
	s += a[i]
	i += 1
if int(s) > max:
	max = int(s)
a[len(a) - 2] = a[len(a) - 1]
i = 0
s = ''
while i < len(a) - 1:
	s += a[i]
	i += 1
if int(s) > max:
	max = int(s)
print(max)


n = int(input())
if n > 0:
	print(n)
else:
	if n > -11:
		print(0)
		quit()
	else:
		l = list(str(n))
		if int(l[-1]) < int(l[-2]):
			l[-2] = l[-1]
		n = int(''.join(l))
	print(int(n / 10))


def last(n):
	return -(-n // 10)

def onetolast(n):
	k = -n % 10
	return -(-n // 100 * 10 + k)
n = int(input())
if n < 0:
	if onetolast(n) >= last(n):
		print(onetolast(n))
	else:
		print(last(n))
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	if n % 10 > n // 10 % 10:
		ans = str(n)[:-1]
	else:
		ans = str(n)[:-2] + str(n)[-1]
	if ans == '0':
		print(0)
	else:
		print('-' + ans)


s = input()
if s[0] != '-':
	print(s)
else:
	k = int(s[1:]) // 10
	k -= k % 10
	k += int(s[-1])
	l = int(s[1:]) // 10
	if l == 0 or k == 0:
		print(0)
	else:
		print('-' + str(min(k, l)))


def balance(n):
	if n > 0:
		return n
	else:
		number = str(n)
		l = len(number)
		no1 = number[:l - 2] + number[l - 1]
		no2 = number[:l - 1]
		if int(no1) > int(no2):
			return int(no1)
		else:
			return int(no2)
n = int(input())
print(balance(n))


n = int(input())
m = abs(n)
if n < 0:
	l = -(m // 10)
	bl = -(m // 100 * 10 + m % 10)
	print(max(l, bl))
else:
	print(n)


n = input()
if int(n) >= 0:
	print(n)
else:
	l = list(n)
	if int(l[len(l) - 1]) > int(l[len(l) - 2]):
		l.pop(len(l) - 1)
	else:
		l.pop(len(l) - 2)
	ans = ''
	n = ans.join(l)
	print(int(n))


n = int(input())
if n >= 0:
	print(n)
else:
	x0 = -(-n // 10)
	x1 = -(-n // 100 * 10 + -n % 10)
	print(max(x0, x1))


m = input()
if int(m) < 0:
	o = int(m[:-1])
	t = int(m[:-2] + m[-1])
	if o >= t:
		print(o)
	else:
		print(t)
else:
	print(int(m))


n = int(input())
k = abs(n) // 10
n = str(n)
lst = []
for i in n:
	lst.append(i)
lst.pop(len(n) - 2)
result = ''.join(lst)
if int(n) < 0:
	print(max(int(n), -k, int(result)))
else:
	print(max(int(n), k, int(result)))


n = int(input())
if n >= 0:
	print(n)
else:
	s = str(-n)
	b = []
	temp = ''
	for i in range(len(s) - 1):
		temp = temp + s[i]
	b.append(int(temp))
	temp = ''
	for i in range(len(s) - 2):
		temp = temp + s[i]
	temp = temp + s[len(s) - 1]
	b.append(int(temp))
	print(-min(b[0], b[1]))


n = input()
ls = list(n)
ln = len(ls)
if ls[0] != '-':
	print(n)
else:
	if int(ls[ln - 1]) < int(ls[ln - 2]):
		del ls[ln - 2]
	else:
		del ls[ln - 1]
	if all((i == '0' for i in ls[1:ln - 1])):
		print(0)
	else:
		print(''.join(ls))


n = int(input())
if n >= 0:
	print(n)
else:
	n = n * -1
	k1 = n // 10 * -1
	k2 = (n // 100 * 10 + n % 10) * -1
	print(max(k1, k2))


a = int(input())
if a >= 0:
	num1 = a
else:
	a = str(a)
	l1 = list(a)
	l1.remove('-')
	if len(l1) == 1:
		num1 = 0
	else:
		pri1 = l1[-1]
		pri2 = l1[-2]
		if int(pri1) > int(pri2):
			l1.pop(len(l1) - 1)
		else:
			l1.pop(len(l1) - 2)
	str1 = '-'
	for i in l1:
		str1 += i
	num1 = str1
	if str1 == '-0':
		num1 = '0'
print(num1)


n = int(input())
if n > 0:
	print(n)
else:
	z = -n
	d = []
	d.append(n)
	zz = z // 10
	d.append(-zz)
	y = z % 10
	z = z // 100
	z = z * 10 + y
	d.append(-z)
	print(max(d))


n = input()
s = list(n)
if s[0] == '-':
	if s[len(s) - 1] < s[len(s) - 2]:
		s[len(s) - 2] = s[len(s) - 1]
	if s[1] == '0':
		print(0)
	else:
		for i in range(len(s) - 1):
			print(s[i], end='')
else:
	print(n)


from sys import stdout
rawNum = input()
num = int(rawNum)
if num > -1:
	stdout.write(rawNum)
else:
	dgt1 = len(rawNum) - 1
	dgt2 = len(rawNum) - 2
	dgtRm = dgt1 if rawNum[dgt1] > rawNum[dgt2] else dgt2
	out = list(rawNum)
	out[dgtRm] = ''
	out = ''.join(out)
	out = '0' if out == '-0' else out
	stdout.write(out)


t = input()
if t[0] == '-':
	print(max(int(t[:-1]), int(t[:-2] + t[-1])))
else:
	print(t)


n = input()
las = int(n[:-1])
sla = int(n[:-2] + n[-1])
n = int(n)
if las >= sla and las >= n:
	print(las)
elif sla >= las and sla >= n:
	print(sla)
else:
	print(n)


import sys
from sys import stdin, stdout
import math
import random
import heapq
from collections import Counter
from functools import lru_cache
try:
	for _ in range(1):
		n = input()
		if n[0] == '-':
			if int(n[-1]) > int(n[-2]):
				print(n[:-1])
			else:
				ans = int(n[:-2] + n[-1])
				print(ans)
		else:
			print(n)
except EOFError as e:
	print(e)


n = input()
k = int(n)
res = ''
if k >= 0:
	res = n
elif n[-2] >= n[-1]:
	res = n[:-2] + n[-1]
else:
	res = n[:-1]
if res == '-0':
	res = '0'
print(res)


str = list(input())
if str[0] != '-':
	print(''.join(str))
else:
	if str[-1] > str[-2]:
		del str[-1]
	else:
		del str[-2]
	if len(str) == 2 and str[1] == '0':
		del str[0]
	print(''.join(str))


n = int(input())
if n >= 0:
	print(n)
else:
	num = str(n).lstrip('-')
	s = len(num)
	if s == 1:
		print(0)
	elif int(num[:s - 1]) > int(num[:s - 2] + num[s - 1]):
		if not num[:s - 2] + num[s - 1] == '0':
			print('-' + num[:s - 2] + num[s - 1])
		else:
			print(0)
	else:
		print('-' + num[:s - 1])


n = int(input())
if n >= 0:
	print(n)
else:
	ns = str(n)
	if len(ns) == 1:
		print(0)
	else:
		l = []
		s1 = str()
		s2 = str()
		for i in ns:
			if i != '-':
				l.append(i)
		for i in range(len(l)):
			if i != len(l) - 2:
				s1 += l[i]
			if i != len(l) - 1:
				s2 += l[i]
		if s1 == '0' or s2 == '0':
			print(0)
		else:
			print('-{}'.format(min(s1, s2)))


n = str(input())
t = len(n)
if '-' in n:
	c = int(n[t - 2]) > int(n[t - 1])
	d = not c
	n = n[:t - 2] + n[t - 2 + c:t - 1 * d]
	print(int(n))
else:
	print(int(n))


n = input()
if n[0] != '-':
	print(n)
	exit(0)
print(-min(int(n[1:-1]), int(n[1:-2] + n[-1])))


def a(n):
	n.pop(-1)
	return int(''.join(n))

def b(n):
	n.pop(-2)
	return int(''.join(n))
n = list(str(input()))
flag = 1
if n[0] == '-':
	n.pop(0)
	flag = -1
m = int(''.join(n))
x = []
x.extend(n)
y = []
y.extend(n)
if flag == 1:
	print(max(m, a(x), b(y)))
else:
	print(flag * min(m, a(x), b(y)))


s = input()
if int(s) >= 0:
	print(int(s))
else:
	s1 = s[:-1]
	s2 = s[:-2] + s[-1]
	print(max(int(s1), int(s2)))


n = int(input())
if n > 0:
	print(n)
else:
	n = -n
	a = n % 10
	m = n // 10
	b = m % 10
	f = m // 10
	r = min(a, b)
	print(-10 * f - r)


s = input()
if int(s) < 0:
	if int(s[:-1]) > int(s[:-2] + s[-1]):
		if s[:-1] == '-0':
			print(0)
		else:
			print(s[:-1])
	elif s[:-2] + s[-1] == '-0':
		print(0)
	else:
		print(s[:-2] + s[-1])
else:
	print(s)


data = int(input())
if data > 0:
	print(data)
elif data >= -10:
	print(0)
else:
	a = int(str(data)[:-1])
	b = int(str(data)[:-2] + str(data)[-1])
	if a > b:
		print(a)
	else:
		print(b)


n = int(input())

def number(x):
	y = ''.join(x)
	return int(y)
if n >= 0:
	print(n)
else:
	nu_1 = list(str(-n))
	nu_2 = list(str(-n))
	num = []
	del nu_1[-1]
	del nu_2[-2]
	mi = min(number(nu_1), number(nu_2))
	print(0 - mi)


n = int(input())
s = str(n)
l = list(s)
s1 = l[0:-1]
del l[-2]
s1 = ''.join(s1)
s2 = ''.join(l)
s1 = int(s1)
s2 = int(s2)
if n < s1 and n < s2:
	if s1 > s2:
		print(s1)
	else:
		print(s2)
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	s = min(-n // 10, -n // 100 * 10 + -n % 10)
	print(-s)


a = input()
s = abs(int(a))
s = str(s)
p = 0
o = 0
i = 0
d = []
while i < len(s):
	d.append(int(s[i]))
	i = i + 1
if int(a) >= 0:
	print(a)
if int(a) < 0:
	g = ''
	i = 0
	while i < len(s) - 2:
		g = g + s[i]
		i = i + 1
	p = p + d[-1]
	o = o + d[-2]
	if p > o:
		g = g + str(o)
	if p < o:
		g = g + str(p)
	if p == o:
		g = g + str(o)
	g = int(g)
	g = g - 2 * g
	print(g)


n = int(input())
if n >= 0:
	print(n)
elif len(str(n)) == 2:
	print(0)
elif str(n)[-1] > str(n)[-2]:
	print(eval(str(n)[:-1]))
else:
	print(eval(str(n)[:-2] + str(n)[-1]))


s = input()
l = list(s)
a = l[0:len(l) - 1]
del l[-2]
b = l
a = ''.join(a)
b = ''.join(b)
if int(a) >= int(b) and int(a) > int(s):
	print(int(a))
elif int(b) > int(a) and int(b) > int(s):
	print(int(b))
else:
	print(int(s))


n = int(input())
if n >= 0:
	print(n)
if n < 0:
	m = str(n)
	num = len(m)
	if int(m[num - 1]) <= int(m[num - 2]):
		print(int(m[:-2] + m[num - 1]))
	if int(m[num - 1]) > int(m[num - 2]):
		print(int(m[:-2] + m[num - 2]))


t = int(input())
if t >= 0:
	print(t)
else:
	p = str(t)
	if len(p) > 3:
		if p[-2] > p[-1]:
			q = p[:-2] + p[-1]
			print(q)
		else:
			print(int(p[:-1]))
	elif len(p) == 3:
		if p[-1] != '0':
			if p[-2] > p[-1]:
				q = p[:-2] + p[-1]
				print(q)
			else:
				print(int(p[:-1]))
		else:
			print(0)
	else:
		print(0)


def main():
	n = input()
	if int(n) < 0:
		if int(n[:-1]) > int(n[:-2] + n[-1]):
			print(int(n[:-1]))
		else:
			print(int(n[:-2] + n[-1]))
		return 0
	print(n)
	return 0
main()


a = input()
b = []
if int(a) >= 0:
	l = len(a)
	b.append(int(a))
	b.append(int(a[0:l - 1]))
	b.append(int(a[0:l - 2] + a[-1]))
	print(max(b))
else:
	k = a[1:]
	l = len(k)
	b.append(int(k))
	b.append(int(k[0:l - 1]))
	b.append(int(k[0:l - 2] + k[-1]))
	if min(b) == 0:
		print('0')
	else:
		print('-', end='')
		print(min(b))


n = int(input())
if n >= 0:
	print(n)
else:
	s = list(str(n))
	if len(s) == 2:
		print(0)
	elif int(s[-1]) > int(s[-2]):
		del s[-1]
		s = ''.join(map(str, s))
		print(int(s))
	else:
		del s[-2]
		s = ''.join(map(str, s))
		print(int(s))


n = int(input())
if n >= 0:
	print(n)
elif abs(n) >= 100:
	last = abs(n) % 10
	last2 = abs(n) % 100 // 10
	if last >= last2:
		print(-(-n // 10))
	else:
		print(-(-n // 100) * 10 - last)
elif abs(n) < 10:
	print(0)
else:
	last = abs(n) % 10
	last2 = abs(n) // 10
	if last >= last2:
		print(-(-n // 10))
	else:
		print(last * -1)


import sys

def check_last(n):
	n_str = list(n)
	x = n_str.pop()
	value_1 = int(''.join(n_str))
	n_str.pop()
	n_str.append(x)
	value_2 = int(''.join(n_str))
	return max(value_1, value_2)

def main():
	n = sys.stdin.readline().rstrip()
	if int(n) > 0:
		sys.stdout.write(f'{n}')
	else:
		sys.stdout.write(f'{check_last(n)}')
main()


n = int(input())
if n == abs(n):
	print(n)
else:
	m1 = int(str(n)[:-1])
	m2 = int(str(n)[:-2] + str(n)[-1])
	if m1 > m2:
		print(m1)
	else:
		print(m2)


def maximize(number_string):
	if number_string[0] != '-':
		return int(number_string)
	else:
		number = list(number_string)
		if number[-1] >= number[-2]:
			number.pop(-1)
		else:
			number.pop(-2)
		new_number = ''.join(number)
		return int(new_number)
inp = str(input())
print(maximize(inp))


n = int(input())
if n >= 0:
	print(n)
elif len(str(n)) == 1:
	print(0)
else:
	s = str(n)[0:len(str(n))]
	s1 = ''
	if int(s[len(s) - 1]) >= int(s[len(s) - 2]):
		for i in range(0, len(s) - 1):
			s1 += s[i]
		print(int(s1))
	else:
		for i in range(0, len(s) - 2):
			s1 += s[i]
		s1 += s[len(s) - 1]
		print(int(s1))


s = input()
if s[0] != '-':
	print(s)
else:
	l = len(s)
	if int(s[l - 1]) >= int(s[l - 2]):
		s = s[:l - 1]
	else:
		s = s[:l - 2] + s[l - 1:]
	if s == '-0':
		print(0)
	else:
		print(s)


inp_str = input()
inp_nochange = int(inp_str)
inp_lastdigit = int(inp_str[:-1])
inp_secondlastdigit = int(inp_str[:-2] + inp_str[-1])
print(max(inp_nochange, inp_lastdigit, inp_secondlastdigit))


R = lambda : list(map(int, input().split()))
n = int(input())
if n < 0:
	x = -n // 10
	y = -n // 100 * 10 + -n % 10
	n = max(-x, -y)
print(n)


inp = input()
n = int(inp)
if n > 0:
	print(n)
else:
	length = len(inp)
	if length == 2:
		print(0)
	elif int(inp[-2]) > int(inp[-1]):
		print(int(inp[:-2] + inp[-1]))
	else:
		print(int(inp[:-1]))


s = str(input())
n = len(s)
s1 = s[:n - 1]
s2 = s[:n - 2] + s[n - 1]
(x, y, z) = (int(s), int(s1), int(s2))
if x >= y and x >= z:
	print(x)
elif y >= z and y >= z:
	print(y)
else:
	print(z)


entrada = int(input())
if entrada > 0:
	print(entrada)
else:
	string = str(entrada)
	if string[-1] > string[-2]:
		string = string[:-1]
	else:
		string = string[:-2] + string[-1]
	print(int(string))


a = input()
if a[0] == '-':
	b = a[:-1]
	c = a[:-2] + a[-1]
	d = int(b[1:])
	e = int(c[1:])
	if c == '-0' or b == '-0':
		print(0)
	elif d > e:
		print(c)
	else:
		print(b)
else:
	print(a)


n = input()
if n[0] == '-':
	if len(n) == 2:
		print(0)
	elif int(n[len(n) - 1]) > int(n[len(n) - 2]):
		res = n[:len(n) - 1]
		if res == '-0':
			print(0)
		else:
			print(res)
	else:
		res = n[:len(n) - 2] + n[len(n) - 1]
		if res == '-0':
			print(0)
		else:
			print(res)
else:
	print(n)


n = input()
if int(n) > 0:
	print(int(n))
else:
	p1 = int(n[:len(n) - 2] + n[len(n) - 1])
	p2 = int(n[:len(n) - 1])
	print(max(p1, p2))


acount = input()
output = ''
if int(acount) >= 0:
	output = acount
else:
	acount_list = [str(i) for i in acount]
	del acount_list[-2]
	output = max(int(acount[:-1]), int(''.join(acount_list)))
print(output)


n = input()
if n[0] != '-':
	print(n)
else:
	print(max(map(int, (n[:-2] + n[-1], n[:-1]))))


n = int(input())
if n >= 0:
	print(n)
else:
	print(max(-(-n // 10), -(-n // 10 - -n // 10 % 10 + abs(n) % 10)))


s = input()
a = ''
b = ''
if int(s) > 0:
	print(s)
	exit()
else:
	a = s[:-1]
	b = s[:-2] + s[-1]
if a == '-0':
	a = '0'
if b == '-0':
	b = '0'
if int(a) > int(b):
	print(a)
else:
	print(b)


n = input()
ni = int(n)
if ni >= 0:
	print(n)
else:
	n1 = int(n[:len(n) - 1])
	n2 = int(n[:len(n) - 2] + n[len(n) - 1:])
	print((n2, n1)[n1 > n2])


import math
n = int(input())
if n >= 0:
	print(n)
else:
	print(max(-((abs(n) - abs(n) % 10) // 10), -((abs(n) - (abs(n) % 100 - abs(n) % 10) // 10 * 10 - abs(n) % 10) // 10 + abs(n) % 10)))


n = int(input().strip())
arr = []
if n >= 0:
	print(n)
else:
	n = -n
	if n < 10:
		print('0')
	else:
		nn = n
		temp = int(n / 100)
		a = n % 10
		b = int(nn / 10) % 10
		print(max(-(temp * 10 + a), -(temp * 10 + b)))


n = input()
if int(n) >= 0:
	print(n)
else:
	ans = n[:-2]
	mini = str(min(int(n[-2]), int(n[-1])))
	if (ans + mini)[1] == str(0):
		print((ans + mini)[1])
	else:
		print(ans + mini)


n = int(input())
if n < 0:
	n = n * -1
	if n % 10 >= n % 100 // 10:
		print(n // 10 * -1)
	else:
		c = str(n % 100 // 10)
		n1 = str(n)
		n3 = int(n1[:-2] + n1[-1])
		print(n3 * -1)
else:
	print(n)


n = input()

def account(n):
	sn = int(n)
	if sn >= 0:
		return sn
	else:
		l = len(n) - 1
		if l < 2:
			return 0
		else:
			last = int(n[:l])
			slast = int(n[:l - 1] + n[l:])
			y = max(last, slast)
			return y
print(account(n))


account = input()
money = int(account)
if money <= -10:
	a = list(account)
	b = list(account)
	a = int(''.join(a[0:-1]))
	b[-2] = b[-1]
	b = int(''.join(b[0:-1]))
	print(max(a, b))
elif money >= 0:
	print(account)
else:
	print('0')


a = int(input())
d = str(a)
b = d[0:-1]
c = d[0:-2] + d[-1]
b = int(b)
c = int(c)
if a > 0:
	print(a)
elif -10 < a < 0:
	print(0)
elif a <= -10:
	print(max(b, c))


s = input()
a = int(s)
b = s[0:len(s) - 1]
b = int(b)
c = s[0:len(s) - 2] + s[len(s) - 1]
c = int(c)
l = []
l.append(a)
l.append(b)
l.append(c)
print(max(l))


n = input()
if int(n) > 0:
	print(n)
elif abs(int(n[:len(n) - 1])) > abs(int(n[:len(n) - 2] + n[len(n) - 1])):
	if abs(int(n[:len(n) - 2] + n[len(n) - 1])) == 0:
		print(0)
	else:
		print(n[:len(n) - 2] + n[len(n) - 1])
elif abs(int(n[:len(n) - 1])) == 0:
	print(0)
else:
	print(n[:len(n) - 1])


n = input()
c = t = ''
if n[0] != '-':
	print(n)
else:
	for i in range(len(n) - 1, -1, -1):
		if i != len(n) - 1:
			t = n[i] + t
		if i != len(n) - 2:
			c = n[i] + c
	print(max(int(t), int(c)))


n = input()
st = n[0:-2]
s1 = s2 = str()
i = 0
s1 = st + n[-1]
s2 = st + n[-2]
i = max(int(s1), int(s2))
if int(n) < i:
	print(i)
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	s1 = list(map(int, str(n)))
	s2 = list(map(int, str(n)))
	if len(s1) == 1:
		print(0)
	else:
		del s1[-1]
		del s2[-2]
		S1 = str()
		S2 = str()
		for i in s1:
			S1 += str(i)
		n1 = int(S1)
		for i in s2:
			S2 += str(i)
		n2 = int(S2)
		print(max(-n1, -n2))


a = input()
if int(a) >= 0:
	print(a)
elif int(a) >= -10 and int(a) <= 0 or int(a) == -20 or int(a) == -30 or (int(a) == -40) or (int(a) == -50) or (int(a) == -60) or (int(a) == -70) or (int(a) == -80) or (int(a) == -90):
	print(0)
else:
	mid = list(a)
	if int(mid[len(mid) - 1]) > int(mid[len(mid) - 2]):
		for i in range(len(mid) - 1):
			print(mid[i], end='')
	elif int(mid[len(mid) - 1]) <= int(mid[len(mid) - 2]):
		for i in range(len(mid) - 2):
			print(mid[i], end='')
		print(mid[len(mid) - 1], end='')


amount = input()
maxValue = []
if amount[0] == '-':
	maxValue.append(int(amount[:-1]))
	maxValue.append(int(amount[:-2] + amount[-1]))
	maxValue.append(int(amount))
else:
	maxValue.append(int(amount[:-1]))
	maxValue.append(int(amount[:-2] + amount[-1]))
	maxValue.append(int(amount))
print(max(maxValue))


saldo = int(input())
if not saldo >= 0:
	saldoSTR = str(saldo * -1)
	nuevos = [int(saldoSTR[:-1]), int(saldoSTR[:-2] + saldoSTR[-1])]
	print(min(nuevos) * -1)
else:
	print(saldo)


import sys
s = sys.stdin.readline().strip()
a = int(s[:-1] if len(s) > 1 and s[:-1] != '-' else s)
b = int(s[:-2] + s[-1] if len(s) > 1 else s)
c = int(s)
print(max(a, b, c))


n = int(input())
s = str(n)
k = len(s)
a = s[:k - 2]
new1 = a + s[-1]
new2 = a + s[-2]
print(max(int(new1), int(new2), n))


n = int(input())
if n >= 0:
	print(n)
else:
	n_1 = int(str(n)[0:len(str(n)) - 1])
	n_2 = int(str(n)[0:len(str(n)) - 2] + str(n)[-1])
	print(max(n_1, n_2))


from math import pi, gcd, factorial
from collections import defaultdict, Counter
from heapq import heapify, heappop, heappush
from sys import maxsize
mod1 = 10 ** (-9)
mod1 = 10 ** 9 + 7

def input_t():
	return int(input())

def input_f():
	return float(input())

def input_list():
	return [int(num) for num in input().split()]

def print_c(i, res):
	print('Case {}: {}'.format(i + 1, res))

def print_e(i, res):
	print('Case {} = {}'.format(i + 1, res))

def max_min():
	return (maxsize, -maxsize - 1)

def tar(a, b, c):
	if a == b == c == 0:
		exit()

def solve():
	n = input_t()
	if n >= 0:
		print(n)
	else:
		s = str(n)
		if len(s) == 1:
			print(0)
		elif int(s[-2]) > int(s[-1]):
			print(int(s[:-2] + s[-1]))
		else:
			print(int(s[:-1]))
solve()


import sys
from random import choice, randint
inp = sys.stdin.readline
out = sys.stdout.write
flsh = sys.stdout.flush
sys.setrecursionlimit(10 ** 9)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, inp().strip().split())

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

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

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

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

def LS():
	return inp().strip().split()

def I():
	return int(inp().strip())

def F():
	return float(inp().strip())

def S():
	return inp().strip()

def pf(s):
	return out(s + '\n')

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	n = I()
	if n >= 0:
		pf(str(n))
	else:
		(x, y) = (str(n)[-2], str(n)[-1])
		s = str(n)
		ans = 0
		if len(s) >= 3:
			if x > y:
				ans = int(s[:-2] + s[-1:])
			else:
				ans = int(s[:-1])
		else:
			ans = n
		pf(str(ans))
main()


n = int(input())
if n > 0:
	print(n)
else:
	sn = str(n)
	sn1 = sn[:-1]
	sn2 = sn[:-2] + sn[-1]
	print(int(max(int(sn1), int(sn2))))


IN = input()
n = len(IN)
if int(IN) >= 0:
	print(IN)
else:
	print(max(int(IN[:n - 1]), int(IN[:n - 2] + IN[n - 1:])))


__author__ = 'runekri3'
n = input()
print(max(map(int, (n, n[:-1], n[:-2] + n[-1]))))


n = int(input())
if n > 0:
	print(n)
else:
	n = abs(n)
	lastDigit = n % 10
	secLastDigit = n // 10 % 10
	if lastDigit > secLastDigit:
		ans = n // 10
		print(-ans)
	else:
		x = n // 100 * 10
		y = n % 10
		ans = x + y
		print(-ans)


s = input()
if int(s) >= 0:
	print(s)
elif len(s) > 2:
	s = s[1:]
	print(-min(int(s[:len(s) - 1]), int(s[:len(s) - 2] + s[-1])))
else:
	print(0)


n = int(input())
if n >= 0:
	print(n)
elif -10 < n < 0:
	print(int(n / 10))
elif n == -10:
	print(int(n + 10))
elif -100 < n < -10:
	if n % 10 == 0:
		print(0)
	elif n % -10 >= int(n / 10):
		print(int(n % -10))
	elif n % -10 < n / 10:
		print(int(n / 10))
elif n < -100:
	if int(n % -100 / 10) >= n % -10 or n % -100 == n % -10:
		print(int(n / 10))
	if int(n % -100 / 10) < n % -10:
		print(int(n / 100) * 10 + int(n % -10))


n = int(input())
if n > 0:
	print(n)
else:
	o = str(n)
	p1 = int(o[-1])
	p2 = int(o[-2])
	if p1 >= p2:
		print(int(o[:len(o) - 1]))
	else:
		print(int(o[:len(o) - 2] + o[-1]))


def jdz(num):
	if num >= 0:
		return num
	else:
		return -num

def last(num):
	return jdz(num - 10 * int(num / 10))

def before(num):
	n = jdz(int(num / 10))
	return last(n)
l = []
num = int(input())
if num >= 0:
	print(num)
elif last(num) > before(num):
	num = str(num)
	if len(num) <= 3 and last(int(num)) == 0:
		print(0)
	else:
		for i in range(len(num) - 1):
			l.append(num[i])
		print(''.join(l))
else:
	num = str(num)
	if len(num) <= 3 and last(int(num)) == 0:
		print(0)
	else:
		for i in range(len(num)):
			if i != len(num) - 2:
				l.append(num[i])
		print(''.join(l))


n = int(input())
l = []
flag = 0
res = []
if n <= 0:
	flag = 1
	if n == 0:
		print(0)
		exit()
	n = abs(n)
n1 = (n - n % 10) // 10
l = [int(x) for x in str(n)]
l.pop(len(l) - 2)
n2 = int(0)
for i in range(0, len(l)):
	n2 = n2 + l[i] * 10 ** (len(l) - (i + 1))
res.append(n)
res.append(n1)
res.append(n2)
if flag == 0:
	print(max(res))
else:
	print(0 - min(res))


n = input()
if int(n) >= 0:
	print(n)
else:
	a1 = n[:-1]
	a2 = n[:-2] + n[-1]
	if int(a1) == 0 or int(a2) == 0:
		print(0)
	elif int(a1) < int(a2):
		print(a2)
	else:
		print(a1)


n = input()
a = int(n)
num = len(n)
if a >= 0:
	print(a)
else:
	x = n[:num - 2] + n[num - 1]
	y = n[:num - 1]
	print(max([int(x), int(y)]))


a1 = input()
l = list(a1)
h = len(l)
a2 = ''.join(l[0:h - 1])
if h > 1:
	l.pop(-2)
a3 = ''.join(l)
b = max(int(a1), int(a2), int(a3))
print(b)


def optimal(num):
	int_num = int(num)
	if int_num >= 0:
		return num
	elif int_num >= -10:
		return 0
	elif num[-2] > num[-1]:
		res = num[0:-2] + num[-1]
	else:
		res = num[0:-1]
	if res == '-0':
		return 0
	return res

def main():
	n = input()
	print(optimal(n))
main()


n = int(input())
if n >= 0:
	print(n)
else:
	r = n + 2 * n
	n = str(n)
	k = len(n)
	ones = int(n[k - 1])
	huns = int(n[k - 2])
	if ones >= huns:
		print(int(n[:k - 1]))
	else:
		f = n[:k - 2] + n[k - 1]
		print(int(f))


n = int(input())
N = -n
a = int((N - N % 10) / 10)
b = int((N - N % 100) / 10 + N % 10)
c = max(-a, -b, n)
print(c)


def trial():
	amount = int(input())
	if amount > 0:
		return print(amount)
	sum = list(str(amount))
	if int(sum[-1]) > int(sum[-2]):
		sum.pop(-1)
	else:
		sum.pop(-2)
	res = ''
	for i in sum:
		res += i
	return print(int(res))
trial()


import math
x = int(input())
if x >= 0:
	print(x)
else:
	x = str(x)
	if x[-1] < x[-2]:
		print(int(x[:-2] + x[-1]))
	else:
		print(int(x[:-1]))


n = input()
z = int(n)
if z > 0:
	print(z)
elif n[-1] >= n[-2]:
	x = n[:-1]
	print(int(x))
elif n[-1] < n[-2]:
	m = n[:-2]
	k = n[-1]
	y = m + k
	print(int(y))


def Main():
	s = input()
	ans = max(int(s), int(s[:-2] + s[-1]), int(s[:-1]))
	print(ans)
Main()


N = int(input())
n = list(str(N))
if N < 0:
	if int(n[-1]) > int(n[-2]):
		n[-1] = ''
		print(int(''.join(n)))
	else:
		n[-2] = ''
		print(int(''.join(n)))
else:
	print(N)


n = int(input())
a = list(str(n))
if a[0] == '-':
	if int(a[-1]) >= int(a[-2]):
		del a[-1]
		print(''.join(a))
	else:
		del a[-2]
		if len(a) == 2:
			if '0' in a:
				print(0)
			else:
				print(''.join(a))
		else:
			print(''.join(a))
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	m = str(n)
	p = int(m[:len(m) - 1])
	q = int(m[:len(m) - 2] + m[len(m) - 1])
	print(max(p, q))


n = int(input())
l = []
if n >= 0:
	print(n)
else:
	line = str(n)
	for i in range(len(line)):
		l.append(line[i])
	for i in range(1, len(line)):
		l[i] = int(l[i])
	if len(line) == 2:
		print(0)
	else:
		if l[len(line) - 2] - l[len(line) - 1] > 0:
			l.pop(len(line) - 2)
		else:
			l.pop(len(line) - 1)
		for i in range(1, len(line) - 1):
			l[i] = str(l[i])
		print(int(''.join(l)))


k = int(input())
if str(k)[0] == '-':
	st = '-0' + str(abs(k))
else:
	st = '0' + str(k)
a = int(st[:-1])
b = int(st[:-2] + str(k)[-1])
print(max(a, b, k))


n = input()
if n[0] != '-':
	print(n)
else:
	d = []
	q = ''
	for i in range(1, len(n)):
		d.append(n[i])
	s = len(d)
	if d[s - 1] > d[s - 2]:
		d.pop()
	else:
		d.pop(s - 2)
	for i in range(s - 1):
		q += d[i]
	print(int('-' + q))


n = int(input())
if n >= 0:
	print(n)
else:
	w = []
	c = str(n)
	for i in range(len(c)):
		w.append(c[i])
	a = int(w[len(c) - 1])
	b = int(w[len(c) - 2])
	d = min(a, b)
	w.pop(-1)
	w.pop(-1)
	w.append(str(d))
	fin = ''
	for i in range(len(w)):
		fin += w[i]
	print(int(fin))


g = int(input())
if g < 0:
	g = g * -1
	g = str(g)
	if g[-1] >= g[-2]:
		k = g[:-1]
		k = int(k)
	else:
		k = g[:-2] + g[-1]
		k = int(k)
	if k == 0:
		print(k)
	else:
		print(k * -1)
else:
	print(g)


n = int(input())
s = str(n)
if n >= 0:
	print(n)
else:
	k = list(s)
	m = list(s)
	del k[-1]
	del m[-2]
	q = ''.join(k)
	w = ''.join(m)
	a = int(q)
	b = int(w)
	if a >= b:
		print(a)
	else:
		print(b)


x = input()
if int(x) > 0:
	print(x)
elif int(int(x) % 10) == 0 and len(x) <= 3:
	print('0')
elif int(x[len(x) - 1]) < int(x[len(x) - 2]):
	print(x[0:len(x) - 2] + x[len(x) - 1])
else:
	print(x[0:len(x) - 2] + x[len(x) - 2])


n = input()
l = len(n)
if int(n) >= 0:
	print(n)
elif l == 2:
	print(0)
elif l == 3 and int(n[-1]) == 0:
	print(0)
else:
	print(n[:l - 2] + str(min(int(n[-2]), int(n[-1]))))


import math
number = int(input())
if number >= 0:
	print(number)
else:
	last_digit = (10 - number % 10) % 10
	number = math.ceil(number / 10)
	second_last_digit = (10 - number % 10) % 10
	number = math.ceil(number / 10)
	if last_digit >= second_last_digit:
		number = number * 10 - second_last_digit
	else:
		number = number * 10 - last_digit
	print(number)


s = input()
num = int(s)
if num >= 0:
	print(num)
if num < 0:
	l1 = list(s)
	l1.remove('-')
	l2 = [int(x) for x in l1]
	ll = l2[-1]
	bl = l2[-2]
	if ll >= bl:
		l2[-1] = 'o'
		l2.remove('o')
	if bl > ll:
		l2[-2] = 'o'
		l2.remove('o')
	no = int(''.join((str(a) for a in l2)))
	no *= -1
	print(no)


n = int(input())
if n >= 0:
	print(n)
else:
	x = str(n)
	if len(x) > 2:
		if len(x) == 3:
			if '0' in x:
				print(0)
			elif x[len(x) - 1] >= x[len(x) - 2]:
				print(x[:-1])
			else:
				print(x[:-2] + x[len(x) - 1])
		elif x[len(x) - 1] >= x[len(x) - 2]:
			print(x[:-1])
		else:
			print(x[:-2] + x[len(x) - 1])
	else:
		print(0)


s = input()
n = len(s)
n1 = int(s)
n2 = int(s[:n - 1])
n3 = int(s[:n - 2] + s[n - 1])
print(max(n1, n2, n3))


n = input()
number = int(n)
if number > 0:
	print(n)
else:
	a = list(n)
	l = len(a)
	p = int(a[l - 1])
	q = int(a[l - 2])
	if p > q:
		a.pop(-1)
		p = ''.join((str(x) for x in a))
		p = int(p)
		if p == -0:
			print(-p)
		else:
			print(p)
	else:
		a.pop(-2)
		p = ''.join((str(x) for x in a))
		p = int(p)
		if p == -0:
			print(-p)
		else:
			print(p)


n = input()
n = list(n)
if n[0] == '-':
	n.remove(n[0])
	n = list(map(int, n))
	length = len(n)
	if n[length - 1] < n[length - 2]:
		del n[length - 2]
	else:
		del n[length - 1]
	n = int(''.join(map(str, n)))
	n *= -1
else:
	n = int(''.join(n))
print(n)


a = int(input())
print([a, max(-(-a // 10), -(-a // 100 * 10 + -a % 10))][a < 0])


n = int(input())
if n >= 0:
	print(n)
	exit(0)
n = list(str(n))
temp1 = [x for x in n]
del temp1[-2]
temp2 = [x for x in n]
del temp2[-1]
print(int(''.join(temp1)) if int(''.join(temp1)) > int(''.join(temp2)) else int(''.join(temp2)))


N = input()
a = int(N)
b = float('-inf')
if len(N) >= 1:
	b = list(N)
	del b[-1]
	b = int(''.join(b))
c = float('-inf')
if len(N) >= 2:
	c = list(N)
	del c[-2]
	c = int(''.join(c))
print(max(a, b, c))


n = input()
num = int(n)
l = len(n)
last = n[l - 1]
if num >= 0:
	print(num)
else:
	num = -num
	ans1 = num // 10
	ans2 = int(str(ans1 // 10) + last)
	print(-min(ans1, ans2))


a = input()
if len(a) == 1:
	n0 = int(a)
	print(max(n0, 0))
else:
	n0 = int(a)
	n1 = int(a[:-1])
	n2 = int(a[:-2] + a[-1])
	print(max(n0, n1, n2))


n = input()
if int(n) >= 0:
	print(int(n))
	exit()
k = int(n)
if len(n) == 2:
	print(0)
	exit()
if int(n[len(n) - 1]) > int(n[len(n) - 2]):
	temp = n[:len(n) - 1]
else:
	temp = n[:len(n) - 2] + n[len(n) - 1]
print(int(temp))


n = input()
if int(n) >= 0:
	print(int(n))
else:
	m = n[:len(n) - 2] + n[len(n) - 1]
	print(int(n[:len(n) - 1])) if int(n[:len(n) - 1]) >= int(m) else print(int(m))


s = input()
t = s[:-1]
u = s[:-2] + s[-1]
if s[0] == '-':
	s = -1 * int(s[1:])
else:
	s = int(s)
if t[0] == '-':
	t = -1 * int(t[1:])
else:
	t = int(t)
if u[0] == '-':
	u = -1 * int(u[1:])
else:
	u = int(u)
print(max(s, t, u))


n = int(input())
if n >= 0:
	print(n)
else:
	a = -n
	p = a // 10
	q = a // 100 * 10 + a % 10
	print(max(-p, -q))


n = int(input())
ans = n
if n < 0:
	if n > -10:
		ans = 0
	else:
		n = -n
		tmp = n // 10
		tmp2 = tmp // 10 * 10 + n % 10
		ans = max(-tmp, -tmp2)
print(ans)


n = str(input())
a = str(n)[-1]
b = str(n)[-2]
c = str(abs(int(n)))
if int(n) > 0 or int(n) == 0:
	print(n)
elif int(n) < 0:
	if int(c[-1]) > int(c[-2]):
		print(int(c[:-1]) * -1)
	else:
		print(int(c[:-2] + c[-1]) * -1)


import math as m
n = int(input())
if n < 0:
	s = str(n)
	exit(print(max(m.ceil(n / 10), int(s[0:len(s) - 2] + s[len(s) - 1]))))
print(n)


import math
n = int(input())
if n >= 0:
	print(n)
else:
	bal = math.fabs(n)
	r = int(bal % 10)
	c1 = int(bal / 100) * 10 + r
	c2 = int(bal / 10)
	if c1 == 0 or c2 == 0:
		print('0')
	elif c1 > c2:
		print('-%d' % c2)
	else:
		print('-%d' % c1)


m = str(input())
m_1 = m[:len(m) - 1]
m_2 = m[:len(m) - 2] + m[len(m) - 1]
m = int(m)
m_1 = int(m_1)
m_2 = int(m_2)
print(max(m, m_1, m_2))


n = int(input())
temp1 = int(n / 10)
temp2 = -(int(-n / 100) * 10 + -n % 10)
if n > 0:
	print(n)
else:
	print(max(temp1, temp2))


n = int(input())
if n >= 0:
	earn = n
elif n >= -10:
	earn = 0
else:
	gewei = abs(n) % 10
	shiwei = (abs(n) % 100 - gewei) / 10
	earn = -(10 * (abs(n) // 100) + min(gewei, shiwei))
print(int(earn))


a = input()
if int(a) >= 0:
	print(a)
elif int(a) >= -9:
	print('0')
elif int(a[-1]) >= int(a[-2]):
	if int(a[0:len(a) - 1]) == 0:
		print('0')
	else:
		print(a[0:len(a) - 1])
elif len(a) == 3 and a[-1] == '0':
	print('0')
else:
	print(a[0:len(a) - 2], end='')
	print(a[-1])


a = int(input())
if a >= 0:
	print(a)
else:
	b = str(a)
	if int(b[-2]) > int(b[-1]):
		c = int(a / 100)
		a = c * 10 - abs(a) % 10
	else:
		a = int(a / 10)
	print(a)


N = input()
if N[0] != '-':
	print(N)
else:
	l = len(N)
	a = int(N[:l - 2] + N[l - 1])
	b = int(N[:l - 1])
	print(max(a, b))


number = int(input())
number_str = str(number)
if number > 0:
	print(number)
else:
	a1 = number_str[:-1]
	a2 = number_str[:-2] + number_str[-1]
	if a2 == '-0':
		print(0)
	elif int(a1) > int(a2):
		print(a1)
	else:
		print(a2)


accnt = int(input())
if accnt >= 0:
	print(accnt)
elif accnt >= -9:
	print(0)
elif accnt % 10 == 0 and accnt > -100:
	print(0)
else:
	last = int(str(accnt)[-1])
	lastbutone = int(str(accnt)[-2])
	resid = str(accnt)[:-2]
	print(resid + str(min(last, lastbutone)))


import sys
input = sys.stdin.readline

def solve(n):
	n = str(n)
	(last, slast) = (n[:-1], n[:-2] + n[-1])
	print(max(int(n), int(last), int(slast)))
n = int(input())
solve(n)


n = int(input())
if n >= 0:
	print(n)
elif -11 < n < 0:
	print(0)
elif int(str(n)[:-1]) > int(str(n)[:-2] + str(n)[-1]):
	print(int(str(n)[:-1]))
else:
	print(int(str(n)[:-2] + str(n)[-1]))


amount = input()
if int(amount) >= 0:
	result = amount
else:
	(last, second_last) = (int(amount[-1]), int(amount[-2]))
	if last <= second_last:
		result = amount[:-2] + str(last)
	else:
		result = amount[:-2] + str(second_last)
if result == '-0':
	result = 0
print(result)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
l = list(z())
if l[0] == '-':
	t = min(int(l[-1]), int(l[-2]))
	n = ''.join(l[:-2]) + str(t)
	n = int(n)
	if n < 0:
		print(n)
	else:
		print(0)
	exit()
print(''.join(l))


n = int(input())
if n > 0:
	print(n)
else:
	n = n * -1
	if n % 10 == 0 and n < 100:
		n = n % 10
		print(n)
	else:
		a = (n - n % 10) / 10
		b = n % 10
		c = (n - n % 10) / 10
		z = c - c % 10
		v = z + b
		a = int(a)
		v = int(v)
		if a < v:
			print('-' + str(a))
		else:
			print('-' + str(v))


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
s = input()
print(max(int(s), int(s[:-1]), int(s[:-2] + s[-1])))


def _313A(state):
	if state >= 0:
		return state
	else:
		state = str(state)
		state = state[0:-2] + str(min(int(state[-2]), int(state[-1])))
		if state == '-0':
			return '0'
		else:
			return state
print(_313A(int(input())))


n = int(input())
if n >= 0:
	print(n)
else:
	acct = []
	temp = str(abs(n))
	acct.append(int(temp[:len(temp) - 1]))
	acct.append(int(temp[:len(temp) - 2] + temp[len(temp) - 1]))
	print(-min(acct))


import math
n = input()
if int(n) >= 0:
	print(int(n))
else:
	b = math.ceil(int(n) / 10)
	a = math.ceil(int(n) / 100) * 10 - int(n[-1])
	if a >= b:
		print(a)
	else:
		print(b)


n = int(input())
if n >= 0:
	print(n)
else:
	m = abs(n)
	a = m % 10
	m = m // 10
	b = m % 10
	if a >= b:
		print(int(abs(n) // 10) - 2 * int(abs(n) // 10))
	else:
		m = m // 10
		m = m * 10 + a
		print(int(m) - 2 * int(m))


s = input()
if int(s) >= 0:
	print(s)
	exit()
if len(s) == 2:
	print(0)
else:
	two = s[:-2] + s[len(s) - 1:]
	print(max(int(two), int(s), int(s[:-1])))


from math import ceil
n = int(input())
if n > 0:
	print(n)
else:
	print(max(n, -(-n // 10), -(-n // 100 * 10 + -n % 10)))


a = int(input())
if a >= 0:
	print(a)
elif a >= -10:
	print(0)
else:
	s = str(a)
	s = list(s)
	mo = int(s[-1])
	mo2 = int(s[-2])
	if mo >= mo2:
		del s[-1]
	else:
		del s[-2]
	if s == ['-', '0']:
		s = ['0']
	print(''.join(s))


n = int(input())
if n >= 0:
	print(n)
else:
	l = str(-n)
	print(-int(str(l[:-1]))) if int(l[:-1]) < int(l[:-2] + l[-1]) else print(-int(str(l[:-2] + l[-1])))


number = int(input())
if number > 0:
	print(number)
else:
	number = abs(number)
	lastDigit = number % 10
	secondLastDigit = number // 10 % 10
	if lastDigit > secondLastDigit:
		print(-(number // 10))
	else:
		print(-(number // 10 // 10 * 10 + lastDigit))


n = int(input())
if n > 0:
	print(n)
else:
	s = str(n)
	s1 = s
	a = s[:-1]
	b = ''
	for i in range(len(s1)):
		if i == len(s1) - 2:
			continue
		else:
			b += s1[i]
	if int(a) > int(b):
		print(int(a))
	else:
		print(int(b))


n = int(input())
if n > 0:
	print(n)
else:
	o1 = str(n)[:-1]
	o2 = str(n)[:-2] + str(n)[-1]
	if int(o1) > int(o2):
		print(eval(o1))
	else:
		print(eval(o2))


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	k = n // 10
	l = k // 10 * 10 + n % 10
	print(0 - min(k, l))


balance = int(input())
if balance >= 0:
	print(balance)
elif len(str(balance)) == 2:
	print(0)
elif str(balance)[-1] > str(balance)[-2]:
	print(int(str(balance)[:-1]))
else:
	print(int(str(balance)[:-2] + str(balance)[-1]))


n = int(input())
s = str(n)
L = list(s)
k = L.pop()
s = ''.join(L)
p = int(s)
if p > n:
	n = p
L.pop()
L.append(k)
s = ''.join(L)
p = int(s)
if p > n:
	n = p
print(n)


s = input()
ori = int(s)
if ori >= 0:
	print(s)
else:
	s1 = s[0:len(s) - 1]
	s2 = s[0:len(s) - 2] + s[len(s) - 1:len(s)]
	int1 = int(s1)
	int2 = int(s2)
	if int1 > int2:
		print(str(int1))
	else:
		print(str(int2))


n = input()
d = []
for i in n:
	d.append(i)
if d[-1] == '0' and int(n) < 0 and (len(d) <= 3):
	print(0)
elif len(d) >= 3 or int(n) > 0:
	if int(n) < 0:
		for i in range(len(n) - 1, len(n) - 2, -1):
			if int(n[i]) > int(n[i - 1]):
				d.pop(-1)
			else:
				d.pop(-2)
	print(*d, sep='')


b = input()
if abs(int(b)) < 9:
	print(0)
else:
	print(max([int(b[:-1]), int(b[:-2] + b[-1]), int(b)]))


n = int(input())
if n > -1:
	q = int(str(n)[:-2] + str(n)[-1])
	print(max(q, n // 10, n))
elif n > -10:
	print(n)
else:
	q = -int(str(n)[1:-2] + str(n)[-1])
	z = 0
	if n % 10 == 0:
		z = n // 10
	else:
		z = n // 10 + 1
	print(max(q, n, z))


n = int(input())
if n >= 0:
	print(n)
else:
	l1 = list(str(n))
	l2 = list(str(n))
	del l1[-1]
	del l2[-2]
	a = int(''.join(l1))
	b = int(''.join(l2))
	x = max(a, b)
	print(x)


n = list(input())
n2 = list(n)
k = list(n)
n.pop()
n1 = ''.join(n)
k.pop(-2)
k1 = ''.join(k)
if k[0] == '-':
	if int(n1) > int(k1):
		if n1 == '-0':
			print(0)
		else:
			print(n1)
	elif k1 == '-0':
		print(0)
	else:
		print(k1)
else:
	print(''.join(n2))


import math
n = input()
n1 = n[:-1]
n2 = n[0:-2] + n[len(n) - 1]
n1 = int(n1)
n2 = int(n2)
if int(n) > 0:
	print(int(n))
elif math.fabs(n1) < math.fabs(n2):
	print(n1)
else:
	print(n2)


x = input()
if int(x) > 0:
	print(int(x))
else:
	x = list(x)
	if x[-1] > x[-2]:
		x.pop(-1)
	else:
		x.pop(-2)
	print(int(''.join(x)))


n = int(input())
if n > 0:
	print(n)
else:
	string_n = str(n)
	if string_n[-1] > string_n[-2]:
		string_n = string_n[:-1]
	else:
		string_n = string_n[0:-2] + string_n[-2 + 1:]
	if string_n == '-0':
		string_n = '0'
	print(string_n)


a = int(input())
if a >= 0:
	print(a)
if a < 0:
	a = str(a)
	a = ' '.join(a)
	a = a.split()
	if a[-1] >= a[-2]:
		del a[-1]
		b = ''
		for i in a:
			b = b + i
		b = int(b)
		if b == -0:
			b = b * -1
			print(b)
		else:
			print(b)
	elif a[-1] < a[-2]:
		del a[-2]
		b = ''
		for i in a:
			b = b + i
		b = int(b)
		if b == -0:
			b = b * -1
			print(b)
		else:
			print(b)


n = input()
if int(n) >= 0:
	print(n)
else:
	wlast = int(n[:-1])
	wplast = int(n[:-2] + n[-1:])
	print(max(wlast, wplast))


n = input()
if int(n) > 0:
	print(n)
else:
	l = len(n) - 1
	if int(n[l]) > int(n[l - 1]):
		n = n[1:l]
	else:
		n = n[1:l - 1] + n[l]
	if int(n) != 0:
		print('-' + n)
	else:
		print('0')


number = int(input())
length = len(str(number))
number_str = str(number)
otriz_posl = str(number_str[:length - 1])
otriz_pred = number_str[:length - 2] + number_str[:length - 2:-1]
if number > 0:
	print(number)
elif len(number_str) > 1:
	if int(otriz_posl) > int(otriz_pred):
		if int(otriz_posl) == -0:
			print(abs(int(otriz_posl)))
		else:
			print(otriz_posl)
	elif int(otriz_pred) == -0:
		print(abs(int(otriz_pred)))
	else:
		print(otriz_pred)
else:
	print(0)


account = str(input())
option1 = int(account[0:len(account) - 1] + '')
option2 = int(account[0:len(account) - 2] + '' + account[len(account) - 1])
if int(account) >= 0:
	answer = int(account)
elif option1 > int(account) and option1 >= option2:
	answer = option1
elif option2 > option1 and option2 > int(account):
	answer = option2
else:
	answer = int(account)
print(answer)


a = int(input())
b = int(str(a)[0:-1])
c = int(str(a)[0:-2] + str(a)[-1])
print(max([a, b, c]))


def maximize(state: int) -> int:
	if state >= 0:
		return state
	if state >= -10:
		return 0
	state = abs(state)
	a = state // 10
	b = state // 100 * 10 + state % 10
	return -min(a, b)
print(maximize(int(input())))


__author__ = 'iag'
N = int(input())
if N > 0:
	print(N)
else:
	n = abs(N)
	num1 = n % 10
	n //= 10
	num2 = n % 10
	n //= 10
	print(-(n * 10 + min(num1, num2)))


z = input()
if int(z) >= 0:
	print(z)
else:
	l1 = z[-1]
	l2 = z[-2]
	ares = z[:-2] + min(l1, l2)
	if ares == '-0':
		print(0)
	else:
		print(ares)


n = int(input())
if n >= 0:
	ans = n
else:
	ans = -min(-n // 10, 10 * (-n // 100) + -n % 10)
print(ans)


l = input()
print(max(int(l[:-2] + l[-1]), int(l[:-1]), int(l)))


a = input()
b = a[:-2] + a[-1]
c = a[:-1]
print(max(int(a), int(b), int(c)))


s = input()
k = ''
if s[0] == '-':
	if s[-1] > s[-2]:
		k += s[:len(s) - 1]
	else:
		k += s[:len(s) - 2] + s[-1]
else:
	k = s
if k[:2] == '-0':
	print(k[1])
else:
	print(k)


a = input()
if a[0] != '-':
	print(a)
else:
	aux = len(a)
	a = list(a)
	if a[aux - 1] >= a[aux - 2]:
		aux = aux - 1
	else:
		aux = aux - 2
	a[aux] = '*'
	a.remove('*')
	a = ''.join(a)
	print(int(a))


nm = input()
a = int(nm)
str = ''
result = a
if a < 0:
	str = str + nm[:-2] + nm[-1]
	max = int(str)
	if int(nm[:-1]) > max:
		max = int(nm[:-1])
	result = max
print(result)


n = int(input())
y = []
z = []
if n >= 0:
	print(n)
elif len(str(n)) == 2:
	print(0)
else:
	x = str(n)
	for i in range(len(x) - 1):
		y.append(x[i])
	for i in range(len(x) - 2):
		z.append(x[i])
	z.append(x[-1])
	a = ''.join(y)
	b = ''.join(z)
	s = int(a)
	c = int(b)
	if s > c:
		print(s)
	else:
		print(c)


n = input()
if int(n) >= 0:
	print(n)
else:
	n1 = n[:-1]
	n2 = n[:-2] + n[-1]
	n_c = max(int(n1), int(n2))
	print(n_c)


s = int(input())
if s >= 0:
	print(s)
else:
	r = t = abs(s)
	t = t // 10
	r = str(r // 100) + str(abs(s) % 10)
	k = min(int(r), int(t))
	if k == 0:
		print(0)
	else:
		print('-' + str(k))


s = input()
n = len(s)
a = int(s[0:-1])
b = int(s[0:-2] + s[-1])
c = int(s)
print(max(a, b, c))


n = int(input())
print([n, -min(-n // 10, -n // 100 * 10 + -n % 10)][n < 0])


def convert(n):
	s = []
	s.extend(n)
	return s

def a(x):
	x.pop()
	return int(''.join(x))

def b(x):
	x.pop(-2)
	return int(''.join(x))
n = input()
if int(n) >= 0:
	print(n)
else:
	w = convert(n)
	w.pop(0)
	v = convert(n)
	v.pop(0)
	print(max(-a(w), -b(v)))


n = int(input())
if n >= 0:
	print(n)
else:
	del1 = int(str(n)[:-1])
	del2 = int(str(n)[0:-2] + str(n)[-1])
	if del1 > del2:
		print(del1)
	else:
		print(del2)


remNone = []
rem0 = []
rem1 = []
bal = list(input())
negative = False
if '-' in bal:
	bal.remove('-')
	negative = True
i = 0
for num in bal:
	remNone.append(num)
	if i != len(bal) - 1:
		rem0.append(num)
	if i != len(bal) - 2:
		rem1.append(num)
	i += 1
remNone = int(''.join(remNone))
rem0 = int(''.join(rem0))
rem1 = int(''.join(rem1))
if negative == True:
	remNone = remNone * -1
	rem0 = rem0 * -1
	rem1 = rem1 * -1
if remNone < rem0:
	remNone = rem0
if remNone < rem1:
	remNone = rem1
print(remNone)


class Solution:

	def bazinga(self, b):
		return max(b, int(str(b)[:-1]), int(str(b)[:-2] + str(b)[-1]))
n = int(input().strip())
S = Solution()
print(S.bazinga(n))


n = int(input())
min = -10 ** 10
sign = 1
if n < 0:
	sign = -1
n = abs(n)
if n < 10:
	print(max(0, sign * n))
else:
	print(max(n * sign, sign * (n // 10), sign * (n // 100 * 10 + n % 10)))


n = input()
if len(n) <= 2:
	print(max(0, int(n)))
else:
	print(max(int(n[:-2] + min(n[-1], n[-2])), int(n)))


a = input()
if int(a) >= 0:
	print(a)
else:
	print(max(int(a[0:len(a) - 2] + a[len(a) - 1]), int(a[0:len(a) - 1])))


n = list(input())
if n[0] == '-':
	if len(n) == 3:
		if '0' in n:
			print(0)
			exit()
	if len(n) < 3:
		print(0)
		exit()
	if n[-1] >= n[-2]:
		n.pop(-1)
		print(*n, sep='')
		exit()
	n.pop(-2)
	print(*n, sep='')
	exit()
print(*n, sep='')


a = list(input())
if a[0] == '-':
	if a[-1] > a[-2]:
		del a[-1]
	else:
		del a[-2]
print(int(''.join(a)))


a = int(input())
if a < 0:
	a1 = -a % 10
	a2 = -a % 100 // 10
	if a1 > a2:
		print(-(-a // 10))
	else:
		print(-(-a // 100 * 10 + a1))
else:
	print(a)


a = int(input())
if a >= 0:
	print(a)
else:
	a = str(a)
	if len(a) == 2:
		print(0)
	else:
		if a[-1] > a[-2]:
			a = a[:-1]
		else:
			a = a[:-2] + a[-1:]
		if int(a) == 0:
			print(0)
		else:
			print(a)


num = input()
word = num
if int(num) > 0:
	print(num)
else:
	word = word[:-1]
	num = num[:-2] + num[-1]
	if int(word) > int(num):
		print(int(word))
	else:
		print(int(num))


N = int(input())
if N >= 0:
	print(N)
else:
	print(max(int(str(N)[:-1]), int(str(N)[:-2] + str(N)[-1])))


n = int(input())
output = 0
if n >= 0:
	output = n
else:
	n = -n
	temp = str(n)
	temp1 = int(temp[:-1])
	temp2 = int(temp[:-2] + temp[-1])
	output = max(-temp1, -temp2)
print(output)


n = input()
l = len(n)
if int(n) < 0:
	c1 = n[:l - 1]
	c2 = n[:l - 2] + n[l - 1]
	if c1 == '-0' or c2 == '-0':
		print('0')
	else:
		print(min(n, c1, c2))
else:
	print(n)


n = int(input())
print([n, max(-(-n // 100) * 10 - -n % 10, -(-n // 10))][n < 0])


account = list(input())
if account[0] != '-':
	print(''.join(account))
elif account[-2] >= account[-1]:
	account.pop(len(account) - 2)
	x = ''.join(account)
	print(int(x))
elif account[-1] > account[-2]:
	account.pop()
	x = ''.join(account)
	print(int(x))


n = input()
if int(n) > 0:
	print(n)
else:
	c1 = n[:-1]
	c2 = n[:-2] + n[-1]
	if c1 is '-0' or c2 is '-0':
		print(0)
	else:
		c1 = int(c1)
		c2 = int(c2)
		if c1 > c2:
			print(c1)
		else:
			print(c2)


n = input()
a = str(n)
if int(n) < 0:
	w = n[-2]
	m = n[-1]
	w = int(w)
	m = int(m)
	if m > w:
		y = n[:-1]
		print(y)
	else:
		m = n[:-2]
		k = n[-1]
		y = m + k
		print(int(y))
elif int(a) > 0:
	print(n)


n = int(input())
s = [-20, -30, -40, -50, -60, -70, -80, -90]
if n >= 0:
	print(n)
elif -10 <= n <= -1 or n in s:
	print(0)
else:
	n = str(n)
	print(n[:-2] + min(n[-1], n[-2]))


n = list(input())
a = int(''.join(n))
m = []
if n[0] != '-':
	print(a)
else:
	del n[0]
	for digit in n:
		m.append(digit)
	del m[-1]
	b = int(''.join(m))
	m = []
	for digit in n:
		m.append(digit)
	del m[-2]
	c = int(''.join(m))
	print(max(a, -b, -c))


x = list(input())
if x[0] != '-':
	for q in range(len(x)):
		print(x[q], end='')
else:
	w = len(x)
	q1 = int(x[w - 1])
	q2 = int(x[w - 2])
	if q1 >= q2:
		x.pop(w - 1)
	else:
		x.pop(w - 2)
	if len(x) == 2 and x[1] == '0':
		print(0)
		exit()
	for z in range(len(x)):
		print(x[z], end='')


import math
st = input()
if int(st) > 0:
	print(st)
else:
	st = list(st)
	if st[len(st) - 1] > st[len(st) - 2]:
		st.pop(len(st) - 1)
	else:
		st.pop(len(st) - 2)
	print(int(''.join(st)))


n = input()
if int(n) >= 0:
	print(n)
else:
	l = len(n)
	out = []
	if int(n[l - 2]) <= int(n[l - 1]):
		for i in range(l - 1):
			out.append(n[i])
	else:
		for i in range(l - 2):
			out.append(n[i])
		out.append(n[l - 1])
	out = ''.join(out)
	if out == '-0':
		out = '0'
	print(out)


a = int(input())
if a >= 0:
	print(a)
else:
	a = a * -1
	b = a % 10
	a = a // 10
	c = a % 10
	a = a // 10
	d = min(b, c)
	a = (a * 10 + d) * -1
	print(a)


n = int(input())
if n > 0:
	print(n)
else:
	newN = abs(n)
	b = (newN - newN % 100 + newN % 10 * 10) // 10
	a = newN // 10
	val = a if a < b else b
	print(val * -1 if val > 0 else 0)


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	temp = str(n)
	temp1 = ''
	temp2 = ''
	for i in range(len(temp)):
		if i == len(temp) - 2:
			continue
		else:
			temp1 += temp[i]
	for i in range(len(temp) - 1):
		temp2 += temp[i]
	temp1 = -int(temp1)
	temp2 = -int(temp2)
	if temp1 > temp2:
		print(temp1)
	else:
		print(temp2)


n = input()
if int(n) >= 0:
	print(n)
else:
	a = list(n)
	if int(n[len(n) - 1]) >= int(n[len(n) - 2]):
		a.pop()
	else:
		a.pop()
		a.pop()
		a.append(n[len(n) - 1])
	b = int(''.join(a))
	print(b)


s = int(input())
s1 = str(s)[:-1]
l = len(str(s))
s2 = str(s)[:l - 2] + str(s)[l - 1:]
print(max(s, int(s1), int(s2)))


n = int(input())
if n >= 0:
	print(n)
else:
	n = abs(n)
	x = n % 10
	n = n // 10
	y = n % 10
	n1 = n // 10
	y = -int(str(n1) + str(x))
	x = -int(n)
	print(max(x, y))


n = int(input())
if n >= 0:
	print(n)
else:
	a = -n
	b = str(a)
	l = len(b)
	s = [str(b[i]) for i in range(l)]
	q = s[:]
	del s[l - 1]
	del q[l - 2]
	if s > q:
		g = int(''.join(q))
		print(-g)
	else:
		h = int(''.join(s))
		print(-h)


a = int(input())
str_a = str(a)
if a > 0:
	print(a)
elif str_a[-1] == str_a[-2]:
	print(int(str_a[:-1]))
elif str_a[-1] > str_a[-2]:
	print(int(str_a[:-1]))
else:
	print(int(str_a[:-2] + str_a[-1]))


3
n = input().strip()
print(max(list(map(int, [n, n[:-1], n[:-2] + n[-1]]))))


s = input()
a1 = int(s[0:-1])
a2 = int(s[0:-2] + s[-1])
a3 = int(s)
print(max(a1, a2, a3))


c = list(input())
if c[0] == '-':
	d = int(c[len(c) - 1])
	a = int(c[len(c) - 2])
	if a >= d:
		del c[len(c) - 2]
	else:
		del c[len(c) - 1]
	if c == ['-', '0']:
		print(0)
	else:
		e = ''
		for i in range(len(c)):
			e += c[i]
		print(e)
else:
	e = ''
	for i in range(len(c)):
		e += c[i]
	print(e)


def schet(n):
	if n >= 0:
		return n
	return max(int(str(n)[:-1]), int(str(n)[:-2] + str(n)[-1]))
print(schet(int(input())))


def run():

	def answer(s):
		if s[0] == '-':
			if len(s) == 2:
				return 0
			else:
				a = int(s[-1])
				b = int(s[-2])
				return int(s[:-2] + str(a if a < b else b))
		else:
			return s
	print(answer(input()))
run()


N = input()
if int(N) >= 0:
	print(N)
else:
	N = int(N) * -1
	L1 = N // 10
	L2 = N // 100 * 10 + N % 10
	print(max(-L1, -L2))


n = int(input())
x = list(str(abs(n)))
if n > 0:
	print(n)
else:
	(a, b) = (int(''.join(x[:-1])) * -1, int(''.join(x[:-2]) + str(x[-1])) * -1)
	print(max(a, b))


n = int(input())
if n >= 0:
	print(n)
else:
	m = abs(n)
	M = str(m)
	ls = []
	for i in range(len(M)):
		ls.append(int(M[i]))
	if ls[-1] < ls[-2]:
		(ls[-1], ls[-2]) = (ls[-2], ls[-1])
	del ls[-1]
	if ls != [0]:
		print('-', end='')
		for k in range(len(ls)):
			print(ls[k], end='')
	else:
		print(0)


state = input('')
if int(state) > 0:
	print(state)
elif int(state) >= -10:
	print(0)
else:
	a = state[:-2] + state[-1]
	b = state[:-2] + state[-2]
	if int(a) > int(b):
		if int(a) == 0:
			print(0)
		else:
			print(a)
	elif int(b) == 0:
		print(0)
	else:
		print(b)


n = int(input())
if n > 0:
	ans = n
else:
	l = list(str(n))
	if l[-2] == '-' or int(l[-1]) > int(l[-2]):
		ans = ''.join(l[:-1])
	else:
		l.pop(-2)
		ans = ''.join(l)
if ans == '-0':
	ans = 0
print(ans)


n = int(input())
if n < 0:
	temp = abs(n)
	l = temp % 10
	temp = temp // 10
	sl = temp % 10
	temp //= 10
	if l > sl:
		print(temp * -10 - sl)
	else:
		print(temp * -10 - l)
else:
	print(n)


n = input()
l = []
g = []
for i in n:
	l.append(i)
	g.append(i)
if int(n) < 0:
	l.pop(-1)
	g.pop(-2)
l = int(''.join(l))
g = int(''.join(g))
if int(n) < 0:
	print(max(l, g))
else:
	print(int(n))


n = input()
if '-' not in n:
	print(n)
else:
	temp = n[1:]
	x1 = temp[:-2] + temp[-1]
	x2 = temp[:-1]
	if '-' + str(min(int(x1), int(x2))) == '-0':
		print('0')
	else:
		print('-' + str(min(int(x1), int(x2))))


n = int(input())
if n >= 0:
	print(n)
elif len(str(n)) == 1:
	print(0)
else:
	temp = list(str(n))
	if int(temp[-2]) > int(temp[-1]):
		temp.pop(-2)
	else:
		temp.pop(-1)
	print(int(''.join(temp)))


num = input()
a = list(num)
a.reverse()
if int(num) >= 0:
	print(num)
elif int(a[0]) > int(a[1]):
	del a[0]
	a.reverse()
	print(''.join(a))
elif int(a[0]) <= int(a[1]):
	del a[1]
	a.reverse()
	if a == ['-', '0']:
		print('0')
	else:
		print(''.join(a))


x = int(input())
string = str(x)
a = string[:-2] + string[-1]
b = string[:-1]
print(max(x, int(a), int(b)))


a = int(input())
if a >= 0:
	print(a)
elif a == -10:
	print(0)
else:
	value = a // -10
	value = -1 * value
	b = str(a)
	value_1 = int(b[:-2] + b[-1])
	if value > value_1:
		print(value)
	else:
		print(value_1)


x = int(input())

def f(x):
	m = 0
	for n in range(len(x)):
		m += x[n] * 10 ** (len(x) - 1 - n)
	return m
if x >= 0:
	print(x)
else:
	p = abs(x)
	s = [int(n) for n in str(p)]
	a = s[len(s) - 1]
	del s[len(s) - 1]
	o = f(s)
	s.append(a)
	b = s[len(s) - 2]
	del s[len(s) - 2]
	m = f(s)
	sd = min(m, o)
	print(sd * -1)


n = input()
nn = len(n)
if int(n) > 0:
	print(n)
else:
	x = list(n)
	x = list(map(int, x[1:]))
	val = x[nn - 2]
	x = x[::-1]
	x.remove(val)
	x = x[::-1]
	val_1 = int(''.join((str(e) for e in x)))
	val2 = x[nn - 3]
	x = x[::-1]
	x.remove(val2)
	x = x[::-1]
	x.append(val)
	val_2 = int(''.join((str(e) for e in x)))
	if val_2 > val_1:
		print('-' + str(val_1))
	elif val_2 != 0:
		print('-' + str(val_2))
	else:
		print(0)


def main():
	S = input()
	print(max(int(S), int(S[:len(S) - 1]), int(S[:len(S) - 2] + S[-1])))
main()


def bank(n):
	if n >= 0:
		return n
	s = str(n)
	ch1 = int(s[:len(s) - 1])
	ch2 = int(s[:len(s) - 2] + s[-1])
	return max(ch1, ch2)
n = int(input())
print(bank(n))


def program(money):
	if money[0] != '-':
		return money
	elif len(money) == 2:
		return '0'
	elif int(money[-1]) > int(money[-2]):
		return int(money[:-1])
	else:
		return int(money[:-2] + money[-1])
print(program(input()))


b = input()
if int(b) < 0:
	if b[-1:] > b[-2:][0]:
		b = b[:-1]
	else:
		b = b[:-2] + b[-1:]
	if b == '-0':
		b = 0
print(b)


import math
import sys, collections
MAXN = 10000001

def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w')

def get_array():
	l = list(map(int, input().split()))
	return l

def get_2_ints():
	(a, b) = map(int, input().split())
	return (a, b)

def get_3_ints():
	(a, b, c) = map(int, input().split())
	return (a, b, c)

def sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, mt.ceil(mt.sqrt(MAXN))):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def getFactorization(x):
	ret = list()
	while x != 1:
		ret.append(spf[x])
		x = x // spf[x]
	return ret

def getFloor(A, x):
	(left, right) = (0, len(A) - 1)
	(ind, floor) = (-1, -1)
	while left <= right:
		mid = (left + right) // 2
		if x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			ind = mid
			left = mid + 1
	return ind
mod = 10 ** 9 + 7

def main():
	s = input()
	a = int(s[:-1])
	b = int(s[:-2] + s[-1])
	print(max(a, b, int(s)))
main()


n = int(input())
if n >= 0:
	final = n
if n < 0 and n >= -9:
	final = 0
if n <= -10:
	b = str(n)
	c = int(b[:-1])
	d = int(b[:-2] + b[-1])
	if c > d:
		final = c
	else:
		final = d
print(final)


n = int(input())
if n > 0:
	print(n)
else:
	n = str(n)
	max1 = min(n[-1], n[-2])
	n = n[:-2]
	n = n + max1
	if n == '-0':
		print(n[-1])
	else:
		print(n)


while True:
	try:
		line = input()
		if int(line) >= 0:
			print(int(line))
			continue
		else:
			line1 = list(line)
			line2 = list(line)
			line1[-1] = ''
			line2[-2] = ''
			line1 = ''.join(line1)
			line2 = ''.join(line2)
			a = int(line1)
			b = int(line2)
			print(max(a, b))
	except EOFError:
		break


a = input()
k = int(a)
last = int(a[-1])
last_be = int(a[-2])
if k >= 0:
	print(k)
	exit()
k_1 = int((k + last) / 10 + last_be - last)
k_2 = int((k + last) / 10)
if k_1 < k_2:
	print(k_2)
else:
	print(k_1)


x = input()
if x[0] != '-':
	print(x)
else:
	print(max(int(x[:-1]), int(x[:-2] + x[-1])))


x = str(input())
x1 = x[:-1]
x2 = x[:-2] + x[-1:]
x = int(x)
x1 = int(x1)
x2 = int(x2)
print(max(x1, x2, x))


account_balance = input()

def solve():
	if account_balance[0] != '-':
		return account_balance
	if int(account_balance[-1]) > int(account_balance[-2]):
		good_bal = account_balance[0:-1]
	else:
		good_bal = account_balance[0:-2] + account_balance[-1]
	return 0 if good_bal == '-0' else good_bal
print(solve())


n = int(input())
if n > 0:
	print(n)
else:
	n *= -1
	x = -int(n / 10)
	y = int(n / 100)
	y = -(y * 10 + n % 10)
	if x > y:
		print(x)
	else:
		print(y)


n = int(input())
if n >= 0:
	print(n)
else:
	val = str(n)
	if int(val[len(val) - 1]) >= int(val[len(val) - 2]):
		result = val[:len(val) - 1]
	else:
		result = val[:len(val) - 2] + val[len(val) - 1:len(val)]
	if result == '-0':
		print('0')
	else:
		print(result)


n = int(input())
if n >= 0:
	print(n)
else:
	a = str(abs(n))
	a = [int(i) for i in a]
	if a[-1] >= a[-2]:
		del a[-1]
	else:
		del a[-2]
	a = [str(i) for i in a]
	print(int('-' + ''.join(a)))


state = int(input())
if state >= 0:
	print(state)
else:
	state = abs(state)
	last_digit = state % 10
	state //= 10
	penultimate = state % 10
	if last_digit > penultimate:
		print(-state)
	else:
		print(-(state - penultimate + last_digit))


import math
import re
from fractions import Fraction
from collections import Counter

class Task:
	n = 0
	answer = 0

	def __init__(self):
		self.n = input()

	def solve(self):
		n = self.n
		self.answer = max(int(n), int(n[:-2] + n[-1]), int(n[:-1]))

	def printAnswer(self):
		print(self.answer)
task = Task()
task.solve()
task.printAnswer()


n = int(input())
if n > 0:
	print(n)
elif len(str(n)) == 1:
	print(0)
else:
	n = -n
	k = n
	r1 = k % 10
	k = k // 10
	r2 = k % 10
	if r1 > r2:
		z = str('-') + str(n)[0:len(str(n)) - 1]
		print(int(z))
	else:
		z = str('-') + str(n)[0:len(str(n)) - 2] + str(n)[len(str(n)) - 1]
		print(int(z))


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	first = n // 10
	first = -first
	second = n // 100 * 10 + n % 10
	second = -second
	if first > second:
		print(first)
	else:
		print(second)


n = int(input())
if n >= 0:
	print(n)
else:
	k = n % 10
	s = str(n)
	if k == 0:
		if len(s) > 3:
			s = s[0:len(s) - 2] + s[len(s) - 1]
			print(s)
		else:
			s = s[1:len(s) - 2] + s[len(s) - 1]
			print(s)
	else:
		s1 = s[0:len(s) - 1]
		s2 = s[0:len(s) - 2] + s[len(s) - 1]
		print(min(s1, s2))


x = input()
if int(x) > 0:
	print(x)
elif len(x) <= 2:
	print(x)
else:
	str1 = x[0:len(x) - 1]
	str2 = x[0:len(x) - 2] + x[len(x) - 1]
	if str1 == '-':
		str1 = 0
	if str2 == '-':
		str2 = 0
	if int(str1) > int(str2):
		print(int(str1))
	else:
		print(int(str2))


n = int(input())
if abs(n) == n:
	print(n)
else:
	str_n = str(n)
	option1 = str_n[:-1]
	option2 = str_n[:-2] + str_n[-2 + 1:]
	print(int(min(option1, option2)))


def bank(n):
	if int(n) < 0:
		print(max(int(n[:-1]), int(n[:-2] + n[-1])))
	if int(n) >= 0:
		print(n)
n = input()
bank(n)


n = int(input())
if n < 0:
	if len(str(abs(n))) == 1:
		print(0)
	else:
		x = min(int(abs(n) / 100) * 10 + abs(n) % 10, int(abs(n) / 100) * 10 + int(abs(n) % 100 / 10))
		print(-x)
else:
	print(n)


x = int(input())
yolo = list(str(x))
if len(str(x)) == 1:
	print(x)
elif x >= 0:
	print(x)
elif yolo[len(yolo) - 1] >= yolo[len(yolo) - 2]:
	yolo.pop(len(yolo) - 1)
	if ''.join(yolo) == '-0':
		print(0)
	else:
		print(''.join(yolo))
else:
	yolo.pop(len(yolo) - 2)
	if ''.join(yolo) == '-0':
		print(0)
	else:
		print(''.join(yolo))


num_str = input()
options = [int(num_str), int(num_str[:-1]), int(num_str[:-2] + num_str[-1:])]
print(max(options))


n = int(input())
if n >= 0:
	print(n)
else:
	n = abs(n)
	last_rem = n % 10
	last = (n - last_rem) // 10
	sec_rem = n % 100
	sec = (n - sec_rem) // 10
	sec_last = sec + last_rem
	if last < sec_last:
		print(0 - last)
	else:
		print(0 - sec_last)


n = int(input())
length = len(str(-1 * n))
if n >= 0:
	print(n)
elif length != 2:
	s = str(-1 * n)
	qudiaozuihou = int(s[:-1])
	qudiaodaoshudier = 10 * int(s[:-2]) + int(s[length - 1])
	print(max(-1 * qudiaozuihou, -1 * qudiaodaoshudier))
elif length == 2:
	s = str(-1 * n)
	qudiaozuihou = int(s[0]) * -1
	qudiaodaoshudier = int(s[1]) * -1
	print(max(qudiaozuihou, qudiaodaoshudier))


inp = input()
gr = int(inp)
if int(inp[:-1]) > gr:
	gr = int(inp[:-1])
if int(inp[:-2] + inp[-1]) > gr:
	gr = int(inp[:-2] + inp[-1])
print(gr)


n = int(input().strip())
if n >= 0:
	print(n)
else:
	n = str(n)
	if int(n[-1]) <= int(n[-2]):
		print(int(n[:-2] + n[-1]))
	else:
		print(int(n[:-1]))


a = input()
print(max(int(a), int(a[:len(a) - 1]), int(a[:len(a) - 2] + a[len(a) - 1:])))


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
number = read_str()
print(max(int(number), int(number[:-1]), int(number[:-2] + number[-1])))


n = int(input())
if n >= 0:
	print(n)
else:
	x = -n // 100
	print(-10 * x - min((-n - 100 * x) % 10, (-n - 100 * x) // 10))


t = int(input())
if t >= 0:
	print(str(t))
	exit()
t1 = (t + abs(t) % 100) // 100 if abs(t) >= 100 else 0
r = max((t + abs(t) % 10) // 10, t1 * 10 - abs(t) % 10, t)
print(str(r))


inp = int(input())
if inp >= 0:
	print(inp)
else:
	ina = abs(inp)
	ans1 = ina // 10
	ans2 = ina // 100 * 10 + ina % 10
	ans = ans1 if ans1 < ans2 else ans2
	if ans > 0:
		print('-', ans, sep='')
	else:
		print('0')


n = input()
if '-' not in n:
	print(n)
else:
	s = n[1:]
	a = s[:-2] + s[-1]
	b = s[:-1]
	out = '-' + str(min(int(a), int(b)))
	if out == '-0':
		print('0')
	else:
		print(out)


bank_amount = input()
new = ''
new1 = ''
if int(bank_amount) > 0:
	print(bank_amount)
else:
	splited = list(bank_amount)
	for item in splited:
		if item != '-':
			new = new + item
	i = 0
	while i < len(splited):
		if splited[i] != '-':
			if i != len(splited) - 2:
				new1 = new1 + splited[i]
		i += 1
	new = new[:-1]
	if int(new) * -1 > int(new1) * -1:
		print(int(new) * -1)
	else:
		print(int(new1) * -1)


n = int(input())
if n <= 0:
	n = -n
	l = n % 10
	m = (n - l) // 10
	k = n // 100 * 10 + l
	if m > k:
		print(-k)
	else:
		print(-m)
else:
	print(n)


a = input()
fst_c = 0
scnd_c = 0
if int(a) >= 0:
	print(a)
elif a[-1] <= a[-2]:
	print(a[:-2] + a[-1] if a[:-2] + a[-1] != '-0' else 0)
else:
	print(a[:-1])


a = input()
if int(a) >= 0:
	print(a)
else:
	k = int(a[-1])
	l = int(a[-2])
	if l > k:
		a = a[:-2] + a[-1:]
		if a == '-0':
			print(a[1:])
		else:
			print(a)
	else:
		a = a[:-1]
		print(a)


n = input()
x = int(n)
if x > 0:
	print(x)
else:
	y = [n[i] for i in range(len(n))]
	y.remove('-')
	if y[len(n) - 2] > y[len(n) - 3]:
		y.pop(len(n) - 2)
	else:
		y.pop(len(n) - 3)
	if y[0] != '0':
		print('-', end='')
	for i in range(len(n) - 2):
		print(y[i], end='')


n = input()
if int(n) >= 0:
	print(n)
else:
	temp1 = int(n[:-1])
	temp2 = n[:-2] + n[-1:]
	if temp2 == '-0':
		temp2 = 0
	temp2 = int(temp2)
	n = int(n)
	if temp1 > n:
		n = temp1
	if temp2 > n:
		n = temp2
	print(n)


n = input()
if int(n) > 0:
	print(n)
else:
	q = n[:-1]
	z = n[:-2] + n[-1]
	if int(q) > int(z):
		if int(q) == 0:
			print(0)
		else:
			print(int(q))
	elif int(z) == 0:
		print(0)
	else:
		print(int(z))


n = int(input())
l = []
if n >= 0:
	print(n)
else:
	k = str(n)
	for i in k:
		l.append(i)
	if len(l) == 2:
		print(0)
	elif len(l) == 3 and l[2] == '0':
		print(0)
	else:
		a = int(l[-1])
		b = int(l[-2])
		k = min(a, b)
		l.pop(-1)
		l.pop(-1)
		l.append(k)
		for i in l:
			print(i, end='')


n = int(input())
if n >= 0:
	print(n)
else:
	s = str(n)
	n = int(s[1:])
	d1 = n % 10
	n = n // 10
	d2 = n % 10
	m = min(d1, d2)
	if s[:-2] == '-' and m == 0:
		print(0)
	else:
		print(s[:-2] + str(m))


def main():
	n = int(input())
	if n >= 0:
		return n
	a = int(''.join(str(n)[:-1]))
	b = int(''.join(str(n)[:-2] + str(n)[-1:]))
	return max(a, b)
print(main())


n = input()
n1 = int(n[0:-1])
n2 = int(n[0:-2] + n[-1])
n = int(n)
if n > n1 and n > n2:
	print(n)
elif n1 > n and n1 > n2:
	print(n1)
elif n2 > n and n2 > n1:
	print(n2)
else:
	print(n1)


n = input()
if n[0] != '-':
	print(n)
else:
	a = max(int(n[:-1]), int(n[:-2] + n[-1]))
	print(a)


import math
n = int(input())
s = [n]
if n < 0:
	a = -n
	b = -math.floor(a / 10)
	c = -(10 * math.floor(a / 100) + a % 10)
	s.append(b)
	s.append(c)
	print(max(s))
else:
	print(n)


n = int(input())
if n > 0:
	print(n)
else:
	t = str(n)
	l = list(t)
	l1 = list(t)
	l[-1] = ''
	l1[-2] = ''
	r1 = int(''.join(l))
	r2 = int(''.join(l1))
	print(max(r1, r2))


n = input()
if int(n) >= 0:
	print(int(n))
else:
	list = []
	for i in range(len(n) - 2, len(n)):
		list.append(n[:i] + n[i + 1:])
	list = [int(i) for i in list]
	print(max(list))


import math
from collections import Counter

def get(f):
	return map(f, input().split())

def main():
	n = int(input())
	if n >= 0:
		print(n)
	else:
		last = int(n / 10)
		strn = str(n)
		pre_last = int(str(n)[:-2] + str(n)[-1])
		print(max(last, pre_last))
main()


n = input()
L = len(n)
if int(n) >= 0:
	print(n)
else:
	a = int(n[0:L - 1])
	b = int(n[0:L - 2] + n[L - 1])
	number = max(a, b)
	print(number)


s = input()
if s.count('-') != 1:
	print(s)
elif -1 * int(s[1:len(s) - 1]) > -1 * int(s[1:len(s) - 2] + s[len(s) - 1]):
	print(-1 * int(s[1:len(s) - 1]))
else:
	print(-1 * int(s[1:len(s) - 2] + s[len(s) - 1]))


num = int(input())
if num < 0:
	num = -1 * num
	l = num % 10
	sl = int(num / 10) % 10
	if num < 100:
		if l > sl:
			num = -1 * sl
		else:
			num = -1 * l
	elif l > sl:
		num = -1 * int(num / 10)
	else:
		num = int(num / 100)
		num = -10 * num - l
print(num)


def main():
	n = int(input())
	if n > -10:
		print(n)
	else:
		n = str(n * -1)
		l = len(n)
		print(min(int(n[:l - 1]), int(n[:l - 2] + n[l - 1])) * -1)
main()


from sys import stdin
import math
n = int(stdin.readline().rstrip())
s = str(n)
a = s[:len(s) - 1]
b = ''
if n < 0:
	b = s[0:len(s) - 2] + s[len(s) - 1:]
else:
	b = s[:len(s) - 2] + s[len(s) - 1:]
print(max(int(a), int(b), n))


n = input()
if int(n) >= 0:
	print(n)
else:
	a = n[1:len(n) - 1]
	b = n[1:len(n) - 2] + n[len(n) - 1:]
	ans = min(int(a), int(b))
	if ans == 0:
		print(0)
	else:
		print(-1 * ans)


n = int(input())
if n >= 0:
	print(int(n))
elif n > -100 and -n % 10 == 0:
	print(int(0))
else:
	a = []
	k = len(str(n))
	for i in range(k - 2, k):
		l = list(str(n))
		del l[i]
		s = int(''.join(l))
		a.append(s)
	print(int(max(a)))


import sys

def data():
	return sys.stdin.readline().strip()

def sp():
	return map(int, data().split())

def l():
	return list(sp())
n = int(data())
if n > 0:
	print(n)
elif n % 10 == 0 and len(str(n)) == 2:
	print(n % 10)
elif n % 10 > n or n % 10 == 0:
	a = str(n)[:-1]
	b = str(n)[:-2] + str(n)[-1]
	if int(a) > int(b):
		print(int(a))
	else:
		print(int(b))


def larger(x, y):
	if x > y:
		return x
	return y
S = input()
if int(S) > 0:
	print(S)
else:
	print(larger(int(S[:len(S) - 1]), int(S[:len(S) - 2] + S[-1])))


n = int(input())
if n > 0:
	print(n)
else:
	n = abs(n)
	n_str = str(n)
	n1 = n_str[:len(n_str) - 1]
	n2 = n_str[:len(n_str) - 2] + n_str[-1]
	n3 = min(int(n1), int(n2)) * -1
	print(n3)


n = int(input())
if n > 0:
	print(n)
else:
	s = str(n)
	s1 = s[0:len(s) - 1]
	s2 = s[0:len(s) - 2] + s[-1]
	is1 = abs(int(s1))
	is2 = abs(int(s2))
	if is1 > is2:
		if s2 == '-0':
			print(0)
		else:
			print(s2)
	elif s1 == '-0':
		print('0')
	else:
		print(s1)


n = str(input())
n1 = int(n)
n2 = int(n[:-1])
n3 = int(n[:-2] + n[-1:])
print(max(n1, n2, n3))


string = input()
a = int(string)
b = int(string[:len(string) - 1])
c = int(string[:len(string) - 2] + string[-1])
print(max(a, b, c))


import sys
score = str(input())
length_score = len(score)
if score[0] == '-':
	last_value = int(score[length_score - 1])
	prev_last_value = int(score[length_score - 2])
	if len(score) == 3:
		if last_value > prev_last_value:
			answer = -prev_last_value
		elif last_value == 0:
			answer = 0
		else:
			answer = -last_value
	elif last_value > prev_last_value:
		answer = -int(score[1:length_score - 1])
	else:
		answer = -int(score[1:length_score - 2] + score[length_score - 1])
else:
	answer = int(score)
print(answer)


a = input()
if int(a) >= 0:
	print(a)
else:
	b = a[:len(a) - 2]
	c = min(int(a[-1]), int(a[-2]))
	print(int(b + str(c)))


n = int(input())
a = int(str(n)[:-1])
b = int(str(n)[:-2] + str(n)[-1])
print(max(n, a, b))


a = int(input())
d = str(a)
D = d[-2:]
C = d[1:-2]
O = d[1:-2]
S = min(D)
w = C + S
if a < 0 and len(w) <= 1 and (w[0] == '0'):
	print(0)
elif a < 0:
	print('-' + w)
else:
	print(a)


from os import path
from sys import stdin
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
	stdout = open('output.txt', 'w')

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

	def In():
		return map(int, input().split())
else:

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

	def In():
		return map(int, stdin.readline().split())

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

	def Sn():
		return stdin.readline().split(' ')

def func():
	n = int(input())
	if n >= 0:
		return n
	l = list(str(abs(n)))
	if int(l[-1]) < int(l[-2]):
		return int(''.join(('-', *l[:-2], l[-1])))
	return int(''.join(('-', *l[:-1])))
print(func())


n = int(input())
if n > 0:
	print(n)
elif n < 0:
	l = list(str(n))
	del l[-1]
	p = int(''.join(l))
	l = list(str(n))
	del l[-2]
	q = int(''.join(l))
	if p > q:
		print(p)
	else:
		print(q)


n = int(input())
if n >= 0:
	print(n)
elif n >= -9:
	print(0)
else:
	x1 = str(n)
	x1 = x1[:len(x1) - 1]
	x1 = int(x1)
	x2 = str(n)
	x2 = x2[:len(x2) - 2] + x2[len(x2) - 1]
	x2 = int(x2)
	print(max(x2, x1))


n = int(input())
if n >= 0:
	print(n)
else:
	s = str(n)
	a = int(s[-1])
	b = int(s[-2])
	if a > b:
		s = s[:-1]
		if abs(int(s)) == 0:
			print(0)
		else:
			print(s)
	else:
		s = s[:-2] + s[-1]
		if abs(int(s)) == 0:
			print(0)
		else:
			print(s)


import sys
import math
n = int(sys.stdin.readline())
if n > 0:
	print(n)
else:
	ost = int(math.fabs(n) % 100)
	a = int(ost / 10)
	b = ost % 10
	if b > a:
		print(int(n / 10.0))
	else:
		k = int(n / 100.0)
		print(k * 10 - b)


x = input()
x = str(x)
x1 = x[:len(x) - 1]
x2 = x[:len(x) - 2] + x[len(x) - 1]
if int(x) >= 0:
	print(x)
elif abs(int(x1)) <= abs(int(x2)):
	print(int(x1))
else:
	print(int(x2))


x = int(input())
n = 1
m = 1
if x >= 0:
	print(x)
else:
	y = list(str(x))
	l = len(y)
	if int(y[l - 1]) > int(y[l - 2]):
		y.pop(l - 1)
	else:
		y.pop(l - 2)
	while n < len(y):
		if y[n] == '0':
			m = m + 1
		n = n + 1
	if m == len(y):
		print(0)
	else:
		z = ''.join(y)
		print(z)


x = int(input())
if x < 0:
	a = int(x / 10)
	b = int(x / 100) * 10 - -x % 10
	if a > b:
		print(a)
	else:
		print(b)
else:
	print(x)


n = input()
s = ''
if int(n) >= 0:
	print(int(n))
elif int(n) < 0:
	if int(n[-1]) >= int(n[-2]):
		s = n[0:len(n) - 1]
	elif int(n[-2]) > int(n[-1]):
		s = n[0:len(n) - 2] + n[-1]
	if int(s) == 0:
		print(0)
	else:
		print(s)


x = input()
m = list(x)
y = list(x)
n = int(x)
if n > 0:
	print(n)
else:
	a = m[-1]
	m.pop()
	r = int(''.join(m))
	m.pop()
	m.append(a)
	t = int(''.join(m))
	if r > t:
		print(r)
	else:
		print(t)


n = int(input())
if n >= 0:
	print(n)
else:
	x = str(-n)
	l = len(x)
	ans1 = x[0:l - 1]
	ans2 = x[0:l - 2] + x[l - 1]
	print(-1 * min(int(ans1), int(ans2)))


s = str(input())
n = int(s)
s1 = int(s[:len(s) - 1])
s2 = int(s[:len(s) - 2] + s[-1])
print(max(n, s1, s2))


n = int(input())
if n > 0:
	print(str(n))
if n < 0:
	n1 = -1 * (abs(n) // 10)
	n2 = -1 * (abs(n) // 100 * 10 + abs(n) % 10)
	print(max(n, n1, n2))
if n == 0:
	print(str(n))


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	p = n // 10
	q = p // 10 * 10 + n % 10
	if p > q:
		print(-q)
	else:
		print(-p)


s = input()
ans = int(s)
if s[0] == '-' and len(s) >= 2:
	if len(s) == 2:
		ans = 0
	else:
		ans = max(int(s[:-1]), int(s[:-2] + s[-1]), ans)
print(ans)


n = int(input(''))
n_list = list(str(n))
last = n_list[:-1]
n_list.pop(-2)
if n >= 0:
	print(n)
else:
	la = int(''.join(last))
	bf_la = int(''.join(n_list))
	la_int = int(la)
	bf_la_int = int(bf_la)
	print(max(la_int, bf_la_int))


t = int(input())
if t < 0:
	n = -t
	d = -(n // 10)
	f = n % 10
	n //= 100
	h = -int(str(n) + str(f))
	x = max(d, h)
	print(x)
else:
	print(t)


n = int(input())
if n >= 0:
	print(n)
else:
	k = -1 * n
	one = -1 * (k // 10)
	two = k // 100 * 10 + k % 10
	second = -1 * two
	print(max(one, second))


num = input()
l = len(num) - 1
if int(num) >= 0:
	print(num)
else:
	print(int(num[:l - 1] + min(num[l - 1], num[l])))


s = input()
n = int(s)
if n >= 0:
	print(s)
elif n >= -10:
	print(0)
else:
	a = s[-1]
	b = s[-2]
	if a > b:
		print(int(s[0:-2] + b))
	else:
		print(int(s[0:-2] + a))


n = int(input())
if n >= 0:
	print(n)
elif n < 0 and n > -10:
	print('0')
else:
	x = int(n / 10)
	y = int(n / 100)
	p = (-1 * y * 10 + int(-1 * n % 10)) * -1
	print(max(x, p))


x = input()
if int(x) < 0:
	if abs(int(x[:-2] + x[-1])) > abs(int(x[:-1])):
		print(int(x[:-1]))
	else:
		print(int(x[:-2] + x[-1]))
else:
	print(x)


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	nstr = str(n)
	nlist = list(nstr)
	numberlast = int(''.join(nlist[:len(nlist) - 1]))
	del nlist[-2]
	numberseclast = int(''.join(nlist))
	print(-min(numberlast, numberseclast))


s = str(input())
if int(s) >= 0:
	print(s)
else:
	s = list(s)
	if int(s[len(s) - 1]) >= int(s[len(s) - 2]):
		s.pop(len(s) - 1)
	else:
		s.pop(len(s) - 2)
	if len(s) == 2 and s[1] == '0':
		print(0)
	else:
		for _ in range(len(s)):
			print(s[_], end='')


num = input()
multiplier = 1
num1 = int(int(num) / 10)
if int(num) < 0:
	multiplier = -1
num2 = int(abs(int(int(num) / 100) * 10) + int(num[len(num) - 1])) * multiplier
if num1 < int(num) and num2 < int(num):
	print(int(num))
	exit()
if num1 > num2:
	print(num1)
else:
	print(num2)


n = input()
l = []
l.append(int(n))
x = n[:len(n) - 1]
l.append(int(x))
x = n[:len(n) - 2]
x = x + n[-1]
l.append(int(x))
print(max(l))


bank = input()
acc = int(bank)
if acc >= 0:
	print(acc)
elif acc <= -1 and acc >= -9:
	print('0')
else:
	listacc1 = list(bank)
	listacc2 = list(bank)
	listacc1[len(listacc1) - 1] = ''
	listacc2[len(listacc2) - 2] = ''
	acc1 = ''.join(listacc1)
	acc2 = ''.join(listacc2)
	iacc1 = int(acc1)
	iacc2 = int(acc2)
	if iacc1 > iacc2:
		print(iacc1)
	else:
		print(iacc2)


s = input()
n = len(s)
if int(s) < 0:
	id = 0
	if s[n - 1] > s[n - 2]:
		id = n - 1
	else:
		id = n - 2
	s = list(s)
	s[id] = ''
	s = ''.join(s)
	print(int(s))
else:
	print(s)


n = int(input())
if n > 0:
	print(n)
else:
	s = str(n)
	(s1, s2) = ('', '')
	for i in range(len(s)):
		if i != len(s) - 1:
			s1 += s[i]
		if i != len(s) - 2:
			s2 += s[i]
	maxi = max(n, int(s1))
	maxi = max(maxi, int(s2))
	print(maxi)


n = int(input())
if n >= 0:
	print(n)
else:
	a = str(n)
	if int(a[-1]) >= int(a[-2]):
		print(int(a[0:-1]))
	else:
		print(int(a[0:-2] + a[-1]))


import bisect, math
s = input()
if int(s) >= 0:
	print(s)
else:
	res = int(s)
	res = max(res, int(s[:-1]))
	res = max(res, int(s[:-2] + s[-1]))
	print(res)


n = input()
A = []
if int(n) >= 0:
	print(n)
else:
	for str in n:
		A.append(str)
	if int(A[len(A) - 1]) > int(A[len(A) - 2]):
		A.pop(len(A) - 1)
	else:
		A.pop(len(A) - 2)
	if int(''.join(A)) == 0:
		print(0)
	else:
		print(''.join(A))


status = input()
y = list(status)
if int(status) < 0:
	if int(status[-1]) >= int(status[-2]):
		y.pop(-1)
	else:
		y.pop(-2)
	y = ''.join(y)
	if int(y) == 0:
		print(0)
	else:
		print(y)
else:
	print(status)


n = int(input())
Max = n
if int(n / 10) > Max:
	Max = int(n / 10)
if n > 0:
	last = n % 10
else:
	last = -(-n % 10)
if n > 0:
	first = int(n / 100) * 10
else:
	first = -int(-n / 100) * 10
if last + first > Max:
	Max = last + first
print(Max)


n = int(input())
if n < 0:
	n = n * -1
	a = str(n)
	z = n
	z = z // 100
	if z != 0:
		s = '-' + str(z)
	elif n % 10 != 0:
		s = '-'
	else:
		s = ''
	if n % 10 > n // 10 % 10:
		print(s + a[-2])
	else:
		print(s + a[-1])
else:
	print(n)


n = eval(input())
if n >= 0:
	print(n)
else:
	tmp = str(n)
	maxium = -999999999
	maxium = max(maxium, eval(tmp[0:-1]))
	maxium = max(maxium, eval(tmp[:-2] + tmp[-1]))
	print(maxium)


n = input()
if int(n) >= 0:
	print(n)
else:
	n = n[1:]
	last = int(n[:-1])
	prev_last = int(n[:-2] + n[-1:])
	if last < prev_last:
		print('-' + str(last)) if not last == 0 else print(last)
	else:
		print('-' + str(prev_last)) if not prev_last == 0 else print(prev_last)


a = input()
if a[0] != '-':
	print(a)
elif len(a) == 2:
	print(0)
elif len(a) == 3 and '0' in a:
	print(0)
elif int(a[-1]) <= int(a[-2]):
	print(a[:-2] + a[-1])
else:
	print(a[:-1])


n = int(input())
if n >= -10 or (n > -100 and n % 10 == 0):
	print(max(n, 0))
else:
	a = int(str(n)[:-1])
	b = int(str(n)[:-2] + str(n)[-1])
	print(max(a, b))


def Ilya(s):
	if int(s) < 0:
		(m, n) = (int(s[-1]), int(s[-2]))
		return int(s[:-1]) if m > n else int(s[:-2] + s[-1])
	return s
s = input()
print(Ilya(s))


n = int(input())
k = str(n)
a = []
b = []
for i in range(0, len(k)):
	if i == len(k) - 1:
		a.append(str(k[i]))
	elif i == len(k) - 2:
		b.append(str(k[i]))
	else:
		a.append(str(k[i]))
		b.append(str(k[i]))
c = ''
d = ''
aa = c.join(a)
bb = d.join(b)
print(max(int(aa), int(bb), n))


N = int(input())
if N >= 0:
	print(N)
else:
	b = abs(N) // 10
	a = abs(N) // 100 * 10 + abs(N) % 10
	t = min(a, b)
	if t == 0:
		print(0)
	else:
		print('-' + str(min(a, b)))


n = input()
removeLast = 0
removeBeforeLast = 0
removeLast = int(''.join(n[:len(n) - 1]))
str = ''.join(n[:len(n) - 2]) + n[-1]
removeBeforeLast = int(str)
print(max(max(int(n), removeLast), removeBeforeLast))


l = input()
if int(l) < 0:
	k = list(l)
	p = len(k)
	if k[p - 1] > k[p - 2]:
		del k[p - 1]
		if len(k) == 2:
			if k[1] == '0':
				print('0')
			else:
				print(''.join(map(str, k)))
		else:
			print(''.join(map(str, k)))
	else:
		del k[p - 2]
		if len(k) == 2:
			if k[1] == '0':
				print('0')
			else:
				print(''.join(map(str, k)))
		else:
			print(''.join(map(str, k)))
else:
	print(l)


from sys import stdin

def main():
	s = stdin.readline().strip()
	if s[0].isdigit():
		return s
	elif len(s) == 2 or (len(s) == 3 and s[2] == '0'):
		return '0'
	return max(s[:-1], s[:-2] + s[-1], key=int)
print(main())


balance = input()
Last = balance[:-1]
beforeLast = balance[:-2] + balance[-1]
print(max(int(balance), int(Last), int(beforeLast)))


n = int(input())
if n > 0:
	print(n)
else:
	x = list(str(n))
	if x[-2] > x[-1]:
		del x[-2]
		if len(x) == 2 and x[1] == '0':
			print(0)
		else:
			print(*x, sep='')
	else:
		print(*x[:-1], sep='')


n = int(input())
if n == 0:
	print(0)
elif n % 100 == 0 and n < 0:
	print(n // 10)
else:
	print(max(n, n // 10 + 1, -(-n % 10) + (n // 100 + 1) * 10))


n = input()
a = max(int(n), int(n[:-1]), int(n[:-2] + n[-1]))
print(a)


s = input()
n = len(s)
t1 = 0
t2 = ''
if int(s) < 0:
	temp = -1 * int(s)
	t1 = int(temp / 10)
	t2 = str(int(temp / 100)) + s[n - 1]
	print(-1 * min(t1, int(t2)))
else:
	print(s)


a = input()
if a[0] == '-':
	print(int(a[:-2] + str(min(int(a[-1]), int(a[-2])))))
else:
	print(a)


m = input()
c = 1
if m[0] != '-':
	print(m)
else:
	for i in range(1, len(m) - 2):
		if m[i] != '0':
			c = 0
	if c == 1:
		i = len(m) - 2
		if m[i] == '0' or m[i + 1] == '0':
			print('0')
		elif len(m) == 2:
			print(m)
		else:
			for i in range(0, len(m) - 2):
				print(m[i], end='')
			i = len(m) - 2
			if ord(m[i]) < ord(m[i + 1]):
				print(m[i])
			else:
				print(m[i + 1])
	else:
		for i in range(0, len(m) - 2):
			print(m[i], end='')
		i = len(m) - 2
		if ord(m[i]) < ord(m[i + 1]):
			print(m[i])
		else:
			print(m[i + 1])


n = int(input())
if n >= 0:
	print(n)
else:
	l = list(str(n))
	x = l.pop()
	m = ''.join(l)
	t = l.pop()
	l.append(x)
	x = ''.join(l)
	print(int(min(m, x)))


str = input()
n = int(str)
if n >= 0:
	print(n)
else:
	a = -n % 10
	b = -n % 100 // 10
	if a >= b:
		print(-(-n // 10))
	elif -n % 10 == 0 and -n // 10 < 10:
		print('0')
	else:
		print(-(-n // 100) * 10 - a)


def process(n):
	if n > -10:
		return n
	if n in [-10, -20, -30, -40, -50, -60, -70, -80, -90]:
		return 0
	return max(int(str(n)[:-1]), int(str(n)[:-2] + str(n)[-1]))
print(process(int(input())))


money = int(input())
if money >= 0:
	print(money)
else:
	line = list(str(-money))
	c = len(line)
	linea = line
	del linea[c - 1]
	a = ''
	b = ''
	for i in linea:
		a = a + i
	line = list(str(-money))
	lineb = line
	del lineb[c - 2]
	for i in lineb:
		b = b + i
	if int(a) < int(b):
		print(-int(a))
	else:
		print(-int(b))


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	d0 = n % 10
	d1 = n // 10 % 10
	print(-(n // 100 * 10 + min(d0, d1)))


b = input()
s = ''
if int(b) >= 0:
	print(int(b))
else:
	l = list(b)
	if l[-1] > l[-2]:
		l.pop(-1)
	else:
		l.pop(-2)
	print(int(s.join(l)))


data = int(input())
new = -data
if data >= 0:
	print(data)
else:
	numb_1 = int(new / 10)
	letter = str(new)
	l = len(letter)
	numb_2 = letter[:l - 2] + letter[l - 1]
	if int(numb_1) < int(numb_2):
		z = -numb_1
		print(z)
	else:
		z = -int(numb_2)
		print(z)


n = int(input(''))
if n >= 0:
	print(n)
else:
	u = str(n)
	s = u[0:len(u) - 1]
	d = u[0:len(u) - 2] + u[len(u) - 1:len(u)]
	if int(s) > int(d):
		print(int(s))
	else:
		print(int(d))


balance = input()
if int(balance) > 0:
	print(balance)
elif len(balance) == 3:
	print(max(int(balance[1]) * -1, int(balance[2]) * -1, int(balance)))
else:
	print(balance[:len(balance) - 2] + min(balance[-2:]))


n = int(input())
if n > 0:
	print(n)
else:
	m = abs(n) % 10
	z = abs(n) // 10 % 10
	if m >= z:
		print(-(abs(n) // 10))
	else:
		print(-(abs(n) // 100 * 10 + m))


n = int(input())
if n > 0:
	print(n)
else:
	n = str(0 - n)
	l = [n[0:-2] + n[-1], n[0:-1]]
	for j in l:
		if j[0] == '0' and int(j) != 0:
			l.remove(j)
	l = list(map(int, l))
	print(0 - min(l))


a = list(input())
f = int(''.join(a))
if f < 0:
	b = a.copy()
	c = a.copy()
	del b[-2]
	del c[-1]
	a = int(''.join(a))
	b = int(''.join(b))
	c = int(''.join(c))
	if b > c:
		print(b)
	elif c > b:
		print(c)
	elif c == b:
		print(c)
else:
	a = int(''.join(a))
	print(a)


s = str(input())
n1 = s[:-1]
n2 = s[:-2] + s[-1]
s = int(s)
n1 = int(n1)
n2 = int(n2)
mas = [s, n1, n2]
print(max(mas))


s = input()
m = list(s)
n = len(m)
if s[0] != '-':
	print(s)
else:
	m1 = m[:-2]
	m1.append(min(m[n - 1], m[n - 2]))
	s1 = ''.join(m1)
	if s1 == '-0':
		print(0)
	else:
		print(s1)


n = int(input())
if n >= 0:
	print(n)
else:
	n1 = int(abs(n) / 10)
	x = abs(n) % 10
	n2 = int(abs(n) / 100) * 10 + x
	if n2 < n1:
		print(n2 * -1)
	else:
		print(n1 * -1)


S = input()
ans1 = int(S[:-1])
ans2 = int(S[:-2] + S[-1])
ans3 = int(S)
print(max(ans1, ans2, ans3))


a = [i for i in input()]
a_num = int(''.join(a))
if a_num < 0:
	b1 = int(''.join(a[:len(a) - 1]))
	b2 = int(''.join(a[:len(a) - 2]) + a[-1])
	print(b1) if b1 > b2 else print(b2)
else:
	print(a_num)


n = int(input())
if n >= 0:
	print(n)
else:
	m = list(str(n))
	a = len(m)
	if m[a - 1] < m[a - 2]:
		del m[a - 2]
	else:
		del m[a - 1]
	x = int(''.join(m))
	if abs(x) == 0:
		print(abs(x))
	else:
		print(''.join(m))


n = int(input())
if n >= 0:
	print(n)
else:
	s = '' + str(-n)
	k = len(s)
	ld = -int(s[0:k - 1])
	ld1 = -int(s[0:k - 2] + s[k - 1])
	if ld > ld1:
		print(ld)
	else:
		print(ld1)


def solve(n):
	if n >= 0:
		return n
	n *= -1
	nlast = -(n // 10)
	n2 = -(n // 100 * 10 + n % 10)
	return max(nlast, n2)
n = int(input())
print(solve(n))


def remove_at(i, s):
	return s[:i] + s[i + 1:]
n = int(input())
if n > 0:
	print(n)
else:
	n *= -1
	n = str(n)
	n1 = remove_at(len(n) - 1, n)
	n2 = remove_at(-2, n)
	(n1, n2) = (int(n1), int(n2))
	(n1, n2) = (n1 * -1, n2 * -1)
	print(max(n1, n2))


m = input()
if int(m) > 0:
	print(m)
else:
	m = list(m)
	m1 = m[0:len(m) - 1]
	m2 = m[0:len(m) - 2]
	m2.append(m[-1])
	m1 = int(''.join(m1))
	m2 = int(''.join(m2))
	print(max(m1, m2))


n = int(input())
if n >= 0:
	print(n)
elif n > -10:
	print(0)
else:
	k = str(n)
	x = int(k[-1])
	y = int(k[-2])
	r = -1 * n
	a = (r - x) // 10
	b = r // 100 * 10 + x
	print(max(-1 * a, -1 * b))


n = input()
if int(n) >= 0:
	print(n)
elif n[-1] == '0' and len(n) == 3:
	print(0)
elif int(n) > -10:
	print(n)
elif n[-1] >= n[-2]:
	ans = ''
	for i in range(len(n)):
		if i == len(n) - 1:
			continue
		else:
			ans = ans + n[i]
	print(ans)
else:
	ans = ''
	for i in range(len(n)):
		if i == len(n) - 2:
			continue
		else:
			ans = ans + n[i]
	print(ans)


state = input()
states = [int(state)]
if state[0] == '-' and len(state) != 2:
	for x in range(len(state) - 2, len(state)):
		temp = state
		digits = []
		for y in temp:
			digits.append(y)
		del digits[x]
		temp = ''
		for y in digits:
			temp += y
		if temp == '-0' or len(str(int(temp))) == len(temp):
			states.append(int(temp))
print(max(states))


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
string = get_string()
if int(string) > 0:
	print(string)
else:
	last = int(string[-1])
	sec_last = int(string[-2])
	if last > sec_last:
		string = string[:-1]
		print(string)
	else:
		string = string[::-1].replace(str(sec_last), '', 1)[::-1]
		print(int(string))


n = input()
mx = int(n)
if int(n) >= 0:
	print(n)
else:
	if int(mx) < int(n[:-1]):
		mx = n[:-1]
	if int(mx) < int(n[:-2] + n[-1]):
		mx = n[:-2] + n[-1]
	if int(mx) < int(n):
		mx = n
	if int(mx) == int(-0):
		print('0')
	else:
		print(mx)


a = int(input())
if a >= 0:
	print(a)
else:
	a = abs(a)
	k = [a]
	b = list(map(int, str(k[0])))
	if len(b) == 2:
		if b[-1] > b[-2]:
			b.pop(-1)
			if b[0] == 0:
				print(0)
			else:
				b.insert(0, '-')
				for i in b:
					print(i, end='')
		else:
			b.pop(-2)
			if b[0] == 0:
				print(0)
			else:
				b.insert(0, '-')
				for i in b:
					print(i, end='')
	elif b[-1] > b[-2]:
		b.pop(-1)
		b.insert(0, '-')
		for i in b:
			print(i, end='')
	else:
		b.pop(-2)
		b.insert(0, '-')
		for i in b:
			print(i, end='')


n = input()
L = [int(n[:-1]), int(n[:-2] + n[-1])]
res = max(L)
if res > int(n):
	print(res)
else:
	print(n)


line = input()
acc = int(line)
list_1 = []
if acc >= 0:
	print(line)
else:
	list_1 = [line[i] for i in range(len(line))]
	list_1.reverse()
	if int(list_1[0]) >= int(list_1[1]):
		del list_1[0]
	else:
		del list_1[1]
	list_1.reverse()
	ans = ''.join(list_1)
	print(int(ans))


n = input()
l = len(n)
x1 = n[0:l - 2] + n[l - 1]
x2 = n[0:l - 2] + n[l - 2]
(y0, y1, y2) = map(int, (n, x1, x2))
print(max(y0, y1, y2))


n = int(input())
if n > 0:
	print(n)
else:
	y = str(n)
	print(max(int(y[0:len(y) - 1]), int(y[0:len(y) - 2] + y[-1])))


n = int(input())
m = abs(n)
a = [int(x) for x in str(m)]
if n >= 0:
	print(n)
else:
	b = list(a)
	a.pop(len(a) - 1)
	b.pop(len(b) - 2)
	z = [str(i) for i in a]
	x = [str(j) for j in b]
	z = int(''.join(z))
	x = int(''.join(x))
	z = min(z, x)
	if z == 0:
		print(z)
	else:
		print('-' + str(z))


t = int(input())
if t >= 0:
	print(t)
else:
	t = str(t)
	if len(t) == 2:
		print(0)
	else:
		q = int(t[:-1])
		w = int(t[:-2] + t[-1])
		print(max(q, w))


n = input()
if n[0] != '-':
	print(n)
else:
	n = n[1:]
	li = len(n) - 1
	num = n[-1]
	l = len(n)
	start = l - 2 if l > 1 else l - 1
	for i in range(start, len(n))[::-1]:
		if num < n[i]:
			num = n[i]
			li = i
	n = n[:li] + n[li + 1:]
	f = False
	for i in n:
		if i != '0':
			print('-' + n)
			f = True
			break
	if not f:
		print(0)


n = int(input())
lst = []
s = ''
if n > 0:
	maxs = n
else:
	maxs = n
	n = str(n)
	for i in range(len(n) - 2):
		s = s + n[i]
	a1 = int(s + n[-1])
	a2 = int(s + n[-2])
	maxs = max(a1, a2)
print(maxs)


n = int(input())
if n >= 0:
	print(n)
else:
	a = list(str(n))
	del a[-1]
	p = int(''.join(a))
	a = list(str(n))
	del a[-2]
	q = int(''.join(a))
	if p > q:
		print(p)
	else:
		print(q)


import sys
balance = sys.stdin.readline().strip()
if balance[0] != '-':
	print(balance)
else:
	print(max(int(balance[:-1]), int(balance[:-2] + balance[-1])))


n = input()
mx = max(int(n), int(n[:-1]))
print(max(mx, int(n[:-2] + n[-1:])))


n = int(input())
c = [1, -1][n < 0]
n *= c
print(max(c * n, n // 10 * c, (n // 100 * 10 + n % 10) * c))


bank_account = input()
if int(bank_account) >= 0:
	print(bank_account)
elif len(bank_account) < 4 and int(bank_account) < 0:
	if bank_account[-1] > bank_account[-2]:
		print(bank_account[0:-1])
	elif bank_account[-1] < bank_account[-2]:
		if bank_account[2] == '0':
			print(bank_account[2])
		else:
			print(bank_account[0] + bank_account[-1])
	else:
		print(bank_account[0::2])
elif len(bank_account) >= 4 and int(bank_account) < 0:
	if bank_account[-1] > bank_account[-2]:
		print(bank_account[0:-1])
	elif bank_account[-1] < bank_account[-2]:
		print(bank_account[0:-2] + bank_account[-1])
	else:
		print(bank_account[0:-1])


s = input()
last = int(s[:-1])
last_before = list(s)
last_before.pop(-2)
last_before = int(''.join(last_before))
print(max(int(s), last, last_before))


n = int(input())
if n >= 0:
	print(n)
else:
	a = list(str(n))
	t = a.pop()
	x = int(''.join(a))
	a.append(t)
	a.pop(-2)
	y = int(''.join(a))
	print(max(x, y))


a = input()
if '-' in a:
	a = int(a)
	if -a // 10 < -a // 100 * 10 + -a % 10:
		print(-(-a // 10))
	else:
		print(-(-a // 100 * 10 + -a % 10))
else:
	print(a)


n = input()
if n >= '0':
	print(n)
else:
	maxi = min(n[:-1], n[:-2] + n[-1])
	if len(maxi) == 2 and maxi[1] == '0':
		print(0)
	else:
		print(maxi)


n = input()
num = int(n)
num_list = list(n)
if num >= 0:
	print(n)
elif int(n[-1]) > int(n[-2]):
	print(int(n.strip(n[-1])))
else:
	num_list.pop(-2)
	print(int(''.join(num_list)))


number = input()
n = int(number)
if n >= 0:
	print(n)
elif n < 0:
	x = n * -1
	y = x % 100
	w = y // 10
	z = x % 10
	if len(number) == 2:
		print(0)
	elif len(number) == 3 and y == 0:
		print(0)
	elif w > z:
		print((x // 100 * 10 + x % 10) * -1)
	else:
		print(x // 10 * -1)


bank = input()
balance = list(bank)
if int(bank) < 10:
	if balance[-2] > balance[-1]:
		balance.pop(-2)
	else:
		balance.pop(-1)
print(int(''.join(balance)))


string_balance = input()
x = len(string_balance)
last_dig = int(string_balance[0:x - 1])
before_last = int(string_balance[0:x - 2] + string_balance[x - 1])
print(max(int(string_balance), last_dig, before_last))


balance = input()
print(max(int(balance), int(balance[0:-1]), int(balance[:-2] + balance[-1])))


n = int(input())
if 10 <= abs(n) <= 10 ** 9:
	a = len(str(abs(n)))
	if n < 0 and a == 2 and (int(str(abs(n))[1]) == 0 or int(str(abs(n))[0]) == 0):
		print(0)
	elif n < 0 and a == 2 and (int(str(abs(n))[1]) > int(str(abs(n))[0])):
		print('-' + str(abs(n))[0])
	elif n < 0 and a == 2 and (int(str(abs(n))[1]) < int(str(abs(n))[0])):
		print('-' + str(abs(n))[1])
	elif 0 > n and a <= 10 and (int(str(abs(n))[a - 1]) == int(str(abs(n))[a - 2])):
		print(int(str(n)[:a]))
	elif 0 > n and a <= 10 and (int(str(abs(n))[a - 1]) > int(str(abs(n))[a - 2])):
		print(int(str(n)[:a]))
	elif 0 > n and a <= 10 and (int(str(abs(n))[a - 1]) < int(str(abs(n))[a - 2])):
		print('-' + str(abs(n))[:a - 2] + str(abs(n))[a - 1])
	else:
		print(n)


n = input()
if int(n) > 0:
	print(n)
else:
	num1 = n[:-1]
	num1 = int(num1)
	num2 = n[:-2] + n[-1]
	num2 = int(num2)
	if num1 > num2:
		print(num1)
	else:
		print(num2)


a = input()
b = list(a)
b1 = list(a)
b2 = list(a)
del b1[len(b) - 2]
del b2[len(b) - 1]
c = int(a)
c1 = ''.join(b1)
c2 = ''.join(b2)
print(max(c, int(c1), int(c2)))


import math
t = int(input())
x = abs(math.ceil(t / 10))
y = abs(int(str(math.ceil(t / 100)) + str(t)[-1]))
print(max(-1 * x, -1 * y, t))


n = int(input())
if n >= 0:
	print(n)
elif 0 > n >= -10 or (n % 10 == 0 and -100 < n <= -10):
	print(0)
else:
	num = list(str(n))
	if num[-1] >= num[-2]:
		num.pop()
		for i in num:
			print(i, end='')
	else:
		num.pop(-2)
		for i in num:
			print(i, end='')


n = int(input())
n1 = int(n / 10)
n2 = 10 * int(n / 100) + (n - 10 * n1)
print(max(n, n1, n2))


p = list(map(str, input()))
x = p.copy()
y = p.copy()
a = ''
b = ''
c = ''
if p[0] == '-':
	x.pop()
	y.pop()
	y.pop()
	y.append(p[len(p) - 1])
	s = a.join(x)
	d = b.join(y)
	print(max(int(s), int(d)))
else:
	print(int(c.join(p)))


N = input()
if N[0] == '-':
	if N[-1] < N[-2]:
		N = N[:-2] + N[-1]
	else:
		N = N[:-1]
print(int(N))


z = list(input())
lst = []
c = z.copy()
lst.append(int(''.join(z)))
z.reverse()
z.remove(z[0])
z.reverse()
lst.append(int(''.join(z)))
c.reverse()
c.remove(c[1])
c.reverse()
lst.append(int(''.join(c)))
print(max(lst))


a = int(input())
minus = False
if a < 0:
	minus = True
	a = -a
	last = a % 10
	previous = a // 10 % 10
	if last > previous:
		a = a // 10
	else:
		a = a // 100 * 10 + a % 10
	a = -a
print(a)


a = input()
if int(a) > 0:
	print(a)
else:
	a = str(abs(int(a)))
	w = a[:-2]
	b = a[-2]
	c = a[-1]
	if int(w + b) < int(w + c):
		print(-1 * int(w + b))
	else:
		print(-1 * int(w + c))


count = int(input())
if count < 0:
	count *= -1
	last_digit = count % 10
	penultimate = count // 10 % 10
	if last_digit >= penultimate:
		count //= 10
	else:
		count = count // 100 * 10 + last_digit
	count *= -1
print(count)


d = int(input())
d_list = []
if d > 0:
	print(d)
if d < 0:
	for i in str(d):
		d_list.append(i)
	for zx in range(0, len(d_list)):
		if zx == len(d_list) - 2:
			del d_list[zx]
	dq = ''
	for t in d_list:
		dq += t
	if int(dq) > int(str(d)[:-1]):
		print(int(dq))
	else:
		print(int(str(d)[:-1]))


n = input()
s = list(n)
ans = []
p = int(n)
if p >= 0:
	print(p)
else:
	if s[len(s) - 1] >= s[len(s) - 2]:
		for i in range(0, len(s) - 1):
			ans.append(s[i])
	else:
		for i in range(0, len(s) - 2):
			ans.append(s[i])
		ans.append(s[len(s) - 1])
	f = ''
	for j in ans:
		f = f + j
	if f == '-0':
		print('0')
	else:
		print(f)


state = int(input())
if state >= 0:
	print(state)
else:
	s = str(0 - state)
	if len(s) == 1:
		print(0)
	if len(s) == 2:
		if s[0] <= s[1]:
			print(0 - int(s[0]))
		else:
			print(0 - int(s[1]))
	if len(s) > 2:
		end = int(s) // 10
		l = len(s)
		bef = s[:l - 2] + s[-1]
		b = int(bef)
		if end <= b:
			print(0 - end)
		else:
			print(0 - b)


n = int(input())
if n > 0:
	print(n)
else:
	if n >= -10:
		print(0)
		exit()
	n = -n
	if n // 10 < int(str(n)[:-2] + str(n)[-1]):
		if n // 10 == 0:
			print(0)
		else:
			print('-{}'.format(n // 10))
	elif int(str(n)[:-2] + str(n)[-1]) == 0:
		print(0)
	else:
		print('-' + str(n)[:-2] + str(n)[-1])


n = int(input())
if n >= 0:
	print(n)
else:
	a = -(-n // 10)
	n = str(n)
	l = list(n)
	if len(l) == 2:
		print(0)
	else:
		l.pop(len(l) - 2)
		b = int(''.join(l))
		if a > b:
			print(a)
		else:
			print(b)


n = int(input())
if n >= 0:
	print(n)
else:
	k = str(abs(n))
	a = ''
	b = ''
	for i in range(len(k)):
		if i != len(k) - 1:
			a += str(k[i])
		if i != len(k) - 2:
			b += str(k[i])
	if int(a) < int(b):
		if int(a) == 0:
			print('0')
		else:
			print('-' + str(a))
	elif int(b) == 0:
		print('0')
	else:
		print('-' + str(b))


import math
n = int(input())
if n >= 0:
	print(n)
else:
	base = int(math.log10(abs(n)) + 1)
	last_digit = abs(n) % 10
	second_last = (abs(n) % 100 - last_digit) // 10
	if last_digit > second_last:
		print(-((abs(n) - last_digit) // 10))
	else:
		print(-((abs(n) - second_last * 10 - last_digit) // 10 + last_digit))


__author__ = 'Utena'
n = int(input())
if n >= 0:
	print(n)
elif n > -10 or (len(str(n)) == 3 and str(n)[-1] == '0'):
	print(0)
else:
	s = str(n)
	if s[-1] > s[-2]:
		print(s[0:-1])
	else:
		print(s[0:-2] + s[-1])


a = input()
if int(a) >= 0:
	print(a)
else:
	l = list(a)
	k = list(a)
	l.pop(len(l) - 1)
	a = int(''.join(l))
	k.pop(len(k) - 2)
	b = int(''.join(k))
	print(max(a, b))


inner_data = input()
if int(inner_data) >= 0:
	print(inner_data)
else:
	inner_data = inner_data[1:]
	ee = ''
	if len(inner_data) >= 2:
		finded = 0
		for i in inner_data[::-1]:
			if i == inner_data[-2] and (not finded):
				finded = 1
				continue
			ee = ee + i
	if int(inner_data[-1]) > int(inner_data[-2]):
		if int(inner_data[-1]) == 0:
			if int(inner_data[-2]) != 0:
				print(0)
		elif int(inner_data[-1]) != 0:
			print('-' + inner_data[0:-1])
	elif int(inner_data[-1]) < int(inner_data[-2]):
		if int(ee[::-1]) == 0:
			print(0)
		else:
			print('-' + ee[::-1])
	elif int(inner_data[-1]) == int(inner_data[-2]):
		print('-' + ee[::-1])
	else:
		print(0)


from math import *
n = int(input())
if n >= 0:
	print(n)
else:
	n = abs(n)
	num = n // 100
	mini = min(n % 10, n // 10 % 10)
	n = num * 10 + mini
	print(-n)


my = input()
s1 = my[:-1]
s2 = my[:-2] + my[-1]
if int(my) >= 0:
	print(my)
elif s1 == '-0' or s2 == '-0':
	print('0')
elif int(s1) < int(s2):
	print(s2)
else:
	print(s1)


import sys, collections, math

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
mod = 1000000007
n = input()
print(max(int(n), int(n[:-1]), int(n[:-2] + n[-1])))


i = input()
l = len(i)
p = int(i)
if p >= 0:
	print(i)
	exit()
elif i[l - 1] < i[l - 2]:
	if i[0:l - 2] + i[l - 1] == '-0':
		print('0')
	else:
		print(i[0:l - 2] + i[l - 1])
elif i[0:l - 1] == '-0':
	print('0')
else:
	print(i[0:l - 1])


num = int(input())
if num > 0:
	print(num)
elif num == -10:
	print(0)
else:
	n1 = int(num / 10)
	n2 = int(num / 10) + int(abs(num / 10) % 10) - abs(num) % 100 % 10
	print(max(n1, n2))


test = int(input())
if test < 0:
	test = -test
	test = str(test)
	if int(test[len(test) - 1]) > int(test[len(test) - 2]):
		newtest = test[:len(test) - 1]
		print(-int(newtest))
	else:
		newtest = test[:len(test) - 2] + test[len(test) - 1:]
		print(-int(newtest))
else:
	print(test)


n = int(input())
if n >= 0:
	print(n)
else:
	x = list(str(n))
	l = len(x)
	y = x[:]
	if int(x[l - 2]) == int(x[l - 1]):
		del x[l - 1]
	else:
		for i in [l - 2, l - 1]:
			if int(y[i]) == max([int(y[l - 2]), int(y[l - 1])]):
				del x[i]
	print(int(''.join(x)))


p = input()
p1 = int(p)
if p1 >= 0:
	print(p1)
elif p1 > -10:
	print('0')
else:
	p2 = int(p[:-1])
	p3 = int(p[:-2] + p[-1])
	if p2 > p3:
		print(p2)
	else:
		print(p3)


import string
m = int(input())
if m >= 0:
	print(m)
	exit()
else:
	s = str(m)
	if len(s) == 1:
		print(0)
	else:
		a = s[:-1]
		b = s[:-2] + s[-1]
		if len(s) == 3 and s[2] == '0':
			print(0)
		elif int(a) > int(b):
			print(a)
		else:
			print(b)


n = input().strip()
arr = [n, n[:-1], n[:-2] + n[-1]]
print(max([int(i) for i in arr]))


s = list(input())
if s[0] == '-':
	if int(s[-1]) > int(s[-2]):
		s.pop(len(s) - 1)
	else:
		s.pop(len(s) - 2)
	if len(s) == 2 and s[1] == '0':
		print(0)
		exit()
print(*s, sep='')


s = input()
l = len(s)
n = int(s)
if n >= 0:
	print(n)
elif l == 3 and s[l - 1] == '0':
	print(0)
else:
	print(s[0:l - 2], end='')
	print(min(int(s[l - 2]), int(s[l - 1])))


s = input()
if int(s) < -9:
	print(max(int(s[:-1]), int(s[:-2] + s[-1])))
elif int(s) < 0:
	print(0)
else:
	print(s)


s = input()
x1 = s[:-2] + s[-1]
x2 = s[:-1]
print(max(int(s), int(x1), int(x2)))


account = input()
num = len(account)
if int(account) >= 0:
	print(account)
else:
	new_account1 = int(account[0:num - 1])
	new_account2 = int(account[0:num - 2] + account[num - 1:num])
	print(max(new_account1, new_account2))


A = input()
if int(A) >= 0:
	print(A)
else:
	B = list(A)
	n = len(B)
	if int(B[n - 1]) <= int(B[n - 2]):
		B.pop(n - 2)
		if len(B) == 2 and int(B[1]) == 0:
			print(0)
		else:
			print(''.join(B))
	else:
		B.pop(n - 1)
		print(''.join(B))


n = input()
x = int(n)
if x > 0:
	print(n)
else:
	l = len(n)
	m = int(n[:-1])
	n = int(n[:-2] + n[l - 1])
	if m > n:
		print(m)
	else:
		print(n)


n = input()
l = len(n)
a = []
n1 = n[0:l - 1]
n2 = n[0:l - 2] + n[-1]
a.append(int(n))
a.append(int(n1))
a.append(int(n2))
print(max(a))


x = input()
if x[0] != '-':
	print(x)
else:
	y = list(x.strip())
	if int(y[len(y) - 1]) > int(y[len(y) - 2]):
		print(int(x[:len(y) - 1]))
	else:
		print(int(x[:len(y) - 2] + x[len(y) - 1]))


n = input()
if int(n) > -1:
	print(n)
else:
	(s, k) = ('', '')
	for i in range(len(n)):
		if i != len(n) - 2:
			s = s + n[i]
		if i != len(n) - 1:
			k = k + n[i]
	print(max(int(s), int(k)))


s = input()
if int(s) > 0:
	print(''.join(s))
else:
	a = list(s)
	b = list(s)
	a.pop(-1)
	b.pop(-2)
	A = ''.join(a)
	B = ''.join(b)
	if int(A) > int(B):
		if A[0] == '-' and all((c == '0' for c in A[1:])):
			print('0')
		else:
			print(A)
	elif B[0] == '-' and all((c == '0' for c in B[1:])):
		print('0')
	else:
		print(B)


import math
x = int(input())
if x >= 0:
	print(x)
else:
	list2 = []
	m = str(x)
	n = len(m)
	x1 = int(m[:n - 1])
	x2 = int(m[:n - 2] + m[n - 1])
	print(max(x1, x2))


c = str(input())
if int(c) >= 0:
	print(c)
else:
	c1 = c[:len(c) - 2] + c[len(c) - 1]
	c2 = c[:len(c) - 1]
	if int(c1) > int(c2):
		print(int(c1))
	else:
		print(int(c2))


def highestBalance(s):
	if s[0] != '-':
		return s
	if int(s) > -11:
		return 0
	if int(s[-1]) > int(s[-2]):
		return s[:len(s) - 1]
	return s[:len(s) - 2] + s[-1]
s = input()
print(highestBalance(s) if highestBalance(s) != '-0' else '0')


def function1(k):
	return max(int(k[:-1]), int(k[:-2] + k[-1]), int(k))

def main():
	print(function1(input()))
main()


n = input()
if int(n) > 0:
	print(n)
elif int(n[-1]) > int(n[-2]):
	x = int(n[-2])
	y = n[:-2] + str(x)
	if y == '-0':
		y = 0
	print(y)
else:
	x = int(n[-1])
	y = n[:-2] + str(x)
	if y == '-0':
		y = 0
	print(y)


s = input()
n = len(s)
s1 = s[:n - 1]
s2 = s[:n - 2] + s[n - 1]
a = int(s)
b = int(s1)
c = int(s2)
if a >= b and a >= c:
	print(a)
elif b >= a and b >= c:
	print(b)
elif c >= a and c >= b:
	print(c)


n = int(input())
if n >= 0:
	print(n)
if -10 <= n < 0:
	print('0')
if n < -10:
	a = str(n)
	c1 = a[0:-1]
	c2 = a[0:-2] + a[-1]
	l1 = int(c1)
	l2 = int(c2)
	print(max(l1, l2))


STR = str(input())
STR1 = STR[:-1]
STR2 = STR[:-2] + STR[-1]
s1 = int(STR1)
s2 = int(STR2)
s3 = int(STR)
list = [s1, s2, s3]
print(max(list))


n = int(input())
if n > 0:
	print(n, end='')
else:
	n = abs(n)
	t = n // 100
	t *= 10
	t += n % 10
	t1 = n // 10
	print(-min(t, t1), end='')


a = int(input())
if a < 0:
	if abs(a) < 100 and abs(a) > 10 and (abs(a) % 10 != 0):
		if abs(a) // 10 % 10 < abs(a) % 10:
			print('-', abs(a) // 10 % 10, sep='')
		else:
			print('-', abs(a) % 10, sep='')
	elif abs(a) >= 1 and abs(a) <= 9:
		print('0')
	elif abs(a) % 10 == 0 and abs(a) < 100:
		print('0')
	elif abs(a) % 10 == 0 and abs(a) > 100 or abs(a) == 100:
		print('-', abs(a) // 100, abs(a) % 10, sep='')
	elif abs(a) // 10 % 10 < abs(a) % 10:
		print('-', abs(a) // 100, abs(a) // 10 % 10, sep='')
	elif abs(a) // 10 % 10 == abs(a) % 10:
		print('-', abs(a) // 10, sep='')
	elif abs(a) > 100 and abs(a) < 10 ** 9 and (abs(a) // 10 % 10 > abs(a) % 10):
		print('-', abs(a) // 100, abs(a) % 10, sep='')
else:
	print(a)


money = int(input())
money1 = money
money2 = money
if money > -1:
	print(money)
else:
	money = abs(money)
	money1 = abs(money1)
	money2 = abs(money2)
	money = [int(i) for i in str(money)]
	money1 = [int(i) for i in str(money1)]
	money2 = [int(i) for i in str(money2)]
	x = money1[:-1]
	y = money2[:-2]
	y.append(money[-1])
	x = int(''.join([str(i) for i in x]))
	y = int(''.join([str(i) for i in y]))
	x = x * -1
	y = y * -1
	if x > y:
		print(x)
	else:
		print(y)


a = int(input())
s = -1 if a < 0 else 1
b = abs(a)
bas = [b, b // 10, b % 10 + b // 100 * 10]
print(max([s * k for k in bas]))


a = int(input())
if a > 0:
	print(a)
else:
	b = str(a)
	l = b[:-2] + b[-1]
	l = int(l)
	m = b[:-1]
	m = int(m)
	print(max(m, l))


from sys import stdin, stdout
import bisect
import math

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
			n = n - 1
		else:
			a = a * a
			n = n >> 1
	return r

def solve():
	n = inp()
	s = str(n)
	if n > 0:
		pr(n)
	else:
		s = s[1:-2] + str(min(int(s[-1]), int(s[-2])))
		if s[0] == '0':
			pr(s)
		else:
			pr('-' + s)
for _ in range(1):
	solve()


n = int(input())
if n >= 0:
	print(n)
if n < 0:
	line = str(n)
	a = len(line)
	if int(line[a - 1]) >= int(line[a - 2]):
		out = int(n / 10)
	else:
		out = int(n / 10 + int(line[a - 2]) - int(line[a - 1]))
	print(out)


n = int(input())
if n >= 0:
	print(n)
	exit()
if n > -10:
	print('0')
	exit()
n = -n
r1 = n // 10
r2 = n // 100 * 10 + n % 10
r = min(r1, r2) * -1
print(r)


x = input()
if int(x) >= -9:
	print(int(x))
else:
	print(max(int(x[:-1]), int(x[:-2] + x[-1:])))


s = input()
n = len(s)
if s[0] == '-':
	if s[n - 1] < s[n - 2]:
		s = s[::-1]
		s = s.replace(s[1], '', 1)
		s = s[::-1]
	else:
		s = s[::-1]
		s = s.replace(s[0], '', 1)
		s = s[::-1]
	if s == '-0':
		print('0')
	else:
		print(s)
else:
	print(s)


s = input()
l = []
a = s[:-1]
b = s[:-2] + s[-1:]
l.append(int(a))
l.append(int(b))
l.append(int(s))
ans = -1
for x in sorted(l):
	ans = x
print(ans)


import sys

def main():
	num = int(sys.stdin.readline().strip())
	if num >= 0:
		print(num)
	elif num >= -10:
		print(0)
	else:
		last = str(num)[0:-1]
		lastbefore = str(num)[0:-2] + str(num)[-1]
		if int(last) > int(lastbefore):
			print(int(last))
		else:
			print(int(lastbefore))
main()


n = input()
if int(n) <= 0:
	if int(n[-1]) > int(n[-2]):
		n = n[:-1]
	else:
		n = n[:-2] + n[-1]
	if len(n) == 2 and n[1] == '0':
		n = '0'
print(n)


n = int(input())
if n > 0:
	r = n
	print(r)
else:
	t1 = str(n)
	t2 = str(n)
	t1 = int(t1[:-1])
	t2 = int(t2[:-2] + t2[-1])
	print(max(t1, t2))


import math
n = input()
if int(n) > 0:
	print(n)
elif int(n[-1]) > int(n[-2]):
	if int(n[-1]) == 0 and len(n) == 2:
		print(0)
	else:
		print(math.ceil(int(n) / 10))
elif int(n[-1]) == int(n[-2]):
	print(math.ceil(int(n) / 10))
else:
	n = n.replace(n[-2] + n[-1], n[-1])
	if int(n[-1]) == 0 and len(n) == 2:
		print(0)
	else:
		print(n)


n = int(input())
if n >= 0:
	print(n)
elif n > -10 and n < 0:
	print(0)
else:
	n = str(n)
	a = n[0:len(n) - 2]
	b = n[len(n) - 1]
	c = n[len(n) - 2]
	s1 = int(a + b)
	s2 = int(a + c)
	if s1 > s2:
		print(s1)
	else:
		print(s2)


def main():
	strn = input()
	n = int(strn)
	if n >= 0:
		print(n)
	else:
		del_last = int(strn[:-1])
		del_pult = int(strn[:-2] + strn[-1])
		print(max(n, del_pult, del_last))

def __starting_point():
	main()
__starting_point()


n = input()
if int(n) > 0:
	print(n)
else:
	t = n
	n = list(n)
	a = n[:-2] + [n[-1]]
	b = n[:-1]
	aa = ''.join(a)
	bb = ''.join(b)
	print(max(int(t), int(aa), int(bb)))


n = int(input())

def bank(n):
	if n > 0:
		return n
	value = str(n)
	first_val = value[:len(value) - 2] + value[len(value) - 1:]
	sec_val = value[:len(value) - 1]
	return max(int(first_val), int(sec_val))
print(bank(n))


n = int(input())
if n >= 0:
	print(n)
else:
	a = n * -1
	b = a // 10
	c = b % 10
	if c >= a % 10:
		print((b - c + a % 10) * -1)
	else:
		print(a // 10 * -1)


n = input()
if int(n) <= -100:
	a = int(n[:-1])
	b = int(n[:-2]) * 10 - int(n[-1])
	if a > b:
		print(a)
	else:
		print(b)
if 0 > int(n) and int(n) > -100:
	a = int(n[-1])
	b = int(n[-2])
	if a < b:
		print(-a)
	else:
		print(-b)
if int(n) >= 0:
	print(n)


d = list(map(str, input()))
s = int(''.join(map(str, d)))
if s >= 0:
	print(s)
elif d[len(d) - 1] > d[len(d) - 2]:
	del d[len(d) - 1]
	ss = ''.join(d)
	if ss == '-0':
		print(0)
	else:
		print(''.join(d))
else:
	del d[len(d) - 2]
	ss = ''.join(d)
	if ss == '-0':
		print(0)
	else:
		print(''.join(d))


n = input()
print(max(int(n), int(n[:-1]) if len(n) > 2 else int(n), int(n[:-2] + n[-1]) if len(n) > 2 else int(n)))


try:
	n = int(input())
	ans = ''
	if n > 0:
		print(n)
	else:
		s = str(n)
		b = max(s[-1], s[-2])
		if b == s[-1]:
			ans += s[:-1]
		else:
			ans += s[:-2] + s[-1]
		if ans == '-0':
			print(0)
		else:
			print(ans)
except:
	pass


N = int(input())
if N >= 0:
	print(N)
else:
	N = str(N)[1:]
	a = int(N[:-1])
	b = int(N[:-2] + N[-1])
	print(-min(a, b))


n = int(input())
k = 0
l = 0
m = 0
hh = -100000000000000000000000000
if n >= 0:
	print(n)
else:
	s = 0 - n
	ss = str(s)
	ls = len(ss)
	q = ls - 2
	while q < ls:
		if q == 0:
			xin = ss[1:ls]
		else:
			xin = ss[0:q] + ss[q + 1:ls]
		shu = 0 - int(xin)
		if shu > hh:
			hh = shu
		q += 1
	print(int(hh))


a = int(input())
if a > 0:
	print(a)
elif a < 0:
	b = list(str(a))
	if b[-1] > b[-2] or b[-1] == b[-2]:
		del b[-1]
		print(''.join(map(str, b)))
	elif b[-1] < b[-2]:
		del b[-2]
		if ''.join(map(str, b)) == '-0':
			print(0)
		else:
			print(''.join(map(str, b)))


s = input()
a = int(s[0:len(s) - 1])
b = int(s[0:len(s) - 2] + s[len(s) - 1:len(s)])
s = int(s)
print(max(s, a, b))


n = int(input())
s = str(n)
m1 = int(s[:len(s) - 1])
m2 = int(s[:-2] + s[-1:])
print(max(n, m1, m2))


n = list(input())
data1 = n[:]
data2 = n[:]
del data1[-1]
del data2[-2]
print(max([int(''.join(data1)), int(''.join(data2))]) if '-' in n else ''.join(n))


n = int(input())
if n > -1:
	print(n)
else:
	x = int(n / 100) * 10 - -n % 10
	if int(n / 10) > x:
		print(-int(-n / 10))
	else:
		print(x)


def deposit(cash):
	if cash >= 0:
		return cash
	if str(cash)[-1] < str(cash)[-2]:
		result = str(cash)[:-2] + str(cash)[-1]
	else:
		result = str(cash)[:-1]
	return int(result)
print(deposit(int(input())))


def maximize(state: str) -> int:
	intstate = int(state)
	if intstate >= 0:
		return intstate
	if intstate >= -10:
		return 0
	a = int(state[:-1])
	b = int(state[:-2] + state[-1])
	return max(a, b)
print(maximize(input()))


n = int(input())
if n >= 0:
	print(int(n))
elif n < 0:
	n = str(n)
	n = list(n)
	if n[-1] < n[-2]:
		del n[-2]
		n = ''.join(n)
	else:
		n.pop()
		n = ''.join(n)
	print(int(n))


n = int(input())
a = list()
if n >= 0:
	print(n)
else:
	n = abs(n)
	a.append(n % 10)
	n //= 10
	a.append(n % 10)
	n //= 10
	if n * 10 + a[0] > n * 10 + a[1]:
		print(-(n * 10 + a[1]))
	else:
		print(-(n * 10 + a[0]))


n = int(input())
if n >= 0:
	print(n)
else:
	n = abs(n)
	a = n // 100
	b = n % 10
	c = a * 10 + b
	d = n // 10
	if d < c:
		print(-1 * d)
	else:
		print(-1 * c)


n = int(input())
s = str(n)
k = s[:-1]
l = s[0:-2]
p = l + s[-1]
k = int(k)
p = int(p)
if n < 0:
	t = max(p, k)
	print(t)
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	list1 = list(str(n))
	list1 = tuple(list1)
	list2 = list(list1)
	list3 = list(list1)
	list2.pop()
	list3.pop(-2)
	int1 = int(''.join(list2))
	int2 = int(''.join(list3))
	x = max(int1, int2)
	print(x)


n = input()
num = int(n)
if num >= 0:
	print(num)
else:
	L = list(n)
	a = int(n[:-1])
	del L[-2]
	b = int(''.join(L))
	c = max(a, b)
	print(c)


import sys
bank = input().strip()
money = int(bank)
max_val = money
if money >= 0:
	print(bank)
	sys.exit()
else:
	for i in range(len(bank) - 2, len(bank)):
		actual_money = int(bank[0:i] + bank[i + 1:])
		if actual_money > max_val:
			max_val = actual_money
print(max_val)


n = input()
m = int(n)
if m >= 0:
	print(n)
else:
	a = list(n)
	b = a.copy()
	a.pop()
	b.pop(-2)
	c = ''.join(a)
	d = ''.join(b)
	c = int(c)
	d = int(d)
	if c > d:
		print(c)
	else:
		print(d)


s = input()
if s[0] != '-':
	print(s)
elif ord(s[len(s) - 1]) > ord(s[len(s) - 2]):
	print(s[0:-1])
else:
	t = s[0:-2] + s[-1]
	if t[1] == '0' and len(t) == 2:
		print('0')
	else:
		print(t)


import sys, os.path
sys.setrecursionlimit(10 ** 5)

def mod():
	return 10 ** 9 + 7

def i():
	return sys.stdin.readline().strip()

def ii():
	return int(sys.stdin.readline())

def li():
	return list(sys.stdin.readline().strip())

def mii():
	return map(int, sys.stdin.readline().split())

def lii():
	return list(map(int, sys.stdin.readline().strip().split()))

def solve():
	a = ii()
	if a >= 0:
		print(a)
	else:
		b = abs(a) % 100
		if b == 0:
			print(str(a)[:-1])
			return True
		y = list(str(a)[-2:])
		if int(y[0]) <= int(y[1]):
			if str(a)[:-1] == '-0':
				print(0)
			else:
				print(str(a)[:-1])
		elif str(a)[:-2] + str(a)[-1] == '-0':
			print(0)
		else:
			print(str(a)[:-2] + str(a)[-1])
for _ in range(1):
	solve()


n = input()
number = []
for i in range(len(n)):
	number.append(n[i])
if n[0] == '-':
	if n[-1] >= n[-2]:
		del number[-1]
	else:
		del number[-2]
if number[0] == '-' and number[1] == '0':
	del number[0]
print(''.join(number))


n = int(input())
s = str(n)
s = s.replace('-', '')
if n > 0:
	print(n)
else:
	p2 = s[:len(s) - 2]
	p1 = s[len(s) - 2:]
	print(max([int(p2 + p1[0]) * -1, int(p2 + p1[1]) * -1]))


n = input()
l = []
l1 = list(n)
l2 = list(n)
if int(n) < 0:
	l2.pop(-1)
	l.append(int(''.join(l2)))
	l1.pop(-2)
	l.append(int(''.join(l1)))
	print(max(l))
if int(n) > 0:
	print(n)


n = input()
nc = int(n)
nl = int(n[:-1])
ns = int(n[:-2] + n[-1])
print(max(nc, nl, ns))


s = input()
if s[0] == '-':
	res = s[:-2] + str(min(s[-1], s[-2]))
	if res != '-0':
		print(res)
	else:
		print(0)
else:
	print(s)


n = input()
if int(n) >= 0:
	print(n)
else:
	n = str(abs(int(n)))
	num1 = [int(x) for x in n]
	num2 = [int(x) for x in n]
	num1.pop()
	num2.pop(-2)
	num1 = [str(x) for x in num1]
	num2 = [str(x) for x in num2]
	n1 = int(''.join(num1))
	n2 = int(''.join(num2))
	print(['-' + str(min(n1, n2)), 0][min(n1, n2) == 0])


l = list(input())
if '-' not in l:
	print(''.join(l))
else:
	n = len(l)
	if l[n - 2] >= l[n - 1]:
		p = n - 2
		if n == 3 and l[2] == '0':
			print(0)
		else:
			print(''.join(l[0:p]), ''.join(l[p + 1:]), sep='')
	else:
		p = n - 1
		print(''.join(l[0:p]))


n = int(input())
lastDigit = abs(n) % 10
a = abs(n) // 10
b = abs(n) // 100
c = int(str(b) + str(lastDigit))
if n < 0:
	a -= a * 2
	c -= c * 2
if n >= 0:
	print(n)
else:
	print(max(a, c))


b = input()
z = []
if int(b) >= 0:
	print(b)
else:
	b = list(b)
	b.remove('-')
	for item in b:
		z.append(int(item))
	z.reverse()
	z.remove(max(z[0], z[1]))
	z.reverse()
	if len(z) == 1 and z[0] == 0:
		print(item)
	else:
		print('-', end='')
		for item in z:
			print(item, end='')


n = input()
S = int(n)
if S > 0:
	print(n)
else:
	if n[-1] > n[-2]:
		n = n[:-1]
	else:
		n = n[:-2] + n[-1:]
	if n[1] == '0':
		print('0')
	else:
		print(n)


n = int(input())
if n > 0:
	print(n)
else:
	n = list(str(abs(n)))
	if len(n) == 1:
		print(0)
	else:
		if int(n[-2]) > int(n[-1]):
			n.pop(-2)
		else:
			n.pop()
		print(-int(''.join(n)))


n = int(input())
c = -n % 10
v = -(-n // 10)
b = -(-n // 100) * 10 - c
if n >= 0:
	print(n)
elif v > b:
	print(v)
else:
	print(b)


n = input()
s2 = n[:len(n) - 2] + n[-1]
s1 = n[:len(n) - 1]
if int(n) < 0:
	if int(s1) < int(s2):
		print(int(s2))
	elif int(s2) < int(s1):
		print(int(s1))
	else:
		print(int(s1))
else:
	print(n)


a = input()
removeLast = int(a[:-1])
removeAlmostLast = int(a[:-2] + a[-1])
a = int(a)
if a > 0:
	print(a)
else:
	print(max(a, max(removeLast, removeAlmostLast)))


n = int(input())
if n < 0:
	n = abs(n)
	r = n % 100
	n //= 100
	digits = [int(d) for d in list(str(r))]
	if len(digits) == 1:
		digits.append(0)
	mini = min(digits)
	n = -1 * int(str(n) + str(mini))
print(n)


n = input()
if n[0] == '-':
	k = int(n[1:-1])
	l = int(n[1:-2] + n[-1])
	if k != 0 and l != 0:
		print('-', end='')
		print(min(k, l))
	else:
		print(min(k, l))
else:
	print(n)


k = input()
a = [max(int(k[:-1]), int(k[:-2] + k[-1])), k]
print(a[int(k) > 0])


from sys import stdin
b = stdin.readline().rstrip()
if b.startswith('-'):
	print(max(int(b[:-1]), int(b[:-2] + b[-1])))
else:
	print(b)


n = int(input())
if n > 0:
	print(n)
else:
	num1 = int(str(n)[:-1])
	num2 = int(str(n)[:-2] + str(n)[-1:])
	print(max(num1, num2))


n = input()
if int(n) >= 0:
	print(n)
elif int(n) < 0:
	if len(n) == 3 and n[2] == '0':
		print(n[2])
	elif len(n) == 3 and n[2] != '0':
		print(n[0] + str(min(n[1], n[2])))
	elif len(n) == 2:
		print(n)
	else:
		ar = [i for i in n]
		if ar[len(n) - 1] > ar[len(n) - 2]:
			del ar[len(n) - 1]
		else:
			del ar[len(n) - 2]
		s = ''
		s += ''.join((i for i in ar))
		print(s)


n = input()
n = int(n)
if n >= 0:
	print(n)
else:
	last = -n % 10
	seclast = (-n % 100 - last) // 10
	remain = -n // 100 * 10
	n = min(remain + last, remain + seclast)
	print(-n)


def ultimoDigito(x):
	if x < 0:
		mod = -1
		x = abs(x)
	else:
		mod = 1
	return int(x // 10) * mod

def penultimoDigito(x):
	if x < 0:
		mod = -1
		x = abs(x)
	else:
		mod = 1
	ult = int((x * 0.1 - x // 10 + 0.001) * 10)
	return (int(x // 100) * 10 + ult) * mod
x = int(input())
best = max(x, ultimoDigito(x), penultimoDigito(x))
print(best)


am = input()
if am[0] != '-':
	print(am)
elif len(am) == 2:
	print('0')
elif len(am) == 3 and am[-1] == '0':
	print('0')
elif am[-1] > am[-2]:
	print(am[0:len(am) - 1])
else:
	x = am[0:len(am) - 2]
	x = x + am[-1]
	print(x)


n = input()
l = 0
a = int(n)
c = 0
if int(n) >= 0:
	print(n)
elif int(n) < 0:
	l = min(int(n[-1]), int(n[-2]))
	if int(l) == 0:
		c = int(-a / 100) * 10
	if int(l) != 0:
		c = int(-a / 100) * 10 + l
	print(-c)


n = int(input())
if n >= 0:
	print(n)
else:
	k = str(n)
	k = k[1:]
	h = k[len(k) - 1]
	if h == '0':
		j = k[0:len(k) - 2]
		w = j + '0'
		if w == '0':
			print(w)
		else:
			w = '-' + w
			print(w)
	elif k[len(k) - 1] > k[len(k) - 2]:
		p = len(k) - 1
		l = k[0:p]
		l = '-' + l
		print(l)
	else:
		g = k[0:len(k) - 2]
		g = g + k[len(k) - 1]
		g = '-' + g
		print(g)


ipt = input()
var = []
var.append(int(ipt[:-1]))
var.append(int(ipt[:-2] + ipt[-1]))
var.append(int(ipt))
print(max(var))


n = input()
if int(n) >= 0:
	print(n)
else:
	s = list(n)
	s.remove('-')
	temp = s.copy()
	temp.pop(-2)
	x = int(''.join(temp))
	s.pop(-1)
	y = int(''.join(s))
	if -1 * x > -1 * y:
		print(-1 * x)
	else:
		print(-1 * y)


def solve(state):
	if state[0] == '-':
		if len(state) == 2:
			return 0
		else:
			blast = state[-2]
			last = state[-1]
			res = state[:-2] + last if blast > last else state[:-1]
			return res if int(res) != 0 else 0
	return state

def main():
	state = input()
	ans = solve(state)
	print(ans)
main()


n = int(input())
a = int(n / 10)
b = int(n / 100) * 10 - abs(n) % 10
print(max(n, a, b))


balance = input()
if int(balance) >= 0:
	print(balance)
else:
	length = len(balance)
	if int(balance[length - 2]) <= int(balance[length - 1]):
		print(int(balance[:length - 1]))
	else:
		print(int(balance[:length - 2] + balance[length - 1]))


n = int(input())
if n >= 0:
	print(n)
elif n >= -9 and n < 0:
	print('0')
else:
	ans = ''
	s = str(n)
	if ord(s[-2]) > ord(s[-1]):
		ans = s[:-2] + s[-1]
	else:
		ans = s[:-1]
	print(int(ans))


while True:
	try:
		n = input()
		if int(n) >= -9:
			print(int(n))
		else:
			print(max(int(n[0:-1]), int(n[0:-2] + n[-1])))
	except EOFError:
		break


n = input()
N0 = int(n)
if N0 >= 0:
	print(N0)
else:
	pieces = list(n)
	if int(pieces[-1]) >= int(pieces[-2]):
		del pieces[-1]
	else:
		del pieces[-2]
	N1 = int(''.join(list(map(str, pieces))))
	print(N1)


from sys import stdin, stdout
inp = stdin.readline
out = stdout.write
n = inp().strip()
if n[0] == '-':
	if int(n[-1]) < int(n[-2]):
		if n[:-2] + n[-1] == '-0':
			print(0)
		else:
			print(n[:-2] + n[-1])
	elif n[:-1] == '-0':
		print(0)
	else:
		print(n[:-1])
else:
	print(n)


def Main():
	blc = input()
	if blc[0] == '-':
		iblc = -1 * int(blc)
		ln = len(blc)
		if ln == 2:
			print(0)
		elif int(blc[ln - 1]) > int(blc[ln - 2]):
			print(blc[:ln - 1])
		else:
			print(-1 * int(blc[1:ln - 2] + blc[ln - 1:]))
	else:
		print(blc)
Main()


money = input().strip()
choice_1 = int(money[0:-1])
choice_2 = int(money[0:-2] + money[-1])
money = int(money)
if choice_1 > money:
	if choice_1 > choice_2:
		print(choice_1)
	else:
		print(choice_2)
elif choice_1 < money:
	if choice_2 > money:
		print(choice_2)
	else:
		print(money)
elif choice_1 == money:
	if choice_2 > choice_1:
		print(choice_2)
	else:
		print(choice_1)
elif choice_2 == money:
	if choice_1 > choice_2:
		print(choice_1)
	else:
		print(choice_2)


n = input()
if int(n) >= 0:
	account = n
else:
	m1 = int(n[0:-1])
	m2 = int(n[0:-2] + n[-1])
	l = max(m1, m2)
	account = l
print(account)


while True:
	try:
		num = int(input())
		if num >= 0:
			print(num)
		else:
			num_str = str(num)[1:]
			if num_str[0] != '0' and num_str[1] == '0' and (len(num_str) == 2):
				print('0')
			elif int(num_str[-1]) >= int(num_str[-2]):
				result = '-' + num_str[0:len(num_str) - 1]
				print(result)
			else:
				result = '-' + num_str[0:len(num_str) - 2] + num_str[-1]
				print(result)
	except EOFError:
		break


y = int(input())
st = str(y)
stl = list(st)
if y < 0:
	if len(st) >= 3:
		we = stl.pop()
		tu = stl.pop()
		if we > tu:
			stl.append(tu)
		else:
			stl.append(we)
		if stl[1] == '0':
			print(0)
			exit()
		for i in range(len(stl)):
			print(stl[i], end='')
		exit()
	if len(st) == 2:
		print(0)
		exit()
else:
	print(y)


import sys, math, string
input = sys.stdin.readline
from collections import deque
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
n = input().strip()
if n[0] == '-':
	k = int(n[1:-2] + str(min(int(n[-1]), int(n[-2]))))
	k *= -1
	print(k)
else:
	print(n)


a = int(input())
a = -a
if a <= 0:
	print(-a)
elif a < 10:
	print(0)
elif a < 100:
	if a % 10 > a // 10:
		print(-(a // 10))
	else:
		print(-(a % 10))
elif a > 99:
	if a % 10 > a % 100 // 10:
		print(-(a // 10))
	else:
		print(-(a // 100 * 10 + +a % 10))


import math
import itertools
mp = lambda : map(int, input().split())
mod = 998244353
mod = int(mod)

def main():
	n = int(input())
	if n < 0:
		n1 = -n
		n1 = min(n1 // 10, n1 // 100 * 10 + n1 % 10)
		n = -n1
	print(n)
main()


n = int(input())
if n >= 0:
	print(n)
else:
	i = int(str(n)[:-1])
	j = int(str(n)[:-2] + str(n)[-1])
	print(max(i, j))


z = input()
x = list(z)
if int(z) >= 0:
	print(z)
else:
	a = list(x[:-2])
	a.append(x[-1])
	a = ''.join(a)
	b = list(x[:-1])
	b = ''.join(b)
	if int(a) > int(b):
		print(int(a))
	else:
		print(int(b))


n = input()
if int(n) > 0:
	print(n)
else:
	n = n.replace('-', '')
	x = len(n)
	if int(n[x - 1]) >= int(n[x - 2]):
		print('-' + n[0:x - 1])
	elif x == 2 and (int(n[x - 1]) == 0 or int(n[x - 2]) == 0):
		print(0)
	else:
		print('-' + n[0:x - 2] + n[x - 1])


import math

def solve(num):
	if num > 0:
		return num
	else:
		num = abs(num)
		return -min(num // 10, num // 100 * 10 + num % 100 % 10)
num = int(input())
result = solve(num)
print(result)


n = input()
nn = int(n)
if nn == 0:
	print(0)
elif nn > 0:
	print(n)
else:
	a = int(n[:-1])
	b = int(n[:-2] + n[-1])
	if a > b:
		print(a)
	else:
		print(b)


a = int(input())
if a > 0:
	print(a)
else:
	s = str(a)
	s1 = s[:-1]
	s2 = s[:-2] + s[-1:]
	ss1 = int(s1)
	ss2 = int(s2)
	print(max(ss1, ss2))


b = int(input())
if b >= 0:
	print(b)
else:
	s = str(b)
	n = len(s)
	r = ''
	if n - 1 > 1:
		for i in range(n - 2):
			r += s[i]
	if int(s[n - 2]) < int(s[n - 1]):
		r += s[n - 2]
	else:
		r += s[n - 1]
	print(int(r))


n = int(input())
if n > 0:
	print(n)
else:
	x = n
	n = list(str(n))[1:]
	if len(n) > 1:
		la = n.pop()
		x = max(x, int('-' + ''.join(n)))
		n.append(la)
		la = n.pop(-2)
		x = max(x, int('-' + ''.join(n)))
	print(x)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
n = int(input())
if n > 0:
	print(n)
else:
	n = abs(n)
	if n < 10:
		print(0)
	elif n < 100:
		print(max(-n, 0 - n // 10, 0 - n % 10))
	else:
		sn = str(n)
		last = str(n % 10)
		last2 = str(n // 10 % 10)
		print(max(-n, -int(sn[:-2] + last), -int(sn[:-2] + last2)))


n = int(input())
if n > 0:
	print(n)
	exit()
else:
	l1 = str(n)
	l = [str(i) for i in l1]
	le = len(l)
	if l[le - 1] > l[le - 2]:
		l.pop(le - 1)
		print(*l, sep='')
		exit()
	else:
		l.pop(le - 2)
		if l[1] == '0':
			print(0)
			exit()
		else:
			print(*l, sep='')
			exit()


s = input()
if int(s) < 0:
	t = s[:-1]
	r = s[:-2] + s[-1]
	temp = max(int(t), int(r))
else:
	temp = int(s)
print(temp)


n = int(input())
if int(n) >= 0:
	print(n)
else:
	list_1 = [i for i in str(n)]
	list_2 = [i for i in str(n)]
	if len(list_1) == 1:
		print('0')
	else:
		del list_1[-1]
		n1 = ''.join(list_1)
		del list_2[-2]
		n2 = ''.join(list_2)
	print(max(n, int(n1), int(n2)))


n = int(input())
n1 = n
s = str(n)
l = []
for i in s:
	l.append(i)
if n1 >= 0:
	print(n)
elif n1 == -10 or n1 == -20 or n1 == -30 or (n1 == -40) or (n1 == -50) or (n1 == -60) or (n1 == -70) or (n1 == -80) or (n1 == -90):
	print(0)
elif l[-1] == '0' and l[-2] == '0':
	l.remove(l[-1])
	print(''.join(l))
elif l[-2] > l[-1]:
	del l[-2]
	print(''.join(l))
else:
	print(''.join(l[:-1]))


x = input()
y = int(x)
a = int(x[len(x) - 2])
b = int(x[len(x) - 1])
if y > 0:
	z = x
elif a > b:
	z = x[:len(x) - 2] + x[len(x) - 1]
else:
	z = x[:len(x) - 1]
print(int(z))


num = input()
print(max(map(int, [num, num[:-1], num[:-2] + num[-1]])))


n = int(input())
if n > 0:
	print(n)
elif n < 0:
	n = str(n)
	j = len(n)
	if j < 3:
		print('0')
	elif j > 3:
		r = n[j - 1]
		s = n[j - 2]
		if r > s:
			n = int(n)
			r = int(r)
			x = n + r
			x = str(x)
			if x[j - 1] == '0':
				k = j - 1
				t = ''
				for i in range(0, j, 1):
					if i != k:
						t = t + x[i]
				t = int(t)
				print(t)
		elif r < s:
			k = j - 2
			t = ''
			for i in range(0, j, 1):
				if i != k:
					t = t + n[i]
			t = int(t)
			print(t)
		elif r == s:
			t = ''
			y = j - 1
			for i in range(0, j, 1):
				if i != y:
					t = t + n[i]
			print(t)
	elif j == 3:
		r = n[j - 1]
		s = n[j - 2]
		if r == '0':
			print('0')
		elif r > s:
			s = '-' + s
			print(s)
		else:
			r = '-' + r
			print(r)
elif n == 0:
	print('0')


n = input()
if n[0] != '-':
	print(int(n))
else:
	n = list(n)
	if int(n[-2]) <= int(n[-1]):
		n[-1] = ''
	else:
		n[-2] = ''
	print(int(''.join(n)))


a = int(input())
if a < 0:
	s = str(a)
	t = s[1:len(s) - 1]
	o = s[1:len(s) - 2] + s[len(s) - 1]
	if int(t) == 0 or int(o) == 0:
		print(0)
	elif t > o:
		print('-' + o)
	else:
		print('-' + t)
else:
	print(a)


a = int(input())
if a == -10 or a == -20 or a == -30 or (a == -40) or (a == -50) or (a == -60) or (a == -70) or (a == -80) or (a == -90):
	print(0)
else:
	if abs(a) % 100 > 9:
		d = abs(a) % 100 // 10
	else:
		d = 0
	if a < 0:
		if abs(a) % 10 > d:
			print('-', end='')
			print(abs(a) // 10)
		else:
			print('-', end='')
			print(abs(a) // 100 * 10 + abs(a) % 10)
	else:
		print(a)


m = list(input())
n = len(m)
if m[0] == '-':
	if n == 2:
		m = '0'
	elif n == 3 and '0' in m:
		m = '0'
	elif int(m[n - 1]) > int(m[n - 2]):
		m[n - 1] = ''
	else:
		m[n - 2] = ''
	print(''.join(m))
else:
	print(''.join(m))


s = input()
k = int(s)
e = 0
if k > 0:
	print(k)
else:
	d = abs(k)
	r1 = d % 10
	d = d // 10
	r2 = d % 10
	d = d // 10
	if d == 0 and min(r1, r2) == 0:
		print('0')
	elif r1 > r2:
		print('-', end='')
		if d != 0:
			print(d, end='')
		print(r2)
	else:
		print('-', end='')
		if d != 0:
			print(d, end='')
		print(r1)


account = int(input())
if account >= 0:
	print(account)
else:
	last_d = abs(account) % 10
	before_d = abs(account) // 10 % 10
	delete_1 = abs(account) // 10
	delete_2 = abs(account) // 10 - before_d + last_d
	print(-min(delete_1, delete_2))


n = int(input())
if n > 0:
	print(n)
else:
	temp = list(map(int, reversed(str(n)[1:])))
	if len(temp) < 2:
		print(0)
	else:
		temp.remove(max(temp[:2]))
		print(-int(''.join(map(str, reversed(temp)))))


a = int(input())
c = str()
if a < 0:
	a = list(str(a))
	if len(a) >= 2:
		if int(a[-1]) >= int(a[-2]):
			a[-1] = str(a[-2])
		else:
			a[-2] = str(a[-1])
		del a[-1]
		for i in a:
			c = c + i
	else:
		c = '0'
	if c == '-0':
		c = '0'
	print(c)
else:
	print(a)


n = input()
num = int(n)
s = [str(i) for i in n]
if num >= 10:
	print(num)
else:
	if s[-1] >= s[-2]:
		del s[-1]
	else:
		del s[-2]
	if s == ['-', '0']:
		print(0)
	else:
		for i in s:
			print(i, end='')


def listo(n):
	n = abs(n)
	d = []
	i = 0
	while n > 0:
		i = n % 10
		d.append(int(i))
		n -= i
		n /= 10
	d.reverse()
	return d

def litso(arr):
	str1 = ''
	return str1.join(arr)
n = int(input())
if n < 0:
	arr = listo(n)
	if len(arr) > 1:
		if arr[-1] > arr[-2]:
			q = arr[-1]
			del arr[-1]
		else:
			del arr[-2]
		if arr[0] == 0:
			print(*arr)
		else:
			print('-', *arr, sep='')
	else:
		arr.remove(arr[-1])
		print('-', *arr, sep='')
else:
	print(n)


m = int(input())
if m >= 0:
	print(m)
else:
	m = -m
	a = m // 10
	b = m // 100 * 10 + m % 10
	if a > b:
		print(-b)
	else:
		print(-a)


amount = int(input())
samount = str(amount)
if amount < 0 and len(samount) > 2:
	if samount[-1] < samount[-2]:
		newAmount = samount[0:-2] + samount[-1]
	else:
		newAmount = samount[0:-1]
	print(int(newAmount))
else:
	print(amount)


a = input()
print((a[0] * int(a[1:-2] + str(min(int(a[-1]), int(a[-2]))) != '0') + a[1:-2] + str(min(int(a[-1]), int(a[-2])))) * int(a[0] == '-') + a * int(a[0] != '-'))


n = int(input())
if n >= 0:
	print(n)
else:
	k = str(abs(n))
	if k[-1] < k[-2]:
		l = '-' + k[0:len(k) - 2] + k[len(k) - 1]
		print(int(l))
	else:
		l = '-' + k[0:len(k) - 1]
		print(int(l))


n = int(input())
maximum = n
if int(str(n)[:-1]) > maximum:
	maximum = int(str(n)[:-1])
if int(str(n)[:-2] + str(n)[-1]) > maximum:
	maximum = int(str(n)[:-2] + str(n)[-1])
print(maximum)


in_string = input()
if '-' not in in_string:
	print(in_string)
	exit()
if in_string[2] == '0' and len(in_string) == 3:
	print(0)
	exit()
l = len(in_string)
if in_string[l - 1] > in_string[l - 2]:
	print(in_string[:l - 1])
else:
	print(in_string[:l - 2] + in_string[l - 1])


n = input()
m = n
max = int(n)
temp = 0
if int(n) >= 0:
	max = int(n)
else:
	n = n[0:-2] + n[-1]
	if int(n) > max:
		max = int(n)
	n = m
	n = n[0:-1]
	if int(n) > max:
		max = int(n)
print(max)


from sys import stdin
input = lambda : stdin.readline().rstrip('\r\n')
from collections import defaultdict as vector
from collections import deque as que
inin = lambda : int(input())
inar = lambda : list(map(int, input().split()))
Testcase = 1
for _ in range(Testcase):
	a = input()
	print(max(int(a), int(a[0:-1]), int(a[0:-2] + a[-1])))


tk = int(input())
if tk > 0:
	print(tk)
else:
	sr = str(tk)
	srLen = len(sr)
	if int(sr[srLen - 1]) > int(sr[srLen - 2]):
		sr = sr[0:srLen - 1]
		print(sr)
	else:
		sr = sr[0:srLen - 2] + sr[srLen - 1]
		print(int(sr))


a = input()
b = int(a)
if b >= 0:
	print(b)
else:
	a = list(a)
	if a[-1] == '0':
		a.pop(-2)
	elif a[-2] == '0':
		a.pop(-1)
	elif a[-2] > a[-1]:
		a.pop(-2)
	elif a[-1] >= a[-2]:
		a.pop(-1)
	x = ''.join(map(str, a))
	if x == '-0':
		print('0')
	elif x == '-':
		print('0')
	else:
		print(x)


import math
n = int(input())
if n > 0:
	print(n)
else:
	data = list(str(n))
	if ord(data[-1]) > ord(data[-2]):
		del data[-1]
	else:
		del data[-2]
	if len(data) == 2 and data[-1] == '0' or len(data) == 1:
		print(0)
	else:
		print(''.join(data))


n = input()
if int(n) >= 0:
	print(n)
else:
	n = abs(int(n))
	a = n % 10
	n = n // 10
	b = n % 10
	n = n // 10 * 10
	a = min(a, b)
	n += a
	print(-n)


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	kl = int(n / 10)
	ksl = int(n / 10) + int(n % 10) - int(kl % 10)
	if kl > ksl:
		print(-ksl)
	else:
		print(-kl)


n = input()
d = []
if int(n) >= 0:
	print(n)
else:
	m = list(n)
	a = m[-2:]
	if len(m) > 3:
		b = max(a)
		a.remove(b)
		d.extend(m[:-2])
		d = d + a
		e = ''.join(d)
		print(str(e))
	elif a[-1] == '0':
		print('0')
	else:
		b = max(a)
		a.remove(b)
		d.extend(m[:-2])
		d = d + a
		e = ''.join(d)
		print(str(e))


n = input()
l = []
l.append(int(n))
l.append(int(n[:-1]))
l.append(int(n[:-2] + n[-1]))
print(max(l))


n = input()
if int(n) >= 0:
	print(n)
else:
	n = list(n)
	n_c = n[:]
	n.pop(-1)
	n1 = int(''.join(n))
	n_c.pop(-2)
	n2 = int(''.join(n_c))
	print(max(n1, n2))


def llya_bank_account():
	balance_str = input()
	if balance_str[0] == '-':
		balance_str = '0' + balance_str[1:]
		return int(balance_str[:-1] if balance_str[-1] > balance_str[-2] else balance_str[:-2] + balance_str[-1]) * -1
	else:
		return balance_str
print(llya_bank_account())


n = int(input())
import math
if n > 0:
	print(n)
else:
	n = abs(n)
	a = n % 10
	b = int(n % 100 / 10)
	if a > b:
		print(int(math.ceil((n - n % 10) / 10 * -1)))
	elif a < b:
		k = math.ceil((n - n % 100 - n % 10) / 10) + n % 10
		print(int(k) * -1)
	else:
		n1 = int(math.ceil((n - n % 10) / 10))
		n2 = math.ceil((n - n % 100 - n % 10) / 10) + n % 10
		n = min(n1, n2)
		n = -1 * n
		print(int(n))


n = input()
print(max(int(n), eval(n[:-1]), eval(n[:-2] + n[-1])))


n = int(input())
s = str(n)
if n < 0:
	l = int(s[-1])
	l1 = int(s[-2])
	if l1 < l:
		s = s[:-1]
	else:
		s = s[:-2] + s[-1]
	if int(s) != 0:
		print(s)
	else:
		print(0)
else:
	print(n)


x = input()
mylist = []
for item in x:
	mylist.append(item)
mylist = mylist[::-1]
if int(x) < 0:
	if int(mylist[0]) > int(mylist[1]):
		mylist.remove(mylist[0])
	else:
		mylist.remove(mylist[1])
else:
	pass
mylist = mylist[::-1]
ans = ''.join(mylist)
print(int(ans))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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 I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	s = S()
	a = int(s)
	b = int(s[:-2] + s[-1:])
	c = int(s[:-1])
	return max(a, b, c)
print(main())


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	a = n // 10
	z = n % 10
	b = a // 10
	y = a % 10
	b = 10 * b
	if z < y:
		y = z
	b = b + y
	b = -b
	print(b)


import math
n = input()
if int(n) >= 0:
	print(n)
else:
	print(int(*[n[0:len(n) - 1]]) if int(*[n[0:len(n) - 1]]) > int(*[n[0:len(n) - 2] + n[len(n) - 1]]) else int(*[n[0:len(n) - 2] + n[len(n) - 1]]))


n = input()
n2 = 0
x = 0
y = 0
if int(n) >= 0:
	print(int(n))
elif len(n) == 2:
	print(0)
else:
	n = list(n)
	n2 = n[:]
	n.pop(-1)
	n2.pop(-2)
	n = ''.join(n)
	n2 = ''.join(n2)
	if n == '-0' or n2 == '-0':
		print(0)
	elif int(n) > int(n2):
		print(int(n))
	elif int(n) < int(n2) or int(n) == int(n2):
		print(int(n2))


n = input()
if int(n) > 0:
	print(int(n))
	exit()
print(int(n[:-2] + n[-1:]) if int(n[-1]) < int(n[-2]) else n[:-1])


b = input()
n = int(b)
if n >= 0:
	print(n)
	exit()
x = int(b[:-1])
y = int(b[:-2] + b[-1])
print(max(x, y))


a = input()
s = ''
t = ''
if int(a) > 0:
	print(int(a))
else:
	for i in range(len(a) - 1):
		s = s + a[i]
	for i in range(len(a)):
		if i != len(a) - 2:
			t = t + a[i]
	if int(s) > int(t):
		print(int(s))
	else:
		print(int(t))


ac = input()
if ac[0] != '-':
	print(ac)
else:
	one = ac[0:len(ac) - 1]
	two = list(ac[0:len(ac) - 2])
	last = ac[-1]
	two.append(last)
	two = ''.join(two)
	one = int(one)
	two = int(two)
	print(max(one, two))


n = int(input())
maxn = max(n, int(n / 10), int(n / 100) * 10 - -n % 10)
print(maxn)


def func(s):
	w = s[0:len(s) - 2] + s[-1]
	return int(w)

def last(s):
	return int(s[0:-1])
n = int(input())
if n >= 0:
	print(n)
else:
	a = str(n)
	if len(a) == 2:
		print(n)
	else:
		print(max(last(a), func(a)))


def swap(s, i, j):
	return ''.join((s[:i], s[j], s[i + 1:j], s[i], s[j + 1:]))
n = input()
l = len(n)
if int(n) < 0 and n[l - 1] != 0 and (n[l - 2] != 0):
	if n[l - 2] > n[l - 1]:
		value = swap(n, l - 2, l - 1)
		value1 = int(value) / 10
		print(int(value1))
	else:
		value1 = int(n) / 10
		print(int(value1))
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	n1 = round((n - n % 10) / 10)
	n2 = round((n - n % 100) / 10 + n % 10)
	if n1 > n2:
		print(-n2)
	else:
		print(-n1)


a = input()
a1 = a[:-1]
a2 = a[:-2] + a[-1]
if a[0] != '-':
	print(a)
if a[0] == '-':
	if a2 == '-0':
		print(0)
	elif a < a1 <= a2:
		print(a)
	elif a < a2 <= a1:
		print(a)
	elif a1 < a < a2:
		print(a1)
	elif a1 < a2 < a:
		print(a1)
	elif a2 < a < a1:
		print(a2)
	elif a2 <= a1 < a:
		print(a2)


n = int(input())
if n >= 0:
	print(n)
else:
	n = str(n)
	long = len(n)
	l = 0
	x1 = ''
	x2 = ''
	while l < long - 2:
		x1 = x1 + n[l]
		x2 = x2 + n[l]
		l = l + 1
	x1 = x1 + n[long - 2]
	x2 = x2 + n[long - 1]
	if x2 < x1:
		print(int(x2))
	else:
		print(int(x1))


a = int(input())
a1 = a + -2 * a
b = a1 % 100 % 10
b += -2 * b
if a >= 0:
	print(a)
elif (a + a1 % 10) // 10 > (a + a1 % 100) // 10 + b:
	print((a + a1 % 10) // 10)
else:
	print((a + a1 % 100) // 10 + b)


n = int(input())
if n >= 0:
	print(n)
else:
	s = str(n)
	p = s[:-1]
	y = s[len(s) - 1]
	h = p[:-1] + y
	h = int(h)
	p = int(p)
	if h > p:
		print(h)
	else:
		print(p)


n = input()
num = int(n)
l = list(n)
res = ''
if num < 0:
	r = n[len(n) - 1]
	s = n[len(n) - 2]
	if r >= s:
		del l[len(l) - 1]
		res = res.join(l)
	else:
		del l[len(l) - 2]
		res = res.join(l)
	print(int(res))
else:
	print(num)


n = int(input())
if n >= 0:
	print(n)
else:
	n *= -1
	h = n // 100
	d = n % 100
	u = d % 10
	d = d // 10
	if d > u:
		print(-(10 * h + u))
	else:
		print(-(10 * h + d))


n = input()
if int(n) >= 0:
	print(int(n))
else:
	a = n[::-1]
	b = max(a[:2])
	c = a.replace(b, '', 1)
	d = c[::-1]
	print(int(d))


n = int(input())
outcome = []
if n >= 0:
	print(n)
else:
	n = 0 - n
	line = str(n)
	length = len(line)
	for i in range(length - 2, length):
		option = line[:i] + line[i + 1:]
		number = int(option)
		if len(str(number)) == len(option):
			outcome.append(number)
	high = 0 - min(outcome)
	print(high)


n = int(input())
c = []
d = []
if n >= 0:
	print(n)
if n < 0:
	k = -n
	n = k
	while k > 0:
		c.append(k % 10)
		k = k // 10
	c.reverse()
	if len(c) >= 2:
		del c[len(c) - 2]
		m = 0
		for i in c:
			m = m * 10 + i
		if m > n // 10:
			print(-(n // 10))
		else:
			print(-m)
	else:
		print(-(n // 10))


n = int(input())
if n > 0 or n == 0:
	print(n)
else:
	n = str(n)
	list1 = []
	list2 = []
	for i in range(1, len(n)):
		list2.append(n[i])
		list1.append(n[i])
	a = ''
	b = ''
	del list1[len(list1) - 1]
	del list2[len(list2) - 2]
	for i in list1:
		a += i
	for i in list2:
		b += i
	if int(a) * -1 > int(b) * -1:
		print(-int(a))
	else:
		print(-int(b))


c = int(input())
b = []
if c >= 0:
	print(c)
else:
	c *= -1
	a = str(c)
	for i in a:
		b.append(i)
	b = list(map(int, b))
	if b[-1] >= b[-2]:
		b.pop(-1)
	else:
		b.pop(-2)
	print(-int(''.join(list(map(str, b)))))


m = input()
print(max(eval(m[:-1]), eval(m[:-2] + m[-1]), eval(m)))


n = int(input())
if n >= 0:
	print(n)
else:
	s = str(n)
	s1 = s[:len(s) - 1]
	s2 = s[:len(s) - 2] + s[len(s) - 1]
	print(max(n, int(s1), int(s2)))


n = int(input())
if n < 0:
	firstDigit = abs(n) % 10
	firstDigit = firstDigit * -1
else:
	firstDigit = abs(n) % 10
temp1 = int(n / 10)
temp2 = int(n / 100) * 10 + firstDigit
if n >= temp1 and n >= temp2:
	print(n)
elif temp1 >= n and temp1 >= temp2:
	print(temp1)
elif temp2 >= n and temp2 >= temp1:
	print(temp2)


n = input()
a = []
b = []
for i in n:
	a += [i]
	b += [i]
del a[-1]
del b[-2]
a = int(''.join(a))
b = int(''.join(b))
li = [a, b, int(n)]
li.sort()
print(li[2])


balance = int(input())
if balance < 0:
	d1 = -balance % 10
	d2 = (-balance - d1) / 10 % 10
	if d1 > d2:
		balance = int((balance + d1) / 10)
	else:
		balance = int(-(-balance // 100) * 10 - d1)
print(balance)


n = input()
if int(n) >= 0:
	print(int(n))
else:
	ret = int(n[:-1])
	if ret < int(n[:-2] + n[-1]):
		ret = int(n[:-2] + n[-1])
	print(ret)


data = int(input())
if data >= 0:
	print(data)
elif 0 > data >= -10:
	print(0)
else:
	print(max(int(str(data)[:-1]), int(str(data)[:-2] + str(data)[-1])))


n = int(input())
if n >= 0:
	print(n)
else:
	a = list(str(n))
	c = [a[-i - 1] for i in range(len(a))]
	if len(a) == 2:
		print(0)
	elif len(a) == 3:
		print(-min(int(a[-1]), int(a[-2])))
	else:
		c.remove(str(max(int(c[0]), int(c[1]))))
		c = [c[-i - 1] for i in range(len(c))]
		print(''.join(c))


bank_account = input()
if int(bank_account) >= 0:
	print(bank_account)
elif int(bank_account) < 0:
	if bank_account[-1] > bank_account[-2]:
		print(bank_account[0:-1])
	elif bank_account[-1] < bank_account[-2] and bank_account[2] == '0':
		print(bank_account[2])
	elif bank_account[-1] < bank_account[-2]:
		print(bank_account[0:-2] + bank_account[-1])
	else:
		print(bank_account[0:-1])


import sys
local_launch = False
try:
	open('LOCAL').read()
	local_launch = True
except:
	pass
input_data = open('INPUT.txt').read() if local_launch else sys.stdin.read()
done = {'i': 0}
tokens = input_data.split()

def next_token():
	result = tokens[done['i']]
	done['i'] += 1
	return result

def next_int():
	return int(next_token())

def next_str():
	return next_token()
n = next_int()
if n > 0:
	print(n)
else:
	n = n * -1
	y = n % 10
	u = n // 10 % 10
	if y > u:
		print(n // 10 * -1)
	else:
		print((n // 100 * 10 + n % 10) * -1)


n = int(input())
if n >= 0:
	print(n)
elif n > -10:
	if len(str(n)) == 3:
		print('0')
	else:
		print(n)
else:
	s = str(n).replace('-', '')
	l = len(s)
	r = int(s[:l - 1])
	t = int(s[:l - 2] + s[l - 1])
	if r == 0 or t == 0:
		print(0)
	elif r < t:
		print('-' + str(r))
	else:
		print('-' + str(t))


n = input()
n2 = int(n[:-1])
n3 = int(n[:-2] + n[-1:])
n = int(n)
print(max(n, n2, n3))


num = int(input())
n = len(str(num))
if num >= 0:
	print(num)
else:
	x = list(str(num))
	x.pop()
	a = ''.join(x)
	x = list(str(num))
	x.pop(-2)
	b = ''.join(x)
	if int(a) > int(b):
		out = a
	else:
		out = b
	if int(out) == 0:
		print(0)
	else:
		print(out)


n = input()
o = n
if n[0] == '-':
	if int(n[-2]) <= int(n[-1]):
		o = n[:-1]
	else:
		o = n[:-2] + n[-1]
	o = int(o)
print(o)


n = int(input())
if n >= 0:
	print(n)
elif n <= -10 and n >= -90 and (n % 10 == 0):
	print(0)
else:
	n = str(n)
	n.split()
	k = []
	k = n[:len(n) - 1]
	l = []
	l = n[:len(n) - 2] + n[len(n) - 1]
	k = ''.join(k)
	l = ''.join(l)
	(k, l) = (int(k), int(l))
	if k >= l:
		print(k)
	else:
		print(l)


n = int(input())
if n >= 0:
	print(n)
else:
	n = list(str(n))
	if len(n) == 2:
		print(0)
	elif len(n) == 3:
		print(max(int(n[0] + n[2]), int(n[0] + n[1])))
	else:
		last = int(n[-1])
		secLast = int(n[-2])
		if last >= secLast:
			print(''.join(n[:-1]))
		else:
			print('-' + str(''.join(n[1:-2])) + str(n[-1]))


x = input()
w = x[0:-1]
e = x[0:-2] + x[-1]
if int(x) >= 0:
	print(x)
elif int(w) > int(e):
	print(int(w))
else:
	print(int(e))


a = input()
if a[0] != '-':
	print(a)
elif a[-2] == '0':
	b = a[0:len(a) - 1]
	if b == '-0':
		print('0')
	else:
		print(b)
else:
	if ord(a[-2]) > ord(a[-1]):
		b = a[0:-2] + a[-1]
	else:
		b = a[0:-1]
	if b == '-0':
		print('0')
	else:
		print(b)


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().split())
inl = lambda : list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))
n = ins()
print(max(int(n), int(n[:-1]), int(n[:-2] + n[-1])))


balance = input()
changed1 = balance[:-2] + balance[-1]
changed2 = balance[:-1]
options = map(int, [balance, changed1, changed2])
print(max(options))


money = int(input())
mon = ''
if money >= 0:
	print(money)
else:
	st = str(money).strip('-')
	n = len(st)
	m = max(map(int, st[n - 2:]))
	for i in range(n):
		if i >= n - 2:
			if st[n - 1] == st[n - 2]:
				if i == n - 2:
					pass
				else:
					mon += st[i]
			elif str(m) == st[i]:
				pass
			else:
				mon += st[i]
		else:
			mon += st[i]
	print(0 - int(mon))


n = int(input())
if n > 0:
	print(n)
else:
	n = str(n)
	v = n[:len(n) - 1]
	c = n[:len(n) - 2] + n[-1]
	if int(c) > int(v):
		if str(c) == '-0':
			print(0)
		else:
			print(c)
	elif v == -0:
		print(0)
	else:
		print(v)


n = input()
nz = n[:len(n) - 1]
if int(n) > 0:
	print(n)
else:
	n1 = n[-1]
	n2 = n[-2]
	if int(n1) > int(n2):
		nz = n[:len(n) - 1]
		print(nz)
	else:
		nnn = nz[:len(n) - 2] + n[len(n) - 1]
		if nnn == '-0':
			print(0)
		else:
			print(nnn)


n = int(input())
if n >= 0:
	print(n)
elif n >= -10 or (n >= -90 and n % 10 == 0):
	print(0)
else:
	tmp = list(str(n))
	length = len(tmp)
	for i in range(0, length - 2):
		print(tmp[i], end='')
	if int(tmp[length - 1]) <= int(tmp[length - 2]):
		print(tmp[length - 1])
	else:
		print(tmp[length - 2])


from operator import itemgetter
n = int(input())
if n >= 0:
	print(n)
else:
	n = str(n)
	n1 = int(n[:len(n) - 1])
	n2 = int(n[:len(n) - 2] + n[-1])
	print(max(n1, n2))


n = input()
m = int(n)
A = []
b = 0
if m >= 0:
	print(m)
else:
	for i in n:
		A.append(i)
	del A[0]
	max = 0
	if len(A) > 1:
		if A[-1] > A[-2]:
			del A[-1]
		else:
			del A[-2]
		s = ''
		for l in A:
			s = s + l
		s = int(s) * -1
		print(s)
	else:
		print(0)


m = input()[:]
n = int(m)
if n > -11:
	print(max(n, 0))
else:
	print(int(m[:-2] + '0') - int(min(m[-1], m[-2])))


x = int(input())
if x > 0:
	print(x)
elif x > -100:
	x = str(x)
	print(max(-int(x[1]), -int(x[2])))
else:
	x = str(x)
	f = int(x[:len(x) - 1])
	s = int(x[:len(x) - 2] + x[-1])
	print(max(f, s))


n = int(input())
if n < 0:
	if n in range(-10, 0):
		print(0)
	else:
		s = str(n)
		l = len(s)
		print(max(int(s[0:l - 1]), int(s[0:l - 2] + s[-1])))
else:
	print(n)


dolg = input()
if dolg[0] == '-':
	srt_dolg_1 = dolg[:-1]
	srt_dolg_2 = dolg[:-2] + dolg[-1:]
	if srt_dolg_1 == '-':
		print(0)
	else:
		print(max(int(srt_dolg_1), int(srt_dolg_2)))
else:
	print(dolg)


n = int(input())
s = 0
m = int()
if n >= 0:
	s = n
else:
	m = -n
	l = list(str(m))
	t = len(l)
	t1 = int(t - 1)
	t2 = int(t - 2)
	if l[t1] > l[t2]:
		l.pop()
	else:
		del l[-2]
	s = map(str, l)
	s = ''.join(s)
	if s == '0':
		s = 0
	else:
		s = '-' + s
print(s)


n = input()
last_removed = ''
one_before_last_removed = ''
if int(n) >= 0:
	print(n)
elif len(n) > 2:
	for i in range(0, len(n) - 1):
		last_removed += n[i]
	for i in range(0, len(n) - 2):
		one_before_last_removed += n[i]
	one_before_last_removed += n[-1]
	print(max(int(n), int(one_before_last_removed), int(last_removed)))
else:
	print(0)


n = input()
if int(n) >= 0:
	print(n)
	exit()
c1 = int(n[-1])
c2 = int(n[-2])
if len(n) == 3 and c1 == 0:
	print(0)
	exit()
if c1 == c2:
	print(n[:-1])
elif c1 > c2:
	print(n[:-1])
else:
	print(n[:-2] + n[-1])


n = input()
l = n[:-1]
m = n[:-2] + n[-1:]
print(max(int(l), int(m), int(n)))


n = int(input())
if n >= 0:
	print(n)
else:
	n = abs(n)
	l = n % 10
	a = n // 10 % 10
	if a > l:
		print(-1 * (n // 100 * 10 + l))
	else:
		print(-1 * (n // 100 * 10 + a))


balance = input()
if int(balance) >= 0:
	print(balance)
elif int(balance[-1]) < int(balance[-2]):
	print(int(balance[:-2] + balance[-1]))
else:
	print(balance[:-1])


t = input

def new(inp, del1):
	inp1 = inp[0:len(inp) - del1]
	inp2 = inp[len(inp) - del1 + 1:len(inp)]
	return int(inp1 + inp2)
n = int(t())
print(max(n, new(str(n), 1), new(str(n), 2)))


n = int(input())

def theeonethee(n):
	if n < 0:
		p = str(abs(n))[:-2] + str(abs(n))[-1]
		q = str(abs(n))[:-1]
		if int(p) <= int(q):
			return -1 * int(p)
		else:
			return -1 * int(q)
	else:
		return n
print(theeonethee(n))


def posl(a):
	jigo = str(a)
	res = 0
	mat = []
	sat = []
	for i in jigo:
		mat.append(i)
	for i in range(len(mat) - 1):
		mat[i] = int(mat[i])
		sat.append(mat[i])
	for i in range(len(sat)):
		res += sat[i] * 10 ** (len(sat) - i - 1)
	return res

def predposl(a):
	jigo = str(a)
	res = 0
	mat = []
	sat = []
	for i in jigo:
		mat.append(i)
	for i in range(len(mat)):
		if i != len(mat) - 2:
			mat[i] = int(mat[i])
			sat.append(mat[i])
	for i in range(len(sat)):
		res += sat[i] * 10 ** (len(sat) - i - 1)
	return res
a = int(input())
if a >= 0:
	print(a)
else:
	a = abs(a)
	if posl(a) < predposl(a):
		print(posl(a) * -1)
	else:
		print(predposl(a) * -1)


a = int(input())
l = 0
n = 0
if a < 0:
	l = a * -1
for i in range(0, 10):
	if a >= 0:
		print(a)
		break
	n = l // 10
	if l % 10 > n % 10:
		print(l // 10 * -1)
		break
	elif l % 10 < n % 10:
		l = l - 10
	elif l % 10 == n % 10:
		print(l // 10 * -1)
		break


n = input()
if int(n) > 0:
	print(n)
else:
	s = n[0:len(n) - 1]
	n = n[:len(s) - 1] + n[len(n) - 1]
	print(max(int(n), int(s)))


n = int(input())
if n > 0:
	print(n)
else:
	d = -n
	a = d % 10
	s = d // 10
	e = s % 10
	if e < a:
		print(-s)
	elif e > a:
		z = s - e + a
		print(-z)
	else:
		print(-s)


n = int(input())
if n > 0:
	print(n)
else:
	n = abs(n)
	digit1 = n % 10
	digit2 = n % 100 // 10
	if digit1 > digit2:
		bil = str(n)
		bil = bil[:-1]
		n = int(bil)
		print(-n)
	else:
		bil = str(n)
		bil = bil[:-2]
		bil = bil + str(n % 10)
		n = int(bil)
		print(-n)


a = int(input())
if a >= 0:
	print(a)
else:
	x = int(str(a)[:-1])
	y = int(str(a)[:-2] + str(a)[-1])
	print(max(x, y))


inputs = int(input())
if inputs > 0:
	print(inputs)
else:
	inputs = str(inputs)
	midlen = len(inputs)
	newstr1 = int(inputs[:midlen - 1])
	newstr2 = int(inputs[:midlen - 2] + inputs[midlen - 1:])
	minim = max(newstr2, newstr1)
	print(minim)


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
value = f_input().replace('\n', '')
(first, second) = (int(value[:len(value) - 1]), int(value[:len(value) - 2] + value[::-1][0]))
if max(first, second) > int(value):
	f_print(str(max(first, second)))
else:
	f_print(value)


from math import floor, ceil, log

def main():
	a = input()
	ans = a
	if a[0] == '-':
		if int(a[-1]) > int(a[-2]):
			ans = a[:-1]
		else:
			ans = a[:-2] + a[-1]
	if ans == '-0':
		ans = '0'
	print(ans)
main()


def maximiseAmount(n):
	first = n[:len(n) - 1]
	second = n[:len(n) - 2] + n[len(n) - 1]
	return max(int(first), int(second), int(n))
n = input()
print(maximiseAmount(n))


N = int(input())
if N >= 0:
	print(N)
elif len(str(N)[1:]) == 1:
	print(0)
elif len(str(N)[1:]) == 2:
	if int(str(N)[len(str(N)) - 1]) == 0:
		print(0)
	else:
		print(f'-{min(int(str(N)[len(str(N)) - 1]), int(str(N)[len(str(N)) - 2]))}')
else:
	print(f'{str(N)[:len(str(N)) - 2]}{min(int(str(N)[len(str(N)) - 1]), int(str(N)[len(str(N)) - 2]))}')


n = input()
if n[0] != '-':
	print(n)
else:
	length = len(n)
	s = ''
	if n[length - 1] > n[length - 2]:
		index = length - 1
	else:
		index = length - 2
	for i in range(1, length):
		if i != index:
			s += n[i]
	if int(s) == 0:
		print(0)
	else:
		print('-' + str(int(s)))


n = input()
nlist = list(n)
n_i = int(n)
if n_i >= 0:
	print(n_i)
elif n_i < 0:
	n1 = int(n_i / 10)
	n2 = nlist
	del n2[-2]
	n2l = ''.join(n2)
	n2_i = int(n2l)
	if n2_i > n1:
		print(n2_i)
	else:
		print(n1)


m = int(input())
if m < 0:
	print(max(-(-m // 10), -(-m // 100 * 10) - -m % 10))
else:
	print(m)


n = input()
if int(n) >= 0:
	print(n)
else:
	dig1 = n[len(n) - 1]
	dig2 = n[len(n) - 2]
	if int(dig1) >= int(dig2):
		result = n[:len(n) - 1]
		print(result)
	else:
		s = list(n)
		s[len(n) - 2] = s[len(n) - 1]
		n = ''.join(s[:-1])
		print(int(n))


n = int(input())
if n < 0:
	li = [int(x) for x in str(n) if x.isdigit()]
	if li[-1] > li[-2]:
		li.pop(-1)
	else:
		li.pop(-2)
	s = [str(i) for i in li]
	res = int(''.join(s))
	if res == 0:
		print(0)
	else:
		print(-res)
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	s = str(n)
	l = len(s)
	if l == 2:
		print('0')
	elif l == 3:
		print(max(-int(s[1]), -int(s[-1])))
	else:
		d = int(s[:l - 1])
		e = int(s[:l - 2] + s[l - 1:])
		print(max(d, e))


n = int(input())
s = str(n)
if n >= 0:
	print(n)
else:
	l = len(s)
	if l == 1:
		print('0')
	else:
		m = int(s[0:-1])
		p = s[0:-2]
		q = s[-1]
		r = int(p + q)
		if r > m:
			print(r)
		else:
			print(m)


n = int(input())
if n > 0:
	print(n)
else:
	l = list(str(n))
	a = int(''.join(l[:-1]))
	l.pop(-2)
	b = int(''.join(l))
	print(max(a, b))


n = int(input())
if n > 0:
	print(n)
if n < 0:
	str = str(n)
	m1 = []
	m2 = []
	for i in range(len(str)):
		m1.append(str[i])
		m2.append(str[i])
	m1.pop(len(str) - 1)
	m2.pop(len(str) - 2)
	n1 = int(''.join(m1))
	n2 = int(''.join(m2))
	print(max(n1, n2))


k = input()
if int(k) < 0:
	print(max(int(k[0:len(k) - 1]), int(k[0:len(k) - 2] + k[len(k) - 1])))
else:
	print(k)


n = int(input())
an = abs(n)
print(n if n >= 0 else int('-' + str(an // 100) + str(min(an % 10, an % 100 // 10))))


acc = int(input())
if acc >= 0:
	print(acc)
else:
	case1 = int(abs(acc) / 10)
	case2 = int(str(int(abs(acc) / 100)) + str(int(abs(acc) % 10)))
	if case1 > case2:
		print(-1 * case2)
	else:
		print(-1 * case1)


n = input()
a = list(n)
w = list(n)
b = int(n)
if b >= 0:
	print(b)
if b < 0 and len(a) == 2:
	print('0')
if b < 0 and len(a) > 2:
	del a[len(a) - 1]
	c = a
	del w[len(w) - 2]
	d = w
	e = int(''.join(c))
	f = int(''.join(d))
	if e >= f:
		print(e)
	else:
		print(f)


n = input()
a = int(n[-1])
b = int(n[-2])
c = int(n)
if c >= 0:
	print(c)
elif a > b:
	print(int(n[:-1]))
elif a == b:
	print(int(n[:-1]))
elif a < b:
	print(int(n[:-2] + n[-1]))


b = input()
if int(b) > 0:
	print(b)
else:
	print(int(b[:-2] + str(min(b[-1], b[-2]))))


bb = input()
if int(bb) >= 0:
	print(bb)
	pass
elif int(bb[-1]) >= int(bb[-2]):
	print(bb[:len(bb) - 1])
else:
	print(int(bb[:len(bb) - 2] + bb[-1]))


n = input()
if n.startswith('-'):
	if len(n) >= 3:
		a = n[-1]
		b = n[-2]
		if a >= b:
			print(int(n[:-1]))
		else:
			print(int(n[:-2] + n[-1]))
	else:
		print(0)
else:
	print(n)


n = int(input())
if n >= 0:
	print(n)
else:
	copy = str(n)
	if len(copy) == 2:
		print(0)
	else:
		(remain, last2, last1) = (copy[:-2], int(copy[-2]), int(copy[-1]))
		if len(copy) == 3 and (last2 == 0 or last1 == 0):
			nn = 0
		elif last1 > last2:
			nn = remain + str(last2)
		elif last2 > last1:
			nn = remain + str(last1)
		else:
			nn = remain + str(last1)
		print(nn)


def main():
	n = int(input())
	if n >= 0:
		print(n)
	else:
		n = abs(n)
		if n // 10 >= n // 100 * 10 + n % 10:
			print(-int(n // 100 * 10 + n % 10))
		else:
			print(-(n // 10))
main()


def solve(n):
	if n >= 0:
		return n
	n = n * -1
	resp = min(int(n / 10), int(n / 100) * 10 + n % 10)
	return resp * -1

def test():
	assert solve(-100003) == -10000
test()
n = int(input())
print(solve(n))


n = int(input())
if n >= 0:
	print(n)
else:
	n = -n
	nl = n // 10
	npl = n // 100 * 10 + n % 10
	print(-min(nl, npl))


n = input()
import copy
a = list(n)
if a[0] != '-':
	print(int(n))
elif a[0] == '-':
	del a[0]
	for i in range(len(a)):
		a[i] = int(a[i])
	b = copy.copy(a)
	del b[len(a) - 1]
	c = copy.copy(a)
	del c[len(a) - 2]
	bb = 0
	cc = 0
	for i in range(len(b)):
		bb += 10 ** (len(b) - 1 - i) * b[i]
		cc += 10 ** (len(b) - 1 - i) * c[i]
	if cc > bb:
		out = -bb
	elif cc <= bb:
		out = -cc
	print(out)


import string
n = int(input())
if n >= 0:
	print(n)
else:
	s = str(n)
	a = s[:-2]
	a += s[-1]
	b = s[:-1]
	if int(a) >= int(b):
		print(int(a))
	else:
		print(int(b))


n = int(input())
if n > 0:
	print(n)
else:
	data_str = str(n)
	last = int(data_str[0:len(data_str) - 1])
	second_last = int(data_str[0:len(data_str) - 2] + data_str[len(data_str) - 1])
	if last > second_last:
		print(last)
	else:
		print(second_last)


s = input()
n = int(s)
if s[0] == '-':
	s1 = s[0:len(s) - 1]
	s2 = s[0:len(s) - 2] + s[len(s) - 1]
	n1 = int(s1)
	n2 = int(s2)
	n = max(n1, n2)
print(n)


n = int(input())
a1 = n
a2 = str(n)
a2 = int(a2[:-2] + a2[-1:])
a3 = str(n)
a3 = int(a3[:-1])
print(max(a1, a2, a3))


str = input()
if int(str) >= 0:
	print(str)
else:
	str1 = str[0:-1]
	str2 = str[0:-2] + str[-1]
	if int(str1) > int(str2):
		print(str1)
	elif str2 != '-0':
		print(str2)
	else:
		print('0')


n = input()
if int(n) < 0:
	if int(n[-2]) > int(n[-1]):
		print(int(''.join(n[:-2] + n[-1])))
	elif int(n[-2]) < int(n[-1]):
		print(int(n) // 10 + 1)
	elif int(n[-2]) == int(n[-1]):
		print(n[:-1])
else:
	print(int(n))


n = int(input())
if n >= 0:
	print(n)
else:
	t = n
	n = abs(n)
	q = abs(n % 10)
	w = abs(n % 100 // 10)
	if q >= w:
		if n // 10 == 0:
			print('0')
		else:
			print(-(n // 10))
	elif n // 100 * 10 + n % 10 == 0:
		print('0')
	else:
		print(-(n // 100 * 10 + n % 10))


x = int(input())
if x >= 0:
	print(x)
else:
	x = str(x)
	a = int(x[:len(x) - 2] + x[-2])
	b = int(x[:len(x) - 2] + x[-1])
	print(max(a, b))


number = input()
if int(number) <= 0:
	a = number[:-1]
	b = number[:-2] + number[-1]
	if int(a) > int(b):
		print(int(a))
	else:
		print(int(b))
else:
	print(number)


n = str(input())
if int(n) >= 0:
	print(int(n))
else:
	e = n[::-1]
	d = e.replace(e[0], '', 1)
	f = e.replace(e[1], '', 1)
	q = d[::-1]
	x = f[::-1]
	print(max(int(q), int(x)))


n = int(input())
if n >= 0:
	print(n)
else:
	pieces = list(str(n))
	L = len(pieces)
	if pieces[L - 1] > pieces[L - 2]:
		del pieces[L - 1]
	else:
		del pieces[L - 2]
	if pieces[1] == '0':
		print(0)
	else:
		print(''.join(pieces))


x = input()
if int(x) > 0:
	print(x)
elif int(x) < 0:
	c = int(str(x[:-2] + x[-1]))
	d = int(str(x[:-1]))
	if c > d:
		print(c)
	else:
		print(d)


n = int(input())
if n > 0:
	print(n)
else:
	k = str(n)
	if len(k) == 3:
		r1 = -1 * int(k[2])
		r2 = -1 * int(k[1])
		if r1 > r2:
			print(r1)
		else:
			print(r2)
	else:
		n = -1 * n
		r1 = n % 10
		n = n // 10
		r2 = n % 10
		if r1 > r2:
			print(-1 * n)
		else:
			n = n // 10
			print(-1 * (n * 10 + r1))


s = input()
if s[0] != '-':
	print(s)
elif (len(s) == 2) | (len(s) == 3) & (s[-1] == '0'):
	print('0')
elif s[-1] > s[-2]:
	print(s[:-1])
else:
	print(s[:-2], end='')
	print(s[-1])


import math
n = int(input())
if n >= 0:
	print(n)
else:
	n = abs(n)
	if n < 10:
		print(0)
	else:
		a = n - 10 * math.floor(n / 10)
		b = (n - 100 * math.floor(n / 100) - a) / 10
		if a >= b:
			print(int(-1 * math.floor(n / 10)))
		else:
			print(int(-1 * (math.floor(n / 10) - b + a)))


def main():
	n = int(input())
	if n >= 0:
		return n
	return max(-(-n // 10), -(-n // 100 * 10 + -n % 10))
print(main())


n = int(input())
res = n
if n < 0:
	n = abs(n)
	res = min(n // 10, n // 100 * 10 + n % 10)
	res *= -1
print(res)


a = input()
k = len(a) - 1
ans1 = int(a[:k])
ans2 = int(a[:k - 1] + a[k])
print(max(int(a), ans1, ans2))


s = input()
n1 = list(s)
n1[len(n1) - 1] = ''
j = ''.join(n1)
n2 = list(s)
n2[len(n1) - 2] = ''
k = ''.join(n2)
li = [int(s), int(k), int(j)]
li.sort(reverse=True)
print(li[0])


b = input()
if int(b) >= 0:
	print(b)
else:
	l = list(b)
	if l[-1] >= l[-2]:
		del l[-1]
	else:
		del l[-2]
	if l != ['-', '0']:
		print(''.join(l))
	else:
		print('0')


n = int(input())
if n >= 0:
	print(n)
elif n < 0:
	n = -n
	n = min(int(n / 10), int(n / 100) * 10 + n % 10)
	print(-n)


n = input()
if int(n) >= 0:
	print(n)
else:
	a = list(n)
	a.pop(len(a) - 1)
	a1 = ''.join(a)
	a1 = int(a1)
	b = list(n)
	b.pop(len(b) - 2)
	b1 = ''.join(b)
	b1 = int(b1)
	print(max(a1, b1))


N = input()
if not N.startswith('-'):
	print(N)
else:
	A = int(N[-1])
	B = int(N[-2])
	N = N[::-1].replace(str(max(A, B)), '', 1)
	N = N[::-1]
	print(N.replace('-', '') if N[1] == '0' and len(N) == 2 else N)


import re
import math
import copy
l = int(input())
if l >= 0:
	print(l)
else:
	o = [i for i in str(l)]
	l = [i for i in str(l)]
	o.pop()
	l.pop(-2)
	o = ''.join(o)
	l = ''.join(l)
	if int(o) < int(l):
		print(int(l))
	else:
		print(int(o))


from sys import stdin

def ii():
	return int(stdin.readline())

def si():
	return stdin.readline()

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())
a = input()
if a[0] == '-':
	l = len(a) - 1
	if int(a[l]) > int(a[l - 1]):
		a = a[:l]
	else:
		a = a[:l - 1] + a[l]
print(int(a))


def main():
	from sys import stdin, stdout
	n = int(stdin.readline())
	if n < 0:
		n *= -1
		b = n // 10
		a = b // 10 * 10 + n % 10
		if a < b:
			if a:
				stdout.write('-' + str(a))
			else:
				stdout.write('0')
		elif b:
			stdout.write('-' + str(b))
		else:
			stdout.write('0')
	else:
		stdout.write(str(n))
main()


def fun(n):
	if n >= 0:
		return n
	else:
		n = abs(n)
		ls = n // 10
		rm = n % 10
		sec = ls // 10 * 10 + rm
		return max(-1 * sec, -1 * ls)
n = int(input())
print(fun(n))


N = input()
if int(N) >= 0:
	print(N)
else:
	c = int(N[:-1])
	d = int(N[:-2] + N[-1])
	if c < d:
		print(d)
	else:
		print(c)