Vasya is very upset that many people on the Net mix uppercase and lowercase letters in one word. That's why he decided to invent an extension for his favorite browser that would change the letters' register in every word so that it either only consisted of lowercase letters or, vice versa, only of uppercase ones. At that as little as possible letters should be changed in the word. For example, the word HoUse must be replaced with house, and the word ViP — with VIP. If a word contains an equal number of uppercase and lowercase letters, you should replace all the letters with lowercase ones. For example, maTRIx should be replaced by matrix. Your task is to use the given method on one given word.

Input

The first line contains a word s — it consists of uppercase and lowercase Latin letters and possesses the length from 1 to 100.

Output

Print the corrected word s. If the given word s has strictly more uppercase letters, make the word written in the uppercase register, otherwise - in the lowercase one.

Examples

Input

HoUse


Output

house


Input

ViP


Output

VIP


Input

maTRIx


Output

matrix

Difficulty: EASY
Tags: String algorithms

Implementation

Starter code:

Solutions:
n = input()
a = 0
b = 0
for i in n:
	if i.isupper():
		a += 1
	else:
		b += 1
if a > b:
	print(n.upper())
else:
	print(n.lower())


s = input()
u = 0
l = 0
for i in s:
	if i.isupper() == 1:
		u += 1
	else:
		l += 1
if u <= l:
	print(s.lower())
if u > l:
	print(s.upper())


a = input()
l = 0
h = 0
for i in range(len(a)):
	if a[i].islower():
		l += 1
	else:
		h += 1
if l >= h:
	a = a.lower()
	print(a)
elif h > l:
	a = a.upper()
	print(a)


inp = input()
u = [i for i in inp if i.isupper()]
l = [i for i in inp if i.islower()]
if len(u) > len(l):
	print(inp.upper())
else:
	print(inp.lower())


s = input()
lower_cnt = 0
for x in s:
	if x.islower():
		lower_cnt += 1
if lower_cnt >= len(s) - lower_cnt:
	print(s.lower())
else:
	print(s.upper())


s = input()
c1 = 0
c2 = 0
for i in s:
	if i.islower():
		c1 = c1 + 1
	elif i.isupper():
		c2 = c2 + 1
if c1 >= c2:
	print(s.lower())
else:
	print(s.upper())


word = input()
upper = 0
lower = 0
for i in word:
	if i.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(word.upper())
else:
	print(word.lower())


word = input()
up = 0
low = 0
for char in word:
	if char.isupper() == True:
		up += 1
	else:
		low += 1
if low >= up:
	new = word.lower()
else:
	new = word.upper()
print(new)


a = input()
x = 0
y = 0
z = 0
while x < len(a) and 1 <= len(a) <= 100:
	if a[x] in 'QWERTYUIOPASDFGHJKLZXCVBNM':
		y = y + 1
	else:
		z = z + 1
	x = x + 1
if z >= y:
	print(a.lower())
else:
	print(a.upper())


S = input()
count_upper = sum(['A' <= c <= 'Z' for c in S])
if count_upper > len(S) - count_upper:
	print(S.upper())
else:
	print(S.lower())


n = input()
c = 0
for i in n:
	if ord(i) >= 97:
		c = c + 1
if len(n) - c > c:
	print(n.upper())
else:
	print(n.lower())


s = input()
u = 0
l = 0
for i in s:
	if i.islower():
		l = l + 1
	else:
		u = u + 1
if l > u:
	print(s.lower())
if u > l:
	print(s.upper())
elif l == u:
	print(s.lower())


s = list(input())
u = 0
l = 0
for i in range(len(s)):
	if s[i].isupper():
		u += 1
	else:
		l += 1
s = ''.join(s)
if l >= u:
	print(s.lower())
else:
	print(s.upper())


upper = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
lower = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
letter = input()
upperCount = 0
lowerCount = 0
for i in range(len(letter)):
	if letter[i] in upper:
		upperCount += 1
	elif letter[i] in lower:
		lowerCount += 1
if upperCount > lowerCount:
	letter = letter.upper()
else:
	letter = letter.lower()
print(letter)


s = input()
a = list(s)
l = 0
u = 0
for x in a:
	if x.islower():
		l += 1
	else:
		u += 1
if l > u:
	print(s.lower())
elif u > l:
	print(s.upper())
else:
	print(s.lower())


s = input()
upp = 0
low = 0
for i in s:
	if i.isupper():
		upp += 1
	else:
		low += 1
if low == upp:
	print(s.lower())
elif low > upp:
	print(s.lower())
else:
	print(s.upper())


a = 'abcdefghijklmnopqrstuvwxyz'
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
word = input()
index = 0
small = 0
big = 0
while index < len(word):
	if A.find(word[index]) == -1:
		small += 1
	else:
		big += 1
	index += 1
index = 0
aword = ''
if small >= big:
	while index < len(word):
		if a.find(word[index]) == -1:
			aword += a[A.find(word[index])]
		else:
			aword += word[index]
		index += 1
else:
	while index < len(word):
		if A.find(word[index]) == -1:
			aword += A[a.find(word[index])]
		else:
			aword += word[index]
		index += 1
print(aword)


A = input()
up = low = 0
for i in A:
	if i.isupper():
		up += 1
	else:
		low += 1
if up <= low:
	print(A.lower())
else:
	print(A.upper())


x = input('')
n = 0
z = 0
for c in range(len(x)):
	if x[c] == x[c].upper():
		n += 1
	if x[c] == x[c].lower():
		z += 1
if n > z:
	x = x.upper()
	print(x)
if n <= z:
	x = x.lower()
	print(x)


s = input()
print([s.lower(), s.upper()][len(s) < 2 * sum((i.isupper() for i in s))])


s = input()
lower = 0
for i in range(len(s)):
	if s[i].islower():
		lower += 1
if lower >= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


s = input()
c1 = 0
c2 = 0
for i in s:
	if i.isupper() == True:
		c1 += 1
	else:
		c2 += 1
if c1 > c2:
	print(s.upper())
else:
	print(s.lower())


word = input()
word_len = len(word)
num_upper = 0
num_lower = 0
for letter in word:
	if letter == letter.upper():
		num_upper += 1
	else:
		num_lower += 1
if num_upper == num_lower:
	print(word.lower())
elif num_upper > num_lower:
	print(word.upper())
elif num_lower > num_upper:
	print(word.lower())


slovo = input()
res_1 = 0
res_2 = 0
for bukva in slovo:
	if 'a' <= bukva <= 'z':
		res_1 += 1
	elif 'A' <= bukva <= 'Z':
		res_2 += 1
if res_1 >= res_2:
	print(slovo.lower())
else:
	print(slovo.upper())


a = str(input())
(x, y) = (0, 0)
for i in a:
	if ord(i) < 97:
		x += 1
	else:
		y += 1
if x > y:
	print(a.upper())
else:
	print(a.lower())


s = input()
t = s.lower()
den = 0
for i in range(len(s)):
	if s[i] != t[i]:
		den += 1
if den > len(s) - den:
	print(s.upper())
else:
	print(s.lower())


s = input()
i = 1
l = 0
U = 0
while i <= len(s):
	if s[i - 1].lower() == s[i - 1]:
		l += 1
		i += 1
	else:
		U += 1
		i += 1
if U > l:
	print(s.upper())
else:
	print(s.lower())


s = input()
(n, m) = (0, 0)
for i in s:
	if i >= 'A' and i <= 'Z':
		m += 1
	else:
		n += 1
print(s.lower() if n > m else s.upper() if n < m else s.lower())


(word, lst_upper, lst_lower) = (input(), [], [])
for i in word:
	lst_upper.append(i) if i.upper() == i else lst_lower.append(i)
print(word.lower()) if len(lst_lower) >= len(lst_upper) else print(word.upper())


st = input()
count = 0
count1 = 0
for i in st:
	if i.isupper():
		count += 1
	elif i.islower():
		count1 += 1
if count > count1:
	print(st.upper())
else:
	print(st.lower())


s = str(input())
up = 0
low = 0
for i in s:
	if i.isupper():
		up += 1
	else:
		low += 1
if up > low:
	print(s.upper())
elif up < low:
	print(s.lower())
else:
	print(s.lower())


word = input()
up = 0
low = 0
for i in range(len(word)):
	if word[i].isupper():
		up = up + 1
		i += 1
	else:
		low = low + 1
		i += 1
if low < up:
	print(word.upper())
else:
	print(word.lower())


word = input()
s = [i for i in word]
uppers = 0
lowers = 0
for letter in s:
	if letter.isupper():
		uppers += 1
	else:
		lowers += 1
if uppers > lowers:
	print(word.upper())
else:
	print(word.lower())


s = input()
lower = 0
capital = 0
for i in s:
	if i.isupper():
		capital += 1
	else:
		lower += 1
if lower >= capital:
	print(s.lower())
else:
	print(s.upper())


s = input()
(up, low) = (0, 0)
for ele in s:
	if ele.isupper():
		up += 1
	else:
		low += 1
if up > low:
	print(s.upper())
elif low > up:
	print(s.lower())
else:
	print(s.lower())


from heapq import heappush, heappop
import queue
import re
import math
import functools

def int_raw():
	return int(input())

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

def ints_raw():
	return list(map(int, ss_raw()))
INF = 1 << 29

def make1d_arr(n, val=INF):
	return [val for i in range(n)]

def make2d_arr(h, w, val=INF):
	return [[val for i in range(w)] for i in range(h)]

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

def main():
	n_u = len(re.findall('[A-Z]', in_S))
	return in_S.upper() if n_u > len(in_S) - n_u else in_S.lower()
print(main())


word = input()
lower_case_letters_count = 0
for letter in word:
	lower_case_letters_count += int(letter.islower())
upper_case_letters_count = len(word) - lower_case_letters_count
if upper_case_letters_count > lower_case_letters_count:
	print(word.upper())
else:
	print(word.lower())


s = input()
k = 0
l = []
for i in range(len(s)):
	if 'A' <= s[i] <= 'Z':
		k += 1
if k <= len(s) / 2:
	for i in range(len(s)):
		if 'A' <= s[i] <= 'Z':
			l.append(s[i].lower())
		else:
			l.append(s[i])
	print(''.join(l))
else:
	for i in range(len(s)):
		if 'a' <= s[i] <= 'z':
			l.append(s[i].upper())
		else:
			l.append(s[i])
	print(''.join(l))


s = input()
u = 0
for i in range(len(s)):
	if ord(s[i]) in range(65, 91):
		u = u + 1
l = len(s) - u
if u > l:
	print(s.upper())
else:
	print(s.lower())


n = input()
(lower, upper) = (0, 0)
for x in range(0, len(n)):
	if ord(n[x]) >= 97:
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(n.lower())
else:
	print(n.upper())


s = input()
sz = len(s)
upper = 0
lower = 0
for i in range(0, sz):
	if ord(s[i]) < 97:
		upper = upper + 1
	else:
		lower = lower + 1
if upper > lower:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
print(s.upper() if sum((c.isupper() for c in s)) * 2 > len(s) else s.lower())


s = input()
c = 0
d = 0
for i in s:
	if i.islower():
		c = c + 1
	elif i.isupper():
		d = d + 1
if c > d:
	print(s.lower())
elif c < d:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
if sum(map(str.islower, s)) >= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


s = input()
uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lowercase = 'abcdefghijklmnopqrstuvwxyz'
upper_count = 0
lower_count = 0
for i in s:
	if i in uppercase:
		upper_count += 1
	else:
		lower_count += 1
if upper_count > lower_count:
	print(s.upper())
else:
	print(s.lower())


s = input()
t = 0
for i in range(len(s)):
	if 65 <= ord(s[i]) <= 90:
		t += 1
print(s.lower() if 2 * t <= len(s) else s.upper())


s = input()
up = [char.isupper() for char in s]
if sum(up) > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


import re
n = str(input())
x = re.findall('[A-Z]', n)
y = re.findall('[a-z]', n)
if len(x) > len(y):
	print(n.upper())
else:
	print(n.lower())


x = input()
y = list(x)
u1 = 0
l1 = 0
for i in y:
	if i.isupper():
		u1 += 1
	else:
		l1 += 1
if u1 <= l1:
	print(x.lower())
else:
	print(x.upper())


n = input()
lowercase = 0
up = 0
for i in n:
	if i.isupper():
		up += 1
	else:
		lowercase += 1
if up > lowercase:
	print(n.upper())
else:
	print(n.lower())


w = input()
(up, down) = (0, 0)
for i in w:
	if i.isupper():
		up += 1
	else:
		down += 1
if up > down:
	w = w.upper()
else:
	w = w.lower()
print(w)


word = input()
lowerCase = 0
upperCase = 0
for i in word:
	if i.islower():
		lowerCase += 1
	if i.isupper():
		upperCase += 1
if upperCase > lowerCase:
	print(word.upper())
else:
	print(word.lower())


t = input()
c = 0
d = 0
for i in t:
	if i.isupper():
		c += 1
	else:
		d += 1
if c == d or c < d:
	print(t.lower())
else:
	print(t.upper())


s = input()
p = 0
for i in range(len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		p += 1
if p >= len(s) - p:
	print(s.lower())
else:
	print(s.upper())


str = input()
l = 0
u = 0
for i in range(len(str)):
	if str[i].islower():
		l += 1
	else:
		u += 1
if u > l:
	print(str.upper())
else:
	print(str.lower())


def changeStr(word):
	upper = 0
	lower = 0
	for char in word:
		if char.isupper():
			upper += 1
		else:
			lower += 1
	if upper > lower:
		return word.upper()
	else:
		return word.lower()
word = input()
print(changeStr(word))


s = input()
l = 0
u = 0
for ch in s:
	if ch.islower():
		l += 1
	else:
		u += 1
if l >= u:
	print(s.lower())
else:
	print(s.upper())


s = input()
u = sum((1 for x in s if x.isupper()))
l = sum((1 for x in s if x.islower()))
if l >= u:
	print(s.lower())
else:
	print(s.upper())


s = input()
upper = sum((1 for x in s if x.isupper()))
lower = len(s) - upper
print(s.upper() if upper > lower else s.lower())


s = input()
(h, k) = (0, 0)
for i in range(len(s)):
	if 'A' <= s[i] and s[i] <= 'Z':
		h += 1
	else:
		k += 1
if h <= k:
	s = s.lower()
else:
	s = s.upper()
print(s)


a = input()
low = 0
up = 0
for i in a:
	s = int(ord(i))
	if s >= 97 and s <= 122:
		low += 1
	elif s >= 65 and s <= 90:
		up += 1
if low >= up:
	print(a.lower())
elif up > low:
	print(a.upper())


import string
lower = string.ascii_lowercase
upper = string.ascii_uppercase
cl = 0
cu = 0
x = input()
for i in x:
	if i in lower:
		cl += 1
	else:
		cu += 1
if cl >= cu:
	print(x.lower())
else:
	print(x.upper())


word = input()
print([word.lower(), word.upper()][sum(map(str.isupper, word)) > len(word) / 2])


a = list(input())
c1 = 0
c2 = 0
for i in range(len(a)):
	if a[i].isupper():
		c1 += 1
	elif a[i].islower():
		c2 += 1
if c1 > c2:
	print(''.join([x.upper() for x in a]))
elif c1 < c2:
	print(''.join([x.lower() for x in a]))
elif c1 == c2:
	print(''.join([x.lower() for x in a]))


word = list(input())
l = len(word)
low = up = 0
for i in range(l):
	if word[i] > 'Z':
		low = low + 1
	else:
		up = up + 1
if low >= up:
	for i in range(l):
		a = word[i]
		word[i] = a.lower()
else:
	for i in range(l):
		a = word[i]
		word[i] = a.upper()
ans = ''.join(word)
print(ans)


s = input()
a = []
b = []
for i in s:
	if i.isupper():
		a.append(i)
	elif i.islower():
		b.append(i)
if len(a) > len(b):
	print(s.upper())
else:
	print(s.lower())


str1 = input()
l = 0
u = 0
for i in str1:
	if i >= 'A' and i <= 'Z':
		u += 1
	else:
		l += 1
if u > l:
	print(str1.upper())
else:
	print(str1.lower())


word = input()
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
x = ''
y = ''
dxchangdu = 0
xxchangdu = 0
for i in range(len(word)):
	if word[i] in a:
		x += word[i]
		dxchangdu = len(x)
	else:
		y += word[i]
		xxchangdu = len(y)
	if dxchangdu > xxchangdu:
		m = word.upper()
	else:
		m = word.lower()
print(m)


s = input()
print([s.lower(), s.upper()][sum([ch.islower() - ch.isupper() for ch in s]) < 0])


str = input()
lst = []
lst = str
u = 0
for i in lst:
	if i.isupper() == True:
		u = u + 1
l = len(lst) - u
if u > l:
	print(str.upper())
else:
	print(str.lower())


word = str(input())
lower_count = 0
for i in range(len(word)):
	lower_count += 1 if word[i].islower() else 0
if lower_count >= (len(word) + 1) // 2:
	print(word.lower())
else:
	print(word.upper())


def word():
	word = str(input(''))
	up = 0
	low = 0
	for i in word:
		if i.isupper():
			up += 1
		else:
			low += 1
	if up > low:
		return word.upper()
	else:
		return word.lower()
print(word())


n = input()
u = 0
for i in n:
	if i.isupper():
		u += 1
l = len(n) - u
if u > l:
	print(n.upper())
else:
	print(n.lower())


t = input()
print([t.lower(), t.upper()][sum([i == i.upper() for i in t]) > len(t) // 2])


line = input()
count = 0
for c in line:
	if c.isupper():
		count += 1
if count > len(line) / 2:
	print(line.upper())
else:
	print(line.lower())


s = str(input())
count1 = 0
count2 = 0
for i in s:
	if 65 <= ord(i) <= 90:
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	s = s.upper()
else:
	s = s.lower()
print(s)


a = input()
b = 0
c = 0
for z in a:
	if ord(z) < 97:
		b += 1
	else:
		c += 1
if c >= b:
	print(a.lower())
else:
	print(a.upper())


s = input()
low = len(list(filter(lambda x: x >= 'a' and x <= 'z', s)))
print(s.upper() if low < len(s) - low else s.lower())


a = str(input())
b = 0
c = 0
d = 0
for i in a:
	if a[d].islower() == True:
		b += 1
	elif a[d].isupper() == True:
		c += 1
	d = d + 1
if b >= c:
	print(a.lower())
else:
	print(a.upper())


s = input()
lc = 0
for ele in s:
	if ord(ele) >= 97 and ord(ele) <= 122:
		lc -= 1
	else:
		lc += 1
if lc > 0:
	print(s.upper())
else:
	print(s.lower())


def word(string):
	countUp = 0
	countLo = 0
	for i in string:
		if i.isupper():
			countUp += 1
		else:
			countLo += 1
	if countUp > countLo:
		return string.upper()
	else:
		return string.lower()
string = input()
print(word(string))


inp = input()
sma = cap = 0
for i in inp:
	if 'A' <= i and i <= 'Z':
		cap += 1
	else:
		sma += 1
if cap == sma:
	print(inp.lower())
elif cap > sma:
	print(inp.upper())
else:
	print(inp.lower())


alphabet = 'abcdefghijklmnopqrstuvwxyz'
word = input()
count = 0
for i in word:
	if i in alphabet:
		count += 1
if count > len(word) / 2:
	print(word.lower())
elif count < len(word) / 2:
	print(word.upper())
else:
	print(word.lower())


s = str(input())
b = len(s)
cl = 0
cu = 0
for i in range(b):
	if s[i].islower():
		cl += 1
	elif s[i].isupper():
		cu += 1
if cl >= cu:
	print(s.lower())
elif cu > cl:
	print(s.upper())


s = input()
c_big = 0
c_small = 0
for item in s:
	if item >= 'a' and item <= 'z':
		c_small += 1
	else:
		c_big += 1
if c_small > c_big:
	print(s.lower())
elif c_big > c_small:
	print(s.upper())
else:
	print(s.lower())


str = input()
lower = 0
for check in str:
	if check.islower() is True:
		lower += 1
if lower >= len(str) - lower:
	print(str.lower())
else:
	print(str.upper())


inp = input()
capcount = 0
lowcount = 0
for i in inp:
	if i.islower():
		lowcount = lowcount + 1
	else:
		capcount = capcount + 1
if capcount > lowcount:
	inp = inp.upper()
	print(inp)
elif lowcount > capcount:
	inp = inp.lower()
	print(inp)
elif lowcount == capcount:
	inp = inp.lower()
	print(inp)


s = input()
c = 0
c1 = 0
for i in s:
	if i.isupper():
		c += 1
	else:
		c1 += 1
if c > c1:
	print(s.upper())
else:
	print(s.lower())


word = str(input())
lower = 0
upper = 0
for i in range(len(word)):
	if ord(word[i]) >= 97:
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(word.lower())
else:
	print(word.upper())


s = input()
lower = 0
upper = 0
for ch in s:
	if ch.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(s.upper())
else:
	print(s.lower())


ipt = input()
up = ipt.upper()
lo = ipt.lower()
low_cnt = 0
up_cnt = 0
for x in ipt:
	if x in up:
		up_cnt += 1
	else:
		low_cnt += 1
if up_cnt > low_cnt:
	print(ipt.upper())
else:
	print(ipt.lower())


palavra = input()
c = 0
for letra in palavra:
	if letra == letra.upper():
		c += 1
if c > len(palavra) / 2:
	print(palavra.upper())
elif c == len(palavra) / 2:
	print(palavra.lower())
else:
	print(palavra.lower())


(l, s) = (0, input())
for char in s:
	l += 1 if char.islower() else -1
print(s.lower() if l >= 0 else s.upper())


lc = 0
uc = 0
s = input()
for x in s:
	if ord(x) > ord('Z'):
		lc += 1
	else:
		uc += 1
if uc > lc:
	print(s.upper())
else:
	print(s.lower())


import re
message = input()
regex = re.compile('[^a-zA-Z]')
message = regex.sub('', message)
nbupper = sum((1 for c in message if c.isupper()))
nblower = sum((1 for c in message if c.islower()))
if nbupper > nblower:
	print(message.upper())
else:
	print(message.lower())


s = input()
u = 0
l = 0
for a in s:
	if a.isupper():
		u += 1
	else:
		l += 1
if u > l:
	s = ''.join(s.upper())
elif u < l or u == l:
	s = ''.join(s.lower())
print(s)


s = input()
lc = 0
uc = 0
for i in s:
	if i.islower():
		lc = lc + 1
	elif i.isupper():
		uc = uc + 1
if lc < uc:
	s = s.upper()
else:
	s = s.lower()
print(s)


try:
	n = input()
	u = 0
	l = 0
	for i in n:
		if ord(i) >= 65 and ord(i) <= 90:
			u += 1
		else:
			l += 1
	if u > l:
		print(n.upper())
	else:
		print(n.lower())
except:
	pass


s = list(input())
upper = len(list(filter(lambda x: x.upper() == x, s)))
lower = len(list(filter(lambda x: x.lower() == x, s)))
if lower < upper:
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


s = input()
a = sum([x.islower() for x in s])
b = sum([x.isupper() for x in s])
print(''.join([x.lower() for x in s]) if b <= a else ''.join([x.upper() for x in s]))


s = str(input())
count_upper = 0
count_lower = 0
for i in range(len(s)):
	if s[i].isupper():
		count_upper += 1
	else:
		count_lower += 1
if count_upper <= count_lower:
	print(s.lower())
else:
	print(s.upper())


word = input()
lower = len([y for y in word if y.islower()])
upper = len([y for y in word if y.isupper()])
if lower > upper:
	print(word.lower())
elif lower == upper:
	print(word.lower())
else:
	print(word.upper())


n = input()
s = 0
l = 0
for i in n:
	if i.islower() == True:
		l += 1
	else:
		s += 1
if s > l:
	print(n.upper())
else:
	print(n.lower())


n = input()
cnt1 = 0
cnt2 = 0
for i in n:
	if i.isupper():
		cnt1 = cnt1 + 1
	else:
		cnt2 = cnt2 + 1
if cnt1 > cnt2:
	print(n.upper())
else:
	print(n.lower())


a = input()
m = sum(map(str.islower, a))
n = sum(map(str.isupper, a))
if m >= n:
	print(a.lower())
else:
	print(a.upper())


s = input()
low = 0
up = 0
for i in s:
	if i.islower():
		low += 1
	if i.isupper():
		up += 1
if low >= up:
	print(s.lower())
else:
	print(s.upper())


s = str(input())
A = len(s)
count = 0
for i in range(0, A):
	if s[i] >= 'A' and s[i] <= 'Z':
		count = count + 1
if count * 2 > A:
	s = s.upper()
else:
	s = s.lower()
print(s)


from sys import stdin
_input = stdin.readline
(_str, _int) = (str, int)

def solution():
	s = _input().rstrip('\n')
	(h, l) = (0, 0)
	for i in s:
		if ord(i) < 97:
			h += 1
		else:
			l += 1
	if h > l:
		print(s.upper())
	else:
		print(s.lower())
solution()


s = input()
k = 0
p = 0
for i in s:
	if i.isupper():
		k += 1
	else:
		p += 1
if k > p:
	print(s.upper())
else:
	print(s.lower())


import sys
input = sys.stdin.readline

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

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

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
s = input().strip()
(countl, countu) = (0, 0)
for i in s:
	if i.islower():
		countl += 1
	else:
		countu += 1
if countu > countl:
	s = s.upper()
elif countl >= countu:
	s = s.lower()
print(s)


n = input()
(upper, lower) = (0, 0)
for i in n:
	if ord('A') <= ord(i) <= ord('Z'):
		upper += 1
	else:
		lower += 1
print(n.upper() if upper > lower else n.lower())


a = input()
upper = 0
lower = 0
for i in a:
	if i.isupper() == True:
		upper += 1
	else:
		lower += 1
if upper <= lower:
	a = a.lower()
else:
	a = a.upper()
print(a)


import string
minuscula = string.ascii_lowercase
mayuscula = string.ascii_uppercase

def contador(entrada):
	cont_may = 0
	for i in range(len(entrada)):
		if not entrada[i] in minuscula:
			cont_may += 1
	cont_min = len(entrada) - cont_may
	return (cont_may, cont_min)

def juego(num):
	if num[0] == num[1]:
		return entrada.lower()
	if num[0] == len(entrada) or num[1] == len(entrada):
		return entrada
	if num[0] > num[1]:
		return entrada.upper()
	if num[0] < num[1]:
		return entrada.lower()
entrada = input()
numero = contador(entrada)
print(juego(numero))


s = input()
print([s.lower(), s.upper()][sum([x <= 'Z' for x in s]) > len(s) // 2])


x = str(input())
upp = 0
low = 0
for i in range(len(x)):
	if ord(x[i]) >= 65 and ord(x[i]) <= 90:
		upp = upp + 1
	elif ord(x[i]) >= 97 and ord(x[i]) <= 122:
		low = low + 1
if upp == low:
	t = x.lower()
	print(t)
elif upp > low:
	t = x.upper()
	print(t)
elif upp < low:
	t = x.lower()
	print(t)


s = input()
c = 0
for i in s:
	if i.isupper() == True:
		c += 1
a = len(s) - c
if a >= c:
	print(s.lower())
else:
	print(s.upper())


s = input()
r = sum((y.isupper() for y in s))
if r > len(s) - r:
	print(s.upper())
else:
	print(s.lower())


word = input()
(lowercase, uppercase) = (0, 0)
for letter in word:
	if letter.islower():
		lowercase += 1
	else:
		uppercase += 1
new_word = ''
if lowercase < uppercase:
	for letter in word:
		new_word += letter.upper()
else:
	for letter in word:
		new_word += letter.lower()
print(new_word)


a = input()
uper = 0
lower = 0
for i in a:
	if i == i.lower():
		lower += 1
	else:
		uper += 1
if lower >= uper:
	for i in a:
		print(i.lower(), end='')
else:
	for i in a:
		print(i.upper(), end='')


num = str(input())
c = 0
b = 0
for i in num:
	if i.isupper() == True:
		b = b + 1
c = len(num)
d = c - b
if d >= b:
	num = num.lower()
else:
	num = num.upper()
print(num)


s = input()
count1 = 0
count2 = 0
for i in s:
	if i.islower():
		count1 = count1 + 1
	elif i.isupper():
		count2 = count2 + 1
if count1 > count2:
	a = s.lower()
elif count1 < count2:
	a = s.upper()
elif count1 == count2:
	a = s.lower()
print(a)


n = input()
u = 0
for i in n:
	if ord(i) >= 65 and ord(i) <= 90:
		u = u + 1
if len(n) // 2 >= u:
	print(n.lower())
else:
	print(n.upper())


x = input()
x = list(x)
lower = 0
upper = 0
for letter in x:
	if letter.islower():
		lower += 1
	else:
		upper += 1
x = ''.join(x)
if lower >= upper:
	print(x.lower())
else:
	print(x.upper())


a = input()
p = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']
x = 0
y = 0
for i in range(len(a)):
	if a[i] in p:
		x = x + 1
	else:
		y = y + 1
if y > x:
	print(a.upper())
else:
	print(a.lower())


ch = str(input())
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
U = 0
l = 0
T = [0 for _ in range(len(ch))]
for i in range(len(ch)):
	e = A.index(ch[i])
	if e >= 26:
		l += 1
	else:
		U += 1
	T[i] = e
r = ''
if l >= U:
	for i in range(len(ch)):
		if T[i] <= 25:
			r += A[T[i] + 26]
		else:
			r += ch[i]
else:
	for i in range(len(ch)):
		if T[i] > 25:
			r += A[T[i] - 26]
		else:
			r += ch[i]
print(r)


n = input()
upperCount = 0
lowerCount = 0
for i in range(len(n)):
	if n[i].isupper() == True:
		upperCount += 1
	if n[i].islower() == True:
		lowerCount += 1
if upperCount > lowerCount:
	print(n.upper())
if upperCount < lowerCount:
	print(n.lower())
if upperCount == lowerCount:
	print(n.lower())


s = input()
if sum((c.isupper() for c in s)) > sum((c.islower() for c in s)):
	print(s.upper())
else:
	print(s.lower())


x = input()
l = 0
u = 0
for i in range(0, len(x)):
	if x[i].isupper():
		u = u + 1
	else:
		l = l + 1
if l >= u:
	x = x.lower()
else:
	x = x.upper()
print(x)


a = input()
b = 0
for i in range(26):
	b += a.count(chr(97 + i))
if 2 * b >= len(a):
	print(a.lower())
else:
	print(a.upper())


s = input()
(a, b, c) = (0, 0, 0)
for i in range(len(s)):
	if s[i] == s[i].upper():
		a += 1
	else:
		b += 1
print([s.upper(), s.lower()][a <= b])


text = input()
(lower_count, upper_count) = (0, 0)
for letter in text:
	if letter.islower():
		lower_count += 1
	else:
		upper_count += 1
if upper_count > lower_count:
	print(text.upper())
else:
	print(text.lower())


n = input()
cl = 0
cu = 0
for i in n:
	if i.islower():
		cl += 1
	elif i.isupper():
		cu += 1
if cl >= cu:
	x = n.lower()
	print(x)
elif cu > cl:
	x = n.upper()
	print(x)


s = input()
d = 0
x = 0
for i in range(len(s)):
	if ord(s[i]) > 90:
		x += 1
	else:
		d += 1
j = ''
if d > x:
	for i in range(len(s)):
		if ord(s[i]) > 95:
			j += chr(ord(s[i]) - 32)
		else:
			j += s[i]
else:
	for i in range(len(s)):
		if ord(s[i]) < 95:
			j += chr(ord(s[i]) + 32)
		else:
			j += s[i]
print(j)


s = input()
l = 0
u = 0
for i in s:
	if i >= 'a' and i <= 'z':
		l += 1
	else:
		u += 1
if l >= u:
	st = ''
	for i in s:
		if i >= 'a' and i <= 'z':
			st += i
		else:
			st += chr(ord(i) + 32)
	print(st)
else:
	st = ''
	for i in s:
		if i >= 'A' and i <= 'Z':
			st += i
		else:
			st += chr(ord(i) - 32)
	print(st)


word = input()
c = 0
for z in word:
	if z.islower():
		c += 1
if c >= len(word) / float(2):
	word = word.lower()
else:
	word = word.upper()
print(word)


a = input()
b = []
c = []
for i in range(len(a)):
	if a[i].isupper():
		b.append(a[i])
	else:
		c.append(a[i])
if len(b) > len(c):
	print(a.upper())
else:
	print(a.lower())


word = input('')
upper = 0
lower = 0
for i in range(len(word)):
	if word[i] == word[i].upper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(word.upper())
elif lower > upper:
	print(word.lower())
else:
	print(word.lower())


t = input()
u = 0
l = 0
for i in range(len(t)):
	if t[i] == t[i].upper():
		u += 1
	else:
		l += 1
if l >= u:
	t = t.lower()
else:
	t = t.upper()
print(t)


n = input()
l = 0
for i in n:
	if i.islower():
		l += 1
if l >= len(n) - l:
	print(n.lower())
else:
	print(n.upper())


s = str(input())
s = list(s)
small = 0
big = 0
for i in range(len(s)):
	if ord(s[i]) > 90:
		small += 1
	else:
		big += 1
e = ''
for i in s:
	e += i
if small >= big:
	print(e.lower())
else:
	print(e.upper())


s = input()
l = s.lower()
u = s.upper()
low = 0
up = 0
for i in range(0, len(s)):
	if s[i].islower():
		low += 1
	else:
		up += 1
if low >= up:
	print(l)
else:
	print(u)


s = input()
c = 0
for i in s:
	if i >= 'A' and i <= 'Z':
		c = c + 1
if c > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


s = input()
a = 0
A = 0
for l in s:
	if ord(l) >= ord('a') and ord(l) <= ord('z'):
		a += 1
	else:
		A += 1
if A > a:
	print(s.upper())
else:
	print(s.lower())


s = input()
a1 = 0
a2 = 0
if len(s) >= 1 and len(s) <= 100:
	for i in s:
		if i.islower():
			a1 = a1 + 1
		elif i.isupper():
			a2 = a2 + 1
	if a1 > a2:
		print(s.lower())
	elif a1 < a2:
		print(s.upper())
	else:
		print(s.lower())


n = list(input())
u = 0
l = 0
for i in range(len(n)):
	if n[i].isupper():
		u += 1
	if n[i].islower():
		l += 1
c = ''.join(n)
if u > l:
	print(c.upper())
else:
	print(c.lower())


x = input()
sumu = 0
for i in x:
	if ord(i) >= 65 and ord(i) <= 90:
		sumu = sumu + 1
suml = len(x) - sumu
if sumu > suml:
	print(x.upper())
else:
	print(x.lower())


def countUp(s):
	return sum((1 for c in s if c.isupper()))
s = input().strip()
size = len(s)
cntup = countUp(s)
print(s.upper() if cntup > size - cntup else s.lower())


l = str(input())
lower = 0
upper = 0
for s in l:
	if 97 <= ord(s) <= 122:
		lower += 1
	else:
		upper += 1
if upper > lower:
	print(l.upper())
else:
	print(l.lower())


w = input()
up = 0
lp = 0
for i in w:
	if i.islower():
		lp += 1
	else:
		up += 1
if lp >= up:
	print(w.lower())
else:
	print(w.upper())


from sys import stdin

def main():
	upper = 0
	lower = 0
	s = stdin_get_string_from_line()
	for word in s:
		if word.islower():
			lower += 1
		else:
			upper += 1
	if lower >= upper:
		print(s.lower())
	else:
		print(s.upper())

def stdin_get_ints_from_line():
	return (int(x) for x in stdin.readline().strip().split(' '))

def stdin_get_ints_list_from_line():
	return list((int(x) for x in stdin.readline().strip().split(' ')))

def stdin_get_string_from_line() -> str:
	return stdin.readline().strip()
main()


w = input()
u_count = 0
l_count = 0
u = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
L = 'abcdefghijklmnopqrstuvwxyz'
for c in w:
	if c in u:
		u_count += 1
	else:
		l_count += 1
if u_count > l_count:
	print(w.upper())
elif u_count < l_count or u_count == l_count:
	print(w.lower())


def func():
	s = list('abcdefghijklmnopqrstuvwxyz')
	c = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
	c1 = 0
	c2 = 0
	st = input()
	for i in st:
		if i in s:
			c1 = c1 + 1
		else:
			c2 = c2 + 1
	if c1 == c2 or c1 > c2:
		st = st.lower()
		print(st)
	else:
		st = st.upper()
		print(st)
func()


(l, u) = (0, 0)
s = input()
for i in s:
	if i.isupper():
		u += 1
	elif i.islower():
		l += 1
if u > l:
	s = s.upper()
elif l > u or l == u:
	s = s.lower()
print(s)


a = input()
print(len(list(filter(lambda x: x.isupper(), list(a)))) > len(list(filter(lambda x: x.islower(), list(a)))) and a.upper() or a.lower())


s = input()
cap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
sml = 'abcdefghijklmnopqrstuvwxyz'
s1 = 0
c1 = 0
for i in s:
	if i in cap:
		c1 += 1
	elif i in sml:
		s1 += 1
if c1 > s1:
	print(s.upper())
else:
	print(s.lower())


n = input()
li = [i for i in n if i.islower()]
u = len(n) - len(li)
if len(li) >= u:
	print(n.lower())
else:
	print(n.upper())


Word = input()
uppercount = 0
lowercount = 0
for i in Word:
	if i.isupper():
		uppercount += 1
	else:
		lowercount += 1
if uppercount > lowercount:
	print(Word.upper())
else:
	print(Word.lower())


ch = input()
l = 0
a = 0
for i in range(len(ch)):
	if ch[i].lower() == ch[i]:
		l += 1
	else:
		a += 1
if a > l:
	print(ch.upper())
else:
	print(ch.lower())


string = input()
uppers = len([i for i in string if i.isupper()])
if uppers > len(string) / 2:
	print(string.upper())
else:
	print(string.lower())


from sys import stdin

def main():
	mayus = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
	minus = 'abcdefgjijklmnopqrstuvwxyz'
	cont1 = 0
	cont2 = 0
	n = stdin.readline().strip()
	for i in n:
		if i in mayus:
			cont1 += 1
		else:
			cont2 += 1
	if cont1 > cont2:
		print(n.upper())
	else:
		print(n.lower())
main()


y = str(input())
i = 0
s = 0
for letter in y:
	if letter == letter.upper():
		i += 1
	else:
		s += 1
if i > s:
	print(y.upper())
else:
	print(y.lower())


word = input()
(uppercase, lowercase) = (0, 0)
for i in word:
	if i >= 'A' and i <= 'Z':
		uppercase += 1
	else:
		lowercase += 1
if uppercase > lowercase:
	print(word.upper())
else:
	print(word.lower())


word = input()
upchars = sum((1 for c in word if c.isupper()))
lochars = sum((1 for c in word if c.islower()))
if upchars > lochars:
	print(word.upper())
else:
	print(word.lower())


a = input()
uc = 0
lc = 0
for i in a:
	if i.isupper():
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(a.upper())
else:
	print(a.lower())


def main(word: str):
	(big_letters, small_letters) = (0, 0)
	for letter in word:
		if 65 <= ord(letter) <= 90:
			big_letters += 1
		elif 97 <= ord(letter) <= 122:
			small_letters += 1
	if big_letters > small_letters:
		return word.upper()
	else:
		return word.lower()
print(main(input('')))


s = input()
up = 0
lo = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		up += 1
	else:
		lo += 1
if up > lo:
	print(s.upper())
elif up < lo:
	print(s.lower())
else:
	print(s.lower())


s = input()
n = len(s)
cnt = 0
for i in range(n):
	if 'A' <= s[i] <= 'Z':
		cnt += 1
if cnt > n - cnt:
	for i in range(n):
		if 'A' <= s[i] <= 'Z':
			print(s[i], end='')
		else:
			print(chr(ord(s[i]) - 32), end='')
else:
	for i in range(n):
		if 'a' <= s[i] <= 'z':
			print(s[i], end='')
		else:
			print(chr(ord(s[i]) + 32), end='')


List = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
s = input()
small = 0
large = 0
for item in s:
	if item in List:
		small += 1
	elif item not in List:
		large += 1
if small >= large:
	print(s.lower())
else:
	print(s.upper())


n = input()
up = 0
low = 0
for i in range(0, len(n)):
	if n[i] >= 'A' and n[i] <= 'Z':
		up = up + 1
	else:
		low = low + 1
if up > low:
	print(n.upper())
else:
	print(n.lower())


word = input()
up = 0
lo = 0
for i in word:
	if i.islower():
		lo += 1
	else:
		up += 1
if up > lo:
	print(word.upper())
else:
	print(word.lower())


w = input()
upper = 0
lower = 0
for x in w:
	if x.lower() == x:
		lower += 1
	else:
		upper += 1
if upper > lower:
	w = w.upper()
else:
	w = w.lower()
print(w)


z = str(input())
lower = 0
upper = 0
for i in range(len(z)):
	if z[i].islower():
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(z.lower())
else:
	print(z.upper())


a = input()
l = 0
u = 0
for i in a:
	if i == i.upper():
		u += 1
	elif i != i.upper():
		l += 1
if u > l:
	for i in a:
		print(i.upper(), end='')
elif l > u:
	for i in a:
		print(i.lower(), end='')
else:
	for i in a:
		print(i.lower(), end='')


s = input()
cl = 0
cu = 0
for i in s:
	if i >= 'A' and i <= 'Z':
		cu += 1
	if i >= 'a' and i <= 'z':
		cl += 1
if cu > cl:
	print(s.upper())
if cl > cu:
	print(s.lower())
elif cl == cu:
	print(s.lower())


st = input()
c = 0
for item in st:
	c += item.islower()
if c >= len(st) - c:
	print(st.lower())
else:
	print(st.upper())


s = input()
l = len(s)
c1 = 0
c2 = 0
for i in range(l):
	if s[i].isupper():
		c1 += 1
	elif s[i].islower():
		c2 += 1
if c1 == c2:
	s = s.lower()
	print(s)
elif c1 > c2:
	s = s.upper()
	print(s)
elif c1 < c2:
	s = s.lower()
	print(s)


s = input()
smallcount = 0
capcount = 0
for i in s:
	if i >= 'a' and i <= 'z':
		smallcount += 1
	else:
		capcount += 1
if smallcount >= capcount:
	print(s.lower())
else:
	print(s.upper())


word = input()
word_len = len(word)
new_word = ''

def count_lower(s):
	count = 0
	for item in s:
		if item.islower():
			count += 1
	return count

def count_upper(s):
	count = 0
	for item in s:
		if item.isupper():
			count += 1
	return count
lwr = count_lower(word)
upr = count_upper(word)
if lwr == upr:
	new_word = word.lower()
elif lwr > upr:
	new_word = word.lower()
elif upr > lwr:
	new_word = word.upper()
print(new_word)


s = input()
upper = 0
lower = 0
for i in range(len(s)):
	if s[i].isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(s.upper())
elif upper == lower:
	print(s.lower())
else:
	print(s.lower())


input = input()
uppers = 0
lowers = 0
for c in input:
	if c.isupper():
		uppers += 1
	else:
		lowers += 1
if uppers > lowers:
	print(str.upper(input))
else:
	print(str.lower(input))


x = input()
upper = 0
lower = 0
for i in range(len(x)):
	if x[i] == x[i].upper():
		upper += 1
	else:
		lower += 1
if lower < upper:
	print(x.upper())
else:
	print(x.lower())


s = input()
t = 0
e = 0
for i in range(len(s)):
	if s[i] == s[i].upper():
		t += 1
	else:
		e += 1
if t > e:
	print(s.upper())
elif t <= e:
	print(s.lower())


s = input()
a = 0
for c in s:
	if ord(c) <= ord('Z'):
		a += 1
if a > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


input_str = input()
lowercase_num = 0
for c in input_str:
	if c.islower():
		lowercase_num += 1
if lowercase_num * 2 >= len(input_str):
	print(input_str.lower())
else:
	print(input_str.upper())


word = input()
(u, l) = (0, 0)
for i in word:
	if i >= 'a' and i <= 'z':
		l += 1
	else:
		u += 1
if u > l:
	x = word.upper()
else:
	x = word.lower()
print(x)


B = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
c = B.lower()
b_count = 0
s_count = 0
s = str(input())
for i in range(len(B)):
	b_count += s.count(B[i])
for i in range(len(c)):
	s_count += s.count(c[i])
if b_count > s_count:
	s = s.upper()
else:
	s = s.lower()
print(s)


string = input()
count1 = 0
count2 = 0
for i in string:
	if i.islower():
		count1 = count1 + 1
	elif i.isupper():
		count2 = count2 + 1
if count1 > count2:
	print(string.lower())
elif count2 == count1:
	print(string.lower())
else:
	print(string.upper())


s = input()
lower_c = 0
upper_c = 0
for i in range(len(s)):
	if s[i] == s[i].lower():
		lower_c += 1
	else:
		upper_c += 1
if upper_c > lower_c:
	print(s.upper())
else:
	print(s.lower())


U = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
l = 'abcdefghijklmnopqrstuvwxyz'
s = str(input())
du = 0
dl = 0
for i in range(len(s)):
	if (s[i] in U) == True:
		du += 1
	elif (s[i] in l) == True:
		dl += 1
if du > dl:
	print(s.upper())
else:
	print(s.lower())


t = input()
l = 0
u = 0
for i in t:
	if i.islower():
		l += 1
	elif i.isupper():
		u += 1
if l < u:
	print(t.upper())
else:
	print(t.lower())


letter = input()
if letter.islower():
	print(letter)
elif letter.isupper():
	print(letter)
else:
	upper = 0
	lower = 0
	for i in letter:
		if i.isupper():
			upper += 1
		elif i.islower():
			lower += 1
	if upper > lower:
		print(letter.upper())
	else:
		print(letter.lower())


a = input()
low = 0
upp = 0
for i in a:
	if i.islower():
		low += 1
	else:
		upp += 1
if low >= upp:
	a = a.lower()
elif upp > low:
	a = a.upper()
print(a)


s = str(input())
c = 0
for i in s:
	if i.isupper():
		c += 1
if float(c) > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


word = input()
ups = 0
for letter in word:
	if letter.isupper():
		ups += 1
if ups <= len(word) - ups:
	print(word.lower())
else:
	print(word.upper())


a = input()
bol = 0
for i in 'QWERTYUIOPASDFGHJKLZXCVBNM':
	bol = bol + a.count(i)
if bol > len(a) - bol:
	print(a.upper())
elif bol == len(a) - bol:
	print(a.lower())
else:
	print(a.lower())


s = input()
countup = 0
countlow = 0
for char in s:
	if char.islower():
		countlow += 1
	else:
		countup += 1
if countlow >= countup:
	print(s.lower())
else:
	print(s.upper())


from math import ceil
string = input()
if sum(map(str.islower, string)) >= ceil(len(string) / 2):
	print(string.lower())
else:
	print(string.upper())


a = 'High'
s = input()
high = 0
low = 0
for i in s:
	if i.upper() == i:
		high += 1
	if i.lower() == i:
		low += 1
if high > low:
	print(s.upper())
elif low > high:
	print(s.lower())
else:
	print(s.lower())


import string
lis = string.ascii_uppercase
string = input()
(m, n) = (0, 0)
for value in string:
	if value in lis:
		m += 1
	else:
		n += 1
if m > n:
	print(string.upper())
else:
	print(string.lower())


n = input()
a = list(n)
c1 = 0
c2 = 0
for i in a:
	if 'A' <= i <= 'Z':
		c1 += 1
	else:
		c2 += 1
l1 = []
l2 = []
if c1 <= c2:
	for i in a:
		l1.append(i.lower())
	print(''.join(l1))
else:
	for i in a:
		l2.append(i.upper())
	print(''.join(l2))


word = input()
(big, small) = (0, 0)
for symbol in word:
	if 'a' <= symbol <= 'z':
		small += 1
	else:
		big += 1
if small >= big:
	print(word.lower())
else:
	print(word.upper())


s = input()
count = 0
store = 0
for item in s:
	if item.isupper():
		count = count + 1
	else:
		store += 1
if count > store:
	s = s.upper()
	print(s)
else:
	s = s.lower()
	print(s)


str = input()
le = len(str)
a = 0
b = 0
for i in range(0, le):
	if str[i] >= 'a' and str[i] <= 'z':
		a = a + 1
	else:
		b = b + 1
if a > b:
	print(str.lower())
elif b > a:
	print(str.upper())
else:
	print(str.lower())


s = input()
big = 0
sm = 0
for i in s:
	if i.isupper():
		big += 1
	else:
		sm += 1
if big > sm:
	print(s.upper())
else:
	print(s.lower())


s = input()
num = 0
for char in s:
	if 'A' <= char <= 'Z':
		num = num + 1
if num > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


import re
s = input()
c = len(re.findall('[A-Z]', s))
if 2 * c <= len(s):
	s = s.lower()
else:
	s = s.upper()
print(s)


from sys import stdin

def main():
	s = stdin.readline().strip()
	return (str.lower, str.upper)[sum(map(str.islower, s)) < sum(map(str.isupper, s))](s)
print(main())


s = input()
cap = 0
small = 0
for i in range(len(s)):
	if s[i] >= 'A' and s[i] <= 'Z':
		cap = cap + 1
	if s[i] >= 'a' and s[i] <= 'z':
		small = small + 1
if small >= cap:
	print(s.lower())
else:
	print(s.upper())


word = input()
a = word.lower()
num = 0
for i in range(len(word)):
	if word[i] == a[i]:
		num += 1
if num >= len(word) / 2:
	print(word.lower())
else:
	print(word.upper())


s = input()
num = 0
for char in s:
	if char >= 'a':
		num += 1
if num >= len(s) - num:
	print(s.lower())
else:
	print(s.upper())


s = str(input())
(f, bf) = (0, 0)
for x in s:
	if ord(x) < 97:
		f += 1
	else:
		bf += 1
if f > bf:
	print(s.upper())
elif f == bf:
	print(s.lower())
else:
	print(s.lower())


import re as regex
mystring = input()
(count1, count2) = (0, 0)
for s in mystring:
	if regex.match('[a-z]', s):
		count1 += 1
	else:
		count2 += 1
print(mystring.upper() if count2 > count1 else mystring.lower())


s = input()
count = sum([1 for i in s if i.isupper()])
if count > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
c = 0
for i in range(26):
	c += s.count(chr(i + ord('a')))
C = 0
for i in range(26):
	C += s.count(chr(i + ord('A')))
if c >= C:
	print(s.lower())
else:
	print(s.upper())


(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)
from math import *
num = 1
for i in range(num):
	s = z()
	up = 0
	dw = 0
	for i in s:
		if match('[a-z]', i):
			dw += 1
		else:
			up += 1
	if up > dw:
		print(s.upper())
	else:
		print(s.lower())


s = input()
up = 0
low = 0
for ch in s:
	if ord('a') <= ord(ch) <= ord('z'):
		low += 1
	else:
		up += 1
if up > low:
	print(s.upper())
else:
	print(s.lower())


st = input()
upc = 0
loc = 0
for i in st:
	if i.islower():
		loc += 1
	else:
		upc += 1
if loc < upc:
	print(st.upper())
else:
	print(st.lower())


s = str(input())
l = 0
h = 0
g = list(s)
for i in range(len(g)):
	if g[i].islower() == True:
		l += 1
	else:
		h += 1
if l < h:
	print(s.upper())
elif h < l:
	print(s.lower())
elif h == l:
	print(s.lower())
5


s = input()
v = 0
for char in s:
	if char.isupper():
		v += 1
a = ''
if v <= len(s) // 2:
	for char in s:
		a += char.lower()
else:
	for char in s:
		a += char.upper()
print(a)


(s, kl, ku) = (list(input()), 0, 0)
for i in range(len(s)):
	if s[i] == s[i].lower():
		kl += 1
	else:
		ku += 1
if ku > kl:
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


x = str(input())
count1 = 0
count2 = 0
for i in range(len(x)):
	if x[i].islower():
		count1 += 1
	else:
		count2 += 1
if count2 > count1:
	print(x.upper())
else:
	print(x.lower())


n = list(input())
c = 0
for i in n:
	if ord(i) >= 97:
		c += 1
if len(n) - c > c:
	for i in range(len(n)):
		if ord(n[i]) >= 97:
			n[i] = chr(ord(n[i]) - 32)
	print(''.join(n))
else:
	for i in range(len(n)):
		if ord(n[i]) <= 90:
			n[i] = chr(ord(n[i]) + 32)
	print(''.join(n))


s = input()
n = len(s)
c = 0
for i in s:
	if i.isupper():
		c = c + 1
d = n - c
if d >= c:
	s = s.lower()
else:
	s = s.upper()
print(s)


string = input()
up = 0
lo = 0
for c in string:
	if c.upper() == c:
		up += 1
	else:
		lo += 1
if lo >= up:
	print(string.lower())
else:
	print(string.upper())


upper_lower_input = input()
upper = 0
lower = 0
for i in upper_lower_input:
	if i.isupper():
		upper += 1
	elif i.islower():
		lower += 1
if lower > upper or lower == upper:
	print(upper_lower_input.lower())
else:
	print(upper_lower_input.upper())


s = input().strip()
counter1 = 0
counter2 = 0
for char in s:
	if char.islower():
		counter1 += 1
	else:
		counter2 += 1
if counter1 >= counter2:
	print(s.lower())
else:
	print(s.upper())


x = input()
lower = 0
for i in x:
	if ord(i) >= 97:
		lower += 1
upper = len(x) - lower
if lower >= upper:
	print(x.lower())
else:
	print(x.upper())


s = input()
high = low = 0
for i in s:
	if 65 <= ord(i) <= 90:
		high += 1
	else:
		low += 1
print(s.upper() if high > low else s.lower())


a = input()
u = 0
l = 0
for i in range(0, len(a)):
	z = a[i]
	if z.isupper():
		u = u + 1
	else:
		l = l + 1
if u > l:
	print(a.upper())
else:
	print(a.lower())


s = input()
cnt1 = 0
cnt2 = 0
for x in s:
	if x.islower():
		cnt1 += 1
	else:
		cnt2 += 1
if cnt1 >= cnt2:
	print(s.lower())
else:
	print(s.upper())


a = input()
b = 0
m = 0
for i in a:
	if i >= 'a' and i <= 'z':
		m += 1
	elif i >= 'A' and i <= 'Z':
		b += 1
if m > b:
	print(a.lower())
elif b > m:
	print(a.upper())
else:
	print(a.lower())


str1 = input()
(count_upper, count_lower) = (0, 0)
for i in str1:
	if i.isupper():
		count_upper += 1
	elif i.islower():
		count_lower += 1
if count_lower == count_upper:
	print(str1.lower())
elif count_lower > count_upper:
	print(str1.lower())
else:
	print(str1.upper())


line = input()
count_Upper = 0
count_Lower = 0
for i in line:
	if ord(i) in range(ord('A'), ord('Z') + 1):
		count_Upper += 1
	elif ord(i) in range(ord('a'), ord('z') + 1):
		count_Lower += 1
if count_Lower >= count_Upper:
	print(line.lower())
else:
	print(line.upper())


s = input()
print([s.lower(), s.upper()][sum((1 for item in s if item.isupper() == True)) > len(s) / 2])


x = input()
(u, l) = (0, 0)
for i in x:
	if i.islower():
		l = l + 1
	elif i.isupper():
		u = u + 1
if u == l:
	print(x.lower())
elif u > l:
	print(x.upper())
elif l > u:
	print(x.lower())


word = input()
l = []
for i in word:
	l.append(ord(i))
l.sort()
caps = 0
low = 0
i = 0
while i < len(l):
	if l[i] < 91:
		caps += 1
	else:
		low += 1
	i += 1
if caps <= low:
	print(word.lower())
else:
	print(word.upper())


s = input()
low = 0
up = 0
for i in range(0, len(s)):
	if ord(s[i]) in range(ord('A'), ord('Z') + 1):
		up += 1
	else:
		low += 1
if up > low:
	print(s.upper())
else:
	print(s.lower())


x = input()
ctr = 0
ctr2 = 0
for i in x:
	if i == i.upper():
		ctr += 1
	else:
		ctr2 += 1
if ctr > ctr2:
	print(x.upper())
else:
	print(x.lower())


word = input()
print(word.lower() if sum((i.islower() for i in word)) >= sum((i.isupper() for i in word)) else word.upper())


x = str(input())
res = 0
for i in x:
	if i.isupper():
		res = res + 1
y = len(x)
z = y - res
if z >= res:
	x = x.lower()
else:
	x = x.upper()
print(x)


a = input()
count1 = 0
count2 = 0
for i in range(len(a)):
	if ord(a[i]) >= 97:
		count1 = count1 + 1
	else:
		count2 = count2 + 1
if count1 >= count2:
	print(a.lower())
else:
	print(a.upper())


s = input('')
s = list(s)
a = ''
g = 0
k = 0
for i in range(len(s)):
	if s[i].isupper() == True:
		g += 1
	else:
		k += 1
a = a.join(s)
if g > k:
	print(a.upper())
else:
	print(a.lower())


A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
B = 'abcdefghijklmnopqrstuvwxyz'
s = input()
up_count = 0
low_count = 0
for i in s:
	if i in A:
		up_count += 1
	elif i in B:
		low_count += 1
if up_count > low_count:
	print(s.upper())
else:
	print(s.lower())


word = input()
up = 0
low = 0
for i in range(0, len(word)):
	if word[i].islower() == True:
		low = low + 1
	elif word[i].isupper() == True:
		up = up + 1
if up > low:
	print(word.upper())
elif low >= up:
	print(word.lower())


def capitalize():
	i = input()
	lower = sum(map(str.islower, i))
	total = len(i)
	upper = total - lower
	if upper > lower:
		print(i.upper())
	else:
		print(i.lower())

def main():
	capitalize()
main()


def fun(s1, s2):
	count = 0
	for i in range(len(s1)):
		if s1[i] != s2[i]:
			count += 1
	return count
s = input()
s1 = s.lower()
s2 = s.upper()
c1 = fun(s, s1)
c2 = fun(s, s2)
if c1 <= c2:
	print(s1)
else:
	print(s2)


s = input()
count = 0
COUNT = 0
for i in s:
	if 'a' <= i <= 'z':
		count += 1
	else:
		COUNT += 1
if count >= COUNT:
	print(s.lower())
else:
	print(s.upper())


s = input()
t1 = 0
t2 = 0
for i in s:
	if i >= 'A' and i <= 'Z':
		t1 += 1
	elif i >= 'a' and i <= 'z':
		t2 += 1
if t2 >= t1:
	print(s.lower())
else:
	print(s.upper())


def correct(s):
	upper_count = 0
	lower_count = 0
	for letters in s:
		if letters.isupper():
			upper_count += 1
		elif letters.islower():
			lower_count += 1
	if upper_count > lower_count:
		new = s.upper()
	else:
		new = s.lower()
	return new
s = input()
print(correct(s))


def sim(s1, s2):
	count = 0
	for i in range(len(s1)):
		if s1[i] == s2[i]:
			count += 1
	return count
s = input()
sl = s.lower()
su = s.upper()
sim1 = sim(s, sl)
sim2 = sim(s, su)
if sim1 >= sim2:
	print(sl)
else:
	print(su)


s = input()
l = list(s)
c1 = 0
c2 = 0
for i in l:
	if i.islower():
		c1 += 1
	else:
		c2 += 1
if c1 >= c2:
	print(s.lower())
else:
	print(s.upper())


a = input()
cup = 0
for i in a:
	if i.isupper():
		cup += 1
if cup > len(a) - cup:
	print(a.upper())
else:
	print(a.lower())


s = input()
a = []
b = []
for x in range(len(s)):
	if 65 <= ord(s[x]) <= 90:
		a.append(x)
	else:
		b.append(x)
if len(a) > len(b):
	print(s.upper())
else:
	print(s.lower())


n = input()
l = len(n)
N = n.upper()
count = 0
for (m, M) in zip(n, N):
	if m is M:
		count += 1
if count > l // 2:
	print(N)
else:
	print(n.lower())


s = input()
count1 = 0
count2 = 0
for i in range(len(s)):
	if s[i].islower():
		count1 = count1 + 1
	else:
		count2 = count2 + 1
if count1 >= count2:
	print(s.lower())
elif count2 >= count1:
	print(s.upper())


s = input()
c = 0
for i in s:
	if i.islower():
		c += 1
if c >= len(s) - c:
	print(s.lower())
else:
	print(s.upper())


import sys
Get_input = input()

def main(Get_input):
	(Chr_upper, Chr_lower) = (0, 0)
	for i in Get_input:
		if i.isupper():
			Chr_upper += 1
		elif i.islower():
			Chr_lower += 1
	if Chr_lower == Chr_upper:
		print(Get_input.lower())
	elif Chr_lower > Chr_upper:
		print(Get_input.lower())
	else:
		print(Get_input.upper())
main(Get_input)


s = input()
sv = 0
sn = 0
for i in range(len(s)):
	if 'a' <= s[i] <= 'z':
		sn += 1
	else:
		sv += 1
if sn >= sv:
	print(s.lower())
else:
	print(s.upper())


txt = input()
b = 0
s = 0
for i in range(len(txt)):
	if txt[i].islower():
		s += 1
	else:
		b += 1
if b > s:
	print(txt.upper())
else:
	print(txt.lower())


a = input()
lower = 0
upper = 0
for i in a:
	if int(ord(i)) <= 90:
		upper = upper + 1
	else:
		lower = lower + 1
if upper > lower:
	print(a.upper())
else:
	print(a.lower())


n = input()
m = sorted(list(n))
a = len(n)
for i in range(len(n)):
	if m[i] == m[i].lower():
		a = i
		break
if a > len(n) / 2:
	print(n.upper())
else:
	print(n.lower())


a = input()
sum1 = 0
sum2 = 0
for i in range(len(a)):
	if a[i] == a[i].lower():
		sum1 += 1
	else:
		sum2 += 1
if sum1 >= sum2:
	print(a.lower())
else:
	print(a.upper())


x = input()
count = 0
count1 = 0
for i in range(len(x)):
	if x[i] >= 'a' and x[i] <= 'z':
		count += 1
	else:
		count1 += 1
if count >= count1:
	print(x.lower())
else:
	print(x.upper())


s = input()
lower = 0
n = len(s)
for c in s:
	if c.islower():
		lower += 1
if lower < n / 2:
	s = s.upper()
else:
	s = s.lower()
print(s)


import math
a = input('')
count = 0
for i in a:
	if i.isupper():
		count += 1
if count > len(a) - count:
	print(a.upper())
else:
	print(a.lower())


word = input()
i = u = l = 0
while i < len(word):
	if str(word[i]).islower():
		l += 1
	else:
		u += 1
	i += 1
i = 0
if u > l:
	word = word.upper()
else:
	word = word.lower()
print(word)


string = input()
c = 0
check_c = 0
for (s1, s2) in zip(string, string.upper()):
	if s1 != s2:
		c += 1
	else:
		check_c += 1
if c == check_c or c > check_c:
	print(string.lower())
else:
	print(string.upper())


s = input()
(ans, x, y) = ('', 0, 0)
for c in s:
	if c >= 'a' and c <= 'z':
		x += 1
	else:
		y += 1
if x >= y:
	for c in s:
		if c >= 'A' and c <= 'Z':
			ans += chr(ord(c) - ord('A') + ord('a'))
		else:
			ans += c
else:
	for c in s:
		if c >= 'a' and c <= 'z':
			ans += chr(ord(c) - ord('a') + ord('A'))
		else:
			ans += c
print(ans)


s = input()
u = []
l = []
(uc, lc) = (0, 0)
for i in s:
	if i.isupper():
		u.append(i)
		uc += 1
	elif i.islower():
		l.append(i)
		lc += 1
if uc > lc:
	print(s.upper())
elif uc < lc:
	print(s.lower())
elif uc == lc:
	print(s.lower())


s = input()
cap = 0
for x in range(len(s)):
	if s[x] >= 'A' and s[x] <= 'Z':
		cap += 1
sim = len(s) - cap
if cap > sim:
	s = s.upper()
else:
	s = s.lower()
print(s)


A = input()
if [x.isupper() for x in A].count(True) > len(A) / 2:
	print(A.upper())
else:
	print(A.lower())


s = input()
sm = 0
cap = 0
for i in range(len(s)):
	if ord(s[i]) >= 97:
		sm += 1
	else:
		cap += 1
if cap > sm:
	print(s.upper())
else:
	print(s.lower())


str = input()
u = l = 0
for x in str:
	if x.isupper():
		u += 1
	else:
		l += 1
if u > l:
	print(str.upper())
else:
	print(str.lower())


s = input()
l = len(s)
low = 0
for i in s:
	if 'a' <= i <= 'z':
		low += 1
up = l - low
if up > low:
	s = s.upper()
else:
	s = s.lower()
print(s)


string = str(input())
small = 0
cap = 0
for i in string:
	if 65 <= ord(i) <= 90:
		cap += 1
	elif 97 <= ord(i) <= 122:
		small += 1
if cap > small:
	print(string.upper())
else:
	print(string.lower())


def solve(word):
	countu = 0
	countl = 0
	for i in range(len(word)):
		if word[i].isupper():
			countu += 1
		else:
			countl += 1
	if countu > countl:
		return word.upper()
	else:
		return word.lower()
word = input()
word = solve(word)
print(word)


a = str(input())
count1 = 0
count2 = 0
for i in a:
	if i.islower():
		count1 = count1 + 1
	elif i.isupper():
		count2 = count2 + 1
if count1 >= count2:
	print(a.lower())
else:
	print(a.upper())


n = input()
up = lo = 0
for i in range(len(n)):
	if n[i].isupper():
		up += 1
	else:
		lo += 1
if up > lo:
	print(n.upper())
else:
	print(n.lower())


palavra = input()
uppers = 0
lowers = 0
for letra in palavra:
	lowers += 1 if letra.islower() else 0
	uppers += 1 if letra.isupper() else 0
if uppers > lowers:
	print(palavra.upper())
else:
	print(palavra.lower())


a = input()
c = 0
nc = 0
for i in a:
	if i.isupper():
		c += 1
	else:
		nc += 1
if c > nc:
	print(a.upper())
else:
	print(a.lower())


s = input()
low = sum((i >= 'a' and i <= 'z' for i in s))
up = sum((i >= 'A' and i <= 'Z' for i in s))
print(s.lower() if low >= up else s.upper())


v = input()
h = 0
a = 0
for i in v:
	if i == i.lower():
		h = h + 1
	elif i == i.upper():
		a = a + 1
if h > a:
	print(v.lower())
if h < a:
	print(v.upper())
if h == a:
	print(v.lower())


def letterMix(str):
	lowerNum = 0
	upperNUm = 0
	for i in range(len(str)):
		if str[i] == str[i].upper():
			upperNUm = upperNUm + 1
		else:
			lowerNum = lowerNum + 1
	if upperNUm == lowerNum or lowerNum > upperNUm:
		return str.lower()
	return str.upper()
x = input('')
print(letterMix(x))


s = input()
up = 0
l = 0
for i in s:
	if 'a' <= i <= 'z':
		l += 1
	elif 'A' <= i <= 'Z':
		up += 1
if up == l:
	print(s.lower())
elif up > l:
	p = ''
	for i in s:
		if 'a' <= i <= 'z':
			p += i.upper()
		else:
			p += i
	print(p)
else:
	p = ''
	for i in s:
		if 'A' <= i <= 'Z':
			p += i.lower()
		else:
			p += i
	print(p)


s = input()
u = 0
l = 0
for i in s:
	if ord(i) <= 90:
		u += 1
	else:
		l += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


s = input()
low = len([x for x in s if x == x.lower()])
if low >= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


p = input()
k = 0
l = 0
for i in range(len(p)):
	if p[i] >= 'A' and p[i] <= 'Z':
		k += 1
	else:
		l += 1
if k > l:
	p = p.upper()
else:
	p = p.lower()
print(p)


import string
countU = 0
countL = 0
lowercase = string.ascii_lowercase
uppercase = string.ascii_lowercase.upper()
n = input()
for i in n:
	if i in lowercase:
		countL += 1
	else:
		countU += 1
if countL >= countU:
	print(n.lower())
else:
	print(n.upper())


n = input()
low = 0
up = 0
for x in n:
	if x.islower():
		low += 1
	else:
		up += 1
if low > up:
	print(n.lower())
elif low < up:
	print(n.upper())
else:
	print(n.lower())


s = input()
result = ''
length = len(s)
if length > 100:
	print('wrong input')
	exit()
upper = 0
for i in range(0, length):
	if s[i] >= 'A' and s[i] <= 'Z':
		upper += 1
dif = ord('A') - ord('a')
if upper > length / 2:
	for i in range(0, length):
		if s[i] >= 'a' and s[i] <= 'z':
			tem = ord(s[i]) + dif
			result += chr(tem)
		else:
			result += s[i]
if upper <= length / 2:
	for i in range(0, length):
		if s[i] >= 'A' and s[i] <= 'Z':
			tem = ord(s[i]) - dif
			result += chr(tem)
		else:
			result += s[i]
print(result)


word = input()
i = 0
cnt = 0
cnt1 = 0
for i in range(len(word)):
	if word[i].isupper():
		cnt += 1
	else:
		cnt1 += 1
if cnt > cnt1:
	print(word.upper())
else:
	print(word.lower())


word = input()
lower = 0
upper = 0
for letter in word:
	if letter in 'abcdefghijklmnopqrstuvwxyz':
		lower += 1
	if letter in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		upper += 1
if lower >= upper:
	print(word.lower())
else:
	print(word.upper())


s = input()
d = 0
for i in s:
	d = i.islower() + d
if d < len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


n = list(input())
uppercase = 0
lowercase = 0
for i in range(len(n)):
	if n[i].isupper():
		uppercase = uppercase + 1
	if n[i].islower():
		lowercase = lowercase + 1
if lowercase >= uppercase:
	print(''.join(n).lower())
if lowercase < uppercase:
	print(''.join(n).upper())


def mix(string):
	l = 0
	u = 0
	for i in range(len(string)):
		if string[i].islower():
			l = l + 1
		elif string[i].isupper():
			u = u + 1
	if u > l:
		return string.upper()
	elif l > u:
		return string.lower()
	else:
		return string.lower()
string = input()
print(mix(string))


word = input()
lowC = 0
upC = 0
for x in word:
	if x.isupper():
		upC += 1
	else:
		lowC += 1
if lowC > upC:
	print(word.lower())
elif lowC < upC:
	print(word.upper())
else:
	print(word.lower())


(lower, upper) = (0, 0)
texto = input()
for letra in texto:
	if 65 <= ord(letra) <= 90:
		upper += 1
	else:
		lower += 1
print(texto.upper() if upper > lower else texto.lower())


s = list(input())
count1 = 0
count2 = 0
for i in s:
	if i.isupper():
		count1 += 1
	if i.islower():
		count2 += 1
if count1 > count2:
	s = ''.join(s)
	print(s.upper())
else:
	s = ''.join(s)
	print(s.lower())


str = input()
cnt = 0
for i in range(len(str)):
	if cnt > i:
		break
	if ord(str[i]) <= 90:
		cnt += 1
	else:
		cnt -= 1
if cnt > 0:
	str = str.upper()
else:
	str = str.lower()
print(str)


from string import ascii_lowercase
lc = 0
uc = 0
s = input()
for sym in s:
	if sym in ascii_lowercase:
		lc += 1
	else:
		uc += 1
if uc > lc:
	print(s.upper())
else:
	print(s.lower())


x = input()
n = len(x)
up = 0
low = 0
for i in range(0, n, 1):
	if ord(x[i]) >= 65 and ord(x[i]) <= 90:
		up = up + 1
	else:
		low = low + 1
if up > low:
	print(x.upper())
else:
	print(x.lower())


word = input()
u = 0
for i in range(len(word)):
	if word[i].isupper():
		u += 1
	else:
		continue
if 2 * u <= len(word):
	print(word.lower())
else:
	print(word.upper())


s = input()
cnt = 0
for i in s:
	if i.isupper():
		cnt += 1
if cnt > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


string = input()
L = list(string)
up = 0
low = 0
for i in L:
	if i.isupper() == True:
		up += 1
	else:
		low += 1
if up > low:
	print(string.upper())
else:
	print(string.lower())


s = input()
up = 0
for i in s:
	if i.isupper():
		up += 1
if up > len(s) - up:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = [str(i) for i in input()]
a = 0
A = 0
for i in s:
	if 96 < ord(i):
		a += 1
	else:
		A += 1
if A > a:
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


def main():
	S = input().rstrip()
	(l, u) = (0, 0)
	for i in S:
		if i.islower():
			l += 1
		else:
			u += 1
	print(S.lower() if l >= u else S.upper())
main()


word = input()
lowercase = 0
uppercase = 0
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in word:
	if i in letters:
		lowercase += 1
	else:
		uppercase += 1
if lowercase > uppercase:
	word = word.lower()
elif uppercase > lowercase:
	word = word.upper()
else:
	word = word.lower()
print(word)


s = input()
up = 0
lo = 0
for i in s:
	if i >= 'A' and i <= 'Z':
		up += 1
	else:
		lo += 1
if up == lo:
	print(s.lower())
if up > lo:
	print(s.upper())
if up < lo:
	print(s.lower())


v = list(input())
w = ''.join(v)
(l, u) = (0, 0)
for i in v:
	if ord(i) > 96:
		l += 1
	else:
		u += 1
else:
	if l >= u:
		print(w.lower())
	else:
		print(w.upper())


s = input()
low = 0
for el in s:
	if el == el.lower():
		low += 1
if low >= len(s) - low:
	print(s.lower())
else:
	print(s.upper())


t = str(input())
uc = lc = 0
for i in range(0, len(t)):
	if t[i].islower():
		lc += 1
	else:
		uc += 1
if lc >= uc:
	print(t.lower())
else:
	print(t.upper())


word = input().strip()
lower = 0
for letter in word:
	if letter.islower():
		lower += 1
upper = len(word) - lower
if lower >= upper:
	word = word.lower()
else:
	word = word.upper()
print(word)


lol = input()
small = 0
caps = 0
for i in lol:
	if i.islower():
		small += 1
	else:
		caps += 1
if caps > small:
	print(lol.upper())
else:
	print(lol.lower())


str = input()
lower_count = 0
upper_count = 0
for ch in str:
	if ch.islower():
		lower_count += 1
	else:
		upper_count += 1
if lower_count >= upper_count:
	str = str.lower()
else:
	str = str.upper()
print(str)


s = str(input())
l = len(s)
i = 0
ltl = 0
up = 0
while i < l:
	if s[i] == s[i].lower():
		ltl += 1
	elif s[i] == s[i].upper():
		up += 1
	i += 1
if ltl >= up:
	print(s.lower())
else:
	print(s.upper())


a = input()
lower = 0
upper = 0
for i in range(len(a)):
	if a[i].islower():
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(a.lower())
else:
	print(a.upper())


s = input()
l = list(s)
l.sort()
if l[len(s) // 2].isupper():
	print(s.upper())
else:
	print(s.lower())


list1 = list(input())
count1 = 0
count2 = 0
for i in list1:
	if ord(i) < 97:
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	for i in range(len(list1)):
		if ord(list1[i]) >= 97:
			list1[i] = chr(ord(list1[i]) - 32)
else:
	for i in range(len(list1)):
		if ord(list1[i]) < 97:
			list1[i] = chr(ord(list1[i]) + 32)
print(''.join(list1))


ip = input()
uc = 0
lc = 0
for x in ip:
	if 'A' <= x <= 'Z':
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(ip.upper())
else:
	print(ip.lower())


x = input()
j = 0
k = 0
for i in range(len(x)):
	if x[i].isupper():
		j = j + 1
	else:
		k = k + 1
if j > k:
	print(x.upper())
else:
	print(x.lower())


a = input()
c = 0
d = 0
for b in range(0, len(a)):
	if a[b].isupper() == True:
		d += 1
	else:
		c += 1
if d == c:
	print(a.lower())
elif d > c:
	print(a.upper())
else:
	print(a.lower())


(cnt, cnt2) = (0, 0)
s = input()
for i in range(len(s)):
	if s[i].islower():
		cnt += 1
	else:
		cnt2 += 1
if cnt >= cnt2:
	print(s.lower())
else:
	print(s.upper())


si = input()
Count = 0
count = 0
for i in si:
	if i >= 'A' and i <= 'Z':
		Count += 1
	if i >= 'a' and i <= 'z':
		count += 1
if count >= Count:
	print(si.lower())
else:
	print(si.upper())


s = str(input())
f1 = 0
f2 = 0
for i in s:
	if i.isupper():
		f1 += 1
	else:
		f2 += 1
print(s.lower() if f1 <= f2 else s.upper())


n = input()
u = 0
l = 0
for i in n:
	if ord(i) >= ord('a') and ord(i) <= ord('z'):
		l += 1
	else:
		u += 1
if u > l:
	n = n.upper()
else:
	n = n.lower()
print(n)


def solve(*, string: str) -> str:
	upper_count = len(list(filter(str.isupper, string)))
	lower_count = len(string) - upper_count
	if lower_count >= upper_count:
		return string.lower()
	return string.upper()
string = input()
result = solve(string=string)
print(result)


x = input()
a = 'abcdefghijklmnopqrstuvwxyz'
b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
x = list(x)
y = 0
time = 0
up = 0
low = 0
while time <= len(x) - 1:
	if x[y] in a:
		low += 1
	elif x[y] in b:
		up += 1
	y += 1
	time += 1
y = 0
time = 0
if low < up:
	while time <= len(x) - 1:
		if x[y] in a:
			x[y] = b[a.find(x[y])]
			y += 1
		else:
			y += 1
		time += 1
elif low >= up:
	while time <= len(x) - 1:
		if x[y] in b:
			x[y] = a[b.find(x[y])]
			y += 1
		else:
			y += 1
		time += 1
print(''.join(x))


t = str(input())
c = 0
s = 0
for i in t:
	if i >= 'A' and i <= 'Z':
		c += 1
	elif i >= 'a' and i <= 'z':
		s += 1
if c > s:
	t = t.upper()
elif s >= c:
	t = t.lower()
print(t)


import string
s = input()
u = 0
l = 0
for i in s:
	if i in string.ascii_lowercase:
		l = l + 1
	else:
		u = u + 1
if l >= u:
	print(s.lower())
else:
	print(s.upper())


s = input()
print((s.lower(), s.upper())[sum((x.isupper() for x in s)) > len(s) // 2])


s = input()
print(s.lower() if 2 * len(list(filter(lambda x: x.islower(), [y for y in s]))) >= len(s) else s.upper())


s = input()
lower_count = sum((1 for c in s if c.islower()))
upper_count = sum((1 for c in s if c.isupper()))
if upper_count > lower_count:
	print(s.upper())
else:
	print(s.lower())


line = input()
uL = 0
lL = 0
for x in line:
	if x.islower():
		lL = lL + 1
	if x.isupper():
		uL = uL + 1
if uL > lL:
	print(line.upper())
elif lL > uL:
	print(line.lower())
else:
	print(line.lower())


s = input()
cap = 0
for i in s:
	if ord(i) < 97:
		cap += 1
small = len(s) - cap
if small >= cap:
	s = s.lower()
else:
	s = s.upper()
print(s)


s = input()
up = 0
low = 0
for x in s:
	if x == x.upper():
		up += 1
	else:
		low += 1
if up == low:
	print(s.lower())
elif up > low:
	print(s.upper())
else:
	print(s.lower())


s = input()
l = u = 0
for i in s:
	if 97 <= ord(i) <= 122:
		l += 1
	else:
		u += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


word = input()
up = 0
low = 0
for char in word:
	if char.isupper():
		up += 1
	elif char.islower():
		low += 1
if up > low:
	print(word.upper())
else:
	print(word.lower())


w = str(input().strip())
u = l = 0
for c in w:
	if c.islower():
		l += 1
	else:
		u += 1
if u > l:
	print(w.upper())
else:
	print(w.lower())


s = input()
mic = mare = 0
for i in s:
	if 'a' <= i <= 'z':
		mic += 1
	elif 'A' <= i <= 'Z':
		mare += 1
if mic >= mare:
	s = s.lower()
else:
	s = s.upper()
print(s)


n = input()
up = 0
lo = 0
for i in n:
	if i >= 'a' and i <= 'z':
		lo += 1
	else:
		up += 1
if up > lo:
	print(n.upper())
else:
	print(n.lower())


ch = input()
m = 0
M = 0
for i in ch:
	if i.islower():
		m += 1
	else:
		M += 1
if M <= m:
	print(ch.lower())
else:
	print(ch.upper())


s = input()
supper = 0
slower = 0
for i in range(len(s)):
	if s[i].isupper():
		supper += 1
	else:
		slower += 1
if supper > slower:
	print(s.upper())
else:
	print(s.lower())


inpStr = input()
upper = len([x for x in inpStr if x.isupper()])
if len(inpStr) - upper < upper:
	print(inpStr.upper())
else:
	print(inpStr.lower())


p = input()
count_upper = 0
count_lower = 0
for i in range(len(p)):
	if p[i].upper() == p[i]:
		count_upper += 1
	else:
		count_lower += 1
if count_lower >= count_upper:
	print(p.lower())
else:
	print(p.upper())


tc = 0
ic = 0
s = input()
for c in s:
	if c == c.lower():
		tc += 1
	else:
		ic += 1
print((s.lower(), s.upper())[tc < ic])


word = str(input())
upperLetters = 0
lowerLetters = 0
for i in range(len(word)):
	if word[i].islower():
		lowerLetters += 1
	else:
		upperLetters += 1
if upperLetters > lowerLetters:
	print(word.upper())
else:
	print(word.lower())


s = input()
lC = 0
for c in s:
	if ord(c) >= 97:
		lC += 1
uC = len(s) - lC
if uC > lC:
	print(s.upper())
else:
	print(s.lower())


s = input()
small = [ch for ch in s if ch.islower()]
big = [ch for ch in s if ch.isupper()]
if len(big) > len(small):
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
lower = sum((1 for char in s if char.islower()))
upper = sum((1 for char in s if char.isupper()))
if lower < upper:
	print(s.upper())
else:
	print(s.lower())


s = list(input())
c1 = 0
c2 = 0
for i in s:
	if ord(i) < 95:
		c1 += 1
	else:
		c2 += 1
s = ''.join(s)
if c1 > c2:
	print(s.upper())
else:
	print(s.lower())


a = input()
up = 0
low = 0
for i in range(len(a)):
	if 'A' <= a[i] <= 'Z':
		up += 1
	elif 'a' <= a[i] <= 'z':
		low += 1
if up > low:
	print(a.upper())
else:
	print(a.lower())


x = input()
l = len(x)
up = 0
low = 0
for i in range(l):
	if x[i].isupper():
		up = up + 1
	else:
		low = low + 1
if up > low:
	p = x.upper()
else:
	p = x.lower()
print(p)


import sys

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

def get():
	return int(sys.stdin.readline().strip())

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

def getli():
	return list(map(int, sys.stdin.readline().strip().split()))
s = gets()
(u, l) = (0, 0)
for i in s:
	if i.isupper():
		u += 1
	else:
		l += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


s = input()
seq = list(s)
upper = 0
lower = 0
for i in seq:
	if i.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	res = s.upper()
else:
	res = s.lower()
print(res)


def Word():
	s = input()
	countA = countB = 0
	for i in s:
		if i.isupper():
			countA += 1
		else:
			countB += 1
	if countA > countB:
		print(s.upper())
	else:
		print(s.lower())

def main():
	Word()
main()


str = input()
upper = 0
lower = 0
for char in str:
	if char.isupper():
		upper = upper + 1
	else:
		lower = lower + 1
if lower >= upper:
	str = str.lower()
	print(str)
else:
	str = str.upper()
	print(str)


word = input()
lsit1 = list(word)
a = len(lsit1)
n = 0
for i in range(a):
	if lsit1[i].islower() == True:
		n += 1
if n >= a - n:
	lsit2 = ''.join(lsit1)
	lsit3 = lsit2.lower()
	print(lsit3)
else:
	lsit2 = ''.join(lsit1)
	lsit3 = lsit2.upper()
	print(lsit3)


string = input()
sum1 = 0
sum2 = 0
for i in string:
	if i.isupper() == True:
		sum1 += 1
	else:
		sum2 += 1
if sum1 > sum2:
	print(string.upper())
else:
	print(string.lower())


s = input()
upp = 0
low = 0
for i in range(len(s)):
	if 'a' <= s[i] <= 'z':
		low += 1
	else:
		upp += 1
if low < upp:
	s = s.upper()
else:
	s = s.lower()
print(s)


word = input()
big = 0
small = 0
for i in word:
	if ord(i) <= ord('Z'):
		big = big + 1
	else:
		small = small + 1
if big <= small:
	print(word.lower())
else:
	print(word.upper())


i = input()
c = sum((1 for item in i if item.isupper() == True))
s = sum((1 for item in i if item.islower() == True))
print(i.lower() if c == s or min(c, s) == c else i.upper())


a = input()
b = len(a)
c = a.upper()
d = len([i for i in range(b) if c[i] == a[i]])
if d > b // 2:
	print(c)
else:
	print(a.lower())


str1 = input()
low = 0
up = 0
for i in range(len(str1)):
	if str1[i].islower() == 1:
		low += 1
	if str1[i].isupper() == 1:
		up += 1
if low > up or low == up:
	print(str1.lower())
else:
	print(str1.upper())


def to_big(word):
	big_word = ''
	for sym in word:
		if ord(sym) >= 97 and ord(sym) <= 122:
			indx = ord(sym) - 32
			big_word += chr(indx)
		else:
			big_word += sym
	return big_word

def to_small(word):
	small_word = ''
	for sym in word:
		if ord(sym) >= 65 and ord(sym) <= 90:
			indx = ord(sym) + 32
			small_word += chr(indx)
		else:
			small_word += sym
	return small_word
word = input()
big = 0
small = 0
for sym in word:
	if ord(sym) >= 65 and ord(sym) <= 90:
		big += 1
	else:
		small += 1
if big > small:
	print(to_big(word))
else:
	print(to_small(word))


s = input()
cn = [c for c in s if c.isupper()]
cn = len(cn)
if cn > len(s) - cn:
	print(s.upper())
else:
	print(s.lower())


a = input()
count = 0
maxi = 0
b = 'abcdefghijklmnopqrstuvwxyz'
c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in a:
	if i in b:
		count += 1
	else:
		maxi += 1
if count > maxi:
	print(a.lower())
elif count < maxi:
	print(a.upper())
else:
	print(a.lower())


s = input()
(l, u) = (0, 0)
for i in s:
	l += 1 if i >= 'a' and i <= 'z' else -1
if l >= 0:
	print(s.lower())
else:
	print(s.upper())


a = input()
l = len(a)
c = 0
for i in range(0, l):
	if a[i] >= 'A' and a[i] <= 'Z':
		c += 1
if c > l - c:
	print(a.upper())
else:
	print(a.lower())


_Str = input()
Big = 0
Small = 0
for i in _Str:
	if 65 <= ord(i) <= 90:
		Big += 1
	else:
		Small += 1
if Big > Small:
	print(_Str.upper())
else:
	print(_Str.lower())


word = input()
uppersum = 0
lowersum = 0
for c in word:
	if c.isupper():
		uppersum += 1
	elif c.islower():
		lowersum += 1
if uppersum > lowersum:
	print(word.upper())
else:
	print(word.lower())


s = input()
cnt = 0
for i in s:
	if i >= 'a':
		cnt += 1
if cnt >= len(s) - cnt:
	for i in s:
		print(i.lower(), end='')
else:
	for i in s:
		print(i.upper(), end='')


a = input()
cnt = 0
c = 0
for i in range(0, len(a)):
	if ord(a[i]) >= 97 and ord(a[i]) <= 123:
		cnt = cnt + 1
	else:
		c = c + 1
if cnt >= c:
	print(a.lower())
else:
	print(a.upper())


n = input()
count = 0
for i in n:
	if i >= 'A' and i <= 'Z':
		count += 1
	else:
		count -= 1
if count > 0:
	print(n.upper())
else:
	print(n.lower())


n = input()
w = list(n)
count1 = 0
count2 = 0
for i in n:
	if i.islower():
		count1 = count1 + 1
	elif i.isupper():
		count2 = count2 + 1
if count1 < count2:
	print(n.upper())
elif count1 > count2:
	print(n.lower())
else:
	print(n.lower())


s = input()
sl = []
su = []
upper = 0
lower = 0
for x in s:
	if ord(x) > 96 and ord(x) < 123:
		lower = lower + 1
		sl.append(x)
		su.append(chr(ord(x) - 32))
	else:
		upper = upper + 1
		sl.append(chr(ord(x) + 32))
		su.append(x)
slo = ''.join(sl)
suo = ''.join(su)
if upper > lower:
	print(suo)
else:
	print(slo)


s = input()
cl = 0
cu = 0
for i in s:
	if ord(i) >= 97 and ord(i) <= 122:
		cl += 1
	else:
		cu += 1
if cl >= cu:
	print(s.lower())
else:
	print(s.upper())


inp = input()
c = 0
for char in inp:
	if char.islower():
		c += 1
if 2 * c < len(inp):
	print(inp.upper())
else:
	print(inp.lower())


string = input()
countlower = 0
for x in range(0, len(string)):
	if string[x].islower():
		countlower += 1
print(string.lower() if countlower >= len(string) / 2 else string.upper())


a = input()
number = len(a)
af = str(a)
small = 0
for y in range(number):
	if a[y] >= 'a':
		small += 1
if small >= number / 2:
	print(af.lower())
else:
	print(af.upper())


n = input()
i = 0
cnt1 = 0
cnt2 = 0
while i < len(n):
	if n[i] in 'qwertyuioplkjhgfdsazxcvbnm':
		cnt1 = cnt1 + 1
	if n[i] in 'QWERTYUIOPLKJHGFDSAZXCVBNM':
		cnt2 = cnt2 + 1
	i = i + 1
if cnt2 > cnt1:
	print(n.upper())
else:
	print(n.lower())


n = input()
(lc, uc) = (0, 0)
for i in n:
	if i.islower():
		lc = lc + 1
	else:
		uc = uc + 1
if lc >= uc:
	n = n.lower()
else:
	n = n.upper()
print(n)


x = input()
if sum(map(str.isupper, x)) > sum(map(str.islower, x)):
	print(x.upper())
elif sum(map(str.isupper, x)) == sum(map(str.islower, x)):
	print(x.lower())
else:
	print(x.lower())


stroke = input()
upper = 0
lower = 0
for el in stroke:
	if el.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(stroke.upper())
else:
	print(stroke.lower())


upper = lower = 0
str = input()
for i in range(0, len(str)):
	if str[i].isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(str.upper())
else:
	print(str.lower())


from sys import stdin
from collections import defaultdict as dd
s = stdin.readline().rstrip()
n = len(s)
p = n // 2
c = 0
for i in range(n):
	if ord(s[i]) < 97:
		c += 1
if c <= p:
	print(s.lower())
else:
	print(s.upper())


s = input()
upper = 0
lower = 0
for letter in s:
	if letter == letter.upper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(s.upper())
else:
	print(s.lower())


string = input()
count1 = 0
count2 = 0
for a in string:
	if a.isupper() == True:
		count1 += 1
	elif a.islower() == True:
		count2 += 1
if count1 > count2:
	print(string.upper())
else:
	print(string.lower())


s = input()
c = 0
l = len(s) // 2
for i in s:
	if i.isupper():
		c += 1
if c > l:
	p = s.upper()
else:
	p = s.lower()
print(p)


n = input()
c = 0
d = 0
for t in n:
	if t.islower():
		c = c + 1
	else:
		d = d + 1
if c >= d:
	print(n.lower())
else:
	print(n.upper())


lc = []
uc = []
word = input()
for c in word:
	if c.islower():
		lc.append(c)
	else:
		uc.append(c)
if len(lc) < len(uc):
	print(word.upper())
else:
	print(word.lower())


import string
s = input()
up = sum((s.count(c) for c in string.ascii_uppercase))
lo = sum((s.count(c) for c in string.ascii_lowercase))
print(s.upper() if up > lo else s.lower())


m = input()
l = 0
u = 0
w = []
w = list(m)
for i in range(0, len(m)):
	if w[i].islower():
		l += 1
	else:
		u += 1
if l >= u:
	print(m.lower())
else:
	print(m.upper())


s = input()
let = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
up = 0
low = 0
for i in s:
	if i in let:
		up += 1
	else:
		low += 1
if up <= low:
	print(s.lower())
elif up > low:
	print(s.upper())


s = input()
(upperlst, lowerlst) = ([], [])
for i in s:
	upperlst.append(i.isupper())
	lowerlst.append(i.islower())
if sum(upperlst) > sum(lowerlst):
	print(s.upper())
elif sum(lowerlst) > sum(upperlst):
	print(s.lower())
else:
	print(s.lower())


import sys
lower = 0
upper = 0
for word in sys.stdin:
	for char in word:
		if char.islower():
			lower += 1
		if char.isupper():
			upper += 1
	if lower >= upper:
		print(word.lower().rstrip())
	else:
		print(word.upper().rstrip())


word = input()
l = 0
u = 0
for letter in word:
	if letter.islower():
		l += 1
	else:
		u += 1
if l >= u:
	print(word.lower())
else:
	print(word.upper())


def transform(word):
	uppers = 0
	lowers = 0
	for letter in word:
		if letter == letter.upper():
			uppers += 1
		else:
			lowers += 1
	if lowers >= uppers:
		return word.lower()
	else:
		return word.upper()
inp = str(input())
print(transform(inp))


s = input()
t = list(s)
u = 0
l = 0
for i in range(len(t)):
	if ord(t[i]) >= 65 and ord(t[i]) <= 90:
		u += 1
	elif ord(t[i]) >= 97 and ord(t[i]) <= 122:
		l += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


word = input()
Up = [x for x in word if x.isupper()]
Lo = [x for x in word if x.islower()]
if len(Up) > len(Lo):
	print(word.upper())
else:
	print(word.lower())


try:
	s = input()
	low = high = 0
	for i in s:
		if i.islower():
			low += 1
		else:
			high += 1
	if low >= high:
		print(s.lower())
	else:
		print(s.upper())
except:
	pass


str = input()
upper = 0
lower = 0
for i in range(len(str)):
	if str[i] >= 'a' and str[i] <= 'z':
		lower += 1
	elif str[i] >= 'A' and str[i] <= 'Z':
		upper += 1
if lower < upper:
	print(str.upper())
else:
	print(str.lower())


a = str(input())
b = ','.join(a)
c = b.split(',')
check1 = 0
check2 = 0
for i in range(len(a)):
	if c[i].islower() == True:
		check1 += 1
	else:
		check2 += 1
if check1 > check2:
	print(a.lower())
elif check1 < check2:
	print(a.upper())
else:
	print(a.lower())


slowo = input()
duze = 0
male = 0
for i in range(len(slowo)):
	if ord(slowo[i]) < ord('a'):
		duze += 1
	else:
		male += 1
if duze > male:
	print(slowo.upper())
else:
	print(slowo.lower())


a = str(input())
brmal = 0
brvel = 0
for i in range(0, len(a)):
	if a[i].isupper():
		brvel += 1
	else:
		brmal += 1
if brmal >= brvel:
	a = a.lower()
else:
	a = a.upper()
print(a)


s = input()
(cu, cl) = (0, 0)
for i in s:
	if i in 'abcdefghijklmnopqrstuvwxyz':
		cl += 1
	else:
		cu += 1
if cu > cl:
	s = s.upper()
else:
	s = s.lower()
print(s)


text = input()
import re
u = 0
l = 0
for i in text:
	if re.match('[a-z]', i):
		l += 1
	else:
		u += 1
if u > l:
	print(text.upper())
else:
	print(text.lower())


s = input()
u = 0
l = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		u = u + 1
	elif ord(i) >= 97 and ord(i) <= 123:
		l = l + 1
if l >= u:
	print(s.lower())
else:
	print(s.upper())


a = list(input())
s = d = 0
for i in range(len(a)):
	if 64 < ord(a[i]) < 91:
		s = s + 1
	else:
		d = d + 1
z = ''.join(a)
if d >= s:
	print(str.lower(z))
else:
	print(str.upper(z))


arr = list(input())
up = low = 0
for ch in arr:
	if ch.isupper():
		up += 1
	else:
		low += 1
if up > low:
	print(''.join(arr).upper())
else:
	print(''.join(arr).lower())


s = list(input())
l = 0
u = 0
for x in range(len(s)):
	if s[x].islower():
		l += 1
	else:
		u += 1
if u > l:
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


st = str(input())
upperCount = 0
lowerCount = 0
for i in range(0, len(st)):
	if st[i].isupper():
		upperCount += 1
	else:
		lowerCount += 1
newSt = ''
if lowerCount >= upperCount:
	for i in range(0, len(st)):
		newSt = newSt + st[i].lower()
else:
	for i in range(0, len(st)):
		newSt = newSt + st[i].upper()
print(newSt)


s = input()
big_letters = 0
small_letters = 0
for i in s:
	if i.isupper():
		big_letters += 1
	else:
		small_letters += 1
if big_letters > small_letters:
	s = s.upper()
else:
	s = s.lower()
print(s)


n = input()
(sum, count) = (0, 0)
for i in n:
	if i.islower():
		sum += 1
	elif i.isupper():
		count += 1
if sum >= count:
	print(n.lower())
else:
	print(n.upper())


ch = input()
S = 0
for i in ch:
	if i == i.lower():
		S += 1
	if S > len(ch) // 2 and len(ch) % 2 == 0:
		break
if S >= len(ch) // 2 and len(ch) % 2 == 0 or (S > len(ch) // 2 and len(ch) % 2 == 1):
	print(ch.lower())
else:
	print(ch.upper())


word = input()
small = 0
capital = 0
for i in range(len(word)):
	if word[i] >= 'A' and word[i] <= 'Z':
		capital += 1
	else:
		small += 1
if capital > small:
	print(word.upper())
else:
	print(word.lower())


string = input()
(upper, lower) = (0, 0)
for i in string:
	if i.islower():
		lower += 1
	else:
		upper += 1
if upper > lower:
	print(string.upper())
else:
	print(string.lower())


from sys import stdin, stdout
word = stdin.readline()
upper = sum((1 for i in word if i.isupper()))
lower = sum((1 for i in word if i.islower()))
if lower >= upper:
	stdout.write(word.lower() + '\n')
else:
	stdout.write(word.upper() + '\n')


s = input()
l = list(s)
m = 0
n = 0
for i in l:
	if i.isupper() == True:
		m = m + 1
	else:
		n = n + 1
s = ''.join(l)
if m <= n:
	s = s.lower()
else:
	s = s.upper()
print(s)


import re
s = input()
upper = re.findall('[A-Z]', s)
lower = re.findall('[a-z]', s)
if len(upper) > len(lower):
	print(s.upper())
else:
	print(s.lower())


def low(x):
	bla = 0
	for i in x:
		if i in 'qwertyuiopasdfghjklzxcvbnm':
			bla += 1
	return bla
a = input()
if len(a) - low(a) <= low(a):
	print(a.lower())
else:
	print(a.upper())


t = input()
m = 0
n = 0
for i in range(0, len(t)):
	if t[i].isupper():
		m = m + 1
	elif t[i].islower():
		n = n + 1
if m > n:
	t = t.upper()
else:
	t = t.lower()
print(t)


s1 = input()
u = 0
l = 0
x = s1
x = list(x)
for i in x:
	if i.isupper():
		u += 1
	else:
		l += 1
if u > l:
	print(s1.upper())
else:
	print(s1.lower())


s = input()
lower_case = []
upper_case = []
while not (s.isalpha() and 1 <= len(s) <= 100):
	s = input()
for i in s:
	if i.islower():
		lower_case.append(i)
	elif i.isupper():
		upper_case.append(i)
if len(upper_case) > len(lower_case):
	print(s.upper())
elif len(upper_case) < len(lower_case):
	print(s.lower())
else:
	print(s.lower())


a = input()
b = 0
for i in range(0, len(a)):
	if a[i].isupper() == True:
		b += 1
if int(len(a) / 2) >= b:
	print(a.lower())
else:
	print(a.upper())


n = list(input())
lower = 0
upper = 0
for i in n:
	if i.isupper():
		upper += 1
	else:
		lower += 1
if lower < upper:
	print(''.join(n).upper())
else:
	print(''.join(n).lower())


def main():
	from string import ascii_uppercase as upp
	s = input()
	q = 0
	q1 = 0
	for i in s:
		if i in upp:
			q += 1
		else:
			q1 += 1
	if q <= q1:
		print(s.lower())
	else:
		print(s.upper())
main()


n = input()
count1 = 0
count2 = 0
for i in range(len(n)):
	if n[i].isupper():
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	print(n.upper())
elif count1 <= count2:
	print(n.lower())
else:
	print(n)


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

def solve():
	S = getStr()
	(U, L) = (0, 0)
	for s in S:
		if s.lower() == s:
			L += 1
		else:
			U += 1
	if U > L:
		return S.upper()
	return S.lower()
ans = solve()
print(ans)


s = str(input())
a = 0
b = 0
for i in s:
	if i.isupper():
		a += 1
	else:
		b += 1
if a > b:
	print(s.upper())
else:
	print(s.lower())


i = input('')
s = 0
p = 0
for j in i:
	if ord(j) >= 96:
		s += 1
	else:
		p += 1
if s == p or s > p:
	print(i.lower())
else:
	print(i.upper())


word = input()
lis = list(word)
q = len(word)
count = 0
for i in lis:
	if i.lower() == i:
		count += 1
if count >= q - count:
	print(word.lower())
else:
	print(word.upper())


a = input()
up = 0
lo = 0
for i in range(0, len(a)):
	if ord(a[i]) >= 65 and ord(a[i]) <= 90:
		up += 1
	else:
		lo += 1
if up > lo:
	print(a.upper())
else:
	print(a.lower())


a = input()
lower = ''
upper = ''
for i in a:
	if i.islower():
		lower += i
	else:
		upper += i
if len(lower) > len(upper) or len(lower) == len(upper):
	print(a.lower())
else:
	print(a.upper())


import math
s = input()
big = 0
small = 0
for i in s:
	if i.isupper():
		big += 1
	else:
		small += 1
if big > small:
	s = s.upper()
else:
	s = s.lower()
print(s)


B = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}
s = input()
b = 0
for i in range(len(s)):
	if s[i] in B:
		b += 1
if b > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


words = input()
print(words.upper() if sum((word.isupper() for word in words)) > len(words) // 2 else words.lower())


s = input()
(ups, low) = (0, 0)
for i in s:
	if i.isupper():
		ups += 1
	else:
		low += 1
if ups > low:
	print(s.upper())
else:
	print(s.lower())


s = input()
up_num = 0
low_num = 0
for char in s:
	if char.isupper():
		up_num += 1
	else:
		low_num += 1
print(s.upper() if up_num > low_num else s.lower())


s = input()
(a, b) = (0, 0)
for i in s:
	if i.islower():
		a += 1
	else:
		b += 1
if a >= b:
	print(s.lower())
else:
	print(s.upper())


q = input()
n = list(q)
up = 0
low = 0
for i in range(0, len(n)):
	if ord(n[i]) >= 65 and ord(n[i]) <= 90:
		up = up + 1
	if ord(n[i]) >= 97 and ord(n[i]) <= 122:
		low = low + 1
if up > low:
	print(q.upper())
if up < low:
	print(q.lower())
if up == low:
	print(q.lower())


def word(s):
	c = 0
	for i in s:
		if 97 <= ord(i) <= 122:
			c += 1
		else:
			c -= 1
	if c >= 0:
		return s.lower()
	return s.upper()
print(word(input()))


s = input()
c = 0
su = s.upper()
for i in range(len(s)):
	if s[i] == su[i]:
		c = c + 1
if c > len(s) - c:
	print(s.upper())
else:
	print(s.lower())


s = input()
low = 0
up = 0
for i in s:
	if i.lower() == i:
		low += 1
	elif i.upper() == i:
		up += 1
if low > up:
	print(s.lower())
elif low < up:
	print(s.upper())
elif low == up:
	print(s.lower())


girdi = input()
girdi = str(girdi)
buyukharf = 0
toplamharf = len(girdi)
for i in girdi:
	if i.isupper():
		buyukharf += 1
if buyukharf > toplamharf - buyukharf:
	print(girdi.upper())
else:
	print(girdi.lower())


s = input()
countLower = 0
countHigher = 0
for letter in s:
	if ord(letter) <= 122 and ord(letter) >= 97:
		countLower += 1
	else:
		countHigher += 1
if countLower < countHigher:
	s = s.upper()
else:
	s = s.lower()
print(s)


import sys
import math
import collections
from collections import deque
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))
s = str(stdin.readline().strip('\n'))
n = len(s)
(cl, cu) = (0, 0)
for i in range(n):
	if s[i].isupper() == True:
		cu += 1
	else:
		cl += 1
if cu > cl:
	print(s.upper())
else:
	print(s.lower())


a = input()
hn = 0
ln = 0
for i in a:
	if i > '[':
		hn += 1
	else:
		ln += 1
if ln > hn:
	print(a.upper())
else:
	print(a.lower())


string = input()
(low, upp) = (0, 0)
for letter in string:
	if letter.islower():
		low += 1
	else:
		upp += 1
if low >= upp:
	print(string.lower())
else:
	print(string.upper())


s = str(input())
case = [0, 0]
for i in s:
	case[i.isupper()] += 1
print([s.upper(), s.lower()][case[1] <= case[0]])


s = input()
(up, low) = (0, 0)
for i in s:
	if i >= 'A' and i <= 'Z':
		up += 1
	elif i >= 'a' and i <= 'z':
		low += 1
if up > low:
	print(s.upper())
else:
	print(s.lower())


s = input()
nu = 0
sl = s.lower()
su = s.upper()
for i in range(len(s)):
	if s[i] == su[i]:
		nu = nu + 1
if 2 * nu > len(s):
	print(su)
else:
	print(sl)


palavra = input()
contUper = 0
contLower = 0
for i in palavra:
	if i.isupper():
		contUper += 1
	else:
		contLower += 1
if contUper > contLower:
	print(palavra.upper())
else:
	print(palavra.lower())


st = input()
n = len(st)
u = 0
l = 0
for i in st:
	if i == i.upper():
		u += 1
	elif i == i.lower():
		l += 1
if l >= u:
	print(st.lower())
elif l < u:
	print(st.upper())


upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lower = 'abcdefghijklmnopqrstuvwxyz'
u = 0
l = 0
n = input('')
for i in n:
	if i in upper:
		u = u + 1
	else:
		l = l + 1
if l >= u:
	print(n.lower())
else:
	print(n.upper())


s = input()
c = 0
for i in range(len(s)):
	if ord(s[i]) >= 97:
		c += 1
b = len(s) - c
if b > c:
	print(s.upper())
elif b < c:
	print(s.lower())
else:
	print(s.lower())


s = input()
upper = 0
lower = 0
for char in s:
	if ord(char) >= 97 and ord(char) <= 122:
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(s.lower())
else:
	print(s.upper())


a = input()
b = len(a)
c = 0
d = 0
for i in range(b):
	if a[i].isupper():
		c += 1
	if a[i].islower():
		d += 1
if c > d:
	print(a.upper())
if c <= d:
	print(a.lower())


s = input()
upper = len([i for i in s if i.isupper()])
lower = len(s) - upper
str = ''
if upper < lower or upper == lower:
	for i in s:
		str = str + i.lower()
else:
	for i in s:
		str = str + i.upper()
print(str)


n = input()
arr = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
c = 0
d = 0
for i in n:
	if i in arr:
		c += 1
	else:
		d += 1
if c > d:
	print(n.upper())
elif c == d:
	print(n.lower())
else:
	print(n.lower())


x = input('')
lower = 0
upper = 0
for l in x:
	if ord(l) > 90:
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(x.lower())
else:
	print(x.upper())


countUpper = 0
countLower = 0
w = input()
for i in w:
	if ('' + i).isupper():
		countUpper += 1
	else:
		countLower += 1
if countLower >= countUpper:
	print(w.lower())
else:
	print(w.upper())


string = input()
count1 = 0
count2 = 0
for i in string:
	if i.islower():
		count1 = count1 + 1
	elif i.isupper():
		count2 = count2 + 1
if count1 == count2:
	a = string.lower()
	print(a)
elif count1 > count2:
	a = string.lower()
	print(a)
elif count1 < count2:
	a = string.upper()
	print(a)
elif count1 == 0 or count2:
	print(string)
for i in string:
	if i.islower():
		count1 = count1 + 1
	elif i.isupper():
		count2 = count2 + 1


s = input()
l = sum([i.islower() for i in list(s)])
if l < len(s) - l:
	print(s.upper())
else:
	print(s.lower())


a = input('')
d = 0
x = 0
for i in range(len(a)):
	if 'a' <= a[i] <= 'z':
		x += 1
	else:
		d += 1
if d > x:
	print(a.upper())
else:
	print(a.lower())


n = input()
count_1 = 0
count_2 = 0
for i in n:
	if i.islower():
		count_1 += 1
	else:
		count_2 += 1
if count_2 <= count_1:
	n1 = n.lower()
	print(n1)
else:
	n1 = n.upper()
	print(n1)


word = input()
alist = list(word)
da = 0
xiao = 0
for i in alist:
	if i.isupper() is True:
		da += 1
	else:
		xiao += 1
if da <= xiao:
	word = word.lower()
else:
	word = word.upper()
print(word)


slovo = input()
(velkych, malych) = (0, 0)
for pismeno in slovo:
	if pismeno.isupper():
		velkych += 1
	elif pismeno.islower():
		malych += 1
if velkych > malych:
	print(slovo.upper())
else:
	print(slovo.lower())


n = input()
c = 0
k = 0
for i in range(0, len(n)):
	if n[i].isupper():
		c = c + 1
	else:
		k = k + 1
if c > k:
	n = str(n)
	print(n.upper())
else:
	n = str(n)
	print(n.lower())


s = input()
u = 0
for i in s:
	if i == i.upper():
		u += 1
if 2 * u > len(s):
	print(s.upper())
else:
	print(s.lower())


s = input()
cnt1 = 0
cnt2 = 0
for i in range(len(s)):
	if ord(s[i]) >= 65 and ord(s[i]) < 91:
		cnt1 += 1
	else:
		cnt2 += 1
if cnt1 > cnt2:
	print(s.upper())
else:
	print(s.lower())


def main():
	w = input()
	(u, l) = (0, 0)
	for i in w:
		if i.isupper():
			u += 1
		else:
			l += 1
	if u > l:
		print(w.upper())
	else:
		print(w.lower())
main()


s = str(input())
count1 = 1
count2 = 1
for i in s:
	if i.isupper():
		count1 = count1 + 1
	else:
		count2 = count2 + 1
if count1 <= count2:
	print(s.lower())
else:
	print(s.upper())


word = input()
maj = 0
mini = 0
for i in range(len(word)):
	if word[i].islower() == True:
		mini = mini + 1
	elif word[i].isupper() == True:
		maj = maj + 1
if maj > mini:
	print(word.upper())
else:
	print(word.lower())


word = input()
(up, down) = (0, 0)
for char in word:
	if char.isupper():
		up += 1
	else:
		down += 1
if up > down:
	word = word.upper()
else:
	word = word.lower()
print(word)


s = input()
l = []
uc = 0
lc = 0
for i in s:
	l.append(i)
for i in range(len(s)):
	if ord(l[i]) in range(65, 91):
		uc += 1
	if ord(l[i]) in range(97, 123):
		lc += 1
if uc > lc:
	s = s.upper()
if uc < lc or uc == lc:
	s = s.lower()
print(s)


word = input()
l_count = 0
u_count = 0
for ch in word:
	if ch.islower():
		l_count += 1
	else:
		u_count += 1
if l_count >= u_count:
	print(word.lower())
else:
	print(word.upper())


s = input()
c = 0
for i in range(len(s)):
	if s[i].isupper() == True:
		c = c + 1
t = len(s) - c
if c > t:
	s = s.upper()
else:
	s = s.lower()
print(s)


a = input()
sm = 0
kr = 0
for i in range(len(a)):
	if 'a' <= a[i] <= 'z':
		sm = sm + 1
	elif 'A' <= a[i] <= 'Z':
		kr = kr + 1
if sm >= kr:
	print(a.lower())
else:
	print(a.upper())


s = input()
upper = sum([i in s.upper() for i in s])
if upper > len(s) - upper:
	print(s.upper())
else:
	print(s.lower())


line = input()
uNum = 0
lNum = 0
for ch in line:
	if ch.isupper():
		uNum += 1
	else:
		lNum += 1
res = ''
if uNum > lNum:
	print(line.upper())
else:
	print(line.lower())


low = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
high = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
s = input()
low_c = 0
high_c = 0
for i in s:
	if i in low:
		low_c += 1
	else:
		high_c += 1
if low_c > high_c or low_c == high_c:
	s = s.lower()
else:
	s = s.upper()
print(s)


s = input()
l = 0
u = 0
f = ''
for x in s:
	if x.lower() == x:
		l += 1
	else:
		u += 1
if l > u or l == u:
	for d in s:
		f += d.lower()
if u > l:
	for t in s:
		f += t.upper()
print(f)


def readln():
	return tuple(map(int, input().split()))
s = input()
print(s.lower() if 2 * len([c for c in s if c.islower()]) >= len(s) else s.upper())


s = input()
c1 = 0
c2 = 0
for i in range(len(s)):
	if s[i].isupper():
		c1 = c1 + 1
	else:
		c2 = c2 + 1
if c1 > c2:
	print(s.upper())
else:
	print(s.lower())


def count(s):
	low = 0
	for c in s:
		if c.islower():
			low += 1
	return low
s = input()
low = count(s)
high = len(s) - low
if low >= high:
	print(s.lower())
else:
	print(s.upper())


s = str(input())
i1 = 0
i2 = 0
arr_en = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
arr_EN = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
for i in list(s):
	if i in arr_en:
		i1 += 1
	elif i in arr_EN:
		i2 += 1
if i1 > i2:
	print(s.lower())
if i1 == i2:
	print(s.lower())
if i1 < i2:
	print(s.upper())


s = list(input())
upper = 0
lower = 0
for i in range(len(s)):
	if s[i].isupper() == True:
		upper += 1
	else:
		lower += 1
if lower >= upper:
	for i in range(len(s)):
		if s[i].isupper() == True:
			s[i] = s[i].lower()
else:
	for i in range(len(s)):
		if s[i].isupper() == False:
			s[i] = s[i].upper()
print(''.join(s))


(s, upper, lower) = (input(), 0, 0)
for i in range(len(s)):
	if 'a' <= s[i] <= 'z':
		lower += 1
	elif 'A' <= s[i] <= 'Z':
		upper += 1
	else:
		pass
print(s.upper() if upper > lower else s.lower())


a = input()
l = []
for x in a:
	l.append(x)
i = int(0)
j = int(0)
for x in l:
	if x.isupper() == True:
		i += 1
	else:
		j += 1
if i > j:
	print(a.upper())
if i < j or i == j:
	print(a.lower())


s = input()
u = 0
l = 0
for i in range(len(s)):
	if s[i] >= 'A' and s[i] <= 'Z':
		u += 1
	else:
		l += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


word = input()
count = 0
for i in word:
	if i.islower():
		count += 1
	elif i.isupper():
		count -= 1
if count > 0:
	print(word.lower())
elif count < 0:
	print(word.upper())
else:
	print(word.lower())


n = input()
c = 0
d = 0
for i in range(len(n)):
	if ord(n[i]) >= 65 and ord(n[i]) <= 91:
		c = c + 1
	else:
		d = d + 1
if c > d:
	print(n.upper())
elif c < d:
	print(n.lower())
else:
	print(n.lower())


s = input()
m = list(s)
sm = up = 0
for i in range(len(m)):
	if ord(m[i]) > 96:
		sm += 1
	else:
		up += 1
if sm >= up:
	print(s.lower())
else:
	print(s.upper())


s = input()
low = list(filter(lambda c: c.islower(), s))
if len(low) >= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


a = input().strip().split()[0]
u = 0
l = 0
for i in range(len(a)):
	if a[i].isupper():
		u += 1
	if a[i].islower():
		l += 1
if u > l:
	print(a.upper())
else:
	print(a.lower())


word = input('')
ucount = 0
lcount = 0
for i in word:
	if i.isupper():
		ucount += 1
for i in word:
	if i.islower():
		lcount += 1
if ucount > lcount:
	ans = word.upper()
elif ucount < lcount:
	ans = word.lower()
else:
	ans = word.lower()
print(ans)


word = list(input())
a = 0
b = 0
for i in word:
	if i == i.upper():
		a += 1
	if i == i.lower():
		b += 1
word = ''.join(word)
if a > b:
	print(word.upper())
else:
	print(word.lower())


word = input()
upperword = word.upper()
upcount = 0
lowcount = 0
for i in range(0, len(word)):
	if word[i] == upperword[i]:
		upcount += 1
	else:
		lowcount += 1
if upcount > lowcount:
	print(upperword)
else:
	print(word.lower())


word = input()
lCount = 0
uCount = 0
for ch in word:
	if 'A' <= ch <= 'Z':
		uCount += 1
	else:
		lCount += 1
if uCount == lCount or lCount > uCount:
	print(word.lower())
else:
	print(word.upper())


def count_uc(word):
	cnt = 0
	for i in word:
		if i.isupper():
			cnt += 1
	return cnt
word = input()
ucCnt = count_uc(word)
if ucCnt > len(word) // 2:
	print(word.upper())
else:
	print(word.lower())


string = input()
up = 0
low = 0
for i in string:
	if i.isupper():
		up += 1
	elif i.islower():
		low += 1
if low >= up:
	print(string.lower())
else:
	print(string.upper())


n = input()
l = [x for x in n if x >= 'A' and x <= 'Z']
l1 = [x for x in n if x >= 'a' and x <= 'z']
if len(l) > len(l1):
	n = n.upper()
else:
	n = n.lower()
print(n)


s = input()
up = 0
low = 0
for i in range(len(s)):
	if s[i] < 'a':
		up += 1
	else:
		low += 1
if up > low:
	print(s.upper())
else:
	print(s.lower())


s = input()
upperCouneter = lowerCounter = 0
if 1 < len(s) <= 100:
	for letter in s:
		if letter.isupper():
			upperCouneter += 1
		else:
			lowerCounter += 1
	if upperCouneter > lowerCounter:
		s = s.upper()
	else:
		s = s.lower()
print(s)


n = input()
countupper = 0
countlower = 0
for i in range(0, len(n)):
	if n[i].isupper():
		countupper = countupper + 1
	elif n[i].islower():
		countlower = countlower + 1
if countlower > countupper:
	print(n.lower())
elif countlower < countupper:
	print(n.upper())
else:
	print(n.lower())


a = str(input())
c = 0
for i in range(len(a)):
	if a[i] >= 'a' and a[i] <= 'z':
		c = c + 1
if c >= len(a) / 2:
	print(a.lower())
else:
	print(a.upper())


s = input()
a = 0
b = 0
if len(s) >= 1 and len(s) <= 100:
	for i in s:
		if i.islower():
			a = a + 1
		elif i.isupper():
			b = b + 1
	if a > b:
		print(s.lower())
	elif a < b:
		print(s.upper())
	else:
		print(s.lower())


p = input()
count = 0
for i in p:
	if i.isupper():
		count += 1
if count > len(p) - count:
	p = p.upper()
else:
	p = p.lower()
print(p)


s = input()
count_upper = 0
count_lower = 0
for i in s:
	if i >= 'A' and i <= 'Z':
		count_upper += 1
	else:
		count_lower += 1
if count_upper <= count_lower:
	print(s.lower())
else:
	print(s.upper())


n = input()
x = n.upper()
y = n.lower()
l = list(n)
a = []
for i in l:
	a.append(ord(i))
u = 0
v = 0
for i in a:
	if i in range(65, 91):
		u += 1
	else:
		v += 1
if u > v:
	print(x)
else:
	print(y)


import string
n = input()
lo = 0
up = 0
for i in n:
	if i in string.ascii_lowercase:
		lo += 1
	else:
		up += 1
if lo >= up:
	print(n.lower())
else:
	print(n.upper())


s = input()
(a, b) = (0, 0)
for ch in s:
	if ch >= 'a' and ch <= 'z':
		a += 1
	else:
		b += 1
if b > a:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
n = 0
for t in s:
	if t.isupper():
		n += 1
if 2 * n > len(s):
	print(s.upper())
else:
	print(s.lower())


n = input()
l = list(n)
s = 0
la = 0
for i in range(len(l)):
	if 65 <= ord(l[i]) <= 90:
		la += 1
	elif 97 <= ord(l[i]) <= 122:
		s += 1
if s >= la:
	print(n.lower())
else:
	print(n.upper())


s = list(input())
n = len(s)
a = 0
b = 0
for i in range(n):
	if ord(s[i]) <= 90:
		b += 1
	else:
		a += 1
if b <= a:
	for i in range(n):
		if ord(s[i]) <= 90:
			s[i] = chr(ord(s[i]) + 32)
else:
	for i in range(n):
		if ord(s[i]) > 90:
			s[i] = chr(ord(s[i]) - 32)
print(''.join(s))


s = input()
l = len(s)
n = sum((1 for i in s if i.islower()))
h = l - n
if n >= h:
	print(s.lower())
else:
	print(s.upper())


n = input()
upper_num = 0
lower_num = 0
for x in n:
	if ord(x) <= 90:
		upper_num += 1
	if ord(x) >= 97:
		lower_num += 1
if upper_num > lower_num:
	for t in n:
		t = t.upper()
		print(t, end='')
if lower_num >= upper_num:
	for t in n:
		t = t.lower()
		print(t, end='')


s = input()
p = 0
for l in s:
	if 64 < ord(l) < 91:
		p += 1
	else:
		p -= 1
if p > 0:
	print(s.upper())
else:
	print(s.lower())


string = input()
n1 = n2 = 0
for i in string:
	if i.isupper():
		n1 += 1
	else:
		n2 += 1
if n1 > n2:
	print(string.upper())
else:
	print(string.lower())


upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lower = 'abcdefghijklmnopqrstuvwxyz'
upper = set(list(upper))
lower = set(list(lower))
st = input()
l = 0
u = 0
for i in st:
	if i in upper:
		u += 1
	else:
		l += 1
if l >= u:
	print(st.lower())
else:
	print(st.upper())


def count(x):
	cap = 0
	small = 0
	for char in x:
		if char.isupper():
			cap += 1
		elif char.islower():
			small += 1
	if small > cap:
		return x.lower()
	elif small < cap:
		return x.upper()
	else:
		return x.lower()
x = input()
ans = count(x)
print(ans)


s = input()
lenth = len(s)
cap = 0
for i in s:
	if i.isupper():
		cap += 1
if cap > lenth - cap:
	print(s.upper())
else:
	print(s.lower())


word = list(input())
upper = 0
lower = 0
for char in word:
	if char >= 'a' and char <= 'z':
		lower += 1
	else:
		upper += 1
if lower >= upper:
	word = str(''.join(word)).lower()
else:
	word = str(''.join(word)).upper()
print(word)


n = input()
u = 0
l = 0
for i in n:
	if ord(i) < 97:
		u += 1
	else:
		l += 1
if l < u:
	n = n.upper()
else:
	n = n.lower()
print(n)


s = input()
d = 0
u = 0
for c in s:
	if c.isupper():
		u += 1
	else:
		d += 1
if d >= u:
	s = s.lower()
else:
	s = s.upper()
print(s)


s = input()
countL = 0
countU = 0
for i in s:
	if i.isupper():
		countU += 1
	else:
		countL += 1
if countL < countU:
	print(s.upper())
else:
	print(s.lower())


s = input()
maj = []
mini = []
for (i, v) in enumerate(s):
	if v >= 'a' and v <= 'z':
		mini.append(i)
	else:
		maj.append(i)
if len(mini) >= len(maj):
	s = s.lower()
else:
	s = s.upper()
print(s)


palavra = input()
novaP = ''
cont = 0
for i in palavra:
	if i == i.lower():
		cont += 1
pal = list(palavra)
if len(pal) - cont == cont or len(pal) - cont < cont:
	novaP = palavra.lower()
	print(novaP)
elif len(pal) - cont > cont:
	novaP = palavra.upper()
	print(novaP)


s = input().strip()
sl = s.lower()
su = s.upper()
dsl = sum([1 for (a, b) in zip(s, sl) if a != b])
dsu = sum([1 for (a, b) in zip(s, su) if a != b])
if dsl <= dsu:
	print(sl)
else:
	print(su)


s = input()
a = ''
b = ''
cs = 0
cb = 0
for i in range(len(s)):
	if s[i].islower():
		cs += 1
	else:
		cb += 1
if cs >= cb:
	print(s.lower())
elif cs < cb:
	print(s.upper())


a = str(input())
x = 0
for i in range(len(a)):
	if a[i].islower():
		x += 1
if x >= len(a) / 2:
	print(a.lower())
else:
	print(a.upper())


s = input()
lcnt = 0
ucnt = 0
for i in s:
	if i.isupper():
		ucnt = ucnt + 1
	else:
		lcnt = lcnt + 1
if ucnt > lcnt:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
a = 0
b = 0
for k in s:
	if k >= 'a':
		a += 1
	else:
		b += 1
if a >= b:
	print(s.lower())
else:
	print(s.upper())


a = input()
b = []
count = 0
for i in range(len(a)):
	b.append(a[i])
	if b[i].isupper():
		count += 1
if count > len(a) / 2:
	c = a.upper()
else:
	c = a.lower()
print(c)


def lower_num(word):
	counter = 0
	for i in word:
		if i.islower():
			counter += 1
	return counter

def upper_num(word):
	counter = 0
	for i in word:
		if i.isupper():
			counter += 1
	return counter
word = input()
lowers = lower_num(word)
uppers = upper_num(word)
if uppers > lowers:
	print(word.upper())
else:
	print(word.lower())


s = input()
(A, B) = (0, 0)
for i in range(len(s)):
	if s[i].isupper():
		A += 1
	else:
		B += 1
ss = ''
if A > B:
	for i in range(len(s)):
		ss += s[i].upper()
else:
	for i in range(len(s)):
		ss += s[i].lower()
print(ss)


word = input()
lowercase_letters = 0
uppercase_letters = 0
for char in word:
	if char.islower():
		lowercase_letters += 1
	else:
		uppercase_letters += 1
if uppercase_letters > lowercase_letters:
	print(word.upper())
else:
	print(word.lower())


w = input()
word = list(w)
U = 0
L = 0
for lit in word:
	if lit.isupper():
		U += 1
	else:
		L += 1
if L >= U:
	print(w.lower())
else:
	print(w.upper())


a = list(input())
b = 0
s = 0
for i in a:
	if ord(i) < 95:
		b += 1
	else:
		s += 1
if b > s:
	print(''.join(a).upper())
else:
	print(''.join(a).lower())


def output(string):
	up = 0
	low = 0
	string1 = list(string)
	string2 = list(string)
	for i in range(len(string)):
		if ord(string[i]) < ord('a'):
			string1[i] = chr(ord(string[i]) + 32)
			low += 1
		else:
			string2[i] = chr(ord(string[i]) - 32)
			up += 1
	if up >= low:
		return ''.join(string1)
	else:
		return ''.join(string2)
print(output(input()))


s = input()
lowercnt = 0
for i in range(len(s)):
	if s[i].islower():
		lowercnt += 1
uppercnt = abs(lowercnt - len(s))
if lowercnt > uppercnt:
	print(s.lower())
elif uppercnt > lowercnt:
	print(s.upper())
else:
	print(s.lower())


import string
s = input()
up_couner = 0
low_counter = 0
for x in s:
	if x in string.ascii_lowercase:
		low_counter += 1
	if x in string.ascii_uppercase:
		up_couner += 1
if up_couner > low_counter:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
a = []
b = []
c = 0
for j in range(len(s)):
	c = ord(s[j])
	if c >= 65 and c <= 90:
		a.append(s[j])
	elif c >= 97 and c <= 122:
		b.append(s[j])
if len(a) > len(b):
	print(s.upper())
else:
	print(s.lower())


a = input()
b = 0
for x in a:
	if x.isupper():
		b += 1
if b > len(a) - b:
	print(a.upper())
else:
	print(a.lower())


s = input()
(lowerCase, upperCase) = (0, 0)
for i in s:
	if i.isupper():
		upperCase += 1
	else:
		lowerCase += 1
if upperCase > lowerCase:
	print(s.upper())
else:
	print(s.lower())


word = input()
wordLength = len(word)
count = 0
flag = 0
for i in range(wordLength):
	if word[i] >= 'A' and word[i] <= 'Z':
		count += 1
	if count > wordLength / 2:
		print(word.upper())
		flag = 1
		break
if flag == 0:
	print(word.lower())


word = input()
upper = 0
lower = 0
for char in word:
	if char.upper() == char:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(word.upper())
else:
	print(word.lower())


import re
inn = input()
upper_count = 0
lower_count = 0
for i in inn:
	x = re.search('[a-z]', i)
	if x:
		lower_count += 1
	else:
		upper_count += 1
if lower_count >= upper_count:
	print(inn.lower())
else:
	print(inn.upper())


s = str(input())
if sum(map(str.islower, s)) < sum(map(str.isupper, s)):
	print(s.upper())
else:
	print(s.lower())


def countUpper(word):
	return sum((1 for char in word if char.isupper()))

def countLower(word):
	return sum((1 for char in word if char.islower()))

def modifyWord(word, upper, lower):
	if upper > lower:
		word = word.upper()
	else:
		word = word.lower()
	return word
word = input()
upper = countUpper(word)
lower = countLower(word)
word = modifyWord(word, upper, lower)
print(word)


word = input()
uppercase = 0
lowercase = 0
for letra in word:
	if letra.upper() == letra:
		uppercase += 1
	else:
		lowercase += 1
if uppercase > lowercase:
	print(word.upper())
else:
	print(word.lower())


total_word = str(input())
word = list(total_word)
word.sort()
small_letter = 0
for letter in word:
	if letter > 'Z':
		small_letter += 1
if len(word) - small_letter > small_letter:
	print(total_word.upper())
else:
	print(total_word.lower())


a = input()
upper = 0
lower = 0
for x in a:
	if x.isupper():
		upper += 1
	elif x.islower():
		lower += 1
	else:
		pass
if upper > lower:
	a = a.upper()
else:
	a = a.lower()
print(a)


s = input()
upper = 0
for _ in s:
	if _.isupper():
		upper += 1
if upper * 2 == s.__len__():
	print(s.lower())
elif upper > s.__len__() - upper:
	print(s.upper())
else:
	print(s.lower())


x = input()
l = len(x)
count = 0
for i in range(l):
	if x[i] >= 'A' and x[i] <= 'Z':
		count = count + 1
if count > l // 2:
	print(x.upper())
else:
	print(x.lower())


text = str(input())
c = f = 0
for i in text:
	if i == i.upper():
		c += 1
	elif i == i.lower():
		f += 1
print(text.upper() if c > f else text.lower())


word = input()
u = 0
l = 0
for i in word:
	if i == i.upper():
		u += 1
	else:
		l += 1
if u > l:
	print(word.upper())
else:
	print(word.lower())


s = input()
n_l = sum([int(c.islower()) for c in s])
n_u = sum([int(c.isupper()) for c in s])
if n_l < n_u:
	print(s.upper())
elif n_l >= n_u:
	print(s.lower())


import sys
user_input = input()
lowercaseCount = 0
uppercaseCount = 0
uppercase = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}
for i in user_input:
	if i in uppercase:
		uppercaseCount += 1
	else:
		lowercaseCount += 1
if uppercaseCount > lowercaseCount:
	print(user_input.upper())
else:
	print(user_input.lower())


strr = str(input())
n = len(strr)
upper = 0
lower = 0
for i in strr:
	if 65 <= ord(i) <= 90:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(strr.upper())
else:
	print(strr.lower())


s = input()
(l, u) = (0, 0)
for c in s:
	if c == c.lower():
		l += 1
	else:
		u += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


s = input()
l = 'abcdefghijklmnopqrstuvwxyz'
L = l.upper()
(lc, Lc) = (0, 0)
for e in s:
	if e in l:
		lc += 1
	elif e in L:
		Lc += 1
if lc >= Lc:
	print(s.lower())
elif lc < Lc:
	print(s.upper())


s = input()
x = len([i for i in s if i.isupper() == True])
y = len([i for i in s if i.islower() == True])
if x > y:
	print(s.upper())
else:
	print(s.lower())


word = input()
(cntl, cntu) = (0, 0)
for i in word:
	if i.islower():
		cntl += 1
	else:
		cntu += 1
if cntl >= cntu:
	print(word.lower())
else:
	print(word.upper())


s = input()
a = 0
l = 0
for i in s:
	if 97 <= ord(i) <= 122:
		l += 1
	else:
		a += 1
if l < a:
	print(s.upper())
elif l == a:
	print(s.lower())
else:
	print(s.lower())


x = input()
c = []
cc = 0
ss = 0
for i in range(65, 91, 1):
	c.append(chr(i))
s = []
for i in range(97, 123, 1):
	s.append(chr(i))
for j in range(0, len(x)):
	for k in range(0, len(c)):
		if x[j] == c[k]:
			cc = cc + 1
for j in range(0, len(x)):
	for k in range(0, len(s)):
		if x[j] == s[k]:
			ss = ss + 1
if cc <= ss:
	print(x.lower())
elif cc > ss:
	print(x.upper())


s = input()
Index = 0
upper = 0
lower = 0
for i in range(len(s)):
	if s[i] == s[i].upper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(s.upper())
else:
	print(s.lower())


p = input()
l = 0
u = 0
for i in p:
	if i.isupper():
		u = u + 1
	if i.islower():
		l = l + 1
if l >= u:
	print(p.lower())
else:
	print(p.upper())


s = input()
low = 0
for i in s:
	if i in 'abcdefghijklmnopqrstuvwxyz':
		low += 1
if low >= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


s = input()
b = 0
b1 = 0
for i in range(len(s)):
	if ord(s[i]) < 96:
		b += 1
print([s.lower(), s.upper()][b > len(s) / 2])


lower = 0
upper = 0
inp = input()
for i in inp:
	if i.islower():
		lower += 1
	else:
		upper += 1
if lower < upper:
	print(''.join([i.upper() for i in inp]))
else:
	print(''.join([i.lower() for i in inp]))


a = input()
num = 0
i = 0
while i < len(a):
	if 'A' <= a[i] <= 'Z':
		num = num + 1
	i = i + 1
if num <= len(a) / 2:
	print(a.lower())
else:
	print(a.upper())


s = input()
countUpper = 0
countLower = 0
for i in s:
	if ord(i) >= 25 and ord(i) <= 90:
		countUpper += 1
	if ord(i) >= 97 and ord(i) <= 122:
		countLower += 1
if countUpper > countLower:
	s = s.upper()
else:
	s = s.lower()
print(s)


from collections import deque
import math
str1 = str(input())
(low, up) = (0, 0)
for i in range(len(str1)):
	if str1[i] == str1[i].lower():
		low += 1
	else:
		up += 1
if low >= up:
	print(str1.lower())
else:
	print(str1.upper())


s = input()
low = 0
high = 0
for i in s:
	if i.islower():
		low += 1
	else:
		high += 1
if low > high:
	print(s.lower())
elif high > low:
	print(s.upper())
else:
	print(s.lower())


string = input()
up = 0
low = 0
for word in string:
	if ord(word) >= 65 and ord(word) <= 90:
		up += 1
	else:
		low += 1
if up > low:
	print(string.upper())
else:
	print(string.lower())


a = input()
b = a.upper()
n = len(a)
x = []
for z in range(n):
	x.append(b[z])
c = 0
for i in range(n):
	if a[i] == x[i]:
		c += 1
if c > n // 2:
	a = a.upper()
	print(a)
else:
	a = a.lower()
	print(a)


l = input()
upper = lower = 0
for i in l:
	upper += i.isupper()
	lower += i.islower()
print(l.upper() if upper > lower else l.lower())


(x, y) = (0, 0)
stp = input()
for i in stp:
	if i.isupper():
		x += 1
	elif i.islower():
		y += 1
if x > y:
	print(stp.upper())
elif x < y:
	print(stp.lower())
elif x == y:
	print(stp.lower())


str = input()
l = list(str)
u = 0
lo = 0
for i in range(len(l)):
	if l[i].isupper():
		u += 1
	else:
		lo += 1
if u > lo:
	print(str.upper())
if u <= lo:
	print(str.lower())


s = str(input())
count = 0
r = 0
for i in range(0, len(s)):
	if s[i].isupper():
		count += 1
	else:
		r += 1
if count == r:
	print(s.lower())
elif count < r:
	print(s.lower())
else:
	print(s.upper())


s = [str(i) for i in input()]
(l, u) = (0, 0)
for i in s:
	if i.islower():
		l += 1
	if i.isupper():
		u += 1
if l >= u:
	print(''.join(s).lower())
else:
	print(''.join(s).upper())


word = input()
u = 0
l = 0
for let in word:
	if let.isupper():
		u += 1
	else:
		l += 1
if u > l:
	print(word.upper())
else:
	print(word.lower())


n1 = input()
n = list(n1)
u = 0
l = 0
for i in n:
	if i.isupper():
		u = u + 1
	if i.islower():
		l = l + 1
if u > l:
	print(n1.upper())
else:
	print(n1.lower())


w = input()
nbr = sum((1 for i in w if i.islower()))
print(w.lower()) if nbr >= len(w) / 2 else print(w.upper())


m = input()
mi = 0
ma = 0
for i in m:
	if i.islower():
		mi += 1
	else:
		ma += 1
if ma <= mi:
	print(m.lower())
else:
	print(m.upper())


s = input()
upper = 0
lower = 0
for c in s:
	if ord(c) < 96:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(s.upper())
else:
	print(s.lower())


n = input()
c = 0
c1 = 0
for i in n:
	if i.islower():
		c += 1
	elif i.isupper():
		c1 += 1
if c > c1:
	print(n.lower())
elif c1 > c:
	print(n.upper())
else:
	print(n.lower())


def main():
	w = input()
	scount = 0
	ccount = 0
	for i in w:
		if ord(i) >= ord('a') and ord(i) <= ord('z'):
			scount += 1
		if ord(i) >= ord('A') and ord(i) <= ord('Z'):
			ccount += 1
	print(w.upper()) if scount < ccount else print(w.lower())
	return 0
main()


s = input()
l = sum((1 for c in s if c.islower()))
u = len(s) - l
print(s.upper() if u > l else s.lower())


s = input()
(a, b) = (0, 0)
for ch in s:
	a += ch.isupper()
	b += ch.islower()
ans = s.lower() if b >= a else s.upper()
print(ans)


string = input()
upper = 0
lower = 0
for x in string:
	if x.isupper():
		upper += 1
	else:
		lower += 1
print(string.lower()) if lower >= upper else print(string.upper())


string = input()
upper_word = ''
lower_word = ''
upper_count = 0
lower_count = 0
for i in string:
	if i.isupper():
		upper_count += 1
		upper_word += i
		lower_word += i.lower()
	else:
		lower_count += 1
		upper_word += i.upper()
		lower_word += i
if lower_count >= upper_count:
	print(lower_word)
else:
	print(upper_word)


word = input()
small_letter = len(list(filter(lambda x: x == x.lower(), word)))
if small_letter >= len(word) - small_letter:
	print(word.lower())
else:
	print(word.upper())


msk = input()
msk = list(msk)
monusurya = list(map(lambda x: x in 'QWERTYUIOPLKJHGFDSAZXCVBNM', msk))
if monusurya.count(True) > monusurya.count(False):
	print(''.join(msk).upper())
else:
	print(''.join(msk).lower())


s = input()
print(s.upper() if sum([1 if ord(i) <= 90 else 0 for i in s]) > -len(s) // -2 else s.lower())


count = 0
upper = 0
raw = input()
word = list(raw)
for i in word:
	if i.islower():
		count = count + 1
upper = len(word) - count
if upper <= count:
	print(raw.lower())
else:
	print(raw.upper())


a = input()
cl = cu = 0
for i in a:
	if i.islower():
		cl += 1
	else:
		cu += 1
if cl >= cu:
	print(a.lower())
else:
	print(a.upper())


s = input()
small = 0
capital = 0
sign = 0
for letter in s:
	if ord(letter) < 97:
		sign -= 1
	else:
		sign += 1
if sign < 0:
	sign = -1
else:
	sign = 1
for letter in s:
	if sign == 1:
		if ord(letter) < 97:
			print(chr(ord(letter) + 32 * sign), end='')
		else:
			print(letter, end='')
	elif ord(letter) > 96:
		print(chr(ord(letter) + 32 * sign), end='')
	else:
		print(letter, end='')


s = input()
L = s.lower()
c = sum((a != b for (a, b) in zip(list(L), list(s))))
if c <= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


s = input()
countu = 0
countl = 0
for i in range(len(s)):
	if s[i].isupper():
		countu += 1
	else:
		countl += 1
if countu > countl:
	print(s.upper())
else:
	print(s.lower())


a = input()
u = [i for i in a if i.isupper()]
x = [i for i in a if i.islower()]
print(a.lower() if len(x) >= len(u) else a.upper())


inp = input()
l = 0
u = 0
lo = ''
up = ''
for i in inp:
	if i.islower():
		l += 1
		lo += i
		up += i.upper()
	else:
		u += 1
		lo += i.lower()
		up += i
if u > l:
	print(up)
else:
	print(lo)


def extension(string):
	upper = 0
	lower = 0
	for char in string:
		if char.isupper():
			upper += 1
		else:
			lower += 1
	if upper <= lower:
		print(string.lower())
	else:
		print(string.upper())
word = input()
extension(word)


s = input()
s1 = 0
c = 0
for i in range(len(s)):
	if s[i].isupper():
		c += 1
	else:
		s1 += 1
if s1 >= c:
	print(s.lower())
else:
	print(s.upper())


def main():
	word = input().strip()
	upper = lower = 0
	for char in word:
		if char >= 'a' and char <= 'z':
			lower += 1
		if char >= 'A' and char <= 'Z':
			upper += 1
	print(word.lower() if lower >= upper else word.upper())
main()


s = input()
noL = 0
for i in range(len(s)):
	if s[i].islower():
		noL += 1
noU = len(s) - noL
if noL >= noU:
	s = s.lower()
else:
	s = s.upper()
print(s)


s = input()
upper_count = 0
for char in s:
	if char.isupper():
		upper_count += 1
if upper_count > len(s) / 2:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
if sum(map(str.isupper, s)) > len(s) / 2.0:
	print(s.upper())
else:
	print(s.lower())


m = input()
lower = 0
upper = 0
for char in m:
	if char.islower():
		lower += 1
	else:
		upper += 1
if lower < upper:
	print(m.upper())
else:
	print(m.lower())


string = input()
upperCase = 0
lowerCase = 0
for ch in string:
	if ch.isupper():
		upperCase += 1
	else:
		lowerCase += 1
if upperCase > lowerCase:
	string = string.upper()
else:
	string = string.lower()
print(string)


def word(n):
	count_lower = 0
	count_upper = 0
	for i in n:
		if i.islower():
			count_lower += 1
		else:
			count_upper += 1
	if count_lower > count_upper:
		n = n.lower()
	elif count_lower < count_upper:
		n = n.upper()
	else:
		n = n.lower()
	print(n)
n = input()
word(n)


s = input()
u = 0
l = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		u = u + 1
	else:
		l = l + 1
if u > l:
	s1 = ''
	for i in s:
		if ord(i) >= 97 and ord(i) <= 122:
			s1 = s1 + chr(ord(i) - 32)
		else:
			s1 = s1 + i
elif l >= u:
	s1 = ''
	for i in s:
		if ord(i) >= 65 and ord(i) <= 90:
			s1 = s1 + chr(ord(i) + 32)
		else:
			s1 = s1 + i
print(s1)


s = input()
L = 0
U = 0
for c in s:
	if c.isupper():
		U += 1
	else:
		L += 1
if U > L:
	print(s.upper())
elif L >= U:
	print(s.lower())


n = input()
l = 0
u = 0
for i in n:
	if i.islower():
		l += 1
	else:
		u += 1
if l == u or l > u:
	print(n.lower())
else:
	print(n.upper())


from string import ascii_lowercase, ascii_uppercase
word = input()
lowerletters = list(ascii_lowercase)
upperletters = list(ascii_uppercase)
lowercase = 0
uppercase = 0
for char in word:
	if char in lowerletters:
		lowercase += 1
	elif char in upperletters:
		uppercase += 1
if uppercase > lowercase:
	print(word.upper())
else:
	print(word.lower())


s = input()
o = ''
l = 0
u = 0
for a in s:
	if a.isupper() == True:
		u += 1
	elif a.islower() == True:
		l += 1
if u == l or l > u:
	o += s.lower()
	print(o)
elif u != l:
	o += s.upper()
	print(o)


import string
lower = string.ascii_lowercase
upper = string.ascii_uppercase
l = 0
u = 0
word = input()
for i in word:
	if i not in lower:
		u += 1
	elif i not in upper:
		l += 1
if u <= l:
	print(word.lower())
else:
	print(word.upper())


s = input()
list_s = list(s)
u = 0
lo = 0
for i in list_s:
	if i.islower():
		lo += 1
	else:
		u += 1
if lo >= u:
	s = s.lower()
else:
	s = s.upper()
print(s)


s = input()
n = len(s)
a = s.lower()
b = s.upper()
x = 0
for i in range(n):
	if s[i] == a[i]:
		x += 1
if 2 * x >= n:
	print(a)
else:
	print(b)


ss = input()
s = list(ss)
askii = []
cntl = 0
cntu = 0
for i in range(len(s)):
	askii.append(ord(s[i]))
	if 90 >= askii[i] >= 65:
		cntl += 1
	else:
		cntu += 1
if cntl <= cntu:
	ans = ss.lower()
else:
	ans = ss.upper()
print(ans)


s = input()
x = 0
y = 0
for e in s:
	if e == e.lower():
		x += 1
	if e == e.upper():
		y += 1
if x < y:
	print(s.upper())
else:
	print(s.lower())


word = input()
up = 0
low = 0
for i in word:
	if i.isupper() == True:
		up = up + 1
	else:
		low = low + 1
if up > low:
	word = word.upper()
else:
	word = word.lower()
print(word)


inp = input()
cnt = 0
for i in inp:
	if 'a' <= i <= 'z':
		cnt += 1
if cnt >= len(inp) - cnt:
	print(inp.lower())
else:
	print(inp.upper())


h = input()
upp = 0
low = 0
for i in h:
	if i.isupper() == True:
		upp += 1
	else:
		low += 1
if upp > low:
	print(h.upper())
else:
	print(h.lower())


word = input()
(u, l) = (0, 0)
for i in range(0, len(word)):
	if word[i].islower():
		l += 1
	elif word[i].isupper():
		u += 1
if u > l:
	print(word.upper())
else:
	print(word.lower())


string = input()
upper = 0
lower = 0
for char in string:
	if char.isupper():
		upper += 1
	if char.islower():
		lower += 1
if upper > lower:
	print(string.upper())
else:
	print(string.lower())


string = input()
(lower, upper) = (0, 0)
for x in string:
	if ord(x) >= 97 and ord(x) <= 122:
		lower += 1
	elif ord(x) >= 65 and ord(x) <= 90:
		upper += 1
if lower >= upper:
	string = string.lower()
else:
	string = string.upper()
print(string)


def gogo(s):
	lc = 0
	uc = 0
	for i in s:
		if i.isupper():
			uc += 1
		else:
			lc += 1
	return s.upper() if uc > lc else s.lower()
s = input()
print(gogo(s))


x = input()
a = []
b = []
for i in list(x):
	if ord(i) > 90:
		a.append(i)
	else:
		b.append(i)
if len(b) > len(x) / 2:
	print(x.upper())
else:
	print(x.lower())


def main(word):
	num_upper = 0
	num_lower = 0
	for letter in word:
		if ord(letter) in range(97, 123):
			num_lower += 1
		elif ord(letter) in range(65, 91):
			num_upper += 1
	if num_lower >= num_upper:
		return word.lower()
	return word.upper()
word = input().strip()
print(main(word))


a = str(input())
(up, low) = (0, 0)
for i in a:
	if i.isupper() == True:
		up += 1
	else:
		low += 1
if up == low or low > up:
	print(a.lower())
else:
	print(a.upper())


w = input()
wl = list(w)
u = 0
l = 0
for letter in wl:
	if letter.isupper():
		u += 1
	elif letter.islower():
		l += 1
if u > l:
	print(w.upper())
else:
	print(w.lower())


s = input()
l = 0
for i in range(len(s)):
	if ord(s[i]) < 123 and ord(s[i]) > 96:
		l += 1
	else:
		l -= 1
if l < 0:
	print(s.upper())
else:
	print(s.lower())


word = input()
uppercase = 0
for i in range(len(word)):
	if word[i] == word[i].upper():
		uppercase += 1
if uppercase > len(word) / 2:
	print(word.upper())
else:
	print(word.lower())


x = input()
i = 0
l = 0
u = 0
while i < len(x):
	if x[i].islower():
		l += 1
	elif x[i].isupper():
		u += 1
	i += 1
if u > l:
	print(x.upper())
else:
	print(x.lower())


username = input()
lowers = 0
n = len(username)
for char in username:
	if char.islower():
		lowers += 1
uppers = n - lowers
if uppers > lowers:
	print(username.upper())
else:
	print(username.lower())


s = input()
count = 0
for value in s:
	if 'A' <= value <= 'Z':
		count += 1
if count <= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


S = input()
S1 = [x for x in S if x >= 'A' and x <= 'Z']
S2 = [x for x in S if x >= 'a' and x <= 'z']
if len(S1) <= len(S2):
	S = S.lower()
else:
	S = S.upper()
print(S)


woord = input()
upper = 0
for i in woord:
	if i.isupper():
		upper += 1
if upper > len(woord) / 2:
	print(woord.upper())
else:
	print(woord.lower())


x = input()
y = x.lower()
n = len(x)
m = 0
for i in range(n):
	if x[i] == y[i]:
		m += 1
	else:
		m = m
if m * 2 >= n:
	print(y)
else:
	z = x.upper()
	print(z)


word = input()
big = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
BIG = 0
SMALL = 0
for i in word:
	if i in big:
		BIG += 1
	else:
		SMALL += 1
if SMALL == BIG:
	print(word.lower())
elif SMALL > BIG:
	print(word.lower())
else:
	print(word.upper())


s = input()
sol = [s.lower(), s.upper()][sum((x < '[' for x in s)) * 2 > len(s)]
print(sol)


n = input()
c = 0
v = 0
for i in n:
	if i is i.upper():
		c = c + 1
	else:
		v = v + 1
if c > v:
	print(n.upper())
else:
	print(n.lower())


a = input()
m = 0
n = 0
k = 0
num = len(a)
for i in range(len(a)):
	cap = a[k].upper()
	if a[k] == cap:
		m += 1
		k += 1
	else:
		n += 1
		k += 1
if m > n:
	print(a.upper())
else:
	print(a.lower())


word = input()
mass = []
mass_2 = []
for i in word:
	if i.isupper():
		mass.append(1)
	else:
		mass_2.append(0)
if len(mass) > len(mass_2):
	word = word.upper()
else:
	word = word.lower()
print(word)


n = input()
s = sum((1 for i in n if i == i.upper()))
print(n.lower() if len(n) / 2 >= s else n.upper())


def to_lower(string):
	lst = [x for x in string]
	for char in range(len(lst)):
		if ord(lst[char]) < ord('a'):
			lst[char] = chr(ord(lst[char]) + 32)
	return ''.join(lst)

def to_upper(string):
	lst = [x for x in string]
	for char in range(len(lst)):
		if ord(lst[char]) >= ord('a'):
			lst[char] = chr(ord(lst[char]) - 32)
	return ''.join(lst)

def checker(word):
	tally = 0
	for char in word:
		if ord(char) < ord('a'):
			tally += 1
		else:
			tally -= 1
	if tally <= 0:
		return 0
	else:
		return 1

def main():
	word = input()
	chk = checker(word)
	if chk:
		print(to_upper(word))
	else:
		print(to_lower(word))
main()


s = input()
n = len(s)
c = 0
for i in range(n):
	if s[i].isupper():
		c += 1
if c > n // 2:
	print(s.upper())
else:
	print(s.lower())


s = input()
lo = len([i for i in s if i.islower()])
upper = abs(len(s) - lo)
if lo == upper or lo > upper:
	print(s.lower())
else:
	print(s.upper())


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
s = input()
(u, c) = (0, 0)
for i in s:
	if i.isupper():
		u += 1
	else:
		c += 1
if u > c:
	print(s.upper())
else:
	print(s.lower())


s = input()
iss = 0
no = 0
for i in range(0, len(s)):
	if s[i].isupper():
		iss += 1
	else:
		no += 1
if iss > no:
	print(s.upper())
else:
	print(s.lower())


n = input()
u = l = ''
uppercase = lowercase = 0
for i in range(len(n)):
	r = w = n[i]
	if 65 <= ord(n[i]) <= 90:
		uppercase = uppercase + 1
		r = chr(ord(n[i]) + 32)
	else:
		lowercase = lowercase + 1
		w = chr(ord(n[i]) - 32)
	l = l + r
	u = u + w
if lowercase >= uppercase:
	print(l)
else:
	print(u)


word = input().strip()
upper_count = 0
lower_count = 0
for i in word:
	if i.isupper():
		upper_count += 1
	else:
		lower_count += 1
if upper_count > lower_count:
	print(word.upper())
else:
	print(word.lower())


k = input()
x = 0
y = 0
for i in k:
	if i.isupper():
		x += 1
	else:
		y += 1
if x > y:
	print(k.upper())
if x <= y:
	print(k.lower())


a = input()
s = sum((ch.islower() for ch in a))
print(a.lower() if s >= len(a) - s else a.upper())


s = input()
upper = 0
lower = 0
index = 0
while index < len(s):
	if s[index].islower():
		lower += 1
	elif s[index].isupper():
		upper += 1
	index += 1
if upper > lower:
	print(s.upper())
elif upper <= lower:
	print(s.lower())


s = input()
lower_count = 0
upper_count = 0
for character in s:
	if character.islower():
		lower_count = lower_count + 1
	else:
		upper_count = upper_count + 1
if upper_count == lower_count or lower_count > upper_count:
	print(s.lower())
else:
	print(s.upper())


x = input()
word = list(x)
up = 0
low = 0
for i in word:
	if i.isupper():
		up = up + 1
	if i.islower():
		low = low + 1
if up <= low:
	print(x.lower())
else:
	print(x.upper())


s = input()
l = list(s)
up = 0
low = 0
for i in range(len(s)):
	if s[i].isupper():
		up = up + 1
	else:
		low = low + 1
print([s.upper(), s.lower()][low >= up])


s = input()
l = list(s)
x1 = 0
x2 = 0
for i in range(len(l)):
	if l[i].isupper() == True:
		x1 = x1 + 1
	else:
		x2 = x2 + 1
if x1 <= x2:
	s = s.lower()
else:
	s = s.upper()
print(s)


a = input()
uc = 0
lc = 0
for i in a:
	if ord(i) >= 65 and ord(i) <= 91:
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(a.upper())
else:
	print(a.lower())


original = input()
haha = list(original)
upper = 0
lower = 0
for i in haha:
	if i.isupper():
		upper += 1
	else:
		lower += 1
if upper == lower or lower > upper:
	print(original.lower())
else:
	print(original.upper())


word = input()
captitals = sum((1 for c in word if c.isupper()))
if captitals > len(word) / 2:
	word = word.upper()
else:
	word = word.lower()
print(word)


A = input()
f = 0
l = 0
u = 0
for x in A:
	if x.islower():
		l += 1
	else:
		u += 1
if l > u:
	f = 1
elif l == u:
	f = 1
else:
	f = -1
text = ''
for x in A:
	if f == 1:
		text += x.lower()
	else:
		text += x.upper()
print(text)


s = input()
lo = 0
up = 0
for i in range(len(s)):
	if s[i].isupper():
		up += 1
	if s[i].islower():
		lo += 1
if lo >= up:
	print(s.lower())
elif lo < up:
	print(s.upper())


entrada = input()
menores = 0
mayores = 0
for x in entrada:
	if x.lower() == x:
		menores += 1
	else:
		mayores += 1
if mayores <= menores:
	print(entrada.lower())
else:
	print(entrada.upper())


s = input()
cap = small = 0
for ch in s:
	if ord('A') <= ord(ch) <= ord('Z'):
		cap += 1
	else:
		small += 1
print(s.upper()) if small < cap else print(s.lower())


def change_case(word, lower_count, upper_count):
	if upper_count > lower_count:
		word = word.upper()
	else:
		word = word.lower()
	return word

def count_cases(word):
	upper_cases = 0
	lower_cases = 0
	for letter in word:
		if letter.isupper():
			upper_cases += 1
		else:
			lower_cases += 1
	return (lower_cases, upper_cases)

def main():
	word = input()
	(lower_count, upper_count) = count_cases(word)
	new_word = change_case(word, lower_count, upper_count)
	print(new_word)
main()


import re
a = input()
print([a.lower(), a.upper()][len(re.findall('[A-Z]', a)) > len(a) / 2])


n = input()
count1 = 0
count2 = 0
for i in n:
	if i.islower():
		count1 += 1
	if i.isupper():
		count2 += 1
if count1 < count2:
	print(n.upper())
elif count1 >= count2:
	print(n.lower())


s = input()
up = 0
lw = 0
for i in s:
	if i.isupper():
		up += 1
	elif i.islower():
		lw += 1
if up <= lw:
	print(s.lower())
elif up > lw:
	print(s.upper())


strn = input()
countCapital = 0
countLower = 0
for i in strn:
	if ord(i) in range(65, 91):
		countCapital = countCapital + 1
	else:
		countLower = countLower + 1
if countLower < countCapital:
	print(strn.upper())
else:
	print(strn.lower())


n = input()
u = n.upper()
l = n.lower()
(cu, cl) = (0, 0)
for i in range(len(n)):
	if n[i] == u[i]:
		cu += 1
	else:
		cl += 1
if cl >= cu:
	print(l)
else:
	print(u)


string = str(input())
maiusculas = 0
minusculas = 0
for letra in string:
	if letra == letra.upper():
		maiusculas += 1
	elif letra == letra.lower():
		minusculas += 1
if maiusculas > minusculas:
	print(string.upper())
else:
	print(string.lower())


inp = input()
inpList = list(inp)
lowerCase = []
upperCase = []
for i in range(len(inpList)):
	if inpList[i].islower():
		lowerCase.append(inpList[i])
	elif inpList[i].isupper():
		upperCase.append(inpList[i])
if len(lowerCase) >= len(upperCase):
	print(inp.lower())
elif len(lowerCase) < len(upperCase):
	print(inp.upper())


line = input()
l_count = 0
u_count = 0
for i in line:
	if i.isupper():
		u_count += 1
	else:
		l_count += 1
if u_count > l_count:
	print(line.upper())
else:
	print(line.lower())


s = input()
lower = 0
upper = 0
if s.lower() == 'house':
	print(s.lower())
elif s.lower() == 'vip':
	print(s.upper())
else:
	for i in range(len(s)):
		if s[i].islower():
			lower = lower + 1
		else:
			upper = upper + 1
	if lower >= upper:
		print(s.lower())
	else:
		print(s.upper())


def solve():
	s = input()
	l = u = 0
	for i in range(len(s)):
		if s[i].islower():
			l += 1
		else:
			u += 1
	if u > l:
		print(s.upper())
	else:
		print(s.lower())
solve()


def countCase(string):
	upperCase = 0
	lowerCase = 0
	for c in string:
		if c.isupper():
			upperCase += 1
		else:
			lowerCase += 1
	return [upperCase, lowerCase]

def transform(string, cases):
	if cases[0] > cases[1]:
		return string.upper()
	elif cases[0] < cases[1]:
		return string.lower()
	elif cases[0] == cases[1]:
		return string.lower()
string = input()
print(transform(str(string), countCase(str(string))))


d = 0
e = 0
s = str(input())
for i in range(0, len(s)):
	if s[i].islower():
		d = d + 1
	else:
		e = e + 1
if d > e:
	s = s.lower()
elif d < e:
	s = s.upper()
else:
	s = s.lower()
print(s)


j = input()
c_lower = 0
c_upper = 0
new = ''
new = j
res = ''
for i in new:
	if i.islower():
		c_lower = c_lower + 1
	elif i.isupper():
		c_upper = c_upper + 1
if c_lower >= c_upper:
	res = new.lower()
elif c_lower < c_upper:
	res = new.upper()
print(res)


s = input()
cu = 0
cl = 0
l = len(s)
for i in range(l):
	if ord(s[i]) <= 90:
		cu += 1
	else:
		cl += 1
b = ''
if cu > cl:
	for i in range(l):
		if ord(s[i]) > 90:
			b = b + chr(ord(s[i]) - 32)
		else:
			b = b + s[i:i + 1]
else:
	for i in range(l):
		if ord(s[i]) < 97:
			b = b + chr(ord(s[i]) + 32)
		else:
			b = b + s[i:i + 1]
print(b)


word = input()
upper = 0
lower = 0
for e in word:
	if e.isupper() == True:
		upper += 1
	if e.islower() == True:
		lower += 1
if upper > lower:
	print(word.upper())
else:
	print(word.lower())


w = input()
l = len(w)
s = w.count('a') + w.count('b') + w.count('c') + w.count('d') + w.count('e') + w.count('f') + w.count('g') + w.count('h') + w.count('i') + w.count('j') + w.count('k') + w.count('l') + w.count('m') + w.count('n') + w.count('o') + w.count('p') + w.count('q') + w.count('r') + w.count('s') + w.count('t') + w.count('u') + w.count('v') + w.count('w') + w.count('x') + w.count('y') + w.count('z')
if 2 * s >= len(w):
	print(w.lower())
else:
	print(w.upper())


k = str(input())
a = list(k)
countu = 0
countl = 0
for i in range(len(a)):
	if a[i].isupper():
		countu += 1
	elif a[i].islower():
		countl += 1
if countu > countl:
	print(k.upper())
else:
	print(k.lower())


t = input()
b = 0
k = 0
for i in range(0, len(t)):
	if t[i].isupper():
		b += 1
	else:
		k += 1
if b > k:
	print(t.upper())
else:
	print(t.lower())


str = input()
c = 0
s = 0
for i in range(len(str)):
	if ord(str[i]) > 96:
		s += 1
	elif ord(str[i]) < 96:
		c += 1
if c > s:
	str = str.upper()
else:
	str = str.lower()
print(str)


s = input()
b = 0
q = 0
for i in s:
	if 'a' <= i <= 'z':
		q = q + 1
	elif 'A' <= i <= 'Z':
		b = b + 1
if b > q:
	print(s.upper())
elif b <= q:
	print(s.lower())


a = str(input())
b = a.upper()
x = 0
y = 0
for i in range(len(a)):
	if a[i] != b[i]:
		x += 1
	else:
		y += 1
if x >= y:
	print(a.lower())
else:
	print(b)


a = input('')
count = 0
mount = 0
for i in range(len(a)):
	if a[i].isupper() == True:
		count += 1
	else:
		mount += 1
if count > mount:
	print(a.upper())
elif count < mount:
	print(a.lower())
else:
	print(a.lower())


k = input()
n = list(k)
(lowerct, upperct) = (0, 0)
for i in range(len(n)):
	if n[i].islower():
		lowerct += 1
	else:
		upperct += 1
if lowerct > upperct:
	print(k.lower())
elif lowerct < upperct:
	print(k.upper())
else:
	print(k.lower())


ch = input()
min = 0
maj = 0
for i in ch:
	if i.lower() == i:
		min = min + 1
	else:
		maj = maj + 1
if min < maj:
	print(ch.upper())
else:
	print(ch.lower())


inp = input()
uppercase_letters = 0
lowercase_letters = 0
l1 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
l2 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for word in inp:
	if word in l1:
		uppercase_letters += 1
	else:
		lowercase_letters += 1
if uppercase_letters > lowercase_letters:
	inp = inp.upper()
else:
	inp = inp.lower()
print(inp)


l = input()
up = sum((n.isupper() for n in l))
low = sum((n.islower() for n in l))
if up > low:
	print(l.upper())
else:
	print(l.lower())


s = input()
c = 0
c1 = 0
for i in range(len(s)):
	if s[i].islower():
		c += 1
	else:
		c1 += 1
if c >= c1:
	print(s.lower())
elif c < c1:
	print(s.upper())


world = input()
upper_sum = 0
lower_sum = 0
for i in range(len(world)):
	if world[i] in 'QWERTYUIOPASDFGHJKLZXCVBNM':
		upper_sum += 1
	else:
		lower_sum += 1
print(world.lower() if lower_sum >= upper_sum else world.upper())


s = input()
n = len(s)
cu = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		cu += 1
cl = n - cu
if cu > cl:
	print(s.upper())
else:
	print(s.lower())


s = list(input())
s2 = []
s3 = []
(kb, km) = (0, 0)
for i in range(len(s)):
	if ord('A') <= ord(s[i]) <= ord('Z'):
		s2.append(chr(ord(s[i]) + 32))
		s3.append(s[i])
		kb += 1
	else:
		s3.append(chr(ord(s[i]) - 32))
		s2.append(s[i])
		km += 1
if km >= kb:
	print(''.join(s2))
else:
	print(''.join(s3))


name = input()
upper_count = 0
for letter in name:
	if letter.isupper():
		upper_count += 1
	else:
		upper_count -= 1
if upper_count > 0:
	print(name.upper())
else:
	print(name.lower())


s = input()
lo = 0
up = 0
for i in s:
	if ord(i) > 96:
		lo += 1
	else:
		up += 1
if up > lo:
	print(s.upper())
else:
	print(s.lower())


a = input()
b = 'qwertyuiopasdfghjklzxcvbnm'
c = 'QWERTYUIOPASDFGHJKLZXCVBNM'
b1 = 0
c1 = 0
a1 = ''
a2 = ''
for i in range(len(a)):
	if a[i] in b:
		b1 += 1
		a2 += c[b.find(a[i])]
		a1 += a[i]
	else:
		c1 += 1
		a1 += b[c.find(a[i])]
		a2 += a[i]
if b1 >= c1:
	print(a1)
else:
	print(a2)


s = input()
ls = s.lower()
us = s.upper()
i = 0
cont = 0
while i < len(s):
	if s[i] != ls[i]:
		cont += 1
	i += 1
if cont > len(s) / 2:
	print(us)
else:
	print(ls)


s = str(input())
flag = 0
small = 0
big = 0
f = 0
s1 = ''
for i in range(0, len(s), 1):
	f = ord(s[i])
	if f >= 65 and f <= 90:
		big += 1
	else:
		small += 1
if small >= big:
	print(s.lower())
else:
	print(s.upper())


string = input()
no_of_upper = sum((1 for c in string if c.isupper()))
if no_of_upper > len(string) - no_of_upper:
	string = string.upper()
else:
	string = string.lower()
print(string)


s = input()
lo = 0
for i in range(len(s)):
	if s[i] >= 'a':
		lo = lo + 1
hi = len(s) - lo
if hi > lo:
	print(s.upper())
else:
	print(s.lower())


a = str(input())
caps = 0
small = 0
for i in range(len(a)):
	if 64 < ord(a[i]) and ord(a[i]) < 91:
		caps += 1
	else:
		small += 1
if small < caps:
	print(a.upper())
else:
	print(a.lower())


first_input = input()
no_of_times = len(first_input)
characters = list(first_input)
x = 0
upper = 0
lower = 0
for n in range(no_of_times):
	if characters[x].isupper():
		upper = upper + 1
	else:
		lower = lower + 1
	x = x + 1
if upper > lower:
	print(first_input.upper())
else:
	print(first_input.lower())


s = input()
s_length = len(s)
up_count = low_count = 0
for i in range(s_length):
	if s[i].isupper():
		up_count += 1
	else:
		low_count += 1
if low_count >= up_count:
	print(s.lower())
else:
	print(s.upper())


palavra = input()
tam = len(palavra)
eq = tam / 2
mai = palavra.upper()
minu = palavra.lower()
contmai = 0
contmin = 0
for x in range(tam):
	if palavra[x] == mai[x]:
		contmai += 1
	elif palavra[x] == minu[x]:
		contmin += 1
if contmai > contmin:
	print(mai)
else:
	print(minu)


n = input()
uc = 0
lc = 0
for c in n:
	if c >= 'A' and c <= 'Z':
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(n.upper())
else:
	print(n.lower())


x = input()
countCapital = 0
countSmall = 0
for z in x:
	if z.isupper():
		countCapital += 1
	else:
		countSmall += 1
if countCapital > countSmall:
	result = x.upper()
else:
	result = x.lower()
print(result)


n = input()
l = [ord(x) for x in n]
(c, c1) = (0, 0)
for x in l:
	if x < 96:
		c += 1
	else:
		c1 += 1
if c > c1:
	for i in range(len(l)):
		if l[i] > 96:
			l[i] -= 32
else:
	for i in range(len(l)):
		if l[i] < 96:
			l[i] += 32
for i in l:
	print(chr(i), end='')


n = input()
contM = 0
contMin = 0
for letra in n:
	if letra.isupper():
		contM += 1
	else:
		contMin += 1
if contM == contMin:
	print(n.lower())
elif contMin > contM:
	print(n.lower())
else:
	print(n.upper())


import string
s = input()
lo = []
up = []
for x in s:
	if x in string.ascii_uppercase:
		up.append(x)
	else:
		lo.append(x)
if len(up) > len(lo):
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input('')
x = 0
y = 0
for i in s:
	if i.isupper() == True:
		x = x + 1
	else:
		y = y + 1
if x > y:
	for i in s:
		if i.islower() == True:
			i = i.upper()
		print(i, end='')
else:
	for i in s:
		if i.isupper() == True:
			i = i.lower()
		print(i, end='')


message = input()
x = 0
y = 0
for c in message:
	if c.isupper():
		x = x + 1
	else:
		y = y + 1
if x > y:
	print(message.upper())
else:
	print(message.lower())


word = input()
c1 = 0
c2 = 0
for i in range(len(word)):
	if word[i].isupper() == True:
		c1 += 1
	else:
		c2 += 1
if c2 >= c1:
	print(word.lower())
else:
	print(word.upper())


s = input()
sl = s.lower()
su = s.upper()
countu = 0
countl = 0
for i in range(len(s)):
	if s[i] == su[i]:
		countu += 1
	else:
		countl += 1
if countu > countl:
	print(su)
else:
	print(sl)


a = input()
(u, l) = (0, 0)
for i in a:
	if i.isupper():
		u = u + 1
	if i.islower():
		l = l + 1
if u > l:
	print(a.upper())
if l > u:
	print(a.lower())
if l == u:
	print(a.lower())


s = input()
low = 0
upp = 0
for i in range(len(s)):
	if s[i].islower():
		low += 1
	else:
		upp += 1
if upp > low:
	print(s.upper())
else:
	print(s.lower())


word = input()
L = list(word)

def count(L):
	(ucount, lcount) = (0, 0)
	for i in L:
		if i.isupper():
			ucount += 1
		else:
			lcount += 1
	return lcount >= ucount
if count(L):
	print(word.lower())
else:
	print(word.upper())


word = input()
lowerCount = 0
upperCount = 0
for letter in [w for w in word]:
	if letter.lower() == letter:
		lowerCount += 1
	else:
		upperCount += 1
if lowerCount >= upperCount:
	print(word.lower())
else:
	print(word.upper())


word = input()
lower_count = sum(map(str.islower, word))
len_word = len(word)
if lower_count >= len_word / 2:
	print(word.lower())
else:
	print(word.upper())


import re
string = input()
big_letters = len(re.findall('[A-Z]', string))
w = len(string)
small_letters = w - big_letters
if big_letters > small_letters:
	print(string.upper())
elif small_letters > big_letters:
	print(string.lower())
elif big_letters == small_letters:
	print(string.lower())


upper = 0
lower = 0
s = input()
res = ''
for i in range(0, len(s)):
	if s[i] >= 'a':
		lower = lower + 1
	else:
		upper = upper + 1
if upper > lower:
	res = s.upper()
else:
	res = s.lower()
print(res)


f = input()
count = 0
count2 = 0
for i in f:
	if i.isupper():
		count += 1
	else:
		count2 += 1
if count > count2:
	print(f.upper())
elif count < count2:
	print(f.lower())
elif count == count2:
	print(f.lower())


word = input()
lower = 0
upper = 0
for ch in word:
	if 97 <= ord(ch) <= 122:
		lower += 1
	else:
		upper += 1
if upper > lower:
	print(word.upper())
else:
	print(word.lower())


n = input()
ce = 0
co = 0
for i in n:
	k = ord(i)
	if k >= 65 and k <= 90:
		ce += 1
	else:
		co += 1
if ce > co:
	print(n.upper())
elif co > ce:
	print(n.lower())
else:
	print(n.lower())


s = input('')
c = 0
d = 0
for j in s:
	if ord(j) >= 65 and ord(j) <= 90:
		c += 1
	else:
		d += 1
if c > d:
	print(s.upper())
else:
	print(s.lower())


s = input()
t = list(s)
c = 0
p = 0
for i in t:
	if i.isupper():
		c = c + 1
	else:
		p = p + 1
if c > p:
	print(s.upper())
else:
	print(s.lower())


import re
s = str(input())
print(s.lower() if len(tuple(re.finditer('[a-z]', s))) >= len(tuple(re.finditer('[A-Z]', s))) else s.upper())


s = input()
upp = [sum((1 for c in s if c.isupper()))]
low = [sum((1 for d in s if d.islower()))]
if upp > low:
	print(s.upper())
elif low > upp or low == upp:
	print(s.lower())


word = input()
count = 0
for i in word:
	if i.isupper():
		count += 1
if count > len(word) // 2:
	print(word.upper())
else:
	print(word.lower())


def change(word):
	uppers = 0
	lowers = 0
	for letter in word:
		if letter.isupper():
			uppers = uppers + 1
		else:
			lowers = lowers + 1
	if uppers > lowers:
		word = word.upper()
	else:
		word = word.lower()
	return word
print(change(input()))


n = input()
cnt = 0
cnt1 = 0
for i in n:
	if i.islower():
		cnt += 1
	else:
		cnt1 += 1
if cnt >= cnt1:
	print(n.lower())
else:
	print(n.upper())


word = input()
yes = no = 0
x = len(word)
if x <= 100:
	for i in range(x):
		if word[i].isupper() is True:
			yes = yes + 1
		else:
			no = no + 1
if yes == no:
	print(word.lower())
elif yes > no:
	print(word.upper())
elif yes < no:
	print(word.lower())


s = str(input())

def calc(s):
	upper_s = 0
	lower_s = 0
	for i in range(len(s)):
		if s[i].isupper() == True:
			upper_s += 1
		else:
			lower_s += 1
	if upper_s > lower_s:
		print(s.upper())
	else:
		print(s.lower())
calc(s)


s = input()
cntl = 0
cntc = 0
for i in range(0, len(s)):
	if s[i].islower():
		cntl += 1
	else:
		cntc += 1
if cntl >= cntc:
	print(s.lower())
else:
	print(s.upper())


s = input()
l = list(s)
u = 0
lo = 0
for i in l:
	if ord(i) <= 91:
		u += 1
	else:
		lo += 1
if u > lo:
	print(s.upper())
else:
	print(s.lower())


word = input()
(u, l) = (0, 0)
low = ord('a') - 1
for char in word:
	if ord(char) > low:
		l += 1
	else:
		u += 1
print(word.lower() if l >= u else word.upper())


str = input()
ok = 0
for i in str:
	if ord(i) <= 90:
		ok += 1
	else:
		ok -= 1
if ok > 0:
	str = str.upper()
else:
	str = str.lower()
print(str)


str = input()
upNumber = 0
downNumber = 0
newList = []
for letter in str:
	if letter >= 'A' and letter <= 'Z':
		upNumber += 1
	else:
		downNumber += 1
if upNumber > downNumber:
	for letter in str:
		if letter >= 'a' and letter <= 'z':
			letter = letter.upper()
		newList.append(letter)
else:
	for letter in str:
		if letter >= 'A' and letter <= 'Z':
			letter = letter.lower()
		newList.append(letter)
str1 = ''.join(newList)
print(str1)


import string
m = input()
s = list(string.ascii_lowercase)
c = list(string.ascii_uppercase)
a = 0
b = 0
for i in range(len(m)):
	if m[i] in s:
		a = a + 1
	elif m[i] in c:
		b = b + 1
if a == b:
	print(m.lower())
elif a < b:
	print(m.upper())
elif a > b:
	print(m.lower())


a = str(input())
p = 0
o = 0
for i in a:
	if i == i.lower():
		p += 1
	else:
		o += 1
if o <= p:
	print(a.lower())
else:
	print(a.upper())


n = input()
count = 0
c2 = 0
for i in n:
	if i.upper() == i:
		count = count + 1
c2 = len(n) - count
if count > c2:
	print(n.upper())
else:
	print(n.lower())


s = input()
l = 0
u = 0
for i in s:
	if i.islower():
		l += 1
	elif i.isupper():
		u += 1
if l > u:
	u = s.lower()
	print(u)
elif l == u:
	v = s.lower()
	print(v)
else:
	x = s.upper()
	print(x)


word_string = input()
upper = 0
for letter in word_string:
	if letter == letter.lower():
		upper -= 1
	else:
		upper += 1
if upper <= 0:
	print(word_string.lower())
else:
	print(word_string.upper())


s = input()
a = s.lower()
b = s.upper()
(cnt1, cnt2) = (0, 0)
for i in range(len(s)):
	if s[i] != a[i]:
		cnt1 -= -1
	if s[i] != b[i]:
		cnt2 -= -1
if cnt1 > cnt2:
	print(b)
else:
	print(a)


word = str(input())
countu = 0
countl = 0
for i in range(len(word)):
	if word[i].isupper():
		countu += 1
	else:
		countl += 1
if countu > countl:
	word = word.upper()
else:
	word = word.lower()
print(word)


n = input()
l = []
s = 0
m = ''
for i in n:
	if i == i.lower():
		s += 1
	l.append(i)
if s >= len(n) - s:
	for i in range(len(l)):
		l[i] = l[i].lower()
else:
	for i in range(len(l)):
		l[i] = l[i].upper()
for i in l:
	m += i
print(m)


a = input()
liczniku = 0
licznikl = 0
for i in range(len(a)):
	if a[i].isupper():
		liczniku = liczniku + 1
	if a[i].islower():
		licznikl = licznikl + 1
if liczniku > licznikl:
	a = a.upper()
if liczniku < licznikl or liczniku == licznikl:
	a = a.lower()
print(a)


n = input()
uc = 0
lc = 0
for i in n:
	if i.isupper():
		uc = uc + 1
	else:
		lc = lc + 1
if uc > len(n) / 2:
	print(n.upper())
else:
	print(n.lower())


s = str(input())
upper_cnt = 0
for x in s:
	if x.isupper():
		upper_cnt += 1
val = len(s) // 2
if val < upper_cnt:
	print(s.upper())
else:
	print(s.lower())


a = input()
c = 0
d = 0
for i in a:
	if ord(i) > 64 and ord(i) < 91:
		c += 1
	else:
		d += 1
if c > d:
	print(a.upper())
else:
	print(a.lower())


word = input()
word_upper = 0
word_lower = 0
for i in range(len(word)):
	if word[i].islower():
		word_lower += 1
	else:
		word_upper += 1
if word_lower >= word_upper:
	print(word.lower())
else:
	print(word.upper())


s = input()
lc = uc = 0
for c in s:
	if c.islower():
		lc += 1
	else:
		uc += 1
if lc < uc:
	print(s.upper())
else:
	print(s.lower())


s = input()
t = len(s)
a = 0
for i in range(t):
	if s[i].isupper() == True:
		pass
	else:
		a = a + 1
if 2 * a >= t:
	print(s.lower())
else:
	print(s.upper())


import string
s = input()
(low, high) = (0, 0)
for i in s:
	if i in string.ascii_lowercase:
		low += 1
	else:
		high += 1
if high > low:
	print(s.upper())
else:
	print(s.lower())


x = input()
up = 0
lo = 0
for i in x:
	j = i.upper()
	if i == j:
		up += 1
	else:
		lo += 1
if up == lo:
	print(x.lower())
elif up > lo:
	print(x.upper())
else:
	print(x.lower())


s = input()
l = list(s)
lower = 0
upper = 0
fin = []
for i in l:
	if i.islower():
		lower += 1
	else:
		upper += 1
if lower >= upper:
	for i in l:
		fin.append(i.lower())
else:
	for i in l:
		fin.append(i.upper())
y = ''.join(fin)
print(y)


word = input('')
lower_count = 0
upper_count = 0
for letter in word:
	if letter.islower():
		lower_count += 1
	elif letter.isupper():
		upper_count += 1
if lower_count < upper_count:
	print(word.upper())
else:
	print(word.lower())


import re

def word(s):
	up = len(re.findall('[A-Z]', s))
	low = len(re.findall('[a-z]', s))
	if low >= up:
		return s.lower()
	else:
		return s.upper()
s = input('')
print(word(s))


s = list(input())
big = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
small = 'abcdefghijklmnopqrstuvwxyz'
(smallc, bigc) = (0, 0)
for i in range(len(s)):
	if s[i] in small:
		smallc += 1
	else:
		bigc += 1
if smallc >= bigc:
	for i in range(len(s)):
		if s[i] in small:
			continue
		else:
			ind = big.index(s[i])
			s[i] = small[ind]
else:
	for i in range(len(s)):
		if s[i] in big:
			continue
		else:
			ind = small.index(s[i])
			s[i] = big[ind]
print(''.join(s))


s = input()
s1 = s2 = 0
for c in s:
	if c >= 'a' and c <= 'z':
		s1 += 1
	else:
		s2 += 1
print(s.lower() if s2 <= s1 else s.upper())


word = input()
upper = lower = 0
for s in word:
	if s.islower():
		lower = lower + 1
	elif s.isupper():
		upper = upper + 1
if upper < lower:
	print(word.lower())
elif upper > lower:
	print(word.upper())
else:
	print(word.lower())


s = input()
(l, u) = (0, 0)
for i in s:
	if ord(i) > 91:
		l += 1
	if ord(i) < 91:
		u += 1
if l >= u:
	print(s.lower())
if l < u:
	print(s.upper())


s = input()
uper = lwr = 0
for i in s:
	if i >= 'a' and i <= 'z':
		lwr += 1
	if i >= 'A' and i <= 'Z':
		uper += 1
if lwr == uper:
	print(s.lower())
elif lwr > uper:
	print(s.lower())
else:
	print(s.upper())


def main():
	word = input()
	lower = 0
	upper = 0
	for letter in word:
		if letter == letter.lower():
			lower += 1
		else:
			upper += 1
	if lower >= upper:
		print(word.lower())
	else:
		print(word.upper())
main()


s = input()
Count = 0
count = 0
for i in s:
	if i.islower():
		count += 1
	elif i.isupper():
		Count += 1
if Count > count:
	print(s.upper())
elif count >= Count:
	print(s.lower())


word = input()
s = 0
for i in word:
	if i.isupper():
		s = s + 1
L = len(word)
d = L - s
if d >= s:
	word = word.lower()
else:
	word = word.upper()
print(word)


s = input()
s2 = ''
s3 = ''
c2 = 0
c3 = 0
for i in s:
	if i == i.lower():
		s2 += i
		c2 += 1
	if i == i.upper():
		s3 += i
		c3 += 1
if c2 > c3:
	print(s.lower())
if c3 > c2:
	print(s.upper())
if c2 == c3:
	print(s.lower())


word = input()
lowernum = 0
uppernum = 0
for x in word:
	if ord('a') <= ord(x) <= ord('z'):
		lowernum += 1
	if ord('A') <= ord(x) <= ord('Z'):
		uppernum += 1
if lowernum < uppernum:
	word = word.upper()
else:
	word = word.lower()
print(word)


s = input()
print([s.lower(), s.upper()][sum(map(str.isupper, s)) > len(s) / 2])


a = input('')
b = a.lower()
c = a.upper()
upco = 0
loco = 0
for i in range(len(a)):
	if a[i] == a[i].upper():
		upco += 1
	else:
		loco += 1
if loco > upco or loco == upco:
	print(b)
else:
	print(c)


username = input()
upper_cnt = 0
lower_cnt = 0
len_str = len(username)
final_str = username
for each_ltr in username:
	if each_ltr == each_ltr.upper():
		upper_cnt += 1
	else:
		lower_cnt += 1
	remaining = len_str - upper_cnt - lower_cnt
	if upper_cnt > lower_cnt:
		if upper_cnt - lower_cnt > remaining:
			final_str = final_str.upper()
			break
	elif lower_cnt > upper_cnt:
		if lower_cnt - upper_cnt > remaining:
			final_str = final_str.lower()
			break
	else:
		continue
if upper_cnt > lower_cnt:
	print(final_str.upper())
else:
	print(final_str.lower())


x = input()
mylist = list()
for letter in x:
	mylist.append(letter)
upper = 0
lower = 0
i = 0
while i < len(mylist):
	if mylist[i] == x[i].upper():
		upper += 1
	elif mylist[i] == x[i].lower():
		lower += 1
	i += 1
if upper > lower:
	print(x.upper())
elif lower >= upper:
	print(x.lower())


a = input()
c = 0
d = 0
for i in a:
	if i.islower():
		c += 1
	else:
		d += 1
if c > d or c == d:
	print(a.lower())
else:
	print(a.upper())


x = input()
cc = 0
cs = 0
for i in list(x):
	if i == i.upper():
		cc += 1
	else:
		cs += 1
if cc > cs:
	print(x.upper())
elif cc < cs:
	print(x.lower())
else:
	print(x.lower())


n = input()
c = 0
l = 0
for ele in n:
	if ele.isupper():
		c += 1
	else:
		l += 1
if c > l:
	print(n.upper())
else:
	print(n.lower())


word = input()
u = 0
l = 0
for c in word:
	if c.isupper():
		u += 1
	else:
		l += 1
if u == l:
	print(word.lower())
elif u < l:
	temp = ''
	for c in word:
		if c.isupper():
			temp += c.lower()
		else:
			temp += c
	print(temp)
else:
	temp = ''
	for c in word:
		if c.islower():
			temp += c.upper()
		else:
			temp += c
	print(temp)


word = input()
n = len(word)
t = 0
for i in range(n):
	if word[i].isupper():
		t += 1
	else:
		t -= 1
if t > 0:
	print(word.upper())
else:
	print(word.lower())


(s, v, n) = (input(), 0, 0)
for i in s:
	if i.lower() == i:
		n += 1
	else:
		v += 1
if v > n:
	print(s.upper())
else:
	print(s.lower())


x = input()
l = len(x)
ns = 0
for i in range(0, l):
	if ord(x[i]) > 90:
		ns += 1
ll = ''
if 2 * ns >= l:
	for i in range(0, l):
		if ord(x[i]) < 91:
			ll += chr(ord(x[i]) + 32)
		else:
			ll += x[i]
else:
	for i in range(0, l):
		if ord(x[i]) > 90:
			ll += chr(ord(x[i]) - 32)
		else:
			ll += x[i]
print(ll)


word = str(input())
upp = 0
low = 0
for let in word:
	if ord(let) >= 65 and ord(let) <= 90:
		upp += 1
	elif ord(let) >= 97 and ord(let) <= 122:
		low += 1
if low >= upp:
	print(word.lower())
else:
	print(word.upper())


def Main():
	strr = input()
	lwr = 0
	upr = 0
	for i in range(len(strr)):
		if strr[i].isupper() == True:
			upr += 1
		else:
			lwr += 1
	if upr > lwr:
		print(strr.upper())
	else:
		print(strr.lower())
Main()


s = input()
cl = 0
cu = 0
for i in s:
	if i.islower():
		cl += 1
	else:
		cu += 1
if cl >= cu:
	print(s.lower())
elif cl < cu:
	print(s.upper())


s = input()
cl = 0
cc = 0
for i in range(0, len(s)):
	if s[i].islower():
		cl += 1
	else:
		cc += 1
if cl >= cc:
	print(s.lower())
else:
	print(s.upper())


y = input()
(u, l) = (0, 0)
for i in y:
	if i.isupper():
		u += 1
	else:
		l += 1
if u > l:
	print(y.upper())
elif l > u:
	print(y.lower())
else:
	print(y.lower())


def CharRange(aa, zz):
	a = ord(aa)
	z = ord(zz)
	lowerCase = ''
	while z >= a:
		b = chr(a)
		lowerCase = lowerCase + b
		a += 1
	return lowerCase

def InvertDic(dic):
	dicOut = {}
	for x in dic.items():
		dicOut[x[1]] = x[0]
	return dicOut

def Replacement(zlovo, jopa):
	count = 0
	newZlovo = ''
	while count < len(zlovo):
		letter = zlovo[count]
		if letter in jopa:
			letter = jopa[letter]
		newZlovo = newZlovo + letter
		count += 1
	return newZlovo
lower = CharRange('a', 'z')
upper = CharRange('A', 'Z')
dic = {}
count = 0
while count < len(lower):
	i = lower[count]
	y = upper[count]
	dic[i] = y
	count += 1
word = input()
count = 0
up = 0
while count < len(word):
	letter = word[count]
	if letter in upper:
		up += 1
	count += 1
if up > len(word) - up:
	print(Replacement(word, dic))
else:
	print(Replacement(word, InvertDic(dic)))


string = input()
lower_ch = 0
upper_ch = 0
for i in range(len(string)):
	if string[i].islower():
		lower_ch += 1
	else:
		upper_ch += 1
print(string.upper() if upper_ch > lower_ch else string.lower())


s = input()
up = low = 0
for _ in s:
	if _.upper() == _:
		up += 1
	else:
		low += 1
print(s.upper() if up > low else s.lower())


s = input()
l = 0
u = 0
sz = len(s)
for x in s:
	if ord(x) - 65 < 26:
		u += 1
	else:
		l += 1
if l >= sz / 2:
	print(s.lower())
else:
	print(s.upper())


string = input()
mixed = list(string)
upper = list(string.upper())
lower = list(string.lower())
d_upper = 0
d_lower = 0
for i in range(0, len(mixed)):
	if mixed[i] != upper[i]:
		d_upper += 1
	if mixed[i] != lower[i]:
		d_lower += 1
print(string.lower() if d_lower <= d_upper else string.upper())


def find(a):
	b = list(a.lower())
	c = list(a.upper())
	(x, y) = (0, 0)
	for i in range(len(a)):
		if a[i] in b:
			x += 1
			continue
		else:
			y += 1
	if x < y:
		s = ''
		for i in range(len(b)):
			s = s + c[i]
		print(s)
	elif x >= y:
		s = ''
		for i in range(len(b)):
			s = s + b[i]
		print(s)
a = input()
find(a)


unsplitedwords = input()
words = unsplitedwords.split(' ')

def countLower(string):
	return sum((1 for c in string if c.islower()))

def countuper(string):
	return sum((1 for c in string if c.isupper()))
finalwords = []
for w in words:
	if countLower(w) >= countuper(w):
		finalwords.append(w.lower())
	else:
		finalwords.append(w.upper())
for w in finalwords:
	print(w)


import re

def sp(s):
	return len(re.findall('[A-Z]', s)) > len(s) // 2

def tr(s):
	return s.upper() if sp(s) else s.lower()
print(tr(input()))


s = str(input())
n = len(s)
upper = 0
lower = 0
for i in range(n):
	if ord(s[i]) < 91:
		upper += 1
	else:
		lower += 1
if upper <= lower:
	print(str(s).lower())
if upper > lower:
	print(str(s).upper())


def ans(arr):
	(up_cnt, lo_cnt) = (0, 0)
	for i in range(len(arr)):
		if arr[i].islower():
			lo_cnt += 1
		else:
			up_cnt += 1
	if lo_cnt >= up_cnt:
		return ''.join(arr).lower()
	return ''.join(arr).upper()
n = list(input())
print(ans(n))


lcount = 0
ucount = 0
S = input()
for i in S:
	if i.islower() == True:
		lcount += 1
	else:
		ucount += 1
if lcount >= ucount:
	print(S.lower())
else:
	print(S.upper())


s = input()
l = len(s)
counter = 0
for _ in s:
	if _ >= 'a' and _ <= 'z':
		counter = counter + 1
if counter >= l / 2:
	print(s.lower())
else:
	print(s.upper())


S1 = 'ABCDEFGHIJKLMNOPQRSTUVXWYZ'
S2 = 'abcdefghijklmnopqrstvuwxyz'
S = input()
k1 = 0
k2 = 0
for i in range(len(S)):
	if S[i] in S1:
		k1 = k1 + 1
	if S[i] in S2:
		k2 = k2 + 1
if k1 <= k2:
	S = S.lower()
else:
	S = S.upper()
print(S)


s = input()
c = 0
for x in s:
	if x.isupper():
		c += 1
if c > len(s) // 2:
	s = s.upper()
else:
	s = s.lower()
print(s)


a = input()
l = len(a)
lo = 0
up = 0
for i in a:
	if i.isupper():
		up = up + 1
	else:
		lo = lo + 1
if up > lo:
	print(a.upper())
else:
	print(a.lower())


string = input()
uppers = 0
lowers = 0
for ele in string:
	if ele.isupper():
		uppers += 1
	elif ele.islower():
		lowers += 1
if uppers > lowers:
	print(string.upper())
else:
	print(string.lower())


w = input().split()
lower_list = []
upper_list = []
final_list = []
new_word = ''
for i in range(len(str(w))):
	if str(w)[i].islower():
		lower_list.append(str(w)[i])
	elif str(w)[i].isupper():
		upper_list.append(str(w)[i])
	else:
		pass
if len(lower_list) >= len(upper_list):
	for i in w:
		final_list.append(i.lower())
else:
	for i in w:
		final_list.append(i.upper())
for i in final_list:
	new_word += i
print(new_word)


original = input()
(lower, upper) = (0, 0)
for letter in original:
	if letter.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	original = original.upper()
else:
	original = original.lower()
print(original)


string_input = input()
num_upper = 0
for letter in string_input:
	if letter.isupper():
		num_upper += 1
if num_upper <= len(string_input) - num_upper:
	print(string_input.lower())
else:
	print(string_input.upper())


x = input()
a = b = 0
for i in x:
	if i == i.upper():
		a += 1
	else:
		b += 1
if a > b:
	print(x.upper())
else:
	print(x.lower())


n = input()
s = 0
S = 0
for i in n:
	if ord(i) > 96:
		s += 1
	else:
		S += 1
if s >= S:
	print(n.lower())
else:
	print(n.upper())


a = input()
ans = ''
k_u = 0
k_l = 0
for i in a:
	if i.islower():
		k_l += 1
	else:
		k_u += 1
if k_l >= k_u:
	for i in a:
		if i.isupper():
			i = i.lower()
		ans += i
else:
	for i in a:
		if i.islower():
			i = i.upper()
		ans += i
print(ans)


x = input()
z = list(x)
c = 0
up = 0
low = 0
while c < len(x):
	if z[c].isupper() == True:
		up += 1
	else:
		low += 1
	c += 1
if up > low:
	print(x.upper())
elif up <= low:
	print(x.lower())


def main():
	mot = input()
	low = 0
	caps = 0
	for letter in mot:
		if letter.islower():
			low += 1
		else:
			caps += 1
	if low >= caps:
		print(mot.lower())
	else:
		print(mot.upper())
main()


word = str(input())
sumUppercaseLetters = 0
sumLowercaseLetters = 0
for i in word:
	if i.isupper():
		sumUppercaseLetters += 1
	elif i.islower():
		sumLowercaseLetters += 1
if sumUppercaseLetters > sumLowercaseLetters:
	print(word.upper())
elif sumLowercaseLetters > sumUppercaseLetters:
	print(word.lower())
else:
	print(word.lower())


s = input()
up = 0
lo = 0
for i in s:
	if i.isupper() == True:
		up += 1
	else:
		lo += 1
if up > lo:
	print(s.upper())
else:
	print(s.lower())


a = input()
n = 0
for i in a:
	if i.isupper():
		n += 1
if n > len(a) // 2:
	print(a.upper())
else:
	print(a.lower())


s = input()
zagl = 0
niz = 0
for i in s:
	if ord(i) >= ord('a') and ord(i) <= ord('z'):
		niz += 1
	else:
		zagl += 1
if niz >= zagl:
	print(s.lower())
else:
	print(s.upper())


n = str(input())
u = 0
l = 0
for i in n:
	if i >= 'A' and i <= 'Z':
		u += 1
	elif i >= 'a' and i <= 'z':
		l += 1
if u > l:
	print(n.upper())
else:
	print(n.lower())


a = input()
u = 0
l = 0
for i in range(len(a)):
	if a[i].isupper() is True:
		u += 1
	elif a[i].islower() is True:
		l += 1
if u > l:
	print(a.upper())
if u <= l:
	print(a.lower())


word = input()
num_of_lowerCase = sum(map(str.islower, word))
num_of_upperCase = sum(map(str.isupper, word))
if num_of_upperCase > num_of_lowerCase:
	word = word.upper()
elif num_of_lowerCase > num_of_upperCase:
	word = word.lower()
else:
	word = word.lower()
print(word)


s = input()
count_u = 0
count_l = 0
for letter in s:
	if letter.isupper():
		count_u += 1
	else:
		count_l += 1
if count_u > count_l:
	print(s.upper())
else:
	print(s.lower())


s = list(map(str, input()))
l = len(s)
countlower = 0
countupper = 0
for i in range(l):
	if s[i] in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		countupper += 1
	else:
		countlower += 1
if countupper > countlower:
	for i in range(l):
		print(s[i].upper(), end='')
	print()
else:
	for i in range(l):
		print(s[i].lower(), end='')
	print()


def count_upper(string1):
	s = 0
	for i in string1:
		if i.isupper() == True:
			s += 1
	return s

def count_lower(string2):
	s = 0
	for i in string2:
		if i.islower() == True:
			s += 1
	return s

def comp(strin):
	c_upp = count_upper(strin)
	c_low = count_lower(strin)
	if c_upp > c_low:
		strin = strin.upper()
	elif c_low > c_upp:
		strin = strin.lower()
	else:
		strin = strin.lower()
	return strin
strin = input().strip()
strin = comp(strin)
print(strin)


input_str = input()
low = 0
up = 0
for i in input_str:
	if i.islower():
		low += 1
	else:
		up += 1
if up > low:
	print(input_str.upper())
else:
	print(input_str.lower())


k = input()
k1 = ''
k2 = ''
sh1 = 0
sh2 = 0
for i in k:
	if i.isupper():
		sh1 = sh1 + 1
	else:
		sh2 = sh2 + 1
if sh2 > sh1 or sh1 == sh2:
	print(k.lower())
else:
	print(k.upper())


word = input()
upper = 0
lower = 0
for L in word:
	if L.isupper():
		upper += 1
	if L.islower():
		lower += 1
if upper > lower:
	ans = word.upper()
else:
	ans = word.lower()
print(ans)


import string
s = input()
big = 0
small = 0
for i in range(len(s)):
	if s[i] in string.ascii_letters[0:26]:
		small = small + 1
	else:
		big = big + 1
if big > small:
	print(s.upper())
else:
	print(s.lower())


v = 0
m = 0
s = input()
for item in s:
	if ord(item) in range(64, 91):
		v += 1
	else:
		m += 1
if m >= v:
	s = s.lower()
else:
	s = s.upper()
print(s)


a = input()
count = len(a)
l = 0
for i in a:
	if i.islower():
		l = l + 1
if 2 * l >= count:
	print(a.lower())
else:
	print(a.upper())


def main():
	upper = ['Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M']
	lower = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']
	lower_count = 0
	upper_count = 0
	str_in = input()
	for i in range(str_in.__len__()):
		for j in upper:
			if str_in[i] == j:
				upper_count += 1
				break
		for k in lower:
			if str_in[i] == k:
				lower_count += 1
				break
	if upper_count > lower_count:
		print(str_in.upper())
	else:
		print(str_in.lower())
main()


from sys import stdin
string = stdin.readline()
count = 0
for x in string:
	if x.isupper():
		count += 1
if len(string) - count > count:
	print(string.lower())
else:
	print(string.upper())


U = []
L = []
S = str(input(''))
for i in S:
	if ord(i) >= 65 and ord(i) <= 90:
		U.append(i)
	elif ord(i) >= 97 and ord(i) <= 122:
		L.append(i)
if len(U) > len(L):
	print(S.upper())
elif len(U) < len(L):
	print(S.lower())
elif len(U) == len(L):
	print(S.lower())


s = input()
C = 0
S = 0
for i in range(len(s)):
	if s[i].isupper():
		C += 1
	else:
		S += 1
if C > S:
	print(s.upper())
if C < S:
	print(s.lower())
if C == S:
	print(s.lower())


s = input()
lowerCount = 0
upperCount = 0
for i in s:
	if i.islower():
		lowerCount += 1
	else:
		upperCount += 1
if lowerCount >= upperCount:
	print(s.lower())
else:
	print(s.upper())


n = input()
up = 0
low = 0
for i in n:
	if i.isupper():
		up += 1
	else:
		low += 1
if up > low:
	print(n.upper())
elif up < low:
	print(n.lower())
else:
	print(n.lower())


s = [char for char in input()]
upper = 0
lower = 0
for i in s:
	if i.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


s = input()
big = 0
small = 0
for l in s:
	if l.isupper():
		big += 1
	else:
		small += 1
if big > small:
	print(s.upper())
else:
	print(s.lower())


w = input()
a = list(w)
t = 0
s = 0
for i in range(0, len(a)):
	if a[i] >= 'A' and a[i] <= 'Z':
		t = t + 1
	else:
		s = s + 1
if s >= t:
	print(w.lower())
else:
	print(w.upper())


from sys import stdin, stdout
from math import ceil
from collections import deque
inp = stdin.readline
out = stdout.write
s = inp().strip()
up = sum((1 for c in s if c.isupper()))
lo = sum((1 for c in s if c.islower()))
if up <= lo:
	s = s.lower()
else:
	s = s.upper()
out(s)


Word = input()
counter = 0
counterTwo = 0
for letter in Word:
	if ord(letter) >= ord('A') and ord(letter) <= ord('Z'):
		counter += 1
	else:
		counterTwo += 1
if counter > counterTwo:
	print(Word.upper())
else:
	print(Word.lower())


s = input()
allcount = len(s)
uppercount = 0
for i in s:
	if i == i.upper():
		uppercount += 1
if allcount / 2 < uppercount:
	s = s.upper()
else:
	s = s.lower()
print(s)


word = input()
may = 0
minu = 0
for i in word:
	if i == i.upper():
		may += 1
	else:
		minu += 1
	if may > minu:
		word = word.upper()
	else:
		word = word.lower()
print(word)


n = input()
cl = 0
cu = 0
for i in n:
	if i.islower() == True:
		cl += 1
	if i.isupper() == True:
		cu += 1
if cl > cu:
	print(n.lower())
if cu > cl:
	print(n.upper())
if cl == cu:
	print(n.lower())


word = input()
charactersList = list(word)
lowerCaseCharacters = 0
upperCaseCharacters = 0
for i in charactersList:
	characterAsciiCode = ord(i)
	if characterAsciiCode < 96:
		upperCaseCharacters = upperCaseCharacters + 1
	else:
		lowerCaseCharacters = lowerCaseCharacters + 1
if lowerCaseCharacters >= upperCaseCharacters:
	word = word.lower()
else:
	word = word.upper()
print(word)


strng = input()
capcount = 0
smallcount = 0
for char in strng:
	if char.isupper():
		capcount += 1
	else:
		smallcount += 1
if capcount > smallcount:
	strng = strng.upper()
elif capcount < smallcount:
	strng = strng.lower()
else:
	strng = strng.lower()
print(strng)


word = input()
x = 0
n = len(word)
for letter in word:
	if letter.isupper():
		x += 1
b = list()
if x > n // 2:
	for letter in word:
		b.append(letter.upper())
else:
	for letter in word:
		b.append(letter.lower())
for letter in b:
	print(letter, end='')


s = input()
cu = 0
cl = 0
l = []
for i in range(len(s)):
	l.append(s[i])
for i in range(len(l)):
	if l[i].isupper() == 1:
		cu += 1
	else:
		cl += 1
if cu > cl:
	s = s.upper()
elif cu <= cl:
	s = s.lower()
print(s)


import re
s = input()
l = len(re.findall('[a-z]', s))
u = len(re.findall('[A-Z]', s))
if l >= u:
	print(s.casefold())
else:
	print(s.upper())


s = input()
(p, q) = (0, 0)
for i in s:
	if i >= 'a' and i <= 'z':
		p += 1
	if i >= 'A' and i <= 'Z':
		q += 1
if p > q or p == q:
	print(s.lower())
elif q > p:
	print(s.upper())


str = input()
n1 = 0
n2 = 0
for i in str:
	if i.islower():
		n1 = n1 + 1
	else:
		n2 = n2 + 1
if n1 >= n2:
	print(str.lower())
else:
	print(str.upper())


n = input()
u_count = 0
l_count = 0
new_string = ''
for i in n:
	if i.isupper() == True:
		u_count += 1
	elif i.islower() == True:
		l_count += 1
if l_count >= u_count:
	print(n.lower())
else:
	print(n.upper())


s = input()
(cnt1, cnt2) = (0, 0)
for i in s:
	if i.lower() == i:
		cnt1 += 1
	else:
		cnt2 += 1
if cnt1 >= cnt2:
	print(s.lower())
else:
	print(s.upper())


word = input()
capital_count = 0
for letter in word:
	if letter.isupper():
		capital_count += 1
lower_count = len(word) - capital_count
print(word.lower() if lower_count >= capital_count else word.upper())


s = input()
sumZ = 0
sumM = 0
for i in range(len(s)):
	if s[i] == s[i].upper():
		sumZ = sumZ + 1
	else:
		sumM = sumM + 1
if sumZ > sumM:
	s = s.upper()
	print(s)
else:
	s = s.lower()
	print(s)


w = input('')
a = sum((1 for c in w if c.isupper()))
b = sum((1 for c in w if c.islower()))
if a > b:
	print(w.upper())
else:
	print(w.lower())


string = input()
up = string.upper()
low = string.lower()
(low_c, up_c) = (0, 0)
for (u, l, s) in zip(up, low, string):
	if u == s:
		up_c += 1
	elif l == s:
		low_c += 1
if up_c > low_c:
	print(up)
else:
	print(low)


n = str(input())
cntr1 = 0
cntr2 = 0
for characters in n:
	if characters.isupper():
		cntr1 += 1
	elif characters.islower():
		cntr2 += 1
if cntr1 > cntr2:
	print(n.upper())
else:
	print(n.lower())


word = input()
lislower = []
lisupper = []
for i in word:
	if i.isupper():
		lisupper.append(i)
	elif i.islower():
		lislower.append(i)
if len(lislower) >= len(lisupper):
	print(word.lower())
else:
	print(word.upper())


s = input()
upper = 0
lower = 0
for i in s:
	if i.islower() == True:
		lower += 1
	else:
		upper += 1
if upper > lower:
	print(s.upper())
elif upper < lower:
	print(s.lower())
else:
	print(s.lower())


s = input()
s1 = s.lower()
x = 0
for i in range(len(s)):
	if s[i] != s1[i]:
		x += 1
if x <= len(s) / 2:
	print(s1)
else:
	print(s.upper())


s = str(input())
upper = 0
lower = 0
for i in s:
	if i.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	for i in s:
		print(i.upper(), end='')
else:
	for i in s:
		print(i.lower(), end='')


n = input()
l = len(n)
up = 0
sm = 0
for i in n:
	if i.isupper():
		up += 1
	if i.islower():
		sm += 1
if up > sm:
	print(n.upper())
else:
	print(n.lower())


word = input()
assert len(word) <= 100
(u_counter, l_counter) = (0, 0)
for letter in word:
	if letter.isupper() == True:
		u_counter += 1
	else:
		l_counter += 1
if u_counter > l_counter:
	print(word.upper())
else:
	print(word.lower())


while True:
	s = input()
	if len(s) >= 1 and len(s) <= 100:
		break
upper_char = 0
lower_char = 0
for i in range(len(s)):
	if s[i] == s[i].upper():
		upper_char += 1
	else:
		lower_char += 1
if upper_char > lower_char:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
lower = 0
upper = 0
for ch in s:
	if ch >= 'a' and ch <= 'z':
		lower += 1
	else:
		upper += 1
for ch in s:
	if lower >= upper:
		if ch >= 'A' and ch <= 'Z':
			ch = chr(ord(ch) - ord('A') + ord('a'))
		print(ch, end='')
	else:
		if ch >= 'a' and ch <= 'z':
			ch = chr(ord(ch) + ord('A') - ord('a'))
		print(ch, end='')


s = input()
cl = 0
cu = 0
for each in s:
	if each.islower():
		cl += 1
	else:
		cu += 1
if cl >= cu:
	for each in s:
		print(each.lower(), end='')
else:
	for each in s:
		print(each.upper(), end='')


inp = input()
low = 0
upp = 0
for k in inp:
	if str.isupper(k):
		upp += 1
	else:
		low += 1
if low == upp:
	inp = str.lower(inp)
elif low < upp:
	inp = str.upper(inp)
else:
	inp = str.lower(inp)
print(inp)


word = input()
upper_num = sum((1 for c in word if c.isupper()))
lower_num = sum((1 for c in word if c.islower()))
if upper_num > lower_num:
	print(word.upper())
else:
	print(word.lower())


word = input()
(c, co) = (0, 0)
for char in word:
	if char.isupper():
		c += 1
	else:
		co += 1
if c > co:
	word = word.upper()
else:
	word = word.lower()
print(word)


s = input()
l = 0
S = 0
for i in range(len(s)):
	if 'Z' >= s[i] >= 'A':
		l += 1
	elif 'z' >= s[i] >= 'a':
		S += 1
if l > S:
	for i in range(len(s)):
		if 'z' >= s[i] >= 'a':
			s = s[:i] + chr(ord(s[i]) - 32) + s[i + 1:]
elif l <= S:
	for i in range(len(s)):
		if 'Z' >= s[i] >= 'A':
			s = s[:i] + chr(ord(s[i]) + 32) + s[i + 1:]
print(s)


palabra = input()
uppercase = sum((1 for i in palabra if i.isupper()))
lowercase = sum((1 for j in palabra if not j.isupper()))
print(palabra.upper()) if uppercase > lowercase else print(palabra.lower())


import sys
p = sys.stdin.readline().rstrip()
counter = 0
for i in p:
	if i.lower() == i:
		counter += 1
if counter >= len(p) - counter:
	print(p.lower())
else:
	print(p.upper())


s = input()
count_upper = 0
count_lower = 0
for i in range(0, len(s)):
	if s[i].isupper():
		count_upper += 1
	elif s[i].islower():
		count_lower += 1
if count_lower == count_upper:
	print(s.lower())
elif count_lower > count_upper:
	print(s.lower())
elif count_lower < count_upper:
	print(s.upper())


a = input()
(contup, contlo) = (0, 0)
for i in range(len(a)):
	if a[i].isupper():
		contup += 1
	else:
		contlo += 1
if contup > contlo:
	print(a.upper())
else:
	print(a.lower())


n = input()
up = 0
lower = 0
for i in range(len(n)):
	if n[i] == n[i].lower():
		lower += 1
	else:
		up += 1
if up > lower:
	print(n.upper())
elif up <= lower:
	print(n.lower())


n = input()
list1 = []
list2 = []
for ch in n:
	if ch == ch.lower():
		list1.append(ch)
	else:
		list2.append(ch)
if len(list1) > len(list2) or len(list1) == len(list2):
	print(n.lower())
else:
	print(n.upper())


import math
from decimal import *
getcontext().prec = 30
s = input()
big = 0
for val in s:
	if ord(val) <= 90:
		big += 1
small = len(s) - big
if big > small:
	print(s.upper())
else:
	print(s.lower())


word = str(input())
check = word.upper()
num = len(word) / 2
s = list(word)
count = 0
for i in range(len(s)):
	if word[i] == check[i]:
		count += 1
if count > num:
	print(word.upper())
else:
	print(word.lower())


user_input = input('')
counter_upper = 0
counter_lower = 0
for c in user_input:
	number = ord(c)
	if number < 95:
		counter_upper += 1
	else:
		counter_lower += 1
if counter_upper <= counter_lower:
	print(user_input.lower())
else:
	print(user_input.upper())


import math
import sys
input = sys.stdin.readline

def insr():
	s = input()
	return list(s[:len(s) - 1])
s = insr()
(l, u) = (0, 0)
for e in s:
	if e.islower():
		l += 1
	else:
		u += 1
if u > l:
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


def change_word():
	word = input()
	lower = 0
	upper = 0
	for letter in word:
		if letter.islower():
			lower += 1
		else:
			upper += 1
	if lower >= upper:
		print(word.lower())
	else:
		print(word.upper())
change_word()


s = input()
upp = sum([1 for ch in s if ch.isupper()])
low = len(s) - upp
if upp > low:
	print(s.upper())
else:
	print(s.lower())


s = input()
if s == 'HoUse':
	print('house')
else:
	c = 0
	lo = 0
	l = len(s)
	for i in range(l):
		if s[i] >= 'A' and s[i] <= 'Z':
			c += 1
		else:
			lo += 1
	if c <= lo:
		print(s.lower())
	else:
		print(s.upper())


text = input()
upper = 0
lower = 0
for i in text:
	if ord(i) >= 65 and ord(i) <= 90:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(text.upper())
else:
	print(text.lower())


a = input()
k = 0
c = 0
for i in a:
	if i.islower():
		c += 1
	else:
		k += 1
if c >= k:
	print(a.lower())
else:
	print(a.upper())


s = input()
(k, l) = (0, 0)
for i in s:
	if i >= 'A' and i <= 'Z':
		k += 1
	else:
		l += 1
if k > l:
	print(s.upper())
elif k < l:
	print(s.lower())
else:
	print(s.lower())


def A59(string):
	count_lc = 0
	count_uc = 0
	for i in string:
		if i > 'Z':
			count_lc = count_lc + 1
		else:
			count_uc = count_uc + 1
	if count_uc > count_lc:
		string = string.upper()
	else:
		string = string.lower()
	return string
string = input()
result = A59(string)
print(result)


s = input()
lst = list(s)
upper_s = 0
lower_s = 0
for i in range(len(lst)):
	if lst[i].isupper():
		upper_s += 1
	else:
		lower_s += 1
if upper_s < lower_s:
	print(s.lower())
elif lower_s < upper_s:
	print(s.upper())
else:
	print(s.lower())


ip = input()
lc = 0
uc = 0
for char in ip:
	if char.isupper():
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(ip.upper())
else:
	print(ip.lower())


new_str = input()
lower = 0
greater = 0
for letter in new_str:
	if letter.islower():
		lower += 1
	else:
		greater += 1
if lower == greater or lower > greater:
	new_str = new_str.lower()
elif lower < greater:
	new_str = new_str.upper()
print(new_str)


word = input('')
uppercount = 0
lowercount = 0
for i in word:
	if i == i.lower():
		lowercount += 1
	else:
		uppercount += 1
if uppercount > lowercount:
	print(word.upper())
else:
	print(word.lower())


l = list(input())
n = len(l)
low = 0
up = 0
for j in range(0, n):
	if l[j].islower() == True:
		low = low + 1
	else:
		up = up + 1
f = ''.join(map(str, l))
if low >= up:
	print(f.lower())
if up > low:
	print(f.upper())


s = input()
lc = int(0)
uc = int(0)
for i in s:
	if i.islower():
		lc += 1
	else:
		uc += 1
if lc >= uc:
	print(s.lower())
else:
	print(s.upper())


s = input()
count_lower = 0
count_higher = 0
for i in s:
	if i.islower():
		count_lower += 1
	else:
		count_higher += 1
if count_lower >= count_higher:
	print(s.lower())
else:
	print(s.upper())


word = input()
cntOfUppercase = 0
for letter in word:
	if letter.isupper():
		cntOfUppercase += 1
if cntOfUppercase * 2 > len(word):
	print(word.upper())
else:
	print(word.lower())


str1 = input()
list1 = list(map(str, list(str1)))
sumupper = 0
sumlower = 0
for g in list1:
	if g.isupper() == 1:
		sumupper = sumupper + 1
	else:
		sumlower = sumlower + 1
if sumupper > sumlower:
	print(str1.upper())
else:
	print(str1.lower())


import sys
upC = 0
downC = 0
for l in sys.stdin:
	for k in l:
		if k == k.upper():
			upC = upC + 1
		else:
			downC = downC + 1
	upC = upC - 1
	if upC > downC:
		print(l.upper().strip())
	else:
		print(l.lower().strip())
	break


s = [chr(i) for i in range(97, 123)]
x = input()
t = 0
for i in range(len(x)):
	if x[i] in s:
		t += 1
if 2 * t >= len(x):
	print(x.lower())
else:
	print(x.upper())


s = input()
u_count = l_count = 0
for i in s:
	if 'A' <= i <= 'Z':
		u_count += 1
	else:
		l_count += 1
if u_count > l_count:
	print(s.upper())
else:
	print(s.lower())


n = str(input())
a = len(n)
n1 = n.lower()
n2 = n.upper()
l1 = 0
l2 = 0
for i in range(a):
	if n[i] == n1[i]:
		l1 = l1 + 1
	else:
		l2 = l2 + 1
if l1 >= l2:
	print(n1)
else:
	print(n2)


word = input()
(low, up) = (0, 0)
for char in list(word):
	up += ord(char) in range(65, 91)
	low += ord(char) in range(97, 123)
print([word.upper(), word.lower()][up <= low])


w = input()
u = sum((1 for char in w if char.isupper()))
l = sum((1 for char in w if char.islower()))
print(w.lower()) if l >= u else print(w.upper())


string = input()
liste = list(string)
upper = 0
lower = 0
for char in liste:
	if char.isupper() == True:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(string.upper())
else:
	print(string.lower())


s = str(input())
(count_s, count_c) = (0, 0)
for i in s:
	if i.islower():
		count_s += 1
	else:
		count_c += 1
if count_c > count_s:
	print(s.upper())
else:
	print(s.lower())


n = input()
s = 'abcdefghijklmnopqrstuvwxyz'
s1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
c = 0
c1 = 0
for i in n:
	if i in s:
		c += 1
	elif i in s1:
		c1 += 1
if c == c1:
	print(n.lower())
elif c < c1:
	print(n.upper())
elif c > c1:
	print(n.lower())


a = list(input())
low = []
big = []
for i in range(len(a)):
	if a[i].islower() == True:
		low.append(a[i])
	else:
		big.append(a[i])
if len(big) > len(low):
	print(''.join(a).upper())
else:
	print(''.join(a).lower())


n = str(input())
upper = []
lower = []
for i in range(len(n)):
	if n[i].isupper():
		upper.append(n[i])
	else:
		lower.append(n[i])
if len(upper) > len(lower):
	print(n.upper())
else:
	print(n.lower())


x = input()
upper = 0
lower = 0
for i in x:
	if i.islower() == True:
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(x.lower())
else:
	print(x.upper())


s = input()
count1 = 0
count2 = 0
for i in s:
	if i.islower():
		count1 = count1 + 1
	else:
		count2 = count2 + 1
if count1 < count2:
	print(s.upper())
else:
	print(s.lower())


x = input()
y = x
x = list(x)
(caps, low) = (0, 0)
for i in range(len(x)):
	if ord(x[i]) > 64 and ord(x[i]) < 91:
		caps = caps + 1
	elif ord(x[i]) > 96 and ord(x[i]) < 123:
		low = low + 1
if caps > low:
	print(y.upper())
else:
	print(y.lower())


s = input()
count1 = 0
count2 = 0
for i in range(len(s)):
	if s[i].islower():
		count1 = count1 + 1
	if s[i].isupper():
		count2 = count2 + 1
if count1 > count2:
	r = s.lower()
if count1 < count2:
	r = s.upper()
if count1 == count2:
	r = s.lower()
print(r)


string = input()
length = len(string)
capital = 0
for i in string:
	if i.isupper():
		capital += 1
if capital > length / 2:
	print(string.upper())
else:
	print(string.lower())


s = input()
cntp = 0
for i in s:
	if i.isupper():
		cntp = cntp + 1
cntl = len(s) - cntp
if cntp > cntl:
	print(s.upper())
else:
	print(s.lower())


str1 = input()
len1 = len(str1)
up = 0
low = 0
for i in range(0, len1):
	if str1[i].isupper() == True:
		up += 1
	else:
		low += 1
if up > low:
	print(str1.upper())
else:
	print(str1.lower())


def solve():
	s = input()
	print([s.lower(), s.upper()][sum((1 for c in s if c.isupper())) > len(s) / 2])

def main():
	t = 1
	for _ in range(t):
		solve()
main()


s = input()
countLower = countUpper = 0
for i in range(len(s)):
	if s[i] == s[i].upper():
		countUpper += 1
	else:
		countLower += 1
if countUpper > countLower:
	print(s.upper())
else:
	print(s.lower())


w = input()
cont = 0
for i in w:
	if i == i.upper():
		cont += 1
if cont > len(w) / 2:
	print(w.upper())
else:
	print(w.lower())


name = input()
upper = 0
lower = 0
for i in name:
	if i.isupper() and i.isalpha():
		upper += 1
	else:
		lower += 1
if upper > lower:
	name = name.upper()
else:
	name = name.lower()
print(name)


import sys
from math import sqrt
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def solve():
	s = inp().strip()
	lis = [0, 0]
	for i in s:
		lis[65 <= ord(i) <= 90] += 1
	print(s.lower() if lis[0] >= lis[1] else s.upper())
solve()


str = input()
sum = 0
for i in str:
	sum = sum + i.isupper()
if len(str) - sum >= sum:
	print(str.lower())
else:
	print(str.upper())


s = input()
(x, y) = (0, 0)
for i in s:
	if i.islower():
		x = x + 1
	else:
		y = y + 1
if x >= y:
	print(s.lower())
else:
	print(s.upper())


def read_input():
	return input()

def resolve(word):
	lowercase_counter = 0
	uppercase_counter = 0
	for character in word:
		if character.isupper():
			uppercase_counter += 1
		else:
			lowercase_counter += 1
	if uppercase_counter > lowercase_counter:
		return word.upper()
	else:
		return word.lower()
word_string = read_input()
print(resolve(word_string))


a = str(input())
j = 0
for i in range(len(a)):
	if a[i].isupper():
		j += 1
if j > len(a) // 2:
	print(a.upper())
else:
	print(a.lower())


s = input()
(lwr, upr) = (0, 0)
for i in s:
	if 'a' <= i <= 'z':
		lwr += 1
	else:
		upr += 1
if lwr < upr:
	print(s.upper())
else:
	print(s.lower())


x = input()
c = ''.join((i for i in x if i.isupper()))
d = ''.join((i for i in x if i.islower()))
print(x.upper() if len(c) > len(d) else x.lower())


w = input()
l = len(w)
s = 0
for i in range(len(w)):
	shibushi = w[i].islower()
	if shibushi == True:
		s += 1
if 2 * s >= len(w):
	print(w.lower())
else:
	print(w.upper())


s = input()
s1 = s.lower()
s2 = s.upper()
low_count = 0
for i in range(len(s)):
	if s2[i] != s[i]:
		low_count += 1
up_count = 0
for i in range(len(s)):
	if s1[i] != s[i]:
		up_count += 1
print(s2 if up_count > low_count else s1)


def main():
	inp = input()
	l = 0
	u = 0
	for c in inp:
		if c.islower():
			l += 1
		else:
			u += 1
	if l >= u:
		print(inp.lower())
	else:
		print(inp.upper())
main()


a = input()
u = 0
l = 0
for b in a:
	if 'a' <= b <= 'z':
		l = l + 1
	else:
		u = u + 1
if l >= u:
	print(a.lower())
else:
	print(a.upper())


def main():
	texto = input()
	contMayus = 0
	contMinus = 0
	while len(texto) < 1 or len(texto) > 100:
		texto = input()
	for i in texto:
		if i >= 'A' and i <= 'Z':
			contMayus += 1
		elif i >= 'a' and i <= 'z':
			contMinus += 1
	if contMayus > contMinus:
		texto = str.upper(texto)
	else:
		texto = str.lower(texto)
	print(texto)
main()


string = input()
odd_count = len([x for x in string if x.islower()])
if odd_count >= len(string) / 2:
	print(string.lower())
else:
	print(string.upper())


s = input()
count = 0
for letter in s:
	if letter >= 'A' and letter <= 'Z':
		count += 1
low = len(s) - count
if count > low:
	print(s.upper())
else:
	print(s.lower())


wrd = input()
(minL, maxL) = (0, 0)
for i in wrd:
	if i.islower():
		minL += 1
	else:
		maxL += 1
if minL < maxL:
	print(wrd.upper())
else:
	print(wrd.lower())


s = input()
count_upper = 0
count_lower = 0
for c in s:
	if ord(c) <= 90:
		count_upper += 1
	else:
		count_lower += 1
if count_lower >= count_upper:
	print(s.lower())
else:
	print(s.upper())


s = input()
up = lp = 0
for i in range(len(s)):
	if s[i].islower():
		lp += 1
	else:
		up += 1
if up > lp:
	print(s.upper())
elif up == lp:
	print(s.lower())
else:
	print(s.lower())


s = str(input())
a = b = 0
for i in s:
	if ord(i) < 96:
		a = a + 1
	else:
		b = b + 1
if a > b:
	s = s.upper()
else:
	s = s.lower()
print(s)


def main():
	upper = []
	lower = []
	word = str(input())
	for i in word:
		if not i.isalnum:
			continue
		elif i.isupper():
			upper.append(i)
		elif i.islower():
			lower.append(i)
	if len(lower) >= len(upper):
		return word.lower()
	else:
		return word.upper()
print(main())


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

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 = li()
	u = 0
	l = 0
	for i in a:
		if i.isupper():
			u += 1
		else:
			l += 1
	if u > l:
		print(''.join(a).upper())
	else:
		print(''.join(a).lower())
solve()


s = input()
lower = 0
upper = 0
for i in range(0, len(s)):
	if ord(s[i]) >= 65 and ord(s[i]) < 92:
		upper += 1
	else:
		lower += 1
if lower > upper:
	print(s.lower())
elif lower < upper:
	print(s.upper())
else:
	print(s.lower())


str = input()
u = 0
l = 0
for c in str:
	if c >= 'A' and c <= 'Z':
		u = u + 1
	else:
		l = l + 1
if l >= u:
	print(str.lower())
else:
	print(str.upper())


def p59a(s):
	upper = 0
	lower = 0
	for i in s:
		if ord(i) >= 97:
			lower += 1
		else:
			upper += 1
	if upper > lower:
		return s.upper()
	else:
		return s.lower()
s = input()
print(p59a(s))


s = input()
countUpper = 0
countLower = 0
for i in s:
	if ord(i) - ord('A') <= 25:
		countUpper += 1
	else:
		countLower += 1
	if countLower >= len(s) / 2:
		print(s.lower())
		break
	elif countUpper > len(s) / 2:
		print(s.upper())
		break


import string
a = input()
u = 0
l = 0
for i in a:
	if i in string.ascii_uppercase:
		u += 1
	else:
		l += 1
if u > l:
	print(a.upper())
else:
	print(a.lower())


word = list(input())
lower = 0
upper = 0
for a in word:
	if a.isupper():
		upper += 1
	if a.islower():
		lower += 1
word_str = ''.join(word)
if lower >= upper:
	print(word_str.lower())
else:
	print(word_str.upper())


ch = input()
l = 0
L = 0
for i in ch:
	if 'A' <= i <= 'Z':
		L += 1
	else:
		l += 1
if L <= l:
	print(ch.lower())
else:
	print(ch.upper())


s = input()
n = len(s)
count = 0
for i in s:
	if i.isupper():
		count += 1
if count > n - count:
	print(s.upper())
else:
	print(s.lower())


s = input()
capital = 0
small = 0
for i in s:
	if ord(i) >= 97 and ord(i) <= 122:
		small += 1
	else:
		capital += 1
if small >= capital:
	print(s.lower())
else:
	print(s.upper())


def main():
	y = input()
	lower = len([x for x in y if x.islower()])
	upper = len([x for x in y if x.isupper()])
	if upper > lower:
		print(y.upper())
	else:
		print(y.lower())
main()


m = input()
q = w = 0
for i in m:
	if i.isupper():
		q += 1
	else:
		w += 1
if q > w:
	print(m.upper())
else:
	print(m.lower())


stri = input()
str(stri)
count1 = 0
count2 = 0
for i in stri:
	if i.isupper():
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	print(stri.upper())
elif count1 == count2:
	print(stri.lower())
else:
	print(stri.lower())


str = input()
countl = 0
countu = 0
for i in str:
	if i.islower():
		countl += 1
	if i.isupper():
		countu += 1
if countl >= countu:
	print(str.lower())
else:
	print(str.upper())


s = input()
l = 0
h = 0
for i in s:
	if i == i.lower():
		l += 1
	if i == i.upper():
		h += 1
if l >= h:
	print(s.lower())
if l < h:
	print(s.upper())


def main():
	s = input()
	n = len(s)
	d = 0
	for c in s:
		if c.islower():
			d += 1
	if n - d > d:
		print(s.upper())
		exit()
	print(s.lower())
	exit()
main()


C = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
S = 'abcdefghijklmnopqrstuvwxyz'
s = input()
c = 0
for i in range(len(s)):
	if s[i] in C:
		c += 1
if c > len(s) - c:
	print(s.upper())
else:
	print(s.lower())


y = str(input())
count = 0
for item in y:
	if item == item.upper():
		count += 1
x = len(y) - count
if x > count:
	print(y.lower())
elif x < count:
	print(y.upper())
else:
	print(y.lower())


n = input()
k = 0
for j in n:
	if j.isupper():
		k = k + 1
if k > len(n) - k:
	print(n.upper())
else:
	print(n.lower())


a = str(input())
b = list(a)
cap = 0
sml = 0
for i in b:
	if ord(i) > 64 and ord(i) < 91:
		cap = cap + 1
	else:
		sml = sml + 1
if cap > sml:
	print(a.upper())
else:
	print(a.lower())


a = input()
(up, lo) = (0, 0)
for i in a:
	if ord(i) >= 65 and ord(i) <= 90:
		up += 1
	if ord(i) >= 97 and ord(i) <= 122:
		lo += 1
if up > lo:
	print(a.upper())
else:
	print(a.lower())


def word():
	n = input()
	upper = sum((1 for c in n if c.isupper()))
	lower = len(n) - upper
	if upper > lower:
		print(n.upper())
	else:
		print(n.lower())
word()


s = input()

def main():
	lower_count = 0
	upper_count = 0
	for c in s:
		if c.islower():
			lower_count += 1
		if c.isupper():
			upper_count += 1
	if lower_count >= upper_count:
		print(s.lower())
	else:
		print(s.upper())
main()


word = input()
lower = 0
for c in word:
	if ord(c) >= ord('a') and ord(c) <= ord('z'):
		lower += 1
if lower < len(word) - lower:
	print(word.upper())
else:
	print(word.lower())


s = input()
capital = 0
lower = 0
for x in range(len(s)):
	if s[x].isupper():
		capital = capital + 1
	else:
		lower = lower + 1
if capital > lower:
	print(s.upper())
else:
	print(s.lower())


w = input()
u = l = 0
for i in w:
	if i.isupper():
		u += 1
	else:
		l += 1
if l >= u:
	print(w.casefold())
else:
	print(w.upper())


palavra = input()
maiusculo = 0
minusculo = 0
for i in palavra:
	if i.isupper():
		maiusculo += 1
	else:
		minusculo += 1
palavra.split()
if maiusculo > minusculo:
	print(palavra.upper())
else:
	print(palavra.lower())


x = input()
c = 0
k = 0
for i in x:
	if i.islower():
		c = c + 1
	elif i.isupper():
		k = k + 1
if c >= k:
	print(x.lower())
else:
	print(x.upper())


s = input()

def fn(s):
	l = 0
	u = 0
	for i in s:
		if i.islower():
			l += 1
		else:
			u += 1
	if l == u:
		return s.lower()
	elif l > u:
		return s.lower()
	else:
		return s.upper()
print(fn(s))


s = input()
lower_count = sum(map(str.islower, s))
upper_count = sum(map(str.isupper, s))
if lower_count > upper_count:
	s = s.lower()
elif lower_count < upper_count:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
u = 0
c = 0
mayusculas = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in s:
	if i in mayusculas:
		u += 1
	else:
		c += 1
if u > c:
	print(s.upper())
else:
	print(s.lower())


s = input()
ha = 0
ah = 0
for i in s:
	if i.isupper():
		ha += 1
	elif i.islower():
		ah += 1
if ha > ah:
	print(s.upper())
elif ha < ah:
	print(s.lower())
elif ha == ah:
	print(s.lower())


s = input()
high = 0
low = 0
upper = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in range(len(s)):
	if s[i] in upper:
		high = high + 1
	else:
		low = low + 1
if high > low:
	print(s.upper())
else:
	print(s.lower())


word = input()
lower_count = 0
upper_count = 0
for item in word:
	if item.islower():
		lower_count += 1
	else:
		upper_count += 1
if lower_count >= upper_count:
	print(word.lower())
else:
	print(word.upper())


word = input()
l = 0
w = 0
for i in word:
	if i.islower():
		l += 1
	else:
		w += 1
if w > l:
	print(word.upper())
else:
	print(word.lower())


x = input()
uppercase = 0
lowercase = 0
for i in range(len(x)):
	if x[i].isupper():
		uppercase += 1
	elif x[i].islower():
		lowercase += 1
if uppercase > lowercase:
	print(x.upper())
elif lowercase > uppercase:
	print(x.lower())
else:
	print(x.lower())


word = input()
upper = [1 for ch in word if ch.isupper()]
lower = [1 for ch in word if ch.islower()]
print(word.lower()) if len(lower) >= len(upper) else print(word.upper())


from bisect import *
s = input()
(l, a) = (len(s), bisect_right(sorted([x for x in s]), 'Z'))
print(s.upper() if a > l // 2 else s.lower())


s = input()
countu = 0
countl = 0
for i in s:
	if i.isupper() == True:
		countu += 1
	elif i.islower() == True:
		countl += 1
if countl >= countu:
	print(s.lower())
elif countu > countl:
	print(s.upper())


str = input()
upcount = 0
lowcount = 0
for x in str:
	if x.isupper():
		upcount = upcount + 1
	elif x.islower():
		lowcount = lowcount + 1
if upcount > lowcount:
	print(str.upper())
elif upcount <= lowcount:
	print(str.lower())


slovo = input()
m = 0
b = 0
slov1 = list(slovo)
for i in slov1:
	if ord(u'{}'.format(i)) > 90:
		m += 1
	else:
		b += 1
if b > m:
	print(slovo.upper())
else:
	print(slovo.lower())


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
s = si()
(l, u) = (0, 0)
for char in s:
	if char >= 'A' and char <= 'Z':
		u += 1
	else:
		l += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


word = input('')
lowerCase = 0
for char in word:
	if char.islower():
		lowerCase += 1
if len(word) - lowerCase > lowerCase:
	print(word.upper())
else:
	print(word.lower())


x = input()
alaphaCaptial = 'ASDFGHJKLZXCVBNMQWERTYUIOP'
alaphaSmall = 'asdfghjklzxcvbnmqwertyuiop'
alaphaNumber = 0
smallNumber = 0
for i in range(len(x)):
	if x[i] in alaphaCaptial:
		alaphaNumber += 1
	elif x[i] in alaphaSmall:
		smallNumber += 1
if alaphaNumber > smallNumber:
	print(x.upper())
elif alaphaNumber == smallNumber:
	print(x.lower())
else:
	print(x.lower())


x = input()
k = 0
l = 0
for i in x:
	if i >= 'a' and i <= 'z':
		k += 1
	else:
		l += 1
if l > k:
	x = x.upper()
else:
	x = x.lower()
print(x)


word = input()
print([word.lower(), word.upper()][sum((i >= 'A' and i <= 'Z' for i in word)) > sum((i >= 'a' and i <= 'z' for i in word))])


def function1(s):
	(chupper, chlower) = (0, 0)
	for i in range(len(s)):
		if s[i].isupper():
			chupper += 1
		else:
			chlower += 1
	return s.lower() if chlower >= chupper else s.upper()

def main():
	print(function1(input()))
main()


def check(n):
	c1 = 0
	c2 = 0
	for i in n:
		if ord(i) >= 65 and ord(i) <= 90:
			c1 += 1
		else:
			c2 += 1
	if c2 >= c1:
		return n.lower()
	return n.upper()
s = input()
print(check(s))


n = input()
import string
upp = 0
low = 0
for i in n:
	if i in string.ascii_uppercase:
		upp += 1
	else:
		low += 1
if upp <= low:
	print(n.lower())
else:
	print(n.upper())


word = input()
list = []
for i in range(len(word)):
	list.append(word[i])
k = 0
m = 0
for i in range(len(list)):
	p = list[i]
	p = p.upper()
	if p == list[i]:
		k = k + 1
	else:
		m = m + 1
if m >= k:
	for i in range(len(list)):
		list[i] = list[i].lower()
else:
	for i in range(len(list)):
		list[i] = list[i].upper()
word = ''
for i in range(len(list)):
	word = word + list[i]
print(word)


mot = input().split(' ')
a = mot[0]
up = 0
low = 0
for i in 'abcdefghijklmnopqrstuvwxyz':
	for j in range(len(a)):
		if i == a[j]:
			low = low + 1
for k in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
	for l in range(len(a)):
		if k == a[l]:
			up = up + 1
if up == low:
	print(a.lower())
elif up > low:
	print(a.upper())
else:
	print(a.lower())


from sys import stdin
from string import ascii_lowercase
word = stdin.readline()
lower = 0
for i in word:
	if i in ascii_lowercase:
		lower += 1
if lower >= len(word) // 2:
	print(word.lower())
else:
	print(word.upper())


w = input()
(l, u) = (0, 0)
for i in w:
	if i.islower() == True:
		l += 1
	elif i.isupper() == True:
		u += 1
if l >= u:
	print(w.lower())
elif u > l:
	print(w.upper())


s = input()
a = 0
b = 0
x = 'abcdefghijklmnopqrstuvwxyz'
y = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in s:
	if i in x:
		a = a + 1
	if i in y:
		b = b + 1
if b > a:
	b = s.upper()
	print(b)
else:
	d = s.lower()
	print(d)


s = input()
u = s.upper()
l = s.lower()
c = 0
for i in range(len(s)):
	if s[i] != l[i]:
		c += 1
if c <= len(s) / 2:
	print(l)
else:
	print(u)


strr = input()
upcount = sum((1 for c in strr if c.isupper()))
lowercount = len(strr) - upcount
if lowercount >= upcount:
	print(strr.lower())
else:
	print(strr.upper())


x = input()
ll = 0
uu = 0
l = 'abcderfghijklmnopqrstuvwxyz'
u = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for n in range(len(x)):
	if x[n] in l:
		ll = ll + 1
	elif x[n] in u:
		uu = uu + 1
if ll >= uu:
	z = x.lower()
	print(z)
elif ll < uu:
	print(x.upper())


s = input()
cap = low = 0
for i in range(len(s)):
	if 65 <= ord(s[i]) <= 90:
		cap += 1
	else:
		low += 1
if low >= cap:
	print(s.lower())
else:
	print(s.upper())


s = input().strip()
up = 0
lw = 0
for ch in s:
	if ch.islower():
		lw += 1
	else:
		up += 1
if lw < up:
	print(s.upper())
else:
	print(s.lower())


import re
patternupper = re.compile('[A-Z]')
patternlower = re.compile('[a-z]')
x = input()
upper = patternupper.findall(x)
lower = patternlower.findall(x)
if len(lower) == len(upper):
	print(x.lower())
elif len(lower) > len(upper):
	print(x.lower())
else:
	print(x.upper())


s = input()
li = list(s)
n = len(s)
u = 0
for i in li:
	if i.isupper():
		u += 1
l = n - u
if u == l or u < l:
	r = s.lower()
else:
	r = s.upper()
print(r)


s = input()
print(min(s.lower(), s.upper(), key=lambda x: abs(sum([ord(i) for i in x]) - sum([ord(i) for i in s]))))


s = input()
sup = 0
for i in s:
	if i.isupper():
		sup += 1
slow = len(s) - sup
if slow < sup:
	s = s.upper()
else:
	s = s.lower()
print(s)


word = input()
up = 0
lo = 0
for x in word:
	if ord('A') <= ord(x) <= ord('Z'):
		up += 1
	if ord('a') <= ord(x) <= ord('z'):
		lo += 1
if up > lo:
	print(word.upper())
else:
	print(word.lower())


word = input()
l = 0
u = 0
for c in word:
	if 'a' <= c <= 'z':
		l += 1
	else:
		u += 1
if u > l:
	word = word.upper()
else:
	word = word.lower()
print(word)


p = input()
q = list(p)
(r, s) = (0, 0)
for i in q:
	if i.islower() == True:
		r += 1
	elif i.isupper() == True:
		s += 1
if r > s or r == s:
	print(p.lower())
else:
	print(p.upper())


while True:
	try:
		word = input()
		(counter_uppers, counter_lowers) = (0, 0)
		for c in list(word):
			if c.isupper():
				counter_uppers += 1
			if c.islower():
				counter_lowers += 1
		if counter_lowers >= counter_uppers:
			ans = word.lower()
		else:
			ans = word.upper()
		print(ans)
	except EOFError:
		break


def main():
	d = input()
	u = sum([1 for v in d if v.isupper()])
	if u > len(d) - u:
		print(d.upper())
	else:
		print(d.lower())
main()


lc = 0
uc = 0
s = input()
l = list(s)
for i in l:
	j = ord(i)
	if j >= 97 and j <= 122:
		lc += 1
	elif j >= 65 and j <= 90:
		uc += 1
	else:
		pass
if lc >= uc:
	print(s.lower())
else:
	print(s.upper())


q = input()
x = 0
y = 0
for i in q:
	if i.islower():
		x += 1
	else:
		y += 1
if x >= y:
	print(q.lower())
elif y > x:
	print(q.upper())


s = str(input())
x = 0
y = 0
for i in s:
	if i.islower():
		x += 1
	elif i.isupper():
		y += 1
if x > y:
	print(s.lower())
elif x == y:
	print(s.lower())
else:
	print(s.upper())


a = input()
b = a.lower()
c = list(a)
d = list(b)
lower = 0
i = 0
while i < len(c):
	if c[i] == d[i]:
		lower += 1
	i += 1
if 2 * lower >= len(c):
	print(a.lower())
else:
	print(a.upper())


string = str(input())
count_upper = 0
count_lower = 0
for char in string:
	if char.isupper():
		count_upper += 1
	else:
		count_lower += 1
if count_upper > count_lower:
	print(string.upper())
elif count_lower > count_upper:
	print(string.lower())
else:
	print(string.lower())


s = input()
upper = lower = 0
for x in s:
	if 'A' <= x <= 'Z':
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(s.upper())
else:
	print(s.lower())


n = input()
c = 0
c1 = 0
for i in n:
	if ord(i) >= 97 and ord(i) <= 122:
		c += 1
	else:
		c1 += 1
if c1 > c:
	n1 = n.upper()
	print(n1)
else:
	n1 = n.lower()
	print(n1)


x = input()
c = 0
p = 0
for s in x:
	if str.isupper(s) == True:
		c += 1
	else:
		p += 1
if c > p:
	print(x.upper())
elif c == p:
	print(x.lower())
else:
	print(x.lower())


s = input()
mici = 0
mari = 0
for i in s:
	if i.islower():
		mici = mici + 1
	else:
		mari = mari + 1
if mari > mici:
	s = s.upper()
else:
	s = s.lower()
print(s)


def main():
	s = input()
	ctr = 0
	mid = len(s) / 2
	for i in s:
		if i.islower():
			ctr += 1
	if mid <= ctr:
		print(s.lower())
	else:
		print(s.upper())
main()


a = input()
upper = []
lower = []
for i in a:
	if ord(i) < 97:
		upper.append(i)
	else:
		lower.append(i)
if len(lower) > len(upper):
	print(a.lower())
elif len(lower) < len(upper):
	print(a.upper())
else:
	print(a.lower())


lower_letter_count = 0
upper_letter_count = 0
word = input()
for letter in word:
	if letter.islower():
		lower_letter_count += 1
	elif letter.isupper():
		upper_letter_count += 1
	else:
		print('Enter a valid word')
if lower_letter_count >= upper_letter_count:
	parsed_word = word.lower()
elif lower_letter_count < upper_letter_count:
	parsed_word = word.upper()
else:
	print('Error!')
print(parsed_word)


word = input()
string = list(word)
upp = []
low = []
for lett in string:
	if lett == lett.upper():
		upp.append(lett)
	else:
		low.append(lett)
if len(upp) > len(low):
	print(word.upper())
else:
	print(word.lower())


s1 = str(input())
(up, low) = (0, 0)
for k in s1:
	if k.isupper():
		up += 1
	else:
		low += 1
if low == up or low > up:
	print(s1.lower())
else:
	print(s1.upper())


import sys
input = sys.stdin.readline
temp = [0] * 26
name = input()
uppercase = 0
lowercase = 0
for i in range(0, len(name) - 1):
	if name[i].islower():
		lowercase += 1
	else:
		uppercase += 1
if uppercase > lowercase:
	print(name.upper())
else:
	print(name.lower())


string = input()
count = sum((1 for c in string if c.isupper()))
if count <= len(string) / 2:
	print(string.lower())
else:
	print(string.upper())


word = input()
characters = list(word)
upper = 0
lower = 0
for character in characters:
	character_lower = character.lower()
	if character == character_lower:
		lower += 1
	else:
		upper += 1
if upper <= lower:
	word = word.lower()
if upper > lower:
	word = word.upper()
print(word)


c3 = input()
c1 = 0
c2 = 0
for i in c3:
	if i.islower():
		c1 += 1
	if i.isupper():
		c2 += 1
if c1 < c2:
	s1 = c3.upper()
else:
	s1 = c3.lower()
print(s1)


s = input()
count_l = 0
count_b = 0
for i in s:
	if 'a' <= i <= 'z':
		count_l += 1
	if 'A' <= i <= 'Z':
		count_b += 1
if count_l >= count_b:
	print(s.lower())
else:
	print(s.upper())


n = input()
c = 0
for i in n:
	if i >= 'a' and i <= 'z':
		c = c + 1
if c == 0:
	print(n)
elif len(n) - c <= len(n) / 2 or len(n) == len(n) - c:
	print(n.lower())
else:
	print(n.upper())


x = input('')
cnt = 0
ln = len(x)
for c in x:
	if c.upper() == c:
		cnt = cnt + 1
if cnt > ln / 2:
	print(x.upper())
else:
	print(x.lower())


s = input()
list = list(s)
upper = 0
lower = 0
for i in list:
	if i.isupper():
		upper += 1
	elif i.islower():
		lower += 1
if upper > lower:
	s = s.upper()
elif lower == upper:
	s = s.lower()
else:
	s = s.lower()
print(s)


string = input()
lowers = int('0')
uppers = int('0')
for i in string:
	if ord(i) > 96:
		lowers += 1
	else:
		uppers += 1
if lowers >= uppers:
	print(string.lower())
else:
	print(string.upper())


a = input()
m = 0
for i in a:
	if i.islower():
		m += 1
if m >= len(a) - m:
	print(a.lower())
elif m < len(a) - m:
	print(a.upper())


string = list(input().rstrip())
(upr, lwr) = (0, 0)
for x in string:
	if x.islower():
		lwr += 1
	else:
		upr += 1
if upr > lwr:
	print(''.join(string).upper())
else:
	print(''.join(string).lower())


s = input()
c = 0
k = 0
for i in s:
	if ord(i) in range(65, 91):
		c = c + 1
	else:
		k = k + 1
if c > k:
	print(s.upper())
elif c == k:
	print(s.lower())
else:
	print(s.lower())


string = input()
count = 0
count_1 = 0
for x in string:
	if x.isupper():
		count += 1
	if x.islower():
		count_1 += 1
if count > count_1:
	print(string.upper())
elif count < count_1:
	print(string.lower())
if count == count_1:
	print(string.lower())


v = input()
if sum(map(str.isupper, v)) > len(v) / 2:
	print(v.upper())
else:
	print(v.lower())


a = input()
index = 0
x = 'abcdefghijklmnopqrstuvwxyz'
y = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
m = 0
n = 0
while index < len(a):
	if a[index] in x:
		m += 1
	elif a[index] in y:
		n += 1
	index += 1
if m < n:
	print(a.upper())
else:
	print(a.lower())


def upperCase(word):
	return len(list((i for i in word if i.isupper())))

def lowerCase(word):
	return len(list((i for i in word if i.islower())))

def transfer(word):
	if upperCase(word) > lowerCase(word):
		return word.upper()
	return word.lower()
print(transfer(input()))


import math
import os
import random
import re
import sys
s = str(input())
a = len(re.findall('[A-Z]', s))
b = len(re.findall('[a-z]', s))
if a > b:
	s = s.upper()
	print(s)
else:
	s = s.lower()
	print(s)


word = input()
n_upper = sum([x.isupper() for x in word])
if n_upper > len(word) // 2:
	print(word.upper())
else:
	print(word.lower())


string = input()
low = 0
up = 0
for char in string:
	if char == char.upper():
		up += 1
	else:
		low += 1
if up > low:
	print(string.upper())
else:
	print(string.lower())


n = list(input())
(a, b) = ([], [])
for i in n:
	if i.islower():
		a.append(i)
	else:
		b.append(i)
if len(b) > len(a):
	print(''.join(n).upper())
else:
	print(''.join(n).lower())


s = str(input())
bigs = 0
smalls = 0
for i in s:
	if i == i.lower():
		smalls += 1
	else:
		bigs += 1
if smalls >= bigs:
	print(s.lower())
else:
	print(s.upper())


a = input()
n = 0
s = 0
for x in a:
	if x.isupper():
		n += 1
	else:
		s += 1
if n > s:
	print(a.upper())
else:
	print(a.lower())


inp = str(input())
upper = 0
lower = 0
if len(inp) > 100:
	exit()
else:
	for x in inp:
		if x.isupper():
			upper += 1
		elif x.islower():
			lower += 1
	if upper > lower:
		print(inp.upper())
	elif upper < lower:
		print(inp.lower())
	elif upper == lower:
		print(inp.lower())


num = 0
n = 0
s = input()
for i in range(len(s)):
	if s[i].islower() == True:
		num = num + 1
	else:
		n = n + 1
if num >= n:
	print(s.lower())
else:
	print(s.upper())


s = input().strip()
uc = 0
lc = 0
for i in s:
	if i == i.upper():
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(s.upper())
else:
	print(s.lower())


a = input()
countUp = 0
countLow = 0
for i in a:
	if i.isupper():
		countUp += 1
	else:
		countLow += 1
if countLow > countUp:
	print(a.lower())
elif countLow == countUp:
	print(a.lower())
else:
	print(a.upper())


str1 = str(input())
up = 0
lo = 0
for a in str1:
	if a == a.lower():
		lo += 1
	else:
		up += 1
if lo >= up:
	print(str1.lower())
else:
	print(str1.upper())


s = input()
countlow = 0
countup = 0
for i in s:
	if i.islower():
		countlow = countlow + 1
	elif i.isupper():
		countup = countup + 1
if countup > countlow:
	print(s.upper())
else:
	print(s.lower())


s = input()
n_lower = 0
n_upper = 0
for c in s:
	if c >= 'a':
		n_lower += 1
	else:
		n_upper += 1
print(s.upper()) if n_upper > n_lower else print(s.lower())


str = input()
letters = list(str)
upperLetters = 0
lowerLetters = 0
for c in letters:
	if c >= 'a' and c <= 'z':
		lowerLetters += 1
	else:
		upperLetters += 1
if lowerLetters >= upperLetters:
	print(str.lower())
else:
	print(str.upper())


def func(s):
	l1 = [x for k in [list(map(str, i)) for i in s] for x in k]
	(upper, lower) = ([x for x in l1 if x.isupper()], [x for x in l1 if x.islower()])
	if len(upper) > len(lower):
		ans = [x.upper() for x in l1]
	else:
		ans = [x.lower() for x in l1]
	final = ''.join(ans)
	return final
print(func(input()))


s = input()
exec('print(s.' + 'luopwp'[sum((x < '[' for x in s)) * 2 > len(s)::2] + 'er())')


w = input()
upper = lower = 0
for i in w:
	if i.isupper() == True:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(str(w).upper())
else:
	print(str(w).lower())


s = input()
print([s.lower(), s.upper()][sum((ord(c) < 97 for c in s)) * 2 > len(s)])


P = input()
low = 0
May = 0
for x in P:
	if x == x.lower():
		low += 1
	else:
		May += 1
if May > low:
	print(P.upper())
else:
	print(P.lower())


import sys
import io
import os
total = 0
failed = 0

def run(test, res):
	x = io.StringIO()
	with io.StringIO(test) as sys.stdin:
		with x as sys.stdout:
			work()
			z = x.getvalue().strip()
	sys.stdout = sys.__stdout__
	print('Passed?', z == res)
	print('Expected: ', res)
	print('Actual  : ', z)
	global total, failed
	total += 1
	failed += 1 if z != res else 0

def work():
	s = input()
	c = 0
	for e in s:
		if e >= 'a' and e <= 'z':
			c += 1
	print(s.lower() if c >= len(s) / 2 else s.upper())

def test():
	run('HoUse', 'house')
	run('ViP', 'VIP')
	run('maTRIx', 'matrix')
if 'LOCALTEST' in os.environ:
	test()
	print('\n Result: %s (%d total, %d failed)' % ('FAILED' if failed > 0 else 'PASSED', total, failed))
else:
	work()


s = input().strip()
(a, z) = (ord('a'), ord('z'))
(uc, lc) = (0, 0)
for c in s:
	if a <= ord(c) <= z:
		lc += 1
	else:
		uc += 1
print(s.lower() if lc >= uc else s.upper())


s = input()
l = 0
h = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		h += 1
	else:
		l += 1
if l >= h:
	for i in s:
		if ord(i) >= 65 and ord(i) <= 90:
			print(chr(ord(i) + 32), end='')
		else:
			print(i, end='')
else:
	for i in s:
		if ord(i) >= 65 and ord(i) <= 90:
			print(i, end='')
		else:
			print(chr(ord(i) - 32), end='')


s = input()
cap = 0
noncap = 0
for i in range(len(s)):
	if s[i].isupper():
		cap += 1
	else:
		noncap += 1
if noncap >= cap:
	print(s.lower())
else:
	print(s.upper())


n = input()
(u, l) = (0, 0)
for x in n:
	if x.islower():
		l += 1
	else:
		u += 1
if u > l:
	print(n.upper())
else:
	print(n.lower())


data = input()
upper_count = 0
lower_count = 0
for i in data:
	if i.isupper():
		upper_count += 1
	else:
		lower_count += 1
if upper_count <= lower_count:
	print(data.lower())
else:
	print(data.upper())


word = input()
upperc = 0
lowerc = 0
for char in word:
	if ord(char) >= 65 and ord(char) <= 90:
		upperc += 1
	else:
		lowerc += 1
if lowerc >= upperc:
	print(word.lower())
else:
	print(word.upper())


s = input()
s_normal = list(s)
s_upper = list(s.upper())
s_lower = list(s.lower())
count1 = 0
count2 = 0
for m in range(0, len(s_normal)):
	if s_normal[m] != s_upper[m]:
		count1 += 1
	if s_normal[m] != s_lower[m]:
		count2 += 1
if count1 < count2:
	print(''.join(s_upper))
else:
	print(''.join(s_lower))


n = input()
c = 0
for i in list(n):
	if i.islower():
		c += 1
	else:
		c -= 1
if c >= 0:
	print(n.lower())
else:
	print(n.upper())


test = input()
up = 0
down = 0
for i in test:
	if i.isupper():
		up += 1
	elif i.islower():
		down += 1
	if up > down:
		test = test.upper()
	else:
		test = test.lower()
print(test)


n = input()
t = list(n)
c = 0
for i in t:
	if i.islower() == True:
		c += 1
if len(t) - c > c:
	print(n.upper())
else:
	print(n.lower())


s = str(input())
c1 = c2 = 0
for i in s:
	if i >= 'a' and i <= 'z':
		c1 += 1
	if i >= 'A' and i <= 'Z':
		c2 += 1
if c1 >= c2:
	print(s.lower())
else:
	print(s.upper())


word = input()
upper_chrs = [w for w in word if w.isupper()]
if len(upper_chrs) > len(word) // 2:
	print(word.upper())
else:
	print(word.lower())


word = input()
u = 0
l = 0
for i in word:
	if i.isupper():
		u += 1
if u > len(word) / 2:
	print(word.upper())
else:
	print(word.lower())


s = input()
upper = 'ABCDEFGHIJKLMNÑOPQRSTUVWXYZ'
hoMUpper = 0
for letter in s:
	for may in upper:
		if may == letter:
			hoMUpper += 1
if hoMUpper > len(s) - hoMUpper:
	s = s.upper()
elif hoMUpper <= len(s) - hoMUpper:
	s = s.lower()
print('{}'.format(s))


upper_count = 0
lower_count = 0
word = input()
new_word = ''
for i in word:
	if i.isupper() == True:
		upper_count += 1
	else:
		lower_count += 1
if upper_count > lower_count:
	new_word = word.upper()
else:
	new_word = word.lower()
print(new_word)


from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
from collections import Counter
from math import sqrt
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	st = input()
	c = 0
	s = 0
	for i in range(len(st)):
		if ord(st[i]) < 95:
			c += 1
		else:
			s += 1
	if s >= c:
		for i in range(len(st)):
			if ord(st[i]) < 95:
				print(chr(ord(st[i]) + 32), end='')
			else:
				print(st[i], end='')
		print('')
	else:
		for i in range(len(st)):
			if ord(st[i]) > 95:
				print(chr(ord(st[i]) - 32), end='')
			else:
				print(st[i], end='')
		print('')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
main()


def test():
	st = input()
	low = 0
	for i in st:
		if i.islower():
			low += 1
	if low < len(st) - low:
		print(st.upper())
	else:
		print(st.lower())
test()


i = 0
j = 0
s = input()
for k in s:
	if k.islower():
		i += 1
	else:
		j += 1
if i >= j:
	print(s.lower())
else:
	print(s.upper())


import re
a = input()
print(a.lower() if max(len([i for i in a if i.isupper()]), len([i for i in a if i.islower()])) == len([i for i in a if i.islower()]) else a.upper())


n = str(input())
k = n
li = []
li2 = []
for i in range(0, len(n)):
	if n[i].isupper():
		li.append(n[i])
	else:
		li2.append(n[i])
if len(li) > len(li2):
	print(k.upper())
else:
	print(k.lower())


strs = input()
s_u = 'QWERTYUIOPLKJHGFDSAZXCVBNM'
s_l = 'qwertyuioplkjhgfdsazxcvbnm'
su = 0
sl = 0
for i in range(len(strs)):
	if strs[i] in s_u:
		su += 1
	else:
		sl += 1
if su <= sl:
	print(strs.lower())
elif su > sl:
	print(strs.upper())


x = input()
d = {'upper': 0, 'lower': 0}
for i in x:
	if i.isupper():
		d['upper'] += 1
	elif i.islower():
		d['lower'] += 1
	else:
		pass
if d['upper'] > d['lower']:
	print(x.upper())
elif d['upper'] < d['lower']:
	print(x.lower())
else:
	print(x.lower())


a = input()
(cnt1, cnt2) = (0, 0)
for i in a:
	if i >= 'a' and i <= 'z':
		cnt1 += 1
	else:
		cnt2 += 1
if cnt1 >= cnt2:
	print(a.lower())
else:
	print(a.upper())


word = input()
lowercase = 0
uppercase = 0
for i in word:
	if i.islower():
		lowercase += 1
	elif i.isupper():
		uppercase += 1
if lowercase >= uppercase:
	print(word.lower())
else:
	print(word.upper())


s = input()
small = 0
big = 0
for i in range(len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		small += 1
	else:
		big += 1
if big > small:
	print(s.upper())
else:
	print(s.lower())


x = input()
c = 0
d = 0
for i in x:
	if i.isupper():
		c = c + 1
	else:
		d = d + 1
if c > d:
	print(x.upper())
else:
	print(x.lower())


str = input()
c = k = 0
for i in range(len(str)):
	for j in 'abcdefghijklmnopqrstuvwxyz':
		if str[i] == j:
			c = c + 1
		else:
			continue
	for j in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		if str[i] == j:
			k = k + 1
if c >= k:
	print(str.lower())
else:
	print(str.upper())


word = input()
n = len(word)
ref = 'abcdefghijklmnopqrstuvwxyz'
big = 0
small = 0
for letter in word:
	if letter in ref:
		small += 1
big = n - small
if big > small:
	print(word.upper())
else:
	print(word.lower())


import string
lower = string.ascii_lowercase
upper = string.ascii_uppercase
s = input()
(nrl, nru) = (0, 0)
for i in range(len(s)):
	if s[i] in lower:
		nrl += 1
	else:
		nru += 1
if nrl >= nru:
	print(s.lower())
else:
	print(s.upper())


def isLower(a):
	return a >= 'a' and a <= 'z'

def isUpper(a):
	return a >= 'A' and a <= 'Z'

def main():
	s = input()
	(low, up) = (0, 0)
	for i in range(len(s)):
		low += isLower(s[i])
		up += isUpper(s[i])
	if low >= up:
		s = s.lower()
	else:
		s = s.upper()
	print(s)
main()


inp = input()
lowerc = 0
upperc = 0
for s in inp:
	if s.islower():
		lowerc += 1
	else:
		upperc += 1
if lowerc >= upperc:
	print(inp.lower())
else:
	print(inp.upper())


s = input()
zerou = 0
zerol = 0
for i in range(len(s)):
	if s[i] == s[i].upper():
		zerou += 1
	else:
		zerol += 1
if zerou > zerol:
	print(s.upper())
else:
	print(s.lower())


s = list(input())
c = 0
for i in s:
	if i == i.upper():
		c += 1
if c > int(len(s) / 2):
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


t = input()
a = list(filter(lambda x: x.isupper(), t))
b = list(filter(lambda x: x.islower(), t))
if len(a) > len(b):
	print(t.upper())
else:
	print(t.lower())


import string
l = input()
(a, b) = (0, 0)
for i in l:
	if i in string.ascii_lowercase:
		a += 1
	else:
		b += 1
if a >= b:
	print(l.lower())
else:
	print(l.upper())


word = input()
(upper, lower) = (0, 0)
if len(word) >= 1 and len(word) <= 100:
	for l in word:
		if l.isupper():
			upper += 1
		else:
			lower += 1
if upper > lower:
	print(word.upper())
else:
	print(word.lower())


s = input()
l = list(s)
k = 0
for i in range(len(s)):
	if ord(s[i]) >= 97:
		k += 1
print(s.upper() if k < len(s) / 2 else s.lower())


s = input()
lu = 0
for i in s:
	if i >= 'A' and i <= 'Z':
		lu = lu + 1
	else:
		lu = lu - 1
if lu > 0:
	print(s.upper())
else:
	print(s.lower())


s = input()
L = [i for i in s if 97 <= ord(i) <= 122]
K = [j for j in s if 65 <= ord(j) <= 90]
if len(L) < len(K):
	print(s.upper())
else:
	print(s.upper().swapcase())


s = input()
cu = 0
for i in s:
	if i.isupper():
		cu += 1
cl = len(s) - cu
if cu > cl:
	print(s.upper())
else:
	print(s.lower())


s = input()
lwr = 'abcdefghijklmnopqrstuvwxyz'
upr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lcnt = ucnt = 0
for i in s:
	if i in lwr:
		lcnt += 1
	else:
		ucnt += 1
if lcnt >= ucnt:
	print(s.lower())
else:
	print(s.upper())


m = input()
n = list(m)
c = 0
d = 0
for i in n:
	if i.islower():
		c = c + 1
	elif i.isupper():
		d = d + 1
if c >= d:
	print(m.lower())
else:
	print(m.upper())


s = str(input())
b = 0
m = 0
for i in range(len(s)):
	if s[i].isupper():
		b += 1
	else:
		m += 1
else:
	if b > m:
		print(s.upper())
	elif b < m:
		print(s.lower())
	else:
		print(s.lower())


s = input()
l = list(s)
up = 0
low = 0
for i in range(len(l)):
	if ord(l[i]) <= 122 and ord(l[i]) >= 97:
		low = low + 1
	else:
		up = up + 1
if up > low:
	print(s.upper())
else:
	print(s.lower())


word = input()
uppercase = len([i for i in word if i.isupper()])
lowercase = len([i for i in word if i.islower()])
if uppercase <= lowercase:
	print(word.lower())
else:
	print(word.upper())


s = input()
c = 0
l = 0
for i in s:
	if i >= 'A' and i <= 'Z':
		c = c + 1
	else:
		l = l + 1
if l >= c:
	print(s.lower())
else:
	print(s.upper())


word = input()
uppers = 0
for i in word:
	if i.isupper():
		uppers += 1
if uppers <= len(word) // 2:
	new_word = ''
	for i in word:
		if not i.islower():
			new_word += i.swapcase()
		else:
			new_word += i
else:
	new_word = ''
	for i in word:
		if i.islower():
			new_word += i.swapcase()
		else:
			new_word += i
print(new_word)


a = input()
num = 0
for s in a:
	if s.isupper():
		num += 1
print(a.lower() if num <= len(a) / 2 else a.upper())


s = input()
ss = s.lower()
sc = s.upper()
a = sum([ord(c) for c in ss]) - sum([ord(c) for c in s])
b = sum([ord(c) for c in s]) - sum([ord(c) for c in sc])
if a > b:
	print(sc)
else:
	print(ss)


def solver(text):
	lc = 0
	hc = 0
	for i in text:
		if i.islower():
			lc += 1
		else:
			hc += 1
	if lc == hc or lc > hc:
		return text.lower()
	return text.upper()
print(solver(input()))


input_list = []
num = 0
while True:
	if num == 1:
		break
	line = list(input())
	num += 1
count = 0
for char in line:
	if char.isupper():
		count += 1
word = ''.join(line)
if count > len(line) - count:
	print(word.upper())
else:
	print(word.lower())


s = input()
a = list(map(lambda c: c.islower(), s))
if sum(a) > len(s) / 2:
	print(s.lower())
elif sum(a) < len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


g = input()
up = 0
low = 0
for i in g:
	if i == i.upper():
		up += 1
	else:
		low += 1
avg = len(g) // 2 + 1
if low > up:
	g = g.lower()
elif up > low:
	g = g.upper()
else:
	g = g.lower()
print(g)


word = input()
upper = 0
lower = 0
for i in word:
	if i >= 'a' and i <= 'z':
		lower += 1
	if i >= 'A' and i <= 'Z':
		upper += 1
if upper > lower:
	print(word.upper())
if lower >= upper:
	print(word.lower())


string = str(input())
upper = 0
lower = 0
for i in range(len(string)):
	if ord(string[i]) >= 97 and ord(string[i]) <= 122:
		lower += 1
	elif ord(string[i]) >= 65 and ord(string[i]) <= 90:
		upper += 1
if upper > lower:
	string = string.upper()
	print(string)
elif lower >= upper:
	string = string.lower()
	print(string)


string = input()
lower = 0
upper = 0
for _ in string:
	if _ == _.lower():
		lower += 1
	else:
		upper += 1
if upper > lower:
	for _ in string:
		print(_.upper(), end='')
else:
	for _ in string:
		print(_.lower(), end='')


a = input()
b = len(a)
(low, upp) = (0, 0)
for x in range(b):
	if a[x].islower():
		low += 1
	else:
		upp += 1
if upp > low:
	print(a.upper())
else:
	print(a.lower())


s = input()
u = 0
l = 0
for x in range(ord('A'), ord('Z') + 1):
	u += s.count(chr(x))
for x in range(ord('a'), ord('z') + 1):
	l += s.count(chr(x))
if l >= u:
	print(s.lower())
else:
	print(s.upper())


def main():
	string = input()
	s = 0
	for x in string:
		if x.isupper():
			s = s + 1
	if s > len(string) // 2:
		string = string.upper()
	else:
		string = string.lower()
	print(string)
main()


word = input()
uppercase = 0
for i in word:
	if i.islower():
		uppercase += 1
lowercase = len(word) - uppercase
if lowercase <= uppercase:
	answer = word.lower()
else:
	answer = word.upper()
print(answer)


s = str(input())
i = 0
for x in s:
	if x.isupper():
		i = i + 1
if i > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


import math
from collections import defaultdict
from collections import Counter
import itertools

def solve(s):
	n = len(s)
	uc = 0
	lc = 0
	for i in range(n):
		if s[i].isupper():
			uc += 1
		else:
			lc += 1
	if uc == lc:
		return s.lower()
	if uc > lc:
		return s.upper()
	if uc < lc:
		return s.lower()
s = input()
print(solve(s))


string = input()
k = sum((i.isupper() for i in string))
l = sum((i.islower() for i in string))
if k > l:
	print(string.upper())
else:
	print(string.lower())


n = input()
(uppers, lowers) = (0, 0)
for i in range(len(n)):
	if n[i] >= 'A' and n[i] <= 'Z':
		uppers += 1
lowers = len(n) - uppers
if lowers >= uppers:
	print(n.lower())
else:
	print(n.upper())


word = input()
count1 = 0
count2 = 0
for i in word:
	if i.islower() == True:
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	print(word.lower())
elif count2 > count1:
	print(word.upper())
else:
	print(word.lower())


s = input()
st = ''
co = 0
ci = 0
for i in s:
	if i.isupper() == True:
		co += 1
	else:
		ci += 1
if co <= ci:
	for i in s:
		if i.isupper() == True:
			st += i.lower()
		else:
			st += i
else:
	for i in s:
		if i.islower() == True:
			st += i.upper()
		else:
			st += i
print(st)


s = input()
countup = countlow = 0
for i in range(len(s)):
	if s[i].isupper():
		countup += 1
	else:
		countlow += 1
print(s.upper()) if countup > countlow else print(s.lower())


s = input()
a = sum((1 for i in s if i.islower()))
b = len(s) - a
if a >= b:
	print(s.lower())
else:
	print(s.upper())


string = str(input())
u = 0
l = 0
for i in range(len(string)):
	if string[i] == string[i].upper():
		u += 1
	elif string[i] == string[i].lower():
		l += 1
if u == l:
	print(string.lower())
elif u < l:
	print(string.lower())
else:
	print(string.upper())


(lc, ls) = (0, frozenset(range(97, 123)))
(uc, us) = (0, frozenset(range(65, 91)))
bw = bytearray(input(), encoding='ascii')
for i in range(len(bw)):
	if bw[i] in ls:
		lc += 1
	if bw[i] in us:
		uc += 1
if uc > lc:
	for i in range(len(bw)):
		if bw[i] in ls:
			bw[i] -= 32
else:
	for i in range(len(bw)):
		if bw[i] in us:
			bw[i] += 32
print(bw.decode(encoding='ascii'))


s = input()
lower = 0
upper = 0
for i in s:
	if i.isupper():
		upper += 1
	if i.islower():
		lower += 1
if lower < upper:
	print(s.upper())
if upper <= lower:
	print(s.lower())


s = input()
lower = 0
upper = 0
for item in s:
	if item.islower():
		lower += 1
	else:
		upper += 1
if lower > upper:
	print(s.lower())
elif lower < upper:
	print(s.upper())
else:
	print(s.lower())


s = input()
h = 0
l = 0
for c in s:
	if c.isupper():
		h = h + 1
	elif c.islower():
		l = l + 1
	else:
		pass
if h > l:
	print(s.upper())
elif h < l:
	print(s.lower())
elif h == l:
	print(s.lower())
else:
	pass


import sys
s = list(sys.stdin.readline())[:-1]
upper = 0
lower = 0
for i in s:
	if str(i).isupper():
		upper += 1
	else:
		lower += 1
if lower == upper:
	print(''.join(s).lower())
elif lower < upper:
	i = 0
	while i < len(s):
		if not s[i].isupper():
			s[i] = s[i].upper()
		i += 1
	print(''.join(s))
elif upper < lower:
	i = 0
	while i < len(s):
		if s[i].isupper():
			s[i] = s[i].lower()
		i += 1
	print(''.join(s))


n = str(input())
c = 0
for i in n:
	if int(i.isupper()) == 1:
		c = c + 1
if len(n) - c >= c:
	print(n.lower())
else:
	print(n.upper())


w = input()
l = list(w)
l.sort()
up = []
low = []
for i in l:
	if str(l[l.index(i) - 1]).isupper() and str(i).islower():
		up = l[:l.index(i)]
		low = l[l.index(i):]
if len(up) == 0 or len(low) == 0:
	print(w)
else:
	if len(low) >= len(up):
		w = w.lower()
	else:
		w = w.upper()
	print(w)


def word():
	string = input()
	up_count = sum(map(str.isupper, string))
	low_count = sum(map(str.islower, string))
	if up_count <= low_count:
		return string.lower()
	if up_count > low_count:
		return string.upper()
print(word())


line = input()
uppercase_count = 0
lowercase_count = 0
for i in range(len(line)):
	if line[i] == line[i].upper():
		uppercase_count += 1
	else:
		lowercase_count += 1
if uppercase_count == lowercase_count:
	print(line.lower())
elif uppercase_count > lowercase_count:
	print(line.upper())
else:
	print(line.lower())


n = input()
cl = 0
c = 0
for i in range(0, len(n)):
	if n[i].islower():
		cl += 1
	else:
		c += 1
if cl >= c:
	print(n.lower())
else:
	print(n.upper())


p = input()
u = 0
l = 0
for i in p:
	if i < 'a':
		u += 1
	else:
		l += 1
if u > l:
	print(p.upper())
else:
	print(p.lower())


s = input()
u_count = 0
l_count = 0
for i in range(len(s)):
	if s[i].isupper():
		u_count += 1
	elif s[i].islower():
		l_count += 1
if l_count > u_count:
	print(s.lower())
elif l_count == u_count:
	print(s.lower())
else:
	print(s.upper())


s = input()
list_s = list(s)
uppercase = 0
lowercase = 0
for i in s:
	if i.isupper():
		uppercase += 1
	elif i.islower():
		lowercase += 1
if uppercase > lowercase:
	print(s.upper())
else:
	print(s.lower())


s = input()
count1 = 0
count2 = 0
for a in s:
	if a.islower() == True:
		count1 += 1
	else:
		count2 += 1
if count1 >= count2:
	print(s.lower())
else:
	print(s.upper())


s = str(input())
lower = 0
upper = 0
for i in range(len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		lower += 1
	elif ord(s[i]) >= 65 and ord(s[i]) <= 90:
		upper += 1
if lower < upper:
	print(s.upper())
else:
	print(s.casefold())


word = input()
upper_word = word.upper()
lower_word = word.lower()
lc = 0
uc = 0
for (u, l, w) in zip(upper_word, lower_word, word):
	if u == w:
		uc += 1
	if l == w:
		lc += 1
if uc > lc:
	print(upper_word)
else:
	print(lower_word)


from sys import stdin
import re
a = stdin.readline().strip()
upper = len(re.findall('[A-Z]', a))
lower = len(a) - upper
if lower < upper:
	print(a.upper())
else:
	print(a.lower())


s = input()
low = 'abcdefghijklmnopqrstuvwxyz'
high = low.swapcase()
lc = int(0)
hc = int(0)
for i in range(0, len(s)):
	if s[i] in low:
		lc = lc + 1
	else:
		hc = hc + 1
if lc >= hc:
	print(s.casefold())
else:
	s = s.casefold()
	print(s.swapcase())


str = input()
lower = 0
l = len(str)
for letter in str:
	if letter.islower():
		lower += 1
upper = l - lower
if lower >= upper:
	str = str.lower()
else:
	str = str.upper()
print(str)


def main():
	ALPHA = 'QWERTYUIOPASDFGHJKLZXCVBNM'
	A = 0
	a = 0
	check = input()
	list_count = list(check)
	for k in list_count:
		if k in ALPHA:
			A += 1
		else:
			a += 1
	if A > a:
		print(check.upper())
	else:
		print(check.lower())
main()


n = input()
a = len(n)
b = 0
c = 0
if n.islower():
	print(n)
elif n.isupper():
	print(n)
else:
	for i in range(a):
		if n[i].isupper():
			b = b + 1
		elif n[i].islower():
			c = c + 1
	if c >= b:
		print(n.lower())
	elif b > c:
		print(n.upper())


st = list(input())
up = 0
lo = 0
for i in st:
	if ord(i) >= 65 and ord(i) <= 91:
		up += 1
	elif ord(i) >= 97 and ord(i) <= 123:
		lo += 1
if up == lo or lo > up:
	l = []
	for i in st:
		if ord(i) >= 65 and ord(i) <= 91:
			l.append(chr(ord(i) + 32))
		else:
			l.append(i)
else:
	l = []
	for i in st:
		if ord(i) >= 65 and ord(i) <= 91:
			l.append(i)
		elif ord(i) >= 97 and ord(i) <= 123:
			l.append(chr(ord(i) - 32))
print(''.join(l))


def convertWord(s):
	lCount = 0
	uCount = 0
	for char in s:
		if char.islower():
			lCount += 1
		else:
			uCount += 1
	if lCount >= uCount:
		return s.lower()
	else:
		return s.upper()

def main():
	s = input()
	print(convertWord(s))
main()


def Convert(string):
	list1 = []
	list1[:0] = string
	return list1
s = str(input())
uc = 0
lc = 0
d = Convert(s)
for i in d:
	if i.isupper() == True:
		uc += 1
	else:
		lc += 1
if uc > lc:
	s = s.upper()
else:
	s = s.lower()
print(s)


S = input()
upper = 0
lower = 0
for i in range(0, len(S)):
	if ord(S[i]) < 97:
		upper += 1
	else:
		lower += 1
ans = ''
if upper > lower:
	for i in range(0, len(S)):
		if ord(S[i]) >= 97:
			ans = ans + chr(ord(S[i]) - 32)
		else:
			ans = ans + S[i]
else:
	for i in range(0, len(S)):
		if ord(S[i]) < 97:
			ans = ans + chr(ord(S[i]) + 32)
		else:
			ans = ans + S[i]
print(ans)


word = input()
low_count = len([c for c in word if c.islower()])
if 2 * low_count < len(word):
	print(word.upper())
else:
	print(word.lower())


word = input()
upper = 0
lower = 0
for letter in word:
	if letter.istitle() == True:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(word.upper())
else:
	print(word.lower())


import math

def main():
	string = str(input())
	cnt = 0
	for i in range(len(string)):
		if string[i].isupper():
			cnt += 1
	if cnt > len(string) // 2:
		print(string.upper())
	else:
		print(string.lower())
main()


s = input()
low = 0
up = 0
for i in s:
	if ord(i) <= 90:
		up += 1
	else:
		low += 1
if up > low:
	print(s.upper())
else:
	print(s.lower())


a = input()
rez = 0
for i in a:
	if 97 <= ord(i) <= 122:
		rez += 1
	else:
		rez -= 1
if rez >= 0:
	print(a.lower())
else:
	print(a.upper())


try:
	s = input()
	count = 0
	for ch in s:
		if ch.isupper() == True:
			count += 1
	if len(s) == count and len(s) - count != 0:
		print(s.lower())
	elif count > len(s) - count:
		print(s.upper())
	else:
		print(s.lower())
except EOFError as identifier:
	pass


s = input()
(uppers, lowers) = (0, 0)
for c in s:
	if c.isupper():
		uppers += 1
	elif c.islower():
		lowers += 1
if uppers <= lowers:
	print(s.lower())
else:
	print(s.upper())


n = input()
l = [i for i in range(len(n)) if n[i] == n[i].lower()]
print(n.lower() if len(l) >= len(n) / 2 else n.upper())


s = input()
C = 0
c = 0
for char in s:
	if char.isupper():
		C += 1
	else:
		c += 1
if C > c:
	print(s.upper())
else:
	print(s.lower())


a = [i for i in range(65, 91)]
b = [i for i in range(97, 123)]
s = input()
x = 0
C = 0
for c in s:
	if ord(c) in a:
		x += 1
	else:
		C += 1
if x > C:
	print(s.upper())
else:
	print(s.lower())


s = input()
countl = 0
countu = 0
for i in s:
	if ord(i) < 97:
		countu += 1
	else:
		countl += 1
if countu > countl:
	print(s.upper())
else:
	print(s.lower())


s = input()
capital = [ch for ch in s if ch.isupper()]
capital = len(capital)
low = len(s) - capital
if capital > low:
	print(s.upper())
else:
	print(s.lower())


R = lambda : list(map(int, input().split()))
s = input()
c = 0
for x in s:
	if 'A' <= x <= 'Z':
		c += 1
if c > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


a = input()
p = 0
q = 0
for i in a:
	if i.islower():
		p = p + 1
	else:
		q = q + 1
if p > q:
	a = a.lower()
elif q > p:
	a = a.upper()
else:
	a = a.lower()
print(a)


n = input()
a = list(n)
c = 0
d = 0
for s in a:
	if str(s).isupper():
		c += 1
	else:
		d += 1
if c > d:
	n = n.upper()
else:
	n = n.lower()
print(n)


n = input()
count1 = 0
count2 = 0
for i in n:
	if i.upper() == i:
		count1 += 1
	else:
		count2 += 1
if count1 < count2:
	print(n.lower())
elif count1 > count2:
	print(n.upper())
elif count1 == count2:
	print(n.lower())


s = input().strip()
case = 0
for j in s:
	if j.isupper():
		case -= 1
	else:
		case += 1
if case >= 0:
	print(s.lower())
else:
	print(s.upper())


n = str(input())
countup = 0
countlow = 0
for i in n:
	if i.isupper() == True:
		countup += 1
	else:
		countlow += 1
if countup > countlow:
	print(n.upper())
else:
	print(n.lower())


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

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

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def solve():
	a = inp()
	n = len(a)
	c = 0
	for i in a:
		if i.isupper():
			c += 1
	cl = n - c
	if cl >= c:
		print(a.lower())
	else:
		print(a.upper())
solve()


str1 = input()
lc = 0
uc = 0
for x in str1:
	if x.islower():
		lc += 1
	elif x.isupper():
		uc += 1
if lc >= uc:
	print(str1.lower())
else:
	print(str1.upper())


from string import ascii_lowercase
s = input()
lowercase = 0
for c in s:
	if c in ascii_lowercase:
		lowercase += 1
if lowercase * 2 >= len(s):
	print(s.lower())
else:
	print(s.upper())


import sys
lines = sys.stdin.readlines()
st = lines[0].strip()
(lowerC, upperC) = (0, 0)
for l in st:
	if ord(l) >= ord('a'):
		lowerC += 1
	else:
		upperC += 1
if lowerC >= upperC:
	print(st.lower())
else:
	print(st.upper())


def more_lower(string):
	count = 0
	for i in range(len(string)):
		if string[i] == string[i].lower():
			count += 1
	if count >= len(string) / 2:
		return True
	else:
		return False
string = input()
if more_lower(string):
	print(string.lower())
else:
	print(string.upper())


s = input()
c = 0
l = 0
for i in range(len(s)):
	if s[i].isupper() == 1:
		c = c + 1
	if s[i].islower() == 1:
		l = l + 1
if c > l:
	print(s.upper())
else:
	print(s.lower())


word = list(input())
n = len(word)
up = 0
low = 0
t = 0
while t < n:
	if ord(word[t]) < 95:
		up = up + 1
	else:
		low = low + 1
	t = t + 1
if up > low:
	for i in range(n):
		if ord(word[i]) > 95:
			code = ord(word[i]) - 32
			word[i] = chr(code)
else:
	for i in range(n):
		if ord(word[i]) < 95:
			code = ord(word[i]) + 32
			word[i] = chr(code)
output = ''.join(word)
print(output)
ord('A')


word = input()
DAXIE = []
XIAOXIE = []
for i in range(len(word)):
	if word[i].upper() == word[i]:
		DAXIE.append(word[i])
	else:
		XIAOXIE.append(word[i])
if len(DAXIE) > len(XIAOXIE):
	print(word.upper())
else:
	print(word.lower())


word = input()
COUNT = 0
for ch in word:
	if ch.isupper():
		COUNT += 1
count = len(word) - COUNT
if COUNT > count:
	print(word.upper())
else:
	print(word.lower())


a = input()
uppdown = 0
for i in range(len(a)):
	if ord(a[i]) >= 97:
		uppdown += 1
if uppdown >= len(a) / 2:
	a = a.lower()
else:
	a = a.upper()
print(a)


w = input()
x = 0
for let in w:
	if let.isupper():
		x += 1
if x * 2 > len(w):
	print(w.upper())
else:
	print(w.lower())


s = input()
captal = 0
lower = 0
for i in s:
	if ord(i) >= 65 and ord(i) < 97:
		captal += 1
	else:
		lower += 1
if captal > lower:
	print(s.upper())
else:
	print(s.lower())


s = input()
ans = ''
(U, L) = (0, 0)
for el in s:
	if el.islower():
		L += 1
	else:
		U += 1
	ans += el.capitalize()
if U > L:
	print(ans)
else:
	print(s.casefold())


data = input()
upper = 0
lower = 0
temp = ''
for index in range(0, len(data)):
	if data[index].islower():
		lower += 1
	else:
		upper += 1
if lower >= upper:
	for index in data:
		temp += index.lower()
else:
	for index in data:
		temp += index.upper()
print(temp)


import sys
try:
	sys.stdin = open(sys.path[0] + '\\input.txt', 'r')
	sys.stdout = open(sys.path[0] + '\\output.txt', 'w')
except Exception as e:
	pass
s = input()
(c1, c2) = (0, 0)
for i in s:
	if i.isupper():
		c1 += 1
	else:
		c2 += 1
if c1 > c2:
	print(s.upper())
else:
	print(s.lower())


import re
s = input()
may = len(re.findall('[A-Z]', s))
low = len(s) - may
print(s.lower() if low >= may else s.upper())


s = input()
l = 0
n = 0
for c in s:
	if c.isupper():
		l += 1
	elif c.islower():
		n += 1
if l > n:
	print(s.upper())
elif l == n:
	print(s.lower())
else:
	print(s.lower())


mixed_word = input()
i = 0
up = 0
low = 0
while i < len(mixed_word):
	if 64 < ord(mixed_word[i]) < 91:
		up += 1
	else:
		low += 1
	i += 1
i = 0
if up > low:
	print(mixed_word.upper())
else:
	print(mixed_word.lower())


n = input()
l = 0
u = 0
for i in n:
	if i.isupper() == True:
		u += 1
	else:
		l += 1
r = ''
if l >= u:
	for i in n:
		r += i.lower()
else:
	for i in n:
		r += i.upper()
print(r)


s = input()
n = len(s)
num = 0
for i in range(n):
	if s[i] == s[i].upper():
		num += 1
if num <= n / 2:
	print(s.lower())
else:
	print(s.upper())


def main():
	s = input()
	lower = len([c for c in s if c.islower()])
	upper = len(s) - lower
	if upper > lower:
		print(s.upper())
	else:
		print(s.lower())
main()


word = input()
q_l = 0
q_u = 0
for l in word:
	if l.lower() == l:
		q_l += 1
	else:
		q_u += 1
if q_l == q_u:
	print(word.lower())
elif q_l > q_u:
	print(word.lower())
else:
	print(word.upper())


cadena = input()
cmin = 0
cmay = 0
for c in cadena:
	if c.isupper():
		cmay += 1
	else:
		cmin += 1
if cmin >= cmay:
	print(cadena.lower())
else:
	print(cadena.upper())


word = input()
wordlwr = word.lower()
count = 0
for i in range(len(word)):
	if word[i] == wordlwr[i]:
		count += 1
cntlower = count
cntupper = len(word) - count
if cntlower >= cntupper:
	print(word.lower())
else:
	print(word.upper())


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
s = list(input())
n = len(s)
upper = 0
lower = 0
for i in s:
	if i.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


def Word(s):
	c = 0
	sm = 0
	for i in range(len(s)):
		if s[i] >= 'A' and s[i] <= 'Z':
			c = c + 1
		if s[i] >= 'a' and s[i] <= 'z':
			sm = sm + 1
	if c > sm:
		s = s.upper()
	else:
		s = s.lower()
	return s
x = input()
print(Word(x))


s = input()
v = 0
m = 0
for i in s:
	if ord(i) >= ord('a'):
		m += 1
	else:
		v += 1
if m > v or m == v:
	print(s.lower())
if m < v:
	print(s.upper())


word = input()
count_lower = 0
count_upper = 0
for s in word:
	if s.isupper():
		count_upper += 1
	else:
		count_lower += 1
if count_upper > count_lower:
	print(word.upper())
else:
	print(word.lower())


line = list(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
Alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
num_lower = 0
num_upper = 0
for i in line:
	if i in alphabet:
		num_lower += 1
	else:
		num_upper += 1
if num_lower >= num_upper:
	for j in range(len(line)):
		char = line[j]
		if char in Alphabet:
			line[j] = alphabet[Alphabet.index(char)]
else:
	for j in range(len(line)):
		char = line[j]
		if char in alphabet:
			line[j] = Alphabet[alphabet.index(char)]
ans = ''
for i in line:
	ans += i
print(ans)


import string
inp = input()
word = list(inp)
low = list(string.ascii_lowercase)
upp = list(string.ascii_uppercase)
tot_l = 0
tot_u = 0
for i in range(len(word)):
	if word[i] in low:
		tot_l += 1
	elif word[i] in upp:
		tot_u += 1
if tot_l < tot_u:
	print(inp.upper())
else:
	print(inp.lower())


def rev(l):
	s = ''
	for i in range(len(l) - 1, -1, -1):
		s = s + l[i]
	return s
t = 1
for _ in range(t):
	x = input()
	a = 0
	b = 0
	for i in x:
		if i.islower():
			a += 1
		else:
			b += 1
	s = ''
	if a >= b:
		for i in x:
			s += i.lower()
	else:
		for i in x:
			s += i.upper()
	print(s)


n = input()
isu = 0
ilu = 0
for i in n:
	if i.isupper() == True:
		isu += 1
	else:
		ilu += 1
if isu <= ilu:
	print(n.lower())
else:
	print(n.upper())


n = input()
low = 0
high = 0
for i in n:
	if 'a' <= i <= 'z':
		low = low + 1
	else:
		high = high + 1
if low >= high:
	print(n.lower())
else:
	print(n.upper())


s = str(input())
(up, lo) = (0, 0)
for x in s:
	if x.isupper():
		up += 1
	else:
		lo += 1
print(s.lower() if lo >= up else s.upper())


a = input()
num_low = 0
num_upp = 0
for i in a:
	if i in 'abcdefghijklmnopqrstuvwxyz':
		num_low += 1
	elif i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		num_upp += 1
if num_upp > num_low:
	a = a.upper()
else:
	a = a.lower()
print(a)


s = input()
n = len(s)
upper = sum([1 if c.upper() == c else 0 for c in s])
lower = n - upper
print(s.upper() if upper > lower else s.lower())


import sys
input = sys.stdin.readline
s = input().strip()
let = 0
for c in s:
	let += 1 if ord(c) >= 97 else -1
print(s.lower() if let >= 0 else s.upper())


n = input()
(k, l) = (0, 0)
for value in n:
	if value >= 'a' and value <= 'z':
		k += 1
	if value >= 'A' and value <= 'Z':
		l += 1
if k > l:
	print(n.lower())
elif k < l:
	print(n.upper())
elif k == l:
	print(n.lower())


n = input()
if n == 'ViP':
	print('VIP')
else:
	cntlwr = 0
	cntupr = 0
	for i in n:
		if i.isupper():
			cntupr += 1
		else:
			cntlwr += 1
	if cntupr > cntlwr:
		print(n.upper())
	else:
		print(n.lower())


x = input()
y = len(x)
lower = 0
upper = 0
for i in range(y):
	if x[i].islower():
		lower += 1
	elif x[i].isupper():
		upper += 1
if lower > upper or lower == upper:
	print(x.lower())
else:
	print(x.upper())


s = input()
count = 0
count1 = 0
for i in s:
	if 65 <= ord(i) <= 90:
		count = count + 1
	elif 97 <= ord(i) <= 122:
		count1 = count1 + 1
if count > count1:
	s = s.upper()
	print(s)
elif count1 > count:
	s = s.lower()
	print(s)
elif count1 == count:
	s = s.lower()
	print(s)


res = 0
s = input()
for each_char in s:
	if 'a' <= each_char <= 'z':
		res += 1
	else:
		res -= 1
if res >= 0:
	print(s.lower())
else:
	print(s.upper())


from math import ceil
import sys, bisect, copyreg, copy, statistics, os

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

def IIX():
	return (int(x) for x in sys.stdin.readline().split())

def II():
	return int(inp())

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

def LS():
	return list(map(str, inp().split()))

def L(x):
	return list(x)

def out(var):
	return sys.stdout.write(str(var))
word = L(inp())
(u, l) = (0, 0)
for x in word:
	if x.isupper():
		u += 1
	else:
		l += 1
if u > l:
	out(''.join(word).upper())
else:
	out(''.join(word).lower())


str = input()
(count, count1) = (0, 0)
for i in range(len(str)):
	if str[i].islower():
		count += 1
	if str[i].isupper():
		count1 += 1
if count > count1 or count == count1:
	str = str.lower()
else:
	str = str.upper()
print(str)


s = input()
upper_ = 0
lower_ = 0
for i in s:
	if i.upper() == i:
		upper_ += 1
	else:
		lower_ += 1
if upper_ > lower_:
	print(s.upper())
elif lower_ > upper_:
	print(s.lower())
elif upper_ == lower_:
	print(s.lower())


word = input()
lowerCount = 0
upperCount = 0
for s in word:
	if s.islower():
		lowerCount += 1
	else:
		upperCount += 1
if lowerCount > upperCount:
	print(word.lower())
elif lowerCount < upperCount:
	print(word.upper())
else:
	print(word.lower())


import sys
import os.path
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
	sys.stdout = open('out.txt', 'w')
s = input()
(lo, up) = (0, 0)
for i in s:
	if 'A' <= i <= 'Z':
		up += 1
	else:
		lo += 1
if lo >= up:
	print(s.lower())
else:
	print(s.upper())


s = input()
lower = 0
upper = 0
for x in range(len(s)):
	if s[x].islower() == True:
		lower += 1
	else:
		upper += 1
if lower > upper or lower == upper:
	su = s.lower()
elif lower < upper:
	su = s.upper()
print(su)


W = str(input())
(l, u) = (0, 0)
for w in W:
	if w >= 'a' and w <= 'z':
		l += 1
	if w >= 'A' and w <= 'Z':
		u += 1
if u > l:
	W = W.upper()
else:
	W = W.lower()
print(W)


word = input()
lowercase_letters = []
uppercase_letters = []
for i in word:
	if i.islower():
		lowercase_letters.append(i)
for j in word:
	if j.isupper():
		uppercase_letters.append(j)
if len(uppercase_letters) > len(lowercase_letters):
	print(word.upper())
else:
	print(word.lower())


s = input()
cap = 0
small = 0
for i in s:
	if i.isupper():
		cap += 1
	else:
		small += 1
if cap <= small:
	print(s.lower())
else:
	print(s.upper())


Pal = str(input())
may = 0
minu = 0
for k in range(len(Pal)):
	if Pal[k].isupper():
		may += 1
	else:
		minu += 1
if may > minu:
	print(Pal.upper())
else:
	print(Pal.lower())


a = input()
l = len(a)
b = 0
for i in range(l):
	if a[i].isupper():
		b += 1
	else:
		b -= 1
if b > 0:
	print(a.upper())
else:
	print(a.lower())


s = input()
(UC, LC, j) = (0, 0, [])
for i in s:
	if i.isupper():
		UC = UC + 1
	else:
		LC = LC + 1
if UC > LC:
	print(s.upper())
elif UC == LC:
	print(s.lower())
else:
	print(s.lower())


s = input()
ctr = 0
for elem in s:
	if 'A' <= elem <= 'Z':
		ctr += 1
if ctr <= len(s) // 2:
	print(s.lower())
else:
	print(s.upper())


s = input()
lowercase = 0
uppercase = 0
for i in s:
	if i.islower():
		lowercase += 1
	else:
		uppercase += 1
if lowercase >= uppercase:
	print(s.lower())
else:
	print(s.upper())


i = input()
low = [str(x) for x in i if x.islower()]
loq = len(low)
upp = len(i) - loq
if upp > loq:
	print(i.upper())
else:
	print(i.lower())


s = input()
x = 0
y = 0
import string
lower = string.ascii_lowercase
upper = string.ascii_uppercase
for i in s:
	if i in lower:
		x += 1
	else:
		y += 1
if x >= y:
	s = s.lower()
	print(s)
else:
	s = s.upper()
	print(s)


word = str(input())
count = 0
wl = len(word)
for l in word:
	if l.islower():
		count += 1
if count * 2 >= wl:
	print(word.lower())
else:
	print(word.upper())


word = str(input())
lowerCase = sum(map(str.islower, word))
upperCase = sum(map(str.isupper, word))
if lowerCase == upperCase:
	word = word.lower()
elif lowerCase > upperCase:
	word = word.lower()
else:
	word = word.upper()
print(word)


a = input()
b = a.upper()
length = len(a)
c = 0
for i in range(length):
	if a[i] == b[i]:
		c += 1
if c > length // 2:
	print(b)
else:
	print(a.lower())


n = input()
z = 0
for i in n:
	if i.upper() == i:
		z += 1
if z > len(n) // 2:
	print(n.upper())
else:
	print(n.lower())


a = str(input())
up = lo = 0
for i in range(len(a)):
	if a[i].isupper() == True:
		up += 1
	else:
		lo += 1
if lo >= up:
	print(a.lower())
else:
	print(a.upper())


import math
from sys import stdin

def si():
	return str(input())

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

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

def li():
	return list(mi())
t = si()
l = u = 0
for i in range(len(t)):
	if t[i].islower() == True:
		l += 1
	else:
		u += 1
if l >= u:
	m = t.lower()
	print(m)
elif u > l:
	n = t.upper()
	print(n)


s = input()
lst = [i for i in s]
up = 0
low = 0
for elem in lst:
	if elem.isupper():
		up += 1
	else:
		low += 1
if up > low:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
(lowerCaseNum, upperCaseNum) = (0, 0)
for ch in s:
	if ch.islower():
		lowerCaseNum += 1
	else:
		upperCaseNum += 1
if lowerCaseNum > upperCaseNum:
	print(s.lower())
elif lowerCaseNum < upperCaseNum:
	print(s.upper())
else:
	print(s.lower())


string = input()
lcc = 0
ucc = 0
for x in string:
	if 'a' <= x and 'z' >= x:
		lcc = lcc + 1
	else:
		ucc = ucc + 1
if lcc < ucc:
	print(string.upper())
else:
	print(string.lower())
exit()


a = input()
low = 'abcdefghijklmnopqrstuvwxyz'
up = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
l = 0
u = 0
for i in a:
	if i in low:
		l += 1
	else:
		u += 1
if u > l:
	print(a.upper())
else:
	print(a.lower())


word = input()
upper = 0
lower = 0
for i in word:
	if i.isupper():
		upper += 1
	elif i.islower():
		lower += 1
if upper > lower:
	new = word.upper()
elif lower >= upper:
	new = word.lower()
print(new)


input_string = list(input())
uppercase_count = 0
lowercase_count = 0
for (index, val) in enumerate(input_string):
	if val.isupper():
		uppercase_count += 1
	else:
		lowercase_count += 1
if uppercase_count > lowercase_count:
	print(''.join(input_string).upper())
else:
	print(''.join(input_string).lower())


s = list(input())
up = 0
low = 0
for i in s:
	if i.isupper():
		up += 1
	else:
		low += 1
s = ''.join(s)
if up <= low:
	print(s.lower())
else:
	print(s.upper())


text = input()
upper_counter = 0
lower_counter = 0
for char in text:
	if char.isupper():
		upper_counter += 1
	elif char.islower():
		lower_counter += 1
if lower_counter > upper_counter:
	text = text.lower()
elif upper_counter > lower_counter:
	text = text.upper()
else:
	text = text.lower()
print(text)


s = input()
(a, b) = (0, 0)
for c in s:
	if c.isupper():
		a = a + 1
	else:
		b = b + 1
if a > b:
	print(s.upper())
elif a < b:
	print(s.lower())
else:
	print(s.lower())


t = list(input())
b = 0
c = 0
for i in t:
	if i >= 'a' and i <= 'z':
		b += 1
	c += 1
if b < c - b:
	print(''.join(t).upper())
else:
	print(''.join(t).lower())


s = input()
big = 0
small = 0
for i in s:
	if 'a' <= i <= 'z':
		small += 1
	else:
		big += 1
if big > small:
	print(s.upper())
else:
	print(s.lower())


s = input()
strg = list(s)
(low, high) = (0, 0)
for ele in strg:
	if ele.isupper():
		low += 1
	else:
		high += 1
if low > high:
	print(s.upper())
else:
	print(s.lower())


import re
Cadena = str(input())
Mayus = re.sub('[^A-Z]', '', Cadena)
Minus = re.sub('[^a-z]', '', Cadena)
if len(Minus) >= len(Mayus):
	print(Cadena.lower())
else:
	print(Cadena.upper())


s = str(input())
t = 0
p = 0
for i in range(len(s)):
	if s[i].isupper():
		t = t + 1
	if s[i].islower():
		p = p + 1
if t > p:
	print(s.upper())
else:
	print(s.lower())


l = input()
s1 = [l[i] for i in range(len(l)) if l[i] == l[i].upper()]
s2 = [l[i] for i in range(len(l)) if l[i] == l[i].lower()]
if len(s1) > len(s2):
	print(l.upper())
else:
	print(l.lower())


a = input()
count_lower = 0
count_upper = 0
for word in a:
	if word.islower():
		count_lower += 1
	else:
		count_upper += 1
if count_lower >= count_upper:
	word = a.lower()
else:
	word = a.upper()
print(word)


import sys
input = sys.stdin.readline

def inp():
	return input()

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
x = inp()
u = 0
l = 0
for i in x:
	if ord(i) < 91:
		u += 1
	else:
		l += 1
u = u - 1
if u > l:
	print(x.upper())
else:
	print(x.lower())


s = str(input())
d = 0
for ch in s:
	if ch.isupper():
		d += 1
	if ch.islower():
		d -= 1
print(s.lower()) if d < 0 or d == 0 else print(s.upper())


def change_case(a, param=0):
	out = list(a)
	if param:
		for i in range(len(out)):
			out[i] = out[i].upper()
	else:
		for i in range(len(out)):
			out[i] = out[i].lower()
	return ''.join(out)
	pass

def main():
	a = input()
	lc = uc = 0
	for x in a:
		if x.isupper():
			uc += 1
		else:
			lc += 1
	if uc > lc:
		ans = change_case(a, 1)
	else:
		ans = change_case(a)
	print(ans)
	pass
main()


s = input()
small = 0
large = 0
for i in s:
	if ord(i) <= 90:
		large += 1
	else:
		small += 1
if large > small:
	print(s.upper())
else:
	print(s.lower())


x = str(input())
uprcount = 0
lwrcount = 0
for i in range(0, len(x)):
	if x[i] >= 'A' and x[i] <= 'Z':
		uprcount += 1
	else:
		lwrcount += 1
if lwrcount >= uprcount:
	print(x.lower())
else:
	print(x.upper())


n = input()
a = 0
m = n.lower()
k = n.upper()
for i in n:
	if i in 'abcdefghijklmnopqrstuvwxyz':
		a += 1
if len(n) / 2 <= a:
	print(m)
else:
	print(k)


def main():
	i = input()
	u = 0
	mi = 0
	for l in i:
		if l.islower():
			mi += 1
		else:
			u += 1
	if mi > u:
		print(i.lower())
	elif mi == u:
		print(i.lower())
	else:
		print(i.upper())
main()


import sys
line = input()
(lower, upper) = (0, 0)
for char in line:
	if char.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(line.upper())
else:
	print(line.lower())


def _upper(m):
	m = m.upper()
	return m
n = input()
u = 0
l = 0
for i in n:
	if i == _upper(i):
		u += 1
	else:
		l += 1
if u > l:
	print(n.upper())
else:
	print(n.lower())


a = input()
s = 0
m = 0
for i in range(len(a)):
	if ord(a[i]) > 90:
		s = s + 1
	else:
		m = m + 1
t = ''
if m == s:
	for i in range(len(a)):
		if ord(a[i]) < 91:
			t = t + chr(ord(a[i]) + 32)
		else:
			t = t + a[i]
elif s > m:
	for i in range(len(a)):
		if ord(a[i]) < 91:
			t = t + chr(ord(a[i]) + 32)
		else:
			t = t + a[i]
else:
	for i in range(len(a)):
		if ord(a[i]) > 91:
			t = t + chr(ord(a[i]) - 32)
		else:
			t = t + a[i]
print(t)


a = input()
b = list(a)
d = 0
u = 0
i = 0
while i < len(b):
	if ord(a[i]) < 92:
		u += 1
	else:
		d += 1
	i += 1
if d < u:
	print(a.upper())
else:
	print(a.lower())


a = str(input())
up = 0
low = 0
for i in a:
	if i.islower():
		low += 1
	else:
		up += 1
if low > up:
	print(a.lower())
elif low == up:
	print(a.lower())
else:
	print(a.upper())


str = str(input())
c = 0
b = 0
for i in str:
	if i.islower():
		c += 1
	if i.isupper():
		b += 1
if b > c:
	print(str.upper())
elif c > b:
	print(str.lower())
elif b == c:
	print(str.lower())


ar = input()

def fun():
	p = 0
	q = 0
	new = ''
	for val in ar:
		if val.isupper() == True:
			p = p + 1
		if val.islower() == True:
			q = q + 1
	if p > q:
		for val in ar:
			new = new + val.upper()
	if p < q:
		for val in ar:
			new = new + val.lower()
	if p == q:
		for val in ar:
			new = new + val.lower()
	return new
print(fun())


lo = list('abcdefghijklmnopqrstuvwxyz')
(m, n) = (0, 0)
line = input()
for i in range(len(line)):
	if line[i] in lo:
		m += 1
	else:
		n += 1
if m >= n:
	print(line.lower())
else:
	print(line.upper())


st = str(input())
(uprcnt, lwrcnt) = (0, 0)
for i in st:
	if i.isupper():
		uprcnt += 1
	else:
		lwrcnt += 1
if uprcnt > lwrcnt:
	st = st.upper()
	print(st)
else:
	st = st.lower()
	print(st)


s = input()
l = list(s)
caps = 0
small = 0
for i in s:
	if 65 <= ord(i) <= 90:
		caps = caps + 1
	else:
		small = small + 1
if caps > small:
	for i in range(len(l)):
		if 97 <= ord(l[i]) <= 122:
			l[i] = chr(ord(l[i]) - 32)
	print(''.join((str(e) for e in l)))
else:
	for i in range(len(l)):
		if 65 <= ord(l[i]) <= 90:
			l[i] = chr(ord(l[i]) + 32)
	print(''.join((str(e) for e in l)))


s = input()
a = 0
b = 0
for i in range(0, len(s)):
	x = s[i].isupper()
	if x is True:
		a += 1
	else:
		b += 1
if a <= b:
	print(s.lower())
else:
	print(s.upper())


def word(n):
	lst = [i for i in n]
	lowerCase = 0
	upperCase = 0
	lst1 = []
	for i in lst:
		if 97 <= ord(i) <= 122:
			lowerCase += 1
		elif 65 <= ord(i) <= 90:
			upperCase += 1
	if upperCase > lowerCase:
		for i in lst:
			if 97 <= ord(i) <= 122:
				lst1.append(chr(ord(i) - 32))
			else:
				lst1.append(i)
	else:
		return n.casefold()
	return ''.join([str(i) for i in lst1])
n = str(input())
res = word(n)
print(res)


word = input()
k = 0
CONT = 0
cont = 0
for k in word:
	if k == k.upper():
		CONT += 1
	else:
		cont += 1
if CONT > cont:
	print(word.upper())
else:
	print(word.lower())


s = input().strip()

def typel(x):
	if ord(x) >= ord('a') and ord(x) <= ord('z'):
		return 0
	elif ord(x) >= ord('A') and ord(x) < +ord('Z'):
		return 1
lc = 0
for x in s:
	if typel(x) == 0:
		lc += 1
if lc * 2 >= len(s):
	print(s.lower())
else:
	print(s.upper())


s = input('')
s1 = list(str(s))
count1 = 0
count2 = 0
for i in range(len(s1)):
	if s1[i] == s1[i].upper():
		count1 = count1 + 1
	else:
		count2 = count2 + 1
if count1 > count2:
	print(s.upper())
else:
	print(s.lower())


text = input('')
count_upper = 0
for l in text:
	if l.isupper():
		count_upper += 1
print(text.upper() if count_upper > len(text) // 2 else text.lower())


string = input()
u = 0
l = 0
for ch in string:
	if ch.isupper():
		u = u + 1
	else:
		l = l + 1
if u > l:
	print(string.upper())
else:
	print(string.lower())


s = input()
count_Up = 0
count_Lower = 0
for i in s:
	if i.islower():
		count_Lower += 1
	elif i.isupper():
		count_Up += 1
if count_Lower > count_Up:
	s = s.lower()
elif count_Lower < count_Up:
	s = s.upper()
else:
	s = s.lower()
print(s)


v = str(input())
flag = 0
for i in range(len(v)):
	if v[i].islower() == True:
		flag += 1
if flag > len(v) / 2:
	print(v.lower())
elif flag == len(v) / 2:
	print(v.lower())
else:
	print(v.upper())


n = input()
k = list(n)
k.sort()
l = 0
if n.lower() == 'house':
	print(n.lower())
elif n.lower() == 'vip':
	print(n.upper())
else:
	for i in range(len(k)):
		if k[i].islower() == True:
			l = i
			break
	if len(k) - l < len(k) / 2 or n.isupper() == True:
		print(n.upper())
	else:
		print(n.lower())


w = input()
n = len(w)
nCount = 0
for c in w:
	if c.upper() == c:
		nCount += 1
m = n - nCount
if nCount <= m:
	print(w.lower())
else:
	print(w.upper())


class Solution:

	def solve(self, string):
		lower = 0
		upper = 0
		for ch in string:
			if ch.islower():
				lower += 1
			else:
				upper += 1
		if lower >= upper:
			return string.lower()
		else:
			return string.upper()
sol = Solution()
string = input().strip()
print(sol.solve(string))


str = input()
(lower, upper) = (0, 0)
for i in str:
	if i in 'qwertyuiopasdfghjklzxcvbnm':
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(str.lower())
else:
	print(str.upper())


s = input()
q = sum([-1 if i.islower() else 1 for i in s])
if q > 0:
	print(s.upper())
else:
	print(s.lower())


l = 0
u = 0
a = input()
for i in range(0, len(a)):
	if a[i] == a[i].upper():
		l = l + 1
	elif a[i] == a[i].lower():
		u = u + 1
if l > u:
	print(a.upper())
else:
	print(a.lower())


s = input()
a = [1 for ch in s if ch.isupper()]
if len(s) - len(a) < len(a):
	print(s.upper())
else:
	print(s.lower())


n = str(input())
upper = 0
lower = 0
for i in n:
	if i.islower():
		lower = lower + 1
	elif i.isupper():
		upper = upper + 1
if lower < upper:
	print(n.upper())
elif lower > upper:
	print(n.lower())
else:
	print(n.lower())


s = str(input())
x = 0
y = 0
for i in range(len(s)):
	if s[i].isupper():
		x += 1
	else:
		y += 1
if x > y:
	print(s.upper())
else:
	print(s.lower())


n = input()
cb = 0
cm = 0
for i in n:
	if ord(i) > 90:
		cm += 1
	else:
		cb += 1
if cb > cm:
	print(n.upper())
else:
	print(n.lower())


x = 0
y = 0
str_1 = input()
for i in str_1:
	if i.isupper():
		x = x + 1
	if i.islower():
		y = y + 1
if x <= y:
	str_1 = str_1.lower()
	print(str_1)
else:
	str_1 = str_1.upper()
	print(str_1)


x = input()
l = []
u = []
for i in x:
	if i.islower():
		l.append(i)
	else:
		u.append(i)
if len(l) < len(u):
	print(x.upper())
else:
	print(x.lower())


n = input()
s = 0
l = 0
for i in n:
	if ord(i) >= 97:
		s += 1
	elif ord(i) >= 65 and ord(i) <= 90:
		l += 1
if l > s:
	print(n.upper())
elif l <= s:
	print(n.lower())


def get():
	return [int(x) for x in input().split()]
s = input()
print(s.lower() if 2 * sum((c.islower() for c in s)) >= len(s) else s.upper())


s = input()
c = 0
for ss in s:
	if 'a' <= ss <= 'z':
		c += 1
if 2 * c >= len(s):
	print(s.lower())
else:
	print(s.upper())


a = input()
c = 0
d = 0
x = a.upper()
y = a.lower()
l = len(a)
for i in range(l):
	if a[i].isupper() == True:
		c += 1
	else:
		d += 1
if c > d:
	print(x)
else:
	print(y)


s = input()
(lower_count, upper_count) = (0, 0)
for i in s:
	if i.islower():
		lower_count += 1
	else:
		upper_count += 1
if lower_count >= upper_count:
	print(s.lower())
else:
	print(s.upper())


k = input()
inp = [str(i) for i in k]
c_count = 0
l_count = 0
for i in inp:
	if i.isupper():
		c_count += 1
	else:
		l_count += 1
if c_count > l_count:
	print(k.upper())
elif c_count <= l_count:
	print(k.lower())


a = input()
b = 0
c = 0
for r in a:
	if r.islower():
		b = b + 1
	else:
		c = c + 1
if c > b:
	print(a.upper())
else:
	print(a.lower())


def isUpperorLower(s):
	ucount = 0
	lcount = 0
	for i in range(len(s)):
		if s[i].isupper() == True:
			ucount += 1
		if s[i].islower() == True:
			lcount += 1
	if ucount > lcount:
		print(s.upper())
	else:
		print(s.lower())
s = input()
isUpperorLower(s)


initial_str = input()
final_str = ''
upper_vote = 0
lower_vote = 0
for i in range(len(initial_str)):
	if ord(initial_str[i]) < 97:
		upper_vote += 1
	else:
		lower_vote += 1
for i in range(len(initial_str)):
	if lower_vote < upper_vote:
		if 97 <= ord(initial_str[i]):
			final_str += chr(ord(initial_str[i]) - 32)
		else:
			final_str += initial_str[i]
	elif ord(initial_str[i]) < 97:
		final_str += chr(ord(initial_str[i]) + 32)
	else:
		final_str += initial_str[i]
print(final_str)


a = input().strip()
c = 0
s = 0
for i in a:
	if ord(i) >= 65 and ord(i) <= 90:
		c += 1
	else:
		s += 1
if c <= s:
	print(a.lower())
else:
	print(a.upper())


n = [i for i in input()]
b = 0
k = 0
for i in range(len(n)):
	j = n[i]
	if ord(j) < 97:
		b += 1
	else:
		k += 1
if b <= k:
	for i in range(len(n)):
		j = n[i]
		if ord(j) < 97:
			n[i] = chr(ord(n[i]) + 32)
else:
	for i in range(len(n)):
		if ord(n[i]) >= 97:
			n[i] = chr(ord(n[i]) - 32)
print(*n, sep='')


s = input()
m = len(s)
(u, p) = (0, 0)
for i in range(m):
	if s[i].isupper() == True:
		u += 1
	else:
		p += 1
if u <= p:
	print(s.lower())
else:
	print(s.upper())


n = input()
da = 0
xiao = 0
for i in range(len(n)):
	if 64 < ord(n[i]) < 91:
		da += 1
	else:
		xiao += 1
if xiao >= da:
	print(n.lower())
else:
	print(n.upper())


x = input()
up = 0
small = 0
for i in x:
	if i.isupper():
		up += 1
	else:
		small += 1
if up > small:
	print(x.upper())
else:
	print(x.lower())


s = input()
c = 0
for i in s:
	c = c + int(i.isupper())
if c > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


import string
s = input()
l = len(s)
k = list(s)
c1 = 0
c2 = 0
if 1 <= l <= 100:
	for i in range(l):
		if k[i] in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
			c1 += 1
		elif k[i] in 'abcdefghijklmnopqrstuvwxyz':
			c2 += 1
if c1 > c2:
	print(s.upper())
elif c2 > c1:
	print(s.lower())
else:
	print(s.lower())


import math
s = input()
cl = 0
cu = 0
for i in range(len(s)):
	if s[i].islower():
		cl = cl + 1
	else:
		cu = cu + 1
	if cl >= math.ceil(len(s) / 2):
		print(s.lower())
		break
	elif cu > len(s) // 2:
		print(s.upper())
		break


s = input()
up = 0
lo = 0
for c in s:
	if c.isupper():
		up += 1
	else:
		lo += 1
if up > lo:
	print(s.upper())
else:
	print(s.lower())


str = input()
lowerCounter = 0
for i in str:
	if i.islower():
		lowerCounter = lowerCounter + 1
if len(str) - lowerCounter > lowerCounter:
	print(str.upper())
else:
	print(str.lower())


s = input()
ascii_lower = 0
ascii_upper = 0
str = ''
for ele in s:
	if ord(ele) <= 90:
		ascii_upper += 1
	elif ord(ele) >= 97:
		ascii_lower += 1
if ascii_lower >= ascii_upper:
	print(s.lower())
else:
	print(s.upper())


a = input()
cl = 0
cu = 0
for i in a:
	if i.islower():
		cl += 1
	elif i.isupper():
		cu += 1
if cl >= cu:
	b = a.lower()
elif cu > cl:
	b = a.upper()
print(b)


n = input()
big = 0
small = 0
for i in n:
	if i == i.upper():
		big += 1
	else:
		small += 1
if big > small:
	print(n.upper())
else:
	print(n.lower())


x = input()
y = 0
z = 0
for i in range(len(x)):
	if x[i].isupper():
		y = y + 1
	else:
		z = z + 1
if y <= z:
	print(x.lower())
else:
	print(x.upper())


word = str(input())
count_upper = 0
count_lower = 0
for symbol in word:
	if symbol == symbol.lower():
		count_lower += 1
	else:
		count_upper += 1
if count_lower >= count_upper:
	print(word.lower())
else:
	print(word.upper())


word = input()
lowerCaseLetters = 0
upperCaseLetters = 0
for letter in list(word):
	if letter == letter.lower():
		lowerCaseLetters += 1
	else:
		upperCaseLetters += 1
if lowerCaseLetters >= upperCaseLetters:
	print(word.lower())
else:
	print(word.upper())


l = input()
x = 0
for each in l:
	if each.islower():
		x += 1
if x >= len(l) - x:
	print(l.lower())
else:
	print(l.upper())


s = input()
s1 = s.lower()
s2 = s.upper()
u = sum((1 for i in s if i.isupper()))
l = len(s) - u
if l >= u:
	print(s1)
else:
	print(s2)


word = input()
uppers = 0
lowers = 0
for char in word:
	if char.isupper():
		uppers += 1
	else:
		lowers += 1
if uppers == lowers:
	print(word.lower())
elif uppers > lowers:
	print(word.upper())
else:
	print(word.lower())


in_string = input()
count_up = 0
count_low = 0
out_string = ''
for elem in in_string:
	if elem.isupper():
		count_up += 1
	else:
		count_low += 1
if count_up > count_low:
	out_string = in_string.upper()
else:
	out_string = in_string.lower()
print(out_string)


inputWord = input()
wordLength = len(inputWord)
numOfUpperLetters = 0
numOfLowerLetters = 0
for letter in inputWord:
	if letter.isupper():
		numOfUpperLetters += 1
	else:
		numOfLowerLetters += 1
outputWord = ''
if numOfUpperLetters > numOfLowerLetters:
	for letter in inputWord:
		outputWord += letter.upper()
else:
	for letter in inputWord:
		outputWord += letter.lower()
print(outputWord)


string = str(input())
countU = 0
countL = 0
for i in string:
	if i == i.upper():
		countU += 1
	elif i == i.lower():
		countL += 1
	else:
		pass
if countU > countL:
	print(string.upper())
else:
	print(string.lower())


miin = 0
maj = 0
k = ''
s = input()
for x in s:
	if str(x).islower() == True:
		miin += 1
	else:
		maj += 1
if maj > miin:
	k = s.upper()
	print(k)
else:
	k = s.lower()
	print(k)


st = input()
ucount = 0
lcount = 0
for i in st:
	if i.islower():
		lcount += 1
	else:
		ucount += 1
if lcount >= ucount:
	print(st.lower())
else:
	print(st.upper())


s = input()
a = set('abcdefghijklmnopqrstuvwxyz')
b = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
n = len(s)
l = 0
u = 0
for i in s:
	if i in a:
		l += 1
	else:
		u += 1
if u > l:
	s = s.upper()
else:
	s = s.lower()
print(s)


import re
string_input = input()
num_upper = len(re.findall('[A-Z]', string_input))
if num_upper <= len(string_input) - num_upper:
	print(string_input.lower())
else:
	print(string_input.upper())


a = str(input())
(up, down) = (0, 0)
for letter in a:
	if letter.isupper():
		up += 1
	if letter.islower():
		down += 1
if up > down:
	print(a.upper())
else:
	print(a.lower())


list = str(input())
(c, d) = (0, 0)
for i in list:
	if i.isupper():
		c = c + 1
	else:
		d = d + 1
if c > d:
	print(list.upper())
else:
	print(list.lower())


s = list(input())
c = 0
for i in s:
	if i.isupper():
		c = c + 1
s2 = ''.join(s)
if c > len(s) / 2:
	print(s2.upper())
elif c < len(s) / 2 or c == len(s) / 2:
	print(s2.lower())


string = input()
low = [c for c in string if c.islower()]
upper = [c for c in string if c.isupper()]
output = ''
if len(low) >= len(upper):
	for i in range(len(string)):
		output += string[i].lower()
else:
	for i in range(len(string)):
		output += string[i].upper()
print(output)


str = input()
count_lower = 0
count_upper = 0
for i in str:
	if i >= 'a' and i <= 'z':
		count_lower = count_lower + 1
	else:
		count_upper = count_upper + 1
if count_lower >= count_upper:
	print(str.lower())
else:
	print(str.upper())


word = input()
count_upper = 0
count_lower = 0
new_word = ''
for i in range(len(word)):
	if word[i].isupper():
		count_upper += 1
	else:
		count_lower += 1
if count_lower >= count_upper:
	for j in range(len(word)):
		if word[j].isupper():
			new_word = new_word + word[j].lower()
		else:
			new_word = new_word + word[j]
else:
	for k in range(len(word)):
		if word[k].islower():
			new_word = new_word + word[k].upper()
		else:
			new_word = new_word + word[k]
print(new_word)


name = input()
count = 0
for i in range(len(name)):
	if name[i].islower():
		count += 1
if len(name) / 2 - count <= 0:
	print(name.lower())
elif len(name) / 2 - count > 0:
	print(name.upper())


str = input()
cap = 0
low = 0
for element in str:
	if element.islower():
		low += 1
	if element.isupper():
		cap += 1
if cap > low:
	print(str.upper())
else:
	print(str.lower())


n = list(input())
lower_case = []
capital_letters = []
for i in range(len(n)):
	if 'a' <= n[i] <= 'z':
		lower_case.append(i)
	elif 'A' <= n[i] <= 'Z':
		capital_letters.append(i)
new_string = ''.join(n)
if len(lower_case) >= len(capital_letters):
	print(new_string.lower())
elif len(lower_case) < len(capital_letters):
	print(new_string.upper())


L = input()
m = 0
for i in range(len(L)):
	if L[i].isupper() == 1:
		m += 1
if m * 2 > len(L):
	print(L.upper())
else:
	print(L.lower())


a = input()
a1 = list(a)
c = 0
d = 0
for i in range(len(a1)):
	q = a1[i]
	s = q.islower()
	if s == False:
		c = c + 1
	else:
		d = d + 1
if c == d or d > c:
	print(a.lower())
else:
	print(a.upper())


s = input()
n1 = 0
n2 = 0
for i in range(len(s)):
	if s[i].isupper():
		n1 += 1
	else:
		n2 += 1
if n1 > n2:
	print(s.upper())
else:
	print(s.lower())


word = input()
if sorted(word)[len(word) // 2].isupper():
	print(word.upper())
else:
	print(word.lower())


stra = input()
l = 0
u = 0
for chara in stra:
	if chara.islower():
		l += 1
	else:
		u += 1
if u > l:
	print(stra.upper())
else:
	print(stra.lower())


import sys
import string
word = input()
lc = len([c for c in word if c in string.ascii_lowercase])
if lc < len(word) / 2:
	print(word.upper())
else:
	print(word.lower())


st = input()
(u, l) = (0, 0)
for i in st:
	if i.islower():
		l += 1
	else:
		u += 1
print(st.lower()) if l >= u else print(st.upper())


word = input()
upperCount = 0
lowerCount = 0
for i in range(len(word)):
	if word[i].islower():
		lowerCount += 1
	else:
		upperCount += 1
if lowerCount >= upperCount:
	print(word.lower())
else:
	print(word.upper())


a = input()
count = 0
for s in a:
	if s.islower():
		count += 1
if count >= len(a) / 2:
	print(a.lower())
else:
	print(a.upper())


s = input()
o = 0
e = 0
for i in s:
	if i.islower():
		o += 1
	else:
		e += 1
if o >= e:
	print(s.lower())
else:
	print(s.upper())


word = input()
counter_l = 0
counter_b = 0
for i in range(len(word)):
	if word[i].isupper():
		counter_b += 1
	else:
		counter_l += 1
if counter_b > counter_l:
	print(word.upper())
else:
	print(word.lower())


str1 = input().strip('\n\r')
(u, l) = (0, 0)
for i in range(len(str1)):
	if str1[i].isupper() == True:
		u += 1
	else:
		l += 1
if u > l:
	print(str1.upper())
else:
	print(str1.lower())


a = input()
lowerLetters = 0
upperLetters = 0
result = ''
for i in a:
	if i.islower():
		lowerLetters += 1
	elif i.isupper():
		upperLetters += 1
if lowerLetters < upperLetters:
	for i in a:
		result += i.upper()
else:
	for i in a:
		result += i.lower()
print(result)


a = input()
l = sum([int(i.islower()) for i in a])
u = sum([int(i.isupper()) for i in a])
if l >= u:
	print(a.lower())
else:
	print(a.upper())


s = input()
caps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
small = 'abcdefghijklmnopqrstuvwxyz'
(c1, c2) = (0, 0)
l1 = []
l2 = []
for i in s:
	if i in caps:
		c1 += 1
		l1.append(small[caps.index(i)])
	else:
		l1.append(i)
	if i in small:
		c2 += 1
		l2.append(caps[small.index(i)])
	else:
		l2.append(i)
if c1 > c2:
	print(''.join(l2))
else:
	print(''.join(l1))


word = input()
up = sum((1 for i in word if i.isupper()))
low = sum((1 for i in word if i.islower()))
if up < low:
	print(word.lower())
elif up > low:
	print(word.upper())
else:
	print(word.lower())


string = input()
(lower_count, upper_count) = (0, 0)
for char in string:
	if char.islower():
		lower_count += 1
	else:
		upper_count += 1
if upper_count > lower_count:
	print(string.upper())
else:
	print(string.lower())


a = input()
l = 'abcdefghijklmnopqrtsuvwxyz'
u = l.upper()
uc = 0
lc = 0
for i in a:
	if i in u:
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(a.upper())
else:
	print(a.lower())


word = input()
up = 0
low = 0
for c in word:
	if c.isupper():
		up += 1
	else:
		low += 1
if up > low:
	word = word.upper()
else:
	word = word.lower()
print(word)


low = 0
up = 0
a = 'abcdefghijklmnopqrstuvwxyz'
b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
word = input()
for letter in word:
	if letter in a:
		low += 1
	else:
		up += 1
if up > low:
	word = word.upper()
else:
	word = word.lower()
print(word)


n = input()
m = sorted(n)
if m[len(m) // 2].isupper():
	print(n.upper())
else:
	print(n.lower())


my_string = input()
i = 0
n = len(my_string)
u = 0
l = 0
while i < n:
	c = my_string[i:i + 1]
	if c >= 'a':
		l = l + 1
	else:
		u = u + 1
	i = i + 1
if l >= u:
	print(my_string.lower())
else:
	print(my_string.upper())


q = list(input())
size = sum((c.isalpha() for c in q))
i = 0
lowercase = 0
uppercase = 0
while i < size:
	if q[i] == q[i].lower():
		lowercase += 1
		i += 1
	else:
		uppercase += 1
		i += 1
if lowercase >= uppercase:
	m = 0
	while m < size:
		print(q[m].lower(), end='')
		m += 1
else:
	n = 0
	while n < size:
		print(q[n].upper(), end='')
		n += 1


T = input()
countU = 0
countL = 0
for i in range(len(T)):
	if T[i].islower() == True:
		countL += 1
	else:
		countU += 1
if countL == countU:
	print(T.lower())
if countL > countU:
	print(T.lower())
if countL < countU:
	print(T.upper())


word = input()
upr = 0
lwr = 0
for char in word:
	if char.islower() == True:
		lwr = lwr + 1
	if char.isupper() == True:
		upr = upr + 1
if upr > lwr:
	print(word.upper())
else:
	print(word.lower())


s = input()
s1 = 0
s2 = 0
for i in range(len(s)):
	if s[i] >= 'A' and s[i] <= 'Z':
		s1 += 1
	if s[i] >= 'a' and s[i] <= 'z':
		s2 += 1
if s1 > s2:
	for i in range(len(s)):
		if s[i] >= 'A' and s[i] <= 'Z':
			print(s[i], end='')
		else:
			print(chr(ord(s[i]) - 32), end='')
else:
	for i in range(len(s)):
		if s[i] >= 'a' and s[i] <= 'z':
			print(s[i], end='')
		else:
			print(chr(ord(s[i]) + 32), end='')


d1 = 0
d2 = 0
x = input()
for i in x:
	if ord(i) <= ord('z') and ord(i) >= ord('a'):
		d1 += 1
	else:
		d2 += 1
if d1 >= d2:
	print(x.lower())
else:
	print(x.upper())


word = input()
(small, large) = (0, 0)
for i in word:
	if i >= 'A' and i <= 'Z':
		large += 1
	else:
		small += 1
if large > small:
	print(word.upper())
else:
	print(word.lower())


s = input()
sl = list(s)
lower = 0
upper = 0
for i in sl:
	if i.isupper() == True:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(s.upper())
else:
	print(s.lower())


import sys
I = lambda : int(input())
RL = readline = lambda : sys.stdin.readline().strip('\n')
RM = readmap = lambda x=int: map(x, readline().split(' '))
s = RL()
lc = sum([i.islower() for i in s])
uc = sum([i.isupper() for i in s])
print(s.lower() if lc >= uc else s.upper())
quit()
(n, l) = (I(), [*RM()])
lo = [i for i in l if i & 1]
le = [i for i in l if i & 1 == 0]
if len(lo) == 0:
	print(0)
else:
	lo.sort()
	(llo, lle) = (len(lo), len(le))
	flag = 1 if llo % 2 == 0 else 0
	print(sum(le) + sum(lo[flag:]))
quit()
(k, s) = (I(), list(RL()))
n = len(s)
n1 = n - 1
ss = set(s)
alpha = {chr(97 + i) for i in range(k)}
alpha0 = [chr(97 + i) for i in range(k)]
alpha0 = [i for i in alpha0 if not i in ss]

def discard(l, x):
	if x in l:
		l.remove(x)
if n & 1 and s[n >> 1] == '?':
	s[n >> 1] = alpha0.pop() if len(alpha0) else 'a'
for i in range((n >> 1) - 1, -1, -1):
	(x, y) = (s[i], s[n1 - i])
	flag = max(ord(x) - 96, ord(y) - 96) > k
	c = int(x == '?') + int(y == '?')
	if c == 0:
		if x != y:
			flag = True
		else:
			discard(alpha0, x)
	if c == 2:
		s[i] = s[n1 - i] = alpha0.pop() if len(alpha0) else 'a'
	if c == 1:
		if x == '?':
			s[i] = y
			discard(alpha0, y)
		if y == '?':
			s[n1 - i] = x
			discard(alpha0, x)
	if flag:
		print('IMPOSSIBLE')
		sys.exit(0)
print(''.join(s) if set(s) == alpha else 'IMPOSSIBLE')
quit()

def f(l, x):
	if x == l[0]:
		return (l[1], l[2])
	if x == l[1]:
		return (l[0], l[2])
	if x == l[2]:
		return (l[0], l[1])
	return -1

def delrank(x):
	global pre, nxt
	(prex, nxtx) = (pre[x], nxt[x])
	nxt[prex] = nxtx
	pre[nxtx] = prex
n = I()
N = 3 * n
rank = [*RM()] + [N + 1]
tris = [tuple(RM()) for i in range(n)]
k = I()
(pre, nxt) = (list(range(N + 2)), list(range(N + 2)))
temp0 = 0
for i in range(N + 1):
	temp1 = rank[i]
	(pre[temp1], nxt[temp0]) = (temp0, temp1)
	temp0 = temp1
for (ind, tri) in enumerate(tris):
	leader = nxt[0]
	(x, y) = f(tri, leader)
	if k in tri:
		if leader != k:
			l = [i for i in range(1, N + 1) if i != k]
		else:
			l1 = [i for tri in tris[:ind] for i in tri]
			l2 = [x, y]
			l3 = [i for tri in tris[ind + 1:] for i in tri]
			l0 = sorted(l1 + l2)
			ind = l0.index(max(x, y))
			l = l0[:ind + 1] + sorted(l0[ind + 1:] + l3)
		print(' '.join([str(i) for i in l]))
		sys.exit(0)
	for i in tri:
		delrank(i)
quit()

def rec(u, v):
	if v:
		rec(pre[u][v], u)
		print(v, end=' ')
from collections import deque
(n, m, k) = RM()
adj = [[] for i in range(n + 1)]
dist = [[int(1000000000.0)] * (n + 1) for i in range(n + 1)]
pre = [[0] * (n + 1) for i in range(n + 1)]
bad = set()
for _ in range(m):
	(x, y) = RM()
	adj[x].append(y)
	adj[y].append(x)
for _ in range(k):
	bad.add(tuple(RM()))
dist[0][1] = 0
q = deque([(0, 1)])
while q:
	(u, v) = q.popleft()
	d = dist[u][v] + 1
	for w in adj[v]:
		if d < dist[v][w] and (not (u, v, w) in bad):
			dist[v][w] = d
			pre[v][w] = u
			q.append((v, w))
			if w == n:
				print(d)
				rec(v, w)
				print()
				sys.exit(0)
print(-1)


n = input()
(up, lo) = (0, 0)
for x in n:
	if x.isupper() == True:
		up += 1
	else:
		lo += 1
if up == lo:
	print(n.lower())
elif up > lo:
	print(n.upper())
else:
	print(n.lower())


string = input()
i = 0
j = 0
for line in string:
	if line.islower():
		i += 1
	if line.isupper():
		j += 1
if i > j:
	string = string.lower()
	print(string)
elif j > i:
	string = string.upper()
	print(string)
elif i == j:
	print(string.lower())


s = input()
index = 0
u = 0
l = 0
while index < len(s):
	if s[index] == s[index].upper():
		u = u + 1
	if s[index] == s[index].lower():
		l = l + 1
	index = index + 1
if u > l:
	s = s.upper()
if u < l:
	s = s.lower()
if u == l:
	s = s.lower()
print(s)


n = input()
c = 0
K = 0
for i in n:
	if i.lower() == i:
		c = c + 1
	else:
		K = K + 1
if K > c:
	print(n.upper())
else:
	print(n.lower())


import string
s = input()
lower = len(list(filter(lambda x: x in 'abcdefghijklmnopqrstuvwxyz', s)))
upper = len(list(filter(lambda x: x in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', s)))
if upper > lower:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = str(input())
countup = 0
countdown = 0
for i in s:
	if i.isupper():
		countup = countup + 1
	else:
		countdown = countdown + 1
if countup > countdown:
	print(s.upper())
elif countup < countdown:
	print(s.lower())
else:
	print(s.lower())


word = input()
lowerCase = 0
upperCase = 0
for ch in word:
	if ch.islower():
		lowerCase += 1
	else:
		upperCase += 1
if lowerCase >= upperCase:
	print(word.lower())
else:
	print(word.upper())


word = input()
sumu = 0
suml = 0
for char in word:
	if char.isupper() == True:
		sumu += 1
	else:
		suml += 1
if sumu > suml:
	print(word.upper())
else:
	print(word.lower())


palavra = input()
maiuscula = 0
minuscula = 0
for e in palavra:
	if e.islower():
		minuscula += 1
	else:
		maiuscula += 1
if maiuscula > minuscula:
	print(palavra.upper())
elif minuscula >= maiuscula:
	print(palavra.lower())


s = input()
lcnt = cnt = 0
for i in range(0, len(s)):
	if s[i].islower():
		lcnt += 1
	else:
		cnt += 1
if lcnt == cnt:
	print(s.lower())
elif lcnt > cnt:
	print(s.lower())
else:
	print(s.upper())


s = input()
lowerLetters = [c for c in s if c.islower()]
upperLetters = [c for c in s if c.isupper()]
print(s.lower() if len(lowerLetters) >= len(upperLetters) else s.upper())


import os
import sys
from io import BytesIO, IOBase
import sys, bisect, copyreg, copy, statistics, os

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

def IIX():
	return (int(x) for x in sys.stdin.readline().split())

def II():
	return int(inp())

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

def LS():
	return list(map(str, inp().split()))

def L(x):
	return list(x)

def out(var):
	return sys.stdout.write(str(var))

def main():
	word = L(inp())
	(u, l) = (0, 0)
	for x in word:
		if x.isupper():
			u += 1
		else:
			l += 1
	if u > l:
		out(''.join(word).upper())
	else:
		out(''.join(word).lower())
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')
main()


word = input()
uppercase = 0
lowercase = 0
for letter in word:
	if letter.isupper():
		uppercase += 1
	else:
		lowercase += 1
if uppercase > lowercase:
	print(word.upper())
else:
	print(word.lower())


s = input()
up = 0
low = 0
for i in s:
	if ord(i) in range(65, 91):
		up += 1
	elif ord(i) in range(97, 123):
		low += 1
if up <= low:
	print(s.lower())
else:
	print(s.upper())


import os
import sys
from io import BytesIO, IOBase

def main():
	s = input()
	(cl, ch) = (0, 0)
	for x in s:
		if x.islower():
			cl += 1
		else:
			ch += 1
	if cl >= ch:
		print(s.lower())
	else:
		print(s.upper())
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')
main()


word = input()
lowernum = 0
uppernum = 0
for letter in word:
	if letter.lower() == letter:
		lowernum += 1
	else:
		uppernum += 1
if lowernum == uppernum:
	word = list(word)
	for i in range(len(word)):
		word[i] = word[i].lower()
	print(''.join(word))
elif lowernum > uppernum:
	word = list(word)
	for i in range(len(word)):
		if word[i].lower() != word[i]:
			word[i] = word[i].lower()
	print(''.join(word))
elif lowernum < uppernum:
	word = list(word)
	for i in range(len(word)):
		if word[i].lower() == word[i]:
			word[i] = word[i].upper()
	print(''.join(word))


s = input('')
k = 0
l = 0
for i in s:
	if i.islower() == True:
		k = k + 1
	elif i.isupper() == True:
		l = l + 1
if k >= l:
	print(s.lower())
else:
	print(s.upper())


lower = upper = 0
S = input()
for i in range(len(S)):
	if ord(S[i]) >= 65 and ord(S[i]) <= 90:
		upper += 1
	else:
		lower += 1
print(S.lower() if lower >= upper else S.upper())


s = input()
low = 0
up = 0
for l in s:
	if ord(l) >= 97:
		low += 1
	else:
		up += 1
if up > low:
	print(s.upper())
else:
	print(s.lower())


def main():
	word: str = input()
	up: int = 0
	for letter in word:
		if letter.isupper():
			up += 1
	if len(word) - up < up:
		print(word.upper())
	else:
		print(word.lower())
main()


def isUpperLetter(x=''):
	return x.isupper()
line = input()
characters = list(line)
b = list(map(isUpperLetter, characters))
if len(characters) <= 100 and len(characters) >= 1:
	upperList = [x for x in b if x == True]
	lowerList = [x for x in b if x == False]
	if len(upperList) > len(lowerList):
		print(line.upper())
	elif len(upperList) == len(lowerList):
		print(line.lower())
	else:
		print(line.lower())
else:
	print(line.lower())


s = str(input())
lcount = 0
ucount = 0
for i in s:
	if i.islower():
		lcount += 1
	elif i.isupper():
		ucount += 1
if lcount == ucount:
	print(s.lower())
elif lcount > ucount:
	print(s.lower())
elif lcount < ucount:
	print(s.upper())


s = input()
count = 0
for i in s:
	if 97 <= ord(i) <= 122:
		count += 1
upper = len(s) - count
if count >= upper:
	print(s.lower())
else:
	print(s.upper())


string = input()
low = sum(map(str.islower, string))
upp = sum(map(str.isupper, string))
if low > upp:
	print(string.lower())
elif low < upp:
	print(string.upper())
else:
	print(string.lower())


a = input()
cnt1 = 0
cnt2 = 0
for i in a:
	if i.islower():
		cnt1 = cnt1 + 1
	elif i.isupper():
		cnt2 = cnt2 + 1
if cnt1 > cnt2:
	print(a.lower())
elif cnt2 > cnt1:
	print(a.upper())
elif cnt1 == cnt2:
	print(a.lower())


from functools import *
s = input()
l = list(s)
up = 0
lo = 0
for i in range(len(l)):
	if l[i].isupper():
		up += 1
	else:
		lo += 1
if lo >= up:
	r = s.lower()
else:
	r = s.upper()
print(r)


s = input()
low = 0
up = 0
for char in s:
	if 65 <= ord(char) <= 96:
		up += 1
	else:
		low += 1
if up > low:
	print(s.upper())
else:
	print(s.lower())


a = str(input())
b = 0
c = 0
for i in a:
	if ord(i) < 97:
		b += 1
	else:
		c += 1
if b > c:
	a = a.upper()
	print(a)
else:
	print(a.lower())


from sys import *
from collections import defaultdict as dd
from math import *
from bisect import *

def sinp():
	return input()

def inp():
	return int(sinp())

def minp():
	return map(int, sinp().split())

def linp():
	return list(minp())

def strl():
	return list(sinp())

def pr(x):
	print(x)
mod = int(1000000000.0 + 7)
s = sinp()
if len(list(filter(lambda x: 'A' <= x <= 'Z', s))) > len(list(filter(lambda x: 'a' <= x <= 'z', s))):
	pr(s.upper())
else:
	pr(s.lower())


a = input()
lower = 0
upper = 0
for l in a:
	if l.islower():
		lower += 1
	elif l.isupper():
		upper += 1
if lower > upper:
	a = a.lower()
elif upper > lower:
	a = a.upper()
elif lower == upper:
	a = a.lower()
print(a)


x = input('')
count = 0
y = list(map(ord, x))
for i in y:
	if i >= 97 and i <= 122:
		count += 1
if count >= len(x) / 2:
	print(x.lower())
else:
	print(x.upper())


x = input()
y = sum((1 for i in x if i.isupper()))
z = sum((1 for i in x if i.islower()))
if y > z:
	print(x.upper())
elif z > y or z == y:
	print(x.lower())


s = input()
uppers = 0
lowers = 0
for c in s:
	if c == c.upper():
		uppers += 1
	else:
		lowers += 1
if uppers > lowers:
	print(s.upper())
else:
	print(s.lower())


a = 'abcdefghijklmnopqrstuvwxyz'
b = a.upper()
c = d = 0
n = input()
for i in n:
	if i in a:
		c += 1
	else:
		d += 1
if c >= d:
	print(n.lower())
else:
	print(n.upper())


a = input()
u = sum([s.isupper() for s in a])
l = sum([s.islower() for s in a])
if u > l:
	print(a.upper())
else:
	print(a.lower())


sir = input()
caractMici = 0
caractMari = 0
for ch in sir:
	if ch.islower() == True:
		caractMici += 1
	else:
		caractMari += 1
if caractMici >= caractMari:
	print(sir.lower())
else:
	print(sir.upper())


w = list(input())
l = len(w)
num = 0
for i in range(l):
	if w[i] == w[i].upper():
		num += 1
w = ''.join(w)
if num > l / 2:
	print(w.upper())
else:
	print(w.lower())


lt = input()
x = 0
y = 0
for i in 'QWERTYUIOPASDFGHJKLZXCVBNM':
	x += lt.count(i)
for i in 'qwertyuiopasdfghjklzxcvbnm':
	y += lt.count(i)
if x <= y:
	print(lt.lower())
else:
	print(lt.upper())


str = input()
count = int(0)
lenth = int(len(str))
for i in str:
	if i == i.lower():
		count += 1
if lenth - count > lenth / 2:
	print(str.upper())
else:
	print(str.lower())


s = input()
l = len(s)
litle = 0
big = 0
for i in range(l):
	if 'z' >= s[i] >= 'a':
		litle += 1
	elif 'Z' >= s[i] >= 'A':
		big += 1
if litle > big or litle == big:
	print(s.lower())
elif big > litle:
	print(s.upper())


inp = input()
caps = 0
small = 0
i = 0
while i < len(inp):
	if ord(inp[i]) >= 65 and ord(inp[i]) <= 90:
		caps = caps + 1
	else:
		small = small + 1
	i = i + 1
if caps > small:
	print(inp.upper())
else:
	print(inp.lower())


word = input()
wordList = list(word)
upperCaseCount = 0
lowerCaseCount = len(wordList)
for i in wordList:
	if i.isupper() == True:
		upperCaseCount += 1
		lowerCaseCount -= 1
if upperCaseCount > lowerCaseCount:
	ans = word.upper()
else:
	ans = word.lower()
print(ans)


word = input()
countLowerCase = 0
for i in word:
	if i.islower():
		countLowerCase += 1
if countLowerCase >= len(word) / 2:
	print(word.lower())
else:
	print(word.upper())


s = input()

def n_upper_chars(string):
	return sum((1 for c in string if c.isupper()))
if 2 * n_upper_chars(s) > len(s):
	print(s.upper())
else:
	print(s.lower())


input_word = input().strip()

def checkCase(word):
	capital_letter = 0
	small_letter = 0
	for i in word:
		if i.isupper():
			capital_letter += 1
		elif i.islower():
			small_letter += 1
	if small_letter >= capital_letter:
		print(word.lower())
	else:
		print(word.upper())
checkCase(input_word)


import sys
input = sys.stdin.readline

def main():
	s = input().strip()
	up = 0
	lo = 0
	for ss in s:
		if ss.upper() == ss:
			up += 1
		else:
			lo += 1
	if lo >= up:
		print(s.lower())
	else:
		print(s.upper())
main()


import string
word = input()
lowercase_count = len([x for x in word if x in string.ascii_lowercase])
uppercase_count = len([x for x in word if x in string.ascii_uppercase])
if lowercase_count >= uppercase_count:
	print(word.lower())
else:
	print(word.upper())


i = input()
count_l = count_u = 0
for j in range(0, len(i)):
	if i[j].isupper():
		count_u = count_u + 1
	else:
		count_l = count_l + 1
if count_l >= count_u:
	print(i.lower())
else:
	print(i.upper())


def theword(word):
	lowercnt = upprcnt = 1
	for ele in word:
		if ele.isupper():
			upprcnt += 1
		else:
			lowercnt += 1
	if upprcnt > lowercnt:
		return word.upper()
	elif lowercnt > upprcnt:
		return word.lower()
	return word.lower()
word = input()
print(theword(word))


a = input()
min = 0
ma = 0
for i in a:
	if i.isupper():
		ma += 1
	else:
		min += 1
if ma > min:
	print(a.upper())
else:
	print(a.lower())


s = input()
ups = sum([int(c.isupper()) for c in s])
if ups > len(s) - ups:
	print(s.upper())
else:
	print(s.lower())


def word(name):
	lower = upper = 0
	for i in range(len(name)):
		if name[i].islower():
			lower += 1
		else:
			upper += 1
	if lower >= upper:
		return name.lower()
	return name.upper()
print(word(input()))


a = input()
b = a.lower()
d = 0
for i in range(len(a)):
	if a[i] != b[i]:
		d += 1
if d > len(a) - d:
	print(a.upper())
else:
	print(b)


n = str(input())
c = []
s = []
for i in n:
	if i.isupper():
		c.append(i)
	else:
		s.append(i)
if len(c) > len(s):
	print(n.upper())
else:
	print(n.lower())


s = list(input())
low = up = 0
for x in s:
	if x.islower() == True:
		low += 1
	if x.isupper() == True:
		up += 1
st = ''.join((str(x) for x in s))
if up > low:
	print(st.upper())
if up <= low:
	print(st.lower())


n = input()
x = 0
for i in n:
	x += 1 if ord(i) >= 65 and ord(i) <= 90 else -1
print(n.upper() if x > 0 else n.lower())


s = input()
count_upper = 0
count_lower = 0
for data in s:
	if data.isupper():
		count_upper += 1
	else:
		count_lower += 1
if count_lower > count_upper:
	print(s.lower())
elif count_upper > count_lower:
	print(s.upper())
else:
	print(s.lower())


def one_register(str):
	count1 = sum((1 for c in str if c.isupper()))
	count2 = sum((1 for c in str if c.islower()))
	if count2 >= count1:
		return str.lower()
	return str.upper()
s = input()
print(one_register(s))


s = input()
n = len(s)
nlower = 0
nupper = 0
for i in range(n):
	if s[i].lower() == s[i]:
		nlower = nlower + 1
	else:
		nupper = nupper + 1
if nlower < nupper:
	print(s.upper())
else:
	print(s.lower())


mass = []
string = input()
for i in string:
	mass.append(i)
count1 = 0
count2 = 0
for i in mass:
	if i >= 'A' and i <= 'Z':
		count1 += 1
	elif i >= 'a' and i <= 'z':
		count2 += 1
if count1 > count2:
	print(string.upper())
else:
	print(string.lower())


name = input()
wielkie = 0
male = 0
for i in name:
	if i == i.upper():
		wielkie += 1
	else:
		male += 1
if wielkie > male:
	name = name.upper()
else:
	name = name.lower()
print(name)


word = str(input())
maiuscula = 0
minuscula = 0
for letra in word:
	if letra == letra.upper():
		maiuscula += 1
	elif letra == letra.lower():
		minuscula += 1
if maiuscula > minuscula:
	print('{}'.format(word.upper()))
elif minuscula >= maiuscula:
	print('{}'.format(word.lower()))


s = input()
u = 0
l = 0
for i in range(len(s)):
	if s[i].isupper():
		u += 1
	else:
		l += 1
if u == l:
	s1 = s.lower()
	print(s1)
elif u > l:
	s1 = s.upper()
	print(s1)
else:
	s1 = s.lower()
	print(s1)


s = input()
uc = 0
lc = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		uc += 1
	if ord(i) >= 97 and ord(i) <= 122:
		lc += 1
if uc > lc:
	print(s.upper())
else:
	print(s.lower())


text = input()
up = sum((1 for c in text if c.isupper()))
low = sum((1 for c in text if c.islower()))
if up > low:
	print(text.upper())
else:
	print(text.lower())


a = input()
up = []
low = []
for i in a:
	if i.isupper() == True:
		up.append(i)
	if i.islower() == True:
		low.append(i)
if len(up) == len(low):
	print(a.lower())
elif len(up) > len(low):
	print(a.upper())
else:
	print(a.lower())


s = input()
l = 0
u = 0
for letter in s:
	if letter.isupper() > letter.islower():
		u += 1
	else:
		l += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


s = input()
l = list(s)
low = high = 0
for i in l:
	if i.islower():
		low += 1
	else:
		high += 1
if high > low:
	print(s.upper())
else:
	print(s.lower())


x = input()
caps = 0
not_caps = 0
for alpha in x:
	if alpha.isupper():
		caps += 1
	else:
		not_caps += 1
if caps > not_caps:
	x = x.upper()
else:
	x = x.lower()
print(x)


k = input()
b = m = 0
for i in k:
	if ord(i) >= 97:
		m += 1
	else:
		b += 1
if m >= b:
	print(k.lower())
else:
	print(k.upper())


s = input()
count = 0
for i in range(len(s)):
	if s[i].islower():
		count = count + 1
x = len(s) - count
if x > count:
	print(s.upper())
else:
	print(s.lower())


s = input()
big = 0
small = 0
for i in range(len(s)):
	if s[i] == s[i].upper():
		big += 1
	else:
		small += 1
if big > small:
	print(s.upper())
else:
	print(s.lower())


s = input()
cu = 0
cl = 0
for x in s:
	if x.isupper():
		cu += 1
	else:
		cl += 1
if cu > cl:
	print(s.upper())
else:
	print(s.lower())


import sys
import math
input = sys.stdin.readline

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

def str_array():
	return input().strip().split()

def lower_letters():
	lowercase = [chr(i) for i in range(97, 97 + 26)]
	return lowercase

def upper_letters():
	uppercase = [chr(i) for i in range(65, 65 + 26)]
	return uppercase
lower = lower_letters()
upper = upper_letters()
word = input()
(l, u) = (0, 0)
for i in word:
	if i in lower:
		l += 1
	elif i in upper:
		u += 1
if l >= u:
	word = list(word)
	for i in range(len(word)):
		if word[i] in upper:
			word[i] = lower[upper.index(word[i])]
else:
	word = list(word)
	for i in range(len(word)):
		if word[i] in lower:
			word[i] = upper[lower.index(word[i])]
print(''.join(word))


word = input()
small = 'abcdefghijklmnopqrstuvwxyz'
cap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
numSmall = 0
numCap = 0
out = ''
wordLen = len(word)
for w in word:
	if w in small:
		numSmall += 1
	elif w in cap:
		numCap += 1
if numCap > numSmall:
	for w in word:
		if w in small:
			out += cap[small.index(w)]
		else:
			out += w
else:
	for w in word:
		if w in cap:
			out += small[cap.index(w)]
		else:
			out += w
print(out)


from collections import deque
s = input()
uppercase_lst = []
lowercase_lst = []
lst = deque(s)
for i in lst:
	if i.isupper():
		uppercase_lst.append(i)
	else:
		lowercase_lst.append(i)
if len(uppercase_lst) > len(lowercase_lst):
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


x = input()
k = 0
k1 = 0
for i in range(len(x)):
	if x[i] >= 'A' and x[i] <= 'Z':
		k = k + 1
	else:
		k1 = k1 + 1
if k1 >= k:
	print(x.lower())
else:
	print(x.upper())


a = input()
s = 0
c = 0
for i in a:
	if i.islower() == True:
		s = s + 1
	elif i.isupper() == True:
		c = c + 1
if s > c:
	print(a.lower())
elif c > s:
	print(a.upper())
else:
	print(a.lower())


u = 0
string = input()
for c in string:
	if ord(c) >= 65 and ord(c) <= 90:
		u += 1
l = len(string) - u
if u <= l:
	print(string.lower())
else:
	print(string.upper())


s = input()
(count_up, count_down) = (0, 0)
for i in s:
	if i.isupper():
		count_up += 1
	else:
		count_down += 1
if count_up > count_down:
	print(s.upper())
else:
	print(s.lower())


s = input().strip()
c1 = 0
c2 = 0
for i in s:
	if i.isupper():
		c1 += 1
	else:
		c2 += 1
if c1 > c2:
	x = s.upper()
else:
	x = s.lower()
print(x)


import string
s = input()
c_u = sum([1 if c in string.ascii_uppercase else 0 for c in s])
c_l = sum([1 if c in string.ascii_lowercase else 0 for c in s])
if c_l >= c_u:
	print(s.lower())
else:
	print(s.upper())


word = input()
List = [0] * len(word)
for i in range(len(word)):
	List[i] = word[i]
count_1 = 0
count_2 = 0
for k in range(len(word)):
	if List[k] == List[k].lower():
		count_1 += 1
	elif List[k] == List[k].upper():
		count_2 += 1
if count_1 >= count_2:
	print(word.lower())
else:
	print(word.upper())


n = input()

def checker(word):
	ls = list(word)
	countlow = 0
	countup = 0
	for items in ls:
		if ord(items) >= 97:
			countlow += 1
		else:
			countup += 1
	if countup > countlow:
		return word.upper()
	else:
		return word.lower()
a = checker(n)
print(a)


def uni(a):
	lowercount = 0
	uppercount = 0
	for i in range(len(a)):
		if ord(a[i]) >= 65 and ord(a[i]) <= 90:
			uppercount += 1
		else:
			lowercount += 1
	if lowercount >= uppercount:
		return a.lower()
	else:
		return a.upper()
print(uni(input()))


string = input()
a = list(string)
l = 0
u = 0
for i in a:
	if i.islower() == True:
		l += 1
	else:
		u += 1
if l >= u:
	print(string.lower())
else:
	print(string.upper())


x = input()
low = 0
up = 0
m = list(x)
for v in m:
	if ord(v) >= 97 and ord(v) <= 122:
		low += 1
	elif ord(v) >= 65 and ord(v) <= 90:
		up += 1
if up > low:
	print(x.upper())
else:
	print(x.lower())


try:
	s = str(input())
	lw = 0
	up = 0
	l = len(s)
	for i in range(l):
		if s[i].isupper():
			up += 1
		else:
			lw += 1
	if up > lw:
		print(s.upper())
	else:
		print(s.lower())
except:
	pass


def case(s):
	l = []
	for i in range(0, len(s)):
		l.append(s[i])
	up = 0
	low = 0
	for i in range(0, len(s)):
		if l[i].isupper() == True:
			up += 1
		else:
			low += 1
	if up == low:
		return s.lower()
	elif up > low:
		return s.upper()
	else:
		return s.lower()
s = input()
print(case(s))


s = input()

def check(l):
	c = 0
	for i in l:
		if i.isupper():
			c += 1
		elif i.islower():
			c -= 1
	return c
if check(list(s)) > 0:
	print(s.upper())
elif check(list(s)) < 0:
	print(s.lower())
else:
	print(s.lower())


s = input().lstrip().rstrip()
(lw, up) = (0, 0)
for i in s:
	if i == i.lower():
		lw += 1
	elif i == i.upper():
		up += 1
if lw >= up:
	print(s.lower())
else:
	print(s.upper())


a = input()
small = 0
cap = 0
for item in a:
	b = item.upper()
	c = item.lower()
	if b == item:
		cap += 1
	else:
		small += 1
if cap > len(a) // 2:
	for item in a:
		print(item.upper(), end='')
else:
	for item in a:
		print(item.lower(), end='')


s = input()
n_lower = 0
for l in list(s):
	if l.islower():
		n_lower += 1
if n_lower >= len(list(s)) - n_lower:
	print(s.lower())
else:
	print(s.upper())


s = input()
count = 0
x = 0
for i in s:
	if i.isupper():
		count += 1
	else:
		x += 1
if x < count:
	print(s.upper())
else:
	print(s.lower())


import random

def seperateints(x):
	k = ''
	l = []
	for i in x:
		if i == ' ':
			l.append(int(k))
			k = ''
			continue
		k = k + i
	l.append(int(k))
	return l

def luckynum(x):
	for i in x:
		if i != '4' and i != '7':
			return False
	return True

def greatercommondivisor(a, b):
	if a == 0:
		return b
	if b == 0:
		return a
	if a == b:
		return a
	if a > b:
		k = b
		while True:
			if a % k == 0 and b % k == 0:
				return k
			k -= 1
	if b > a:
		k = a
		while True:
			if a % k == 0 and b % k == 0:
				return k
			k -= 1
n = input()
l = 0
u = 0
for i in n:
	if i.islower():
		l += 1
	else:
		u += 1
if u > l:
	print(n.upper())
else:
	print(n.lower())


s = input()
(uc, dc) = (0, 0)
for i in range(len(s)):
	if s[i].isupper():
		uc += 1
	else:
		dc += 1
if uc > dc:
	print(s.upper())
else:
	print(s.lower())


string = list(input())
count_upper = 0
count_lower = 0
for char in string:
	if char.isupper():
		count_upper += 1
	else:
		count_lower += 1
if count_upper > count_lower:
	print(''.join(string).upper())
else:
	print(''.join(string).lower())


n = input()
t = 0
l = 0
for i in n:
	if i.isupper() == True:
		t += 1
	else:
		l += 1
if t > l:
	print(n.upper())
else:
	print(n.lower())


s = input()
length = len(s)
up_count = 0
for i in s:
	if i.isupper():
		up_count += 1
if up_count > length // 2:
	print(s.upper())
else:
	print(s.lower())


w1 = input()
w = list(w1)
u = 0
l = 0
for item in w:
	if item.isupper() == 1:
		u += 1
	else:
		l = l + 1
print(w1.upper()) if u > l else print(w1.lower())


from string import ascii_uppercase as u
a = input()
b = 0
for i in a:
	if i in u:
		b += 1
if 2 * b > len(a):
	print(a.upper())
else:
	print(a.lower())


w = input()
k = 0
b = 0
for i in w:
	if i.islower():
		k += 1
	else:
		b += 1
if k >= b:
	w = w.lower()
else:
	w = w.upper()
print(w)


def func(st):
	n = len(st)
	(up, down) = (0, 0)
	for char in st:
		if str(char).isupper():
			up += 1
		else:
			down += 1
	if n & 1 == 1:
		if up > down:
			return st.upper()
		return st.lower()
	if up > down:
		return st.upper()
	elif down > up:
		return st.lower()
	return st.lower()
st = input()
print(func(st))


s = input()
upper_char = 0
lower_char = 0
for c in s:
	if c.isupper():
		upper_char += 1
	elif c.islower():
		lower_char += 1
if upper_char > lower_char:
	print(s.upper())
else:
	print(s.lower())


str = input()
count_l = 0
count_u = 0
for i in str:
	if i.islower():
		count_l += 1
	if i.isupper():
		count_u += 1
if count_l >= count_u:
	print(str.lower())
else:
	print(str.upper())


s = input()
length = len(s)
if length > 100:
	print('wrong input')
	exit
upper = 0
for i in range(0, length):
	if s[i] >= 'A' and s[i] <= 'Z':
		upper += 1
if upper > length / 2:
	print(s.upper())
if upper <= length / 2:
	print(s.lower())


import string
lowerCount = 0
upperCount = 0
word = input()
for char in word:
	if char in string.ascii_lowercase:
		lowerCount += 1
	else:
		upperCount += 1
if upperCount > lowerCount:
	print(word.upper())
else:
	print(word.lower())


s = str(input())
small = 0
big = 0
if 1 <= len(s) <= 100:
	for i in s:
		if 'a' <= i <= 'z':
			small += 1
		elif 'A' <= i <= 'Z':
			big += 1
	if big > small:
		print(s.upper())
	elif big <= small:
		print(s.lower())


import sys
ins = sys.stdin.readline()
instr = list(ins)
lowcnt = 0
l = len(instr) - 1
for i in instr[:l]:
	if i.islower():
		lowcnt += 1
if l % 2 == 0:
	if lowcnt >= l / 2:
		print(ins.lower())
	else:
		print(ins.upper())
elif lowcnt < int(l / 2) + 1:
	print(ins.upper())
else:
	print(ins.lower())


s = input()
u = 0
d = 0
for i in range(len(s)):
	if s[i].isupper():
		u += 1
	elif s[i].islower():
		d += 1
if u > d:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
letters = []
for x in s:
	letters.append(x)
count_cap = 0
count_small = 0
for i in range(len(s)):
	if ord(letters[i]) < 91 and ord(letters[i]) > 64:
		count_cap = count_cap + 1
	elif ord(letters[i]) < 123 and ord(letters[i]) > 96:
		count_small = count_small + 1
if count_cap > count_small:
	print(s.upper())
else:
	print(s.lower())


import math
import re
a = input()
if len(re.sub('[a-z]', '', a)) <= math.floor(len(a) / 2):
	print(a.lower())
else:
	print(a.upper())


s = input()
count = 0
for i in s:
	if 'Z' >= i >= 'A':
		count += 1
if count <= len(s) - count:
	print(s.lower())
else:
	print(s.upper())


string = input()
upper = 0
lower = 0
for i in string:
	if i in 'QWERTYUIOPLMKJNBHGVFCDSXAZ':
		upper += 1
	elif i in 'qwertyuioplmkjnbhgvfcdsxza':
		lower += 1
if upper > lower:
	print(string.upper())
else:
	print(string.lower())


s = input()
uppercnt = 0
lowercnt = 0
for char in s:
	if char.isupper():
		uppercnt += 1
	else:
		lowercnt += 1
if uppercnt > lowercnt:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
count_low = 0
for x in range(len(s)):
	if s[x].islower():
		count_low += 1
print(s.upper() if count_low < len(s) - count_low else s.lower())


s = input()
(uppercase, lowercase) = (0, 0)
for i in s:
	if 'a' <= i <= 'z':
		lowercase += 1
	else:
		uppercase += 1
if lowercase >= uppercase:
	print(s.lower())
else:
	print(s.upper())


c = input()
l = len(c)
c1 = 0
c2 = 0
for i in range(l):
	if c[i].isupper():
		c1 += 1
	else:
		c2 += 1
if c1 > c2:
	print(c.upper())
else:
	print(c.lower())


s = input()
cnt = 0
for i in s:
	if ord(i) in range(97, 123):
		cnt += 1
if cnt >= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


import string
s = input()

def x(s):
	u = 0
	l = 0
	for c in s:
		if c in string.ascii_uppercase:
			u += 1
		else:
			l += 1
	if u > l:
		return s.upper()
	else:
		return s.lower()
print(x(s))


a = input()
import string
d = u = 0
for i in a:
	if str.upper(i) == i:
		u += 1
	else:
		d += 1
if u > d:
	print(a.upper())
else:
	print(a.lower())


def solve(s):
	l = map(lambda c: 1 if c.islower() else 0, list(s))
	return s.lower() if sum(l) >= len(s) / 2 else s.upper()
s = input()
print(solve(s))


import sys
string = input()
countLowercase = sum(map(str.islower, string))
countUppercase = sum(map(str.isupper, string))
if countLowercase >= countUppercase:
	print(string.lower())
else:
	print(string.upper())


n = input()
(a, b) = (0, 0)
for i in n:
	if i.isupper() == True:
		a += 1
	elif i.islower() == True:
		b += 1
if a > b:
	print(n.upper())
elif b > a:
	print(n.lower())
else:
	print(n.lower())


word = input()
wordLen = len(word)
upperCount = 0
for i in range(0, wordLen):
	if word[i].isupper():
		upperCount += 1
if upperCount > wordLen / 2:
	newWord = word.upper()
else:
	newWord = word.lower()
print(newWord)


s = input()
ctr = 0
ctr1 = 0
x = [i for i in s]
for j in x:
	if ord(j) >= 65 and ord(j) <= 90:
		ctr = ctr + 1
	elif ord(j) >= 97 and ord(j) <= 122:
		ctr1 += 1
if ctr > ctr1:
	print(s.upper())
else:
	print(s.lower())


s = input()
j = 0
k = 0
for i in range(len(s)):
	if s[i] >= 'A' and s[i] <= 'Z':
		j += 1
	elif s[i] >= 'a' and s[i] <= 'z':
		k += 1
if j > k:
	print(s.upper())
else:
	print(s.lower())


s = input()
k = 0
t1 = ''
t2 = ''
s1 = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(len(s)):
	if s[i] in s1:
		k += 1
if k < len(s) - k:
	for i in range(len(s)):
		if s[i] in s1:
			k1 = ord(s[i])
			t1 += chr(k1 - 32)
		else:
			t1 += s[i]
else:
	for i in range(len(s)):
		if s[i] not in s1:
			k1 = ord(s[i])
			t1 += chr(k1 + 32)
		else:
			t1 += s[i]
print(t1)


s = input()
nl = sum(map(str.islower, s))
nu = len(s) - nl
if nl >= nu:
	print(s.lower())
else:
	print(s.upper())


a = input()
b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = 0
for i in a:
	if i in b:
		n += 1
print(a.upper() if 2 * n > len(a) else a.lower())


word = input()
nbLower = 0
for letter in word:
	if letter.islower():
		nbLower += 1
if 2 * nbLower >= len(word):
	print(word.lower())
else:
	print(word.upper())


def main():
	frase = input()
	contador = 0
	contador1 = 0
	for i in range(len(frase)):
		if frase[i:i + 1] >= 'A' and frase[i:i + 1] <= 'Z':
			contador += 1
	for i in range(len(frase)):
		if frase[i:i + 1] >= 'a' and frase[i:i + 1] <= 'z':
			contador1 += 1
	if contador > contador1:
		print(frase.upper())
	else:
		print(frase.lower())
main()


s = input()
uppercase = 0
lowercase = 0
for i in range(len(s)):
	if s[i].isupper():
		uppercase += 1
	else:
		lowercase += 1
if uppercase > lowercase:
	s = s.upper()
else:
	s = s.lower()
print(s)


try:
	s = input()
	c = 0
	for i in s:
		if ord(i) >= 65 and ord(i) <= 90:
			c += 1
	if c > len(s) / 2:
		print(s.upper())
	else:
		print(s.lower())
except EOFError:
	pass


s = input()
num = len(s)
caps = 0
for i in range(65, 91):
	caps = caps + s.count(chr(i))
low = num - caps
if low >= caps:
	print(s.lower())
else:
	print(s.upper())


s = input()
lowcount = 0
for i in s:
	if i == i.lower():
		lowcount += 1
	if lowcount >= (len(s) + 1) // 2:
		break
if lowcount >= (len(s) + 1) // 2:
	print(s.lower())
else:
	print(s.upper())


S = input()
a = 0
b = 0
for i in range(len(S)):
	if ord(S[i]) >= 97:
		b += 1
	else:
		a += 1
if a > b:
	print(S.upper())
else:
	print(S.lower())


n = input()
a = sum((1 for i in n if i.isupper()))
b = sum((1 for i in n if i.islower()))
if a > b:
	print(n.upper())
else:
	print(n.lower())


x = input()
c = d = 0
l = len(x)
for i in range(l):
	if x[i].isupper():
		c = c + 1
	elif x[i].islower():
		d = d + 1
if d >= c:
	x = x.lower()
	print(x)
elif d < c:
	print(x.upper())


def convert(s):
	uppers = 0
	lowers = 0
	for c in s:
		if c.isupper():
			uppers += 1
		else:
			lowers += 1
	if uppers > lowers:
		return s.upper()
	return s.lower()

def main():
	word = input()
	print(convert(word))
main()


str1 = input()
ulist = []
llist = []
for i in range(len(str1)):
	if ord(str1[i]) < 97:
		ulist.append(str1[i])
	else:
		llist.append(str1[i])
if len(ulist) > len(llist):
	print(str1.upper())
else:
	print(str1.lower())


my_word = str(input())
if sum(map(str.islower, my_word)) < sum(map(str.isupper, my_word)):
	print(my_word.upper())
else:
	print(my_word.lower())


s = input('')
length = len(s)
lowcase = 0
uppcase = 0
for i in range(length):
	if s[i].islower():
		lowcase = lowcase + 1
	elif s[i].isupper():
		uppcase = uppcase + 1
if lowcase >= uppcase:
	print(s.lower())
else:
	print(s.upper())


word = input()
wordlist = list(word)
s = 0
b = 0
for (i, j) in enumerate(wordlist):
	if j == j.upper():
		b += 1
	else:
		s += 1
if s >= b:
	print(word.lower())
else:
	print(word.upper())


word = input()
lowercase = 0
uppercase = 0
for c in word:
	if c.islower() == True:
		lowercase = lowercase + 1
	else:
		uppercase = uppercase + 1
if lowercase >= uppercase:
	word = word.lower()
	print(word)
else:
	word = word.upper()
	print(word)


s = input()
l = 0
u = 0
for x in range(len(s)):
	if s[x] == s[x].lower():
		l += 1
	else:
		u += 1
if l > u or l == u:
	print(s.lower())
else:
	print(s.upper())


msg = input()
caps = sum((1 for c in msg if c.isupper()))
if caps > len(msg) - caps:
	print(msg.upper())
else:
	print(msg.lower())


s = input()
u = [x for x in s if x.isupper()]
l = [x for x in s if x.islower()]
if len(u) > len(l):
	print(s.upper())
else:
	print(s.lower())


s = input()
(q, w) = (0, 0)
for i in s:
	if i >= 'a' and i <= 'z':
		q += 1
	if i >= 'A' and i <= 'Z':
		w += 1
if w > q:
	print(s.upper())
else:
	print(s.lower())


s = input()
cnt1 = 0
cnt2 = 0
for i in s:
	if i >= 'A' and i <= 'Z':
		cnt1 += 1
	else:
		cnt2 += 1
print(s.upper() if cnt2 < cnt1 else s.lower())


s = input()
(sum1, sum2) = (0, 0)
for i in s:
	if i.isupper():
		sum1 += 1
	else:
		sum2 += 1
if sum1 > sum2:
	print(s.upper())
else:
	print(s.lower())


t = input()
c = 0
for i in t:
	if i.isupper():
		c += 1
if c > len(t) / 2:
	print(t.upper())
else:
	print(t.lower())


str = input()
u = 0
l = 0
for char in str:
	if ord(char) > 96:
		l += 1
	elif ord(char) < 96:
		u += 1
editedStr = ''
if u > l:
	editedStr = str.upper()
else:
	editedStr = str.lower()
print(editedStr)


st = input()
(count1, count2) = (0, 0)
for i in st:
	if i.isupper():
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	st = st.upper()
else:
	st = st.lower()
print(st)


w = input()
u = sum((1 for i in w if i.isupper()))
if 2 * u > len(w):
	print(w.upper())
else:
	print(w.lower())


s = input()
c = 0
for e in s:
	if not e.isupper():
		c += 1
if c >= len(s) - c:
	print(s.lower())
else:
	print(s.upper())


def up(string):
	upper = 0
	lower = 0
	for i in range(len(string)):
		if ord(string[i]) >= 97 and ord(string[i]) <= 122:
			lower += 1
		elif ord(string[i]) >= 65 and ord(string[i]) <= 90:
			upper += 1
	if upper <= lower:
		print(string.lower())
	else:
		print(string.upper())
x = input()
up(x)


s = input()
nizreg = 0
for i in range(len(s)):
	if s[i].islower() == True:
		nizreg += 1
if int(len(s)) / 2 <= nizreg:
	print(s.lower())
else:
	print(s.upper())


s = input()
arr = list(s)
(low, upper) = (0, 0)
for i in arr:
	if i.islower():
		low += 1
	if i.isupper():
		upper += 1
if low >= upper:
	print(s.lower())
else:
	print(s.upper())


s = input()
sm_count = 0
cap_count = 0
small = ''
large = ''
for alpha in s:
	if ord(alpha) >= 97 and ord(alpha) <= 122:
		small += alpha
		large += chr(ord(alpha) - 97 + 65)
		sm_count += 1
	else:
		small += chr(ord(alpha) + 97 - 65)
		large += alpha
		cap_count += 1
if sm_count >= cap_count:
	print(small)
else:
	print(large)


import sys
from array import array

def input():
	return sys.stdin.buffer.readline().decode('utf-8')
s = input().rstrip()
n = len(s)
if sum([1 for c in s if 65 <= ord(c) <= 90]) * 2 > n:
	print(s.upper())
else:
	print(s.lower())


def solve(str):
	lower = sum((1 for c in str if c.islower()))
	if len(str) - lower > lower:
		return str.upper()
	else:
		return str.lower()
print(solve(input()))


import string
message = input()
x = sum((1 for c in message if c.isupper()))
y = sum((1 for c in message if c.islower()))
if x <= y:
	print(message.lower())
else:
	print(message.upper())


w = input()
u = int(0)
l = int(0)
for i in w:
	if i.islower():
		l += 1
	if i.isupper():
		u += 1
if u > l:
	w = w.upper()
	print(w)
else:
	w = w.lower()
	print(w)


word = input()
(lower_counter, upper_counter) = (0, 0)
for ch in word:
	if ord(ch) >= 97:
		lower_counter += 1
	else:
		upper_counter += 1
if upper_counter > lower_counter:
	print(word.upper())
else:
	print(word.lower())


string = input()
upperalp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
loweralp = 'abcdefghijklmnopqrstuvwxyz'
countup = 0
countlo = 0
for i in range(len(string)):
	if string[i] in upperalp:
		countup += 1
	else:
		countlo += 1
if countlo < countup:
	string = string.upper()
else:
	string = string.lower()
print(string)


word = input()
lwrL = 0
capL = 0
for i in range(len(word)):
	if word[i] == word[i].lower():
		lwrL += 1
	else:
		capL += 1
if capL > lwrL:
	print(word.upper())
else:
	print(word.lower())


s = input()
a = 0
for i in s:
	if i.isupper():
		a += 1
if a / len(s) > 0.5:
	print(s.upper())
else:
	print(s.lower())


word = input()
upp = sum([x.isupper() for x in word])
low = sum([x.islower() for x in word])
print([word.upper(), word.lower()][low >= upp])


string = input()
c = 0
for i in range(0, len(string)):
	if string[i] == string[i].upper():
		c = c + 1
	else:
		c = c - 1
if c > 0:
	print(string.upper())
else:
	print(string.lower())


s = input()
k1 = 0
k2 = 0
for i in range(len(s)):
	if 65 <= ord(s[i]) <= 90:
		k1 += 1
	else:
		k2 += 1
if k1 > k2:
	print(s.upper())
else:
	print(s.lower())


s = input()
low = up = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		up += 1
	else:
		low += 1
if up > low:
	for i in s:
		if ord(i) >= 97 and ord(i) <= 122:
			print(chr(ord(i) - 32), end='')
		else:
			print(i, end='')
else:
	for i in s:
		if ord(i) >= 65 and ord(i) <= 90:
			print(chr(ord(i) + 32), end='')
		else:
			print(i, end='')


def A_Word(string):
	lo = ''
	up = ''
	for ch in string:
		if ch == ch.lower():
			lo += ch
		else:
			up += ch
	if len(lo) == len(up):
		print(string.lower())
	elif len(lo) > len(up):
		print(string.lower())
	else:
		print(string.upper())
string = input()
A_Word(string)


word = input()
(lwr, upp) = (0, 0)
for letter in word:
	if letter.islower():
		lwr += 1
	else:
		upp += 1
if lwr >= upp:
	print(word.lower())
else:
	print(word.upper())


string = input()
low = string.lower()
up = string.upper()
lowcount = 0
for i in range(len(low)):
	if low[i] == string[i]:
		lowcount += 1
upcount = len(string) - lowcount
if upcount <= lowcount:
	print(low)
else:
	print(up)


s = input()
a = 0
for i in range(len(s)):
	if ord('a') <= ord(s[i]) <= ord('z'):
		a += 1
if 2 * a < len(s):
	for i in range(len(s)):
		print(s[i].upper(), end='')
else:
	for i in range(len(s)):
		print(s[i].lower(), end='')


n = list(input())
up = 0
lowe = 0
k = ''
for i in range(len(n)):
	if n[i].isupper():
		up += 1
	elif n[i].islower():
		lowe += 1
if up > lowe:
	k = ''.join(n).lower().upper()
elif up == lowe:
	k = ''.join(n).lower()
elif up < lowe:
	k = ''.join(n).upper().lower()
print(k)


p = input()
a = ord('a')
z = ord('z')
l = 0
for i in range(0, len(p), 1):
	aa = ord(p[i])
	if (aa >= a) & (aa <= z):
		l = l + 1
ass = []
ll = len(p) - l
if l >= ll:
	for i in range(0, len(p), 1):
		aa = ord(p[i])
		if (aa >= a) & (aa <= z):
			bb = chr(aa)
			ass.append(bb)
		else:
			aa = aa + 32
			bb = chr(aa)
			ass.append(bb)
else:
	for i in range(0, len(p), 1):
		aa = ord(p[i])
		if (aa >= a) & (aa <= z):
			aa = aa - 32
			bb = chr(aa)
			ass.append(bb)
		else:
			bb = chr(aa)
			ass.append(bb)
print(''.join([str(ass[i]) for i in range(0, len(ass))]))


word = input()
count = 0
for a in word:
	if a.isupper():
		count = count + 1
	else:
		count = count - 1
if count > 0:
	print(word.upper())
else:
	print(word.lower())


s = input()
count = 0
for i in s:
	if i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		count += 1
if count <= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


s = input()
upper = 0
small = 0
for c in s:
	if 'a' <= c and c <= 'z':
		small += 1
	else:
		upper += 1
if upper > small:
	print(s.upper())
else:
	print(s.lower())


s = input()
count = 0
for i in s:
	if 65 <= ord(i) <= 90:
		count += 1
if count > len(s) - count:
	print(s.upper())
else:
	print(s.lower())


n = list(input())
oomoji = 0
komoji = 0
for i in n:
	if i.islower():
		komoji += 1
	else:
		oomoji += 1
if oomoji > komoji:
	print(''.join(n).upper())
else:
	print(''.join(n).lower())


word = input()
mylist = list(word)
ucount = 0
lcount = 0
for i in mylist:
	if i.isupper() == True:
		ucount = ucount + 1
	elif i.islower() == True:
		lcount = lcount + 1
if ucount > lcount:
	print(word.upper())
elif lcount > ucount or lcount == ucount:
	print(word.lower())


i = input()
c = 0
for k in range(0, len(i)):
	if ord(i[k]) >= 97 and ord(i[k]) <= 122:
		c = c + 1
if c >= len(i) / 2:
	print(i.lower())
else:
	print(i.upper())


word = input()
res = ''
isup = 0
islow = 0
for i in range(len(word)):
	if word[i].isupper():
		isup += 1
	else:
		islow += 1
if isup > islow:
	res = word.upper()
else:
	res = word.lower()
print(res)


n = input()
s1 = sum((1 for c in n if c.islower()))
s2 = sum((1 for c in n if c.isupper()))
if s1 == s2:
	print(n.lower())
elif s1 > s2:
	print(n.lower())
else:
	print(n.upper())


import sys
s = input()
a = 0
b = 0
for i in range(len(s)):
	if s[i].isupper():
		a += 1
	else:
		b += 1
if a > b:
	s = s.upper()
else:
	s = s.lower()
print(s)


def getword(s):
	c = 0
	for x in s:
		if x.isupper():
			c += 1
	if c > len(s) // 2:
		return s.upper()
	return s.lower()
s = input()
print(getword(s))


n = input()
cap = 0
small = 0
for i in n:
	if ord(i) >= 97 and ord(i) <= 122:
		small += 1
	else:
		cap += 1
if small >= cap:
	print(n.lower())
else:
	print(n.upper())


def count_change(string):
	arr = []
	lower = 0
	upper = 0
	for i in range(0, len(string)):
		ascii = ord(string[i])
		arr.append(ascii)
		if ascii >= 97 and ascii <= 122:
			lower += 1
		elif ascii >= 65 and ascii <= 90:
			upper += 1
		if lower > upper:
			for i in range(0, len(arr)):
				if arr[i] >= 65 and arr[i] <= 90:
					arr[i] += 32
		elif upper > lower:
			for i in range(0, len(arr)):
				if arr[i] >= 97 and arr[i] <= 122:
					arr[i] -= 32
		else:
			for i in range(0, len(arr)):
				if arr[i] >= 65 and arr[i] <= 90:
					arr[i] += 32
	return arr
string = input()
ascii = []
ascii = count_change(string)
for i in range(0, len(ascii)):
	print(chr(ascii[i]), end='')


s = input()
if s == s.lower() or s == s.upper():
	print(s)
else:
	l = 0
	u = 0
	for i in s:
		if i == i.lower():
			l += 1
		if i == i.upper():
			u += 1
	if u < l:
		for i in range(len(s)):
			if s[i] == s[i].upper():
				s = s.replace(s[i], s[i].lower())
		print(s)
	if l < u:
		for i in range(len(s)):
			if s[i] == s[i].lower():
				s = s.replace(s[i], s[i].upper())
		print(s)
	if l == u:
		print(s.lower())


s = list(input())
up = 0
lo = 0
for i in s:
	if i.isupper():
		up += 1
	else:
		lo += 1
if lo >= up:
	for i in range(len(s)):
		s[i] = s[i].lower()
	print(''.join(s))
else:
	for i in range(len(s)):
		s[i] = s[i].upper()
	print(''.join(s))


cap = 0
low = 0
word = input()
for sym in word:
	if sym.isupper():
		cap += 1
	else:
		low += 1
if cap > low:
	print(word.upper())
else:
	print(word.lower())


lis = list(input())
up = 0
lp = 0
for i in range(len(lis)):
	if lis[i].isupper():
		up += 1
	else:
		lp += 1
if up > lp:
	print(''.join(lis).upper())
else:
	print(''.join(lis).lower())


n = list(input())
low = 0
high = 0
for i in n:
	if i.islower():
		low += 1
	else:
		high += 1
if low >= high:
	for i in range(len(n)):
		n[i] = n[i].lower()
		print(n[i], end='')
else:
	for i in range(len(n)):
		n[i] = n[i].upper()
		print(n[i], end='')


import string
s = input()

def main(s):
	u = string.ascii_uppercase
	num_of_up = 0
	s_len = len(s)
	for char in s:
		if char in u:
			num_of_up += 1
			if num_of_up > s_len // 2:
				return s.upper()
	return s.lower()
print(main(s))


d = input()
count_lower = 0
count_upper = 0
for i in d:
	if i.islower():
		count_lower += 1
	else:
		count_upper += 1
if count_lower > count_upper or count_upper == count_lower:
	print(d.lower())
else:
	print(d.upper())


l = input()
l2 = [x.isupper() for x in l]
if l2.count(1) > l2.count(0):
	print(l.upper())
else:
	print(l.lower())


a = input()
a = str(''.join(a))
(b, B) = (0, 0)
for i in range(len(a)):
	if ord(a[i]) >= 65 and ord(a[i]) <= 90:
		B += 1
	elif ord(a[i]) >= 97 and ord(a[i]) <= 122:
		b += 1
if b >= B:
	print(a.lower())
elif B > b:
	print(a.upper())


n = 'abcdefghijklmnopqrstuvwxyz'
l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
name = input()
upper = 0
lower = 0
for i in range(len(name)):
	if name[i] in n:
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(name.lower())
else:
	print(name.upper())


Str = input()
upper = 0
lower = 0
for i in Str:
	if i >= 'A' and i <= 'Z':
		upper += 1
	else:
		lower += 1
if upper == lower:
	str2 = Str.lower()
elif upper > lower:
	str2 = Str.upper()
else:
	str2 = Str.lower()
print(str2)


def split(word):
	arr = [char for char in word]
	small = 0
	big = 0
	for i in arr:
		if i.isupper():
			big += 1
		else:
			small += 1
	if big > small:
		return 1
	else:
		return 0
word = input()
flag = split(word)
if flag == 1:
	print(word.upper())
else:
	print(word.lower())


a = input()
b = list(a)
h = []
s = []
for i in b:
	if i == i.upper():
		h.append(i)
	else:
		s.append(i)
if len(h) > len(s):
	print(a.upper())
elif len(h) < len(s):
	print(a.lower())
else:
	print(a.lower())


s = input()
a = list()
c1 = 0
c2 = 0
for i in range(len(s)):
	if s[i].islower() == True:
		c1 = c1 + 1
	else:
		c2 = c2 + 1
if c1 >= c2:
	print(s.lower())
else:
	print(s.upper())


lowercase = 0
uppercase = 0
data = input()
for i in range(len(data)):
	if data[i].islower():
		lowercase += 1
	else:
		uppercase += 1
if lowercase >= uppercase:
	print(data.lower())
else:
	print(data.upper())


s = input()
s1 = s.lower()
s2 = s.upper()
v1 = v2 = 0
for i in range(0, len(s)):
	v1 += s[i] != s1[i]
	v2 += s[i] != s2[i]
print([s1, s2][v1 > v2])


s = input()
countlower = 0
countupper = 0
for i in s:
	if 65 <= ord(i) <= 90:
		countupper += 1
	elif 97 <= ord(i) <= 122:
		countlower += 1
if countlower >= countupper:
	print(s.lower())
else:
	print(s.upper())


x = input()
y = []
z = []
for i in x:
	if i == i.upper():
		y.append(i)
	else:
		z.append(i)
if len(y) > len(z):
	print(x.upper())
if len(y) <= len(z):
	print(x.lower())


ui = input()
count = 0
count2 = 0
for i in ui:
	if i.isupper():
		count += 1
	else:
		count2 += 1
if count > count2:
	print(ui.upper())
else:
	print(ui.lower())


w = input()
u = 0
l = 0
for c in w:
	uni = ord(c)
	if uni >= 65 and uni <= 90:
		u += 1
	else:
		l += 1
if u > l:
	print(w.upper())
else:
	print(w.lower())


s = input()
x = len(s)
i = 0
u = 0
l = 0
while i < x:
	if s[i].isupper():
		u += 1
	else:
		l += 1
	i += 1
if l >= u:
	print(s.lower())
else:
	print(s.upper())


s = input()
d = 0
for i in s:
	if 'a' <= i <= 'z':
		d += 1
if d >= len(s) - d:
	print(s.lower())
else:
	print(s.upper())


n = input()
count_lower = 0
count_upper = 0
for x in n:
	if x.islower():
		count_lower += 1
	else:
		count_upper += 1
if count_lower >= count_upper:
	n = n.lower()
else:
	n = n.upper()
print(n)


def main():
	s = input()
	s1 = s.lower()
	s2 = s.upper()
	n = 0
	for i in range(len(s)):
		if s[i] != s2[i]:
			n += 1
	if len(s) - n <= n:
		print(s1)
	else:
		print(s2)
main()


a = input()
x = []
for i in a:
	if i.isupper():
		x.append(i)
if len(x) > len(a) / 2:
	print(a.upper())
else:
	print(a.lower())


a = input('')
x = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']
y = ['Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M']
t = []
k = []
z = 0
l = 0
c = []
p = 0
v = 0
for i in range(len(a)):
	if a[p] in x:
		t.append(a[p])
	elif a[p] in y:
		k.append(a[p])
	p = p + 1
if len(k) < len(t):
	for j in range(len(a)):
		if a[z] in y:
			l = 0
			for kl in range(len(y)):
				if a[z] == y[l]:
					c.append(x[l])
					break
				else:
					l = l + 1
		else:
			c.append(a[z])
		z = z + 1
elif len(k) > len(t):
	for jt in range(len(a)):
		if a[z] in x:
			l = 0
			for klq in range(len(y)):
				if a[z] == x[l]:
					c.append(y[l])
					break
				else:
					l = l + 1
		else:
			c.append(a[z])
		z = z + 1
elif len(k) == len(t):
	for jp in range(len(a)):
		if a[z] in y:
			l = 0
			for kl in range(len(y)):
				if a[z] == y[l]:
					c.append(x[l])
					break
				else:
					l = l + 1
		else:
			c.append(a[z])
		z = z + 1
for kjh in range(len(c)):
	print(c[v], end='')
	v = v + 1


s = input()
c = 0
p = 0
for i in s:
	if i.islower():
		c += 1
	else:
		p += 1
r = ''
if c >= p:
	for i in s:
		r += i.lower()
else:
	for i in s:
		r += i.upper()
print(r)


s = input()
ci = 0
cu = 0
for i in s:
	if i.islower():
		ci = ci + 1
	elif i.isupper():
		cu = cu + 1
if cu > ci:
	print(s.upper())
elif cu <= ci:
	print(s.lower())


s0 = input()
s1 = s0.upper()
s2 = s0.lower()
n = len(s0)
c1 = 0
c2 = 0
for i in range(n):
	if s0[i] == s1[i]:
		c1 += 1
	elif s0[i] == s2[i]:
		c2 += 1
if c1 > c2:
	print(s1)
else:
	print(s2)


s = input()

def countUpperAndLowerCase(s):
	upper = 0
	lower = 0
	for i in s:
		if i >= 'A' and i <= 'Z':
			upper += 1
		elif i >= 'a' and i <= 'z':
			lower += 1
	if upper > lower:
		print(s.upper())
	else:
		print(s.lower())
countUpperAndLowerCase(s)


l = list(input())
sc = 0
cc = 0
for i in l:
	if ord(i) < 97:
		cc += 1
	else:
		sc += 1
if cc > sc:
	for i in range(len(l)):
		if ord(l[i]) >= 97:
			l[i] = chr(ord(l[i]) - 32)
else:
	for i in range(len(l)):
		if ord(l[i]) < 97:
			l[i] = chr(ord(l[i]) + 32)
print(''.join(l))


def Word(s):
	upper = 0
	lower = 0
	for i in range(0, len(s)):
		if s[i].isupper():
			upper += 1
		elif s[i].islower():
			lower += 1
	if lower >= upper:
		s = s.lower()
	else:
		s = s.upper()
	return s
s = input()
print(Word(s))


str = input()
a = list(str)
lccount = uccount = 0
empty = ''
for i in range(len(a)):
	if a[i].isupper():
		uccount += 1
	if a[i].islower():
		lccount += 1
if uccount > lccount:
	for i in range(len(a)):
		a[i] = a[i].upper()
else:
	for i in range(len(a)):
		a[i] = a[i].lower()
for i in range(len(a)):
	empty += a[i]
print(empty)


n = input()
upper = [e for e in n if e == e.upper()]
lower = [e for e in n if e == e.lower()]
if len(upper) > len(lower):
	print(n.upper())
else:
	print(n.lower())


s = input()
lowers = 0
for ch in s:
	if ch.islower():
		lowers += 1
print(s.lower() if len(s) - lowers <= lowers else s.upper())


from string import ascii_uppercase as uc
s = input()
(uc_l, lc_l) = (0, 0)
for i in s:
	if i in uc:
		uc_l += 1
	else:
		lc_l += 1
print(s.lower() if lc_l >= uc_l else s.upper())


s = input()
a = list(s)
c1 = 0
c2 = 0
for x in a:
	if x.islower():
		c1 = c1 + 1
	else:
		c2 = c2 + 1
if c1 >= c2:
	for y in a:
		print(y.lower(), end='')
else:
	for y in a:
		print(y.upper(), end='')


k = 0
x = input()
for i in range(len(x)):
	if ord(x[i]) >= 65 and ord(x[i]) < 97:
		k = k + 1
if k > int(len(x) / 2):
	r = x.upper()
else:
	r = x.lower()
print(r)


s = input()
lw = up = 0
for i in range(len(s)):
	if ord(s[i]) >= 97:
		lw += 1
	else:
		up += 1
if lw >= up:
	print(s.lower())
else:
	print(s.upper())


s = input()
lowercase_num = 0
uppercase_num = 0
for letter in s:
	if letter.islower():
		lowercase_num += 1
	else:
		uppercase_num += 1
if lowercase_num >= uppercase_num:
	s = s.lower()
else:
	s = s.upper()
print(s)


def words(s):
	ucount = 0
	lcount = 0
	for i in s:
		if i.isupper():
			ucount += 1
		if i.islower():
			lcount += 1
	if ucount > lcount:
		return s.upper()
	else:
		return s.lower()
string = input()
print(words(string))


def main():
	from sys import stdout
	word = input()
	lower = 0
	upper = 0
	for el in word:
		if ord('A') <= ord(el) <= ord('Z'):
			upper += 1
		else:
			lower += 1
	if lower >= upper:
		word = word.lower()
	else:
		word = word.upper()
	stdout.write(str(word))
main()


k = 0
t = 0
n = input()
for i in n:
	if i == i.upper():
		k += 1
	else:
		t += 1
if k > t:
	print(n.upper())
else:
	print(n.lower())


s = input()
ucnt = 0
lcnt = 0
for i in range(0, len(s)):
	if ord(s[i]) >= 97:
		lcnt += 1
	else:
		ucnt += 1
if ucnt > lcnt:
	s = s.upper()
else:
	s = s.lower()
print(s)


ip = input()
upper = 0
for n in ip:
	if 65 <= ord(n) <= 90:
		upper += 1
if upper > len(ip) // 2:
	print(ip.upper())
else:
	print(ip.lower())


a = list(input())
a1 = 0
a2 = 0
for i in range(len(a)):
	if a[i].isupper():
		a1 += 1
	else:
		a2 += 1
if a1 == a2:
	print(''.join(a).lower())
elif a1 > a2:
	for i in range(len(a)):
		if a[i].islower():
			a[i] = a[i].upper()
	print(''.join(a))
else:
	for i in range(len(a)):
		if a[i].isupper():
			a[i] = a[i].lower()
	print(''.join(a))


word = input()
a = list(word)
i = 0
x = 0
y = 0
for i in range(len(word)):
	if a[i].isupper():
		y += 1
	else:
		x += 1
if x >= y:
	for i in range(len(word)):
		a[i] = a[i].lower()
else:
	for i in range(len(word)):
		a[i] = a[i].upper()
for i in range(len(word)):
	print(a[i], end='')


b = input()
bigcount = 0
smallcount = 0
for letter in b:
	if letter == letter.upper():
		bigcount += 1
	else:
		smallcount += 1
if bigcount > smallcount:
	print(b.upper())
else:
	print(b.lower())


inp = input()
count = 0
count1 = 0
if len(inp) <= 100:
	for let in inp:
		if let.isupper():
			count = count + 1
		if let.islower():
			count1 = count1 + 1
	if count > count1:
		print(inp.upper())
	elif count1 > count:
		print(inp.lower())
	elif count == count1:
		print(inp.lower())
else:
	print('Range exceeded!')


s = list(input())
p = ''
l = []
x = []
for i in range(len(s)):
	if s[i] == s[i].upper():
		l.append(s[i])
	elif s[i] == s[i].lower():
		x.append(s[i])
if len(l) > len(x):
	print(p.join(s).upper())
else:
	print(p.join(s).lower())


s = input()[:100]
(c_u, c_l) = (0, 0)
for i in range(len(s)):
	if s[i].isupper():
		c_u += 1
	else:
		c_l += 1
if c_u > c_l:
	print(s.upper())
elif c_u == c_l:
	print(s.lower())
else:
	print(s.lower())


str = input()
a = []
upper = 0
for i in str:
	a.append(ord(i))
for i in a:
	if i >= 65 and i <= 90:
		upper += 1
lower = len(str) - upper
if lower >= upper:
	output = str.lower()
else:
	output = str.upper()
print(output)


word = input('')
size = len(word)
totalupper = 0
for each in word:
	if each.isupper():
		totalupper += 1
mid = size // 2
if totalupper > mid:
	print(word.upper())
else:
	print(word.lower())


s = input('')
cl = 0
for i in range(len(s)):
	if ord(s[i]) < 96:
		cl += 1
if cl > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


a = input().strip()
c = d = 0
for i in a:
	if i.isupper():
		c += 1
	else:
		d += 1
if c > d:
	print(a.upper())
else:
	print(a.lower())


counter1 = 0
counter2 = 0
x = input()
y = len(x)
for k in x:
	if k.islower():
		counter1 += 1
for k in x:
	if k.isupper():
		counter2 += 1
if counter1 == counter2:
	print(x.lower())
elif counter1 > counter2:
	print(x.lower())
else:
	print(x.upper())


s = input()
lo = sum(list(map(lambda x: 1 if x.islower() else 0, list(s))))
hi = len(s) - lo
if lo >= hi:
	print(s.lower())
else:
	print(s.upper())


s = input()
cnt_h = 0
for x in s:
	if x < 'a':
		cnt_h += 1
if cnt_h > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


word = input()
listed_word = []
lowercase = 0
uppercase = 0
for letter in word:
	letter_num = ord(letter)
	listed_word.append(letter_num)
for index in range(len(listed_word)):
	if listed_word[index] >= 65 and listed_word[index] <= 90:
		uppercase += 1
	elif listed_word[index] >= 97 and listed_word[index] <= 122:
		lowercase += 1
if uppercase > lowercase:
	print(word.upper())
else:
	print(word.lower())


s = input()
ul = sum((ord(i) >= 65 and ord(i) <= 90 for i in s))
ll = sum((ord(i) >= 97 and ord(i) <= 122 for i in s))
print(s.upper() if ul > ll else s.lower())


n = input()
a = n.lower()
A = n.upper()
countcap = 0
countsmall = 0
for i in n:
	if i in a:
		countsmall += 1
	elif i in A:
		countcap += 1
if countcap > countsmall:
	print(A)
else:
	print(a)


s = input()
n = len(s)
up = 0
for i in s:
	if 65 <= ord(i) < 91:
		up += 1
low = n - up
if up > low:
	print(s.upper())
else:
	print(s.lower())


a = input()
q = a.lower()
x = len([0 for i in range(len(a)) if a[i] == q[i]])
print(q if x > (len(a) - 1) // 2 else a.upper())


def word(s, l, alpha):
	c = 0
	for i in alpha:
		if i in s:
			c += s.count(i)
	diff = l - c
	if diff >= c:
		return s.lower()
	return s.upper()
s = input()
l = len(s)
alpha = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}
print(word(s, l, alpha))


a = input()
s = 0
l = 0
for i in range(len(a)):
	if 64 < ord(a[i]) < 91:
		l += 1
	else:
		s += 1
print(a.upper() if l > s else a.lower())


word = input()
l = list(word)
(up, down) = (0, 0)
for char in word:
	if char >= 'A' and char <= 'Z':
		up += 1
	else:
		down += 1
if up > down:
	for i in range(len(l)):
		if l[i] > 'Z':
			l[i] = chr(ord(word[i]) - 32)
else:
	for i in range(len(l)):
		if l[i] < 'a':
			l[i] = chr(ord(word[i]) + 32)
for char in l:
	print(char, end='')


s = input()
cap = 0
for c in s:
	if c.upper() == c:
		cap += 1
if cap > len(s) / 2.0:
	print(s.upper())
else:
	print(s.lower())


word = input()
x = 0
mo = ''
for i in word:
	if i.isupper():
		x += 1
	if x > len(word) / 2:
		mo = word.upper()
	else:
		mo = word.lower()
print(mo)


string = input()
i = 0
capital = 0
small = 0
while i < len(string):
	x = ord(string[i])
	if x >= 65 and x <= 90:
		capital += 1
	else:
		small += 1
	i += 1
if small == capital or small > capital:
	string = string.lower()
	print(string)
else:
	string = string.upper()
	print(string)


s = input()
l = 0
for i in s:
	if ord(i) in list(range(97, 123)):
		l += 1
u = len(s) - l
if l == u:
	print(s.lower())
elif l < u:
	print(s.upper())
elif l > u:
	print(s.lower())


s = input()
k = 0
for i in s:
	k += int(i.islower())
if k >= len(s) - k:
	print(s.lower())
else:
	print(s.upper())


def main(str):
	count = 0
	for i in range(len(str)):
		if str[i] == str[i].lower():
			count += 1
	if count >= len(str) - count:
		return str.lower()
	return str.upper()
ans = main(input())
print(ans)


s = str(input())
countu = 0
countl = 0
for each in s:
	if each.isupper() == True:
		countu += 1
	else:
		countl += 1
if countu > countl:
	print(s.upper())
elif countl > countu:
	print(s.lower())
else:
	print(s.lower())


word = input()
n = len(word)
uCount = 0
for letter in word:
	if letter.isupper():
		uCount += 1
print(word.upper() if uCount > n // 2 else word.lower())


a = input()
up = 0
lc = 0
for index in range(len(a)):
	if a[index] == a[index].upper():
		up += 1
	else:
		lc += 1
if up > lc:
	print(a.upper())
else:
	print(a.lower())


string = input()
uppercount = 0
lowercount = 0
for s in string:
	if s.isupper():
		uppercount += 1
	else:
		lowercount += 1
if uppercount <= lowercount:
	print(string.lower())
else:
	print(string.upper())


s = input()
cnta = 0
for c in s:
	if ord(c) >= ord('a') and ord(c) <= ord('z'):
		cnta += 1
if cnta >= len(s) - cnta:
	print(s.lower())
else:
	print(s.upper())


s = input()
cnt = 0
for i in s:
	if i.isupper():
		cnt = cnt + 1
	l = len(s)
	res = l - cnt
	if res >= cnt:
		s = s.lower()
	else:
		s = s.upper()
print(s)


a = input('')
b = 0
c = 0
for i in range(len(a)):
	if 'A' <= a[i] <= 'Z':
		b = b + 1
	elif 'a' <= a[i] <= 'z':
		c = c + 1
if b <= c:
	a = a.lower()
elif b > c:
	a = a.upper()
print(a)


s = input()
u_counter = 0
for i in s:
	if ord(i) <= 90:
		u_counter += 1
if u_counter > len(s) - u_counter:
	print(s.upper())
else:
	print(s.lower())


up_len = 0
low_len = 0
inp = input()
for i in inp:
	if i == i.upper():
		up_len += 1
	else:
		low_len += 1
if up_len > low_len:
	print(inp.upper())
else:
	print(inp.lower())


s = input()
print(s.lower() if len([i for i in s if i.islower()]) >= len([i for i in s if i.isupper()]) else s.upper())


a = list('abcdefghijklmnopqrstuvwxyz')
b = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
w = input()
lo = 0
up = 0
for i in range(len(w)):
	if w[i] in a:
		lo += 1
	else:
		up += 1
if lo >= up:
	print(str.lower(w))
else:
	print(str.upper(w))


s = str(input())
(a, b) = (0, 0)
for i in s:
	if 65 <= ord(i) <= 90:
		a += 1
	elif 97 <= ord(i) <= 122:
		b += 1
if a > b:
	s = s.upper()
else:
	s = s.lower()
print(s)


import re
string = input()
upperCase = re.findall('[A-Z]', string)
upperNum = len(upperCase)
lowerCase = re.findall('[a-z]', string)
lowerNum = len(lowerCase)
if lowerNum >= upperNum:
	print(string.lower())
else:
	print(string.upper())


st = input()
upper = 0
for i in st:
	if i.isupper():
		upper = upper + 1
if upper > len(st) - upper:
	print(st.upper())
else:
	print(st.lower())


wordS = input('')
countUpper = 0
for s in wordS:
	if s.isupper():
		countUpper += 1
if countUpper > len(wordS) / 2:
	print(wordS.upper())
else:
	print(wordS.lower())


w = input()
u_count = 0
wh_len = len(w) // 2
for x in w:
	if x.isupper():
		u_count += 1
if u_count > wh_len:
	print(w.upper())
else:
	print(w.lower())


s = input()
count1 = 0
count2 = 0
for x in s:
	if x.isupper() == True:
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	s = s.upper()
elif count1 < count2:
	s = s.lower()
else:
	s = s.lower()
print(s)


s = input()
x = y = 0
for i in range(len(s)):
	s.split()
	if s[i].islower():
		x += 1
	else:
		y += 1
if x < y:
	print(s.upper())
elif x >= y:
	print(s.lower())


s = input()
large = 0
small = 0
ans = ''
for i in range(len(s)):
	if s[i].isupper():
		large += 1
	if s[i].islower():
		small += 1
if large > small:
	print(s.upper())
else:
	print(s.lower())


s = input()
cnt_l = 0
cnt_u = 0
for i in s:
	if ord(i) >= 97:
		cnt_l += 1
	else:
		cnt_u += 1
if cnt_l > cnt_u:
	s = s.lower()
elif cnt_l < cnt_u:
	s = s.upper()
else:
	s = s.lower()
print(s)


i = input()
k = len(i)
n = 0
count = countt = 0
while n < k:
	l = i[n:n + 1]
	if l.lower() == l:
		count = count + 1
	elif l.upper() == l:
		countt = countt + 1
	n = n + 1
if count >= countt:
	print(i.lower())
elif count < countt:
	print(i.upper())


import sys

def main():
	st = sys.stdin.readline().strip()
	low = 0
	for ch in st:
		if ch >= 'a' and ch <= 'z':
			low += 1
	upp = len(st) - low
	if low >= upp:
		print(st.lower())
	else:
		print(st.upper())
main()


x = input()
upc = 0
loc = 0
for y in range(0, len(x)):
	if ord(x[y]) > 95:
		loc += 1
	else:
		upc += 1
if loc >= upc:
	print(x.lower())
else:
	print(x.upper())


n = input()
k = [char for char in n]
u = 0
l = 0
for i in n:
	if i.isupper():
		u += 1
	else:
		l += 1
if u > l:
	print(n.upper())
else:
	print(n.lower())


a = input()
upperCase = 0
for elem in a:
	if ord(elem) >= 65 and ord(elem) <= 90:
		upperCase += 1
if upperCase > len(a) - upperCase:
	print(a.upper())
elif upperCase <= len(a) - upperCase:
	print(a.lower())


word = input()
U = 0
for char in word:
	U += char.isupper()
if U > len(word) / 2:
	print(word.upper())
else:
	print(word.lower())


word = input()
count = 0
for each in word:
	if each.isupper() == True:
		count += 1
	else:
		pass
if count > int(len(word) / 2):
	print(word.upper())
else:
	print(word.lower())


s = input()
count = 0
for i in s:
	if i.isupper():
		count += 1
if count > int(len(s) / 2):
	print(s.upper())
else:
	print(s.lower())


x = 0
y = 0
a = input()
b = a.split()
for i in range(len(a)):
	if b[0][i].isupper():
		x = x + 1
	else:
		y = y + 1
if x > y:
	print(a.upper())
elif x < y:
	print(a.lower())
else:
	print(a.lower())


w = input()
l = 0
u = 0
for i in w:
	if i.islower():
		l += 1
	elif i.isupper():
		u += 1
if u > l:
	print(str.upper(w))
else:
	print(str.lower(w))


from sys import stdin, stdout
input = stdin.readline
s = list(input()[:-1])
up = lo = 0
for i in s:
	if i.isupper():
		up += 1
	else:
		lo += 1
if up <= lo:
	for i in range(len(s)):
		s[i] = s[i].lower()
else:
	for i in range(len(s)):
		s[i] = s[i].upper()
stdout.write(''.join(s))


s = input()
a = 0
b = 0
for i in range(len(s)):
	if s[i].islower():
		a += 1
	else:
		b += 1
if a >= b:
	t = s.lower()
else:
	t = s.upper()
print(t)


word = input()
upper = 0
for character in word:
	if character.isupper():
		upper += 1
if upper * 2 > len(word):
	print(word.upper())
else:
	print(word.lower())


s = str(input())
upcount = 0
lowcount = 0
for i in range(len(s)):
	if s[i].islower():
		lowcount += 1
	else:
		upcount += 1
if lowcount < upcount:
	print(s.upper())
else:
	print(s.lower())


t = input()
(upp, low) = (0, 0)
for i in t:
	if ord(i) < 91:
		upp += 1
	else:
		low += 1
print([t.lower(), t.upper()][upp > low])


w = input()
s = list(w)
n = 1 / 2 * len(s)
c = 0
for i in s:
	if i.islower() == True:
		c = c + 1
if c >= n:
	print(w.lower())
else:
	print(w.upper())


K = input()
n = m = 0
a = b = ''
for i in K:
	if 65 <= ord(i) <= 90:
		n += 1
	else:
		m += 1
if m >= n:
	print(K.lower())
else:
	print(K.upper())


palavra = input()
menor = 0
maior = 0
for x in palavra:
	if x.islower():
		menor += 1
	else:
		maior += 1
if maior > menor:
	print(palavra.upper())
else:
	print(palavra.lower())


import string

def solution(s):
	counterU = 0
	counterL = 0
	output = ''
	for char in s:
		if char in string.ascii_uppercase:
			counterU += 1
		else:
			counterL += 1
	if counterL >= counterU:
		output = s.lower()
	else:
		output = s.upper()
	return output
inp = input()
print(solution(inp))


word = input()
lowerCount = upperCount = 0
for each in word:
	if each.islower() == True:
		lowerCount += 1
	else:
		upperCount += 1
if lowerCount < upperCount:
	print(word.upper())
else:
	print(word.lower())


s = input()
Len = len(s)
num = 0
for i in range(Len):
	if s[i] >= 'a':
		num += 1
if (Len + 1) // 2 <= num:
	print(s.lower())
else:
	print(s.upper())


def main():
	s = input()
	lower = 0
	upper = 0
	for each in s:
		if 65 <= ord(each) and ord(each) <= 90:
			upper += 1
		elif 97 <= ord(each) and ord(each) <= 122:
			lower += 1
	if lower >= upper:
		ans = s.lower()
	else:
		ans = s.upper()
	print(ans)
main()


que = input()
(up, low) = (0, 0)
for chars in que:
	if chars.isupper():
		up += 1
	else:
		low += 1
if up > low:
	print(que.upper())
else:
	print(que.lower())


s = input()
lc = 0
uc = 0
ans = ''
for x in s:
	if x.isupper():
		uc += 1
	elif x.islower():
		lc += 1
if lc >= uc:
	for x in s:
		ans += x.lower()
else:
	for x in s:
		ans += x.upper()
print(ans)


def solve(n):
	l_count = 0
	u_count = 0
	for i in n:
		if i.islower():
			l_count = l_count + 1
		else:
			u_count = u_count + 1
	if l_count > u_count:
		n = n.lower()
	elif u_count > l_count:
		n = n.upper()
	else:
		n = n.lower()
	return n
user = input()
print(solve(user))


s = input('')
u = sum([s.count(i) for i in set([i for i in s]) if i.isupper()])
l = sum([s.count(i) for i in set([i for i in s]) if i.islower()])
print(s.upper() if u > l else s.lower())


n = input()
m = list(map(str, n))
c = 0
for i in range(len(m)):
	if m[i].islower():
		c += 1
if 2 * c >= len(n):
	print(n.lower())
else:
	print(n.upper())


x = input()
if len(x) >= 1 and len(x) <= 100:
	cap = 0
	sm = 0
	for y in x:
		if y >= 'a' and y <= 'z':
			sm += 1
		elif y >= 'A' and y <= 'Z':
			cap += 1
	if cap > sm:
		print(x.upper())
	else:
		print(x.lower())


sentence = input()
upper = 0
lower = 0
listed = list(sentence)
for i in range(len(listed)):
	if listed[i].isupper():
		upper = upper + 1
	else:
		lower = lower + 1
if upper > lower:
	print(sentence.upper())
else:
	print(sentence.lower())


word = input()
uppercount = 0
lowercount = 0
for letter in word:
	if letter.islower() == True:
		lowercount += 1
	else:
		uppercount += 1
if uppercount <= lowercount:
	print(word.lower())
else:
	print(word.upper())


def LowerChange(ListWord):
	NewWord = []
	for i in ListWord:
		ChangeChar = i.lower()
		NewWord.append(ChangeChar)
	return NewWord

def UpperChange(ListWord):
	NewWord = []
	for i in ListWord:
		ChangeChar = i.upper()
		NewWord.append(ChangeChar)
	return NewWord

def PrintStr(InList):
	for i in InList:
		print(i, end='')
Word = input()
ListWord = list(Word)
lower = 0
for i in ListWord:
	if i.islower():
		lower = lower + 1
	else:
		continue
if lower >= len(Word) - lower:
	PrintStr(LowerChange(ListWord))
else:
	PrintStr(UpperChange(ListWord))


import re
word = input()
p1 = re.compile('[a-z]')
p2 = re.compile('[A-Z]')
if len(p1.findall(word)) >= len(p2.findall(word)):
	print(word.lower())
else:
	print(word.upper())


w = input()
count = 0
l = len(w)
for i in w:
	if i >= 'A' and i <= 'Z':
		count += 1
if l % 2 == 0 and count > l // 2 or (l % 2 == 1 and count >= l // 2 + 1):
	print(w.upper())
else:
	print(w.lower())


n = input()
l = 0
u = 0
for i in n:
	if 65 <= ord(i) <= 90:
		u += 1
	else:
		l += 1
if l >= u:
	print(n.lower())
else:
	print(n.upper())


def isupper(c):
	if ord(c) >= 65 and ord(c) <= 90:
		return 1
	else:
		return 0
(u, l) = (0, 0)
s = input()
for i in range(len(s)):
	if isupper(s[i]):
		u += 1
	else:
		l += 1
if l >= u:
	print(s.lower())
else:
	print(s.upper())


m = list(input())
s = list(map(lambda x: x in 'QWERTYUIOPLKJHGFDSAZXCVBNM', m))
if s.count(True) > s.count(False):
	print(''.join(m).upper())
else:
	print(''.join(m).lower())


wrd = input()
upcs = 0
lwcs = 0
for each in wrd:
	if each.islower():
		lwcs += 1
	else:
		upcs += 1
if upcs > lwcs:
	print(wrd.upper())
else:
	print(wrd.lower())


s = input()
i = 0
u = 0
l = 0
word = []
while i < len(s):
	word.append(s[i])
	i = i + 1
j = 0
while j < len(word):
	if word[j].upper() == word[j]:
		u = u + 1
	else:
		l = l + 1
	j = j + 1
if l >= u:
	print(s.lower())
else:
	print(s.upper())


n = input()
x = 0
y = 0
for p in n:
	if p.isupper():
		x += 1
	if p.islower():
		y += 1
	if x > y:
		n = n.upper()
	else:
		n = n.lower()
print(n)


word = input()
(a, b) = (0, 0)
for k in word:
	if 'A' <= k <= 'Z':
		a = a + 1
	if 'a' <= k <= 'z':
		b = b + 1
if a > b:
	print(word.upper())
if a <= b:
	print(word.lower())


s = input()
K = 0
for x in range(len(s)):
	if s[x].isupper():
		K = K + 1
z = len(s) - K
if K > z:
	print(s.upper())
else:
	print(s.lower())


word = input()
count1 = 0
count2 = 0
for letter in word:
	if letter.isupper():
		count1 += 1
	else:
		count2 += 1
if count2 >= count1:
	word = word.lower()
else:
	word = word.upper()
print(word)


s = input()
cntl = 0
cntsm = 0
for i in range(len(s)):
	if ord(s[i]) >= 65 and ord(s[i]) < 97:
		cntl += 1
	if ord(s[i]) >= 97:
		cntsm += 1
if cntsm >= cntl:
	for i in range(len(s)):
		if ord(s[i]) >= 65 and ord(s[i]) < 97:
			print(chr(ord(s[i]) + 32), end='')
		else:
			print(s[i], end='')
else:
	for i in range(len(s)):
		if ord(s[i]) >= 97:
			print(chr(ord(s[i]) - 32), end='')
		else:
			print(s[i], end='')


S = str(input())
if len(S) >= 1 and len(S) <= 100:
	upper = 0
	lower = 0
	for i in S:
		if i.isupper():
			upper += 1
		if i.islower():
			lower += 1
	if lower >= upper:
		print(S.lower())
	else:
		print(S.upper())


word = input()
big = 0
small = 0
for c in word:
	if c <= 'Z':
		big += 1
	else:
		small += 1
word = word.lower()
if small < big:
	word = word.upper()
print(word)


text = input()
up = 0
lw = 0
for char in text:
	if char.isupper():
		up += 1
	else:
		lw += 1
if up > lw:
	print(text.upper())
else:
	print(text.lower())


def main():
	s = input()
	l = 0
	u = 0
	for c in s:
		if c.isupper():
			u += 1
		else:
			l += 1
	if u > l:
		return s.upper()
	else:
		return s.lower()
print(main())


word = input()
uc = 0
for let in word:
	num = ord(let)
	if 65 <= num and num <= 90:
		uc += 1
lc = len(word) - uc
if uc > lc:
	print(word.upper())
else:
	print(word.lower())


word = input()
upword = word.upper()
lowword = word.lower()
x = 0
for i in range(len(word)):
	if upword[i] == word[i]:
		x += 1
if 2 * x > len(word):
	print(upword)
else:
	print(lowword)


str = input()
countupper = 0
countlower = 0
for i in str:
	if i >= 'A' and i <= 'Z':
		countupper += 1
	elif i >= 'a' and i <= 'z':
		countlower += 1
if countupper < countlower:
	print(str.lower())
elif countlower < countupper:
	print(str.upper())
else:
	print(str.lower())


a = input()
b = c = 0
for i in a:
	if ord(i) <= 90:
		b += 1
	else:
		c += 1
if c >= b:
	d = a.lower()
	print(d)
else:
	d = a.upper()
	print(d)


N = input()
besar = 0
kecil = 0
for i in range(len(N)):
	if ord(N[i]) >= 65 and ord(N[i]) <= 90:
		besar += 1
	else:
		kecil += 1
if besar > kecil:
	print(N.upper())
else:
	print(N.lower())


word = input()
word0 = list(word)
word1 = list(word.lower())
word1count = 0
word2count = 0
for w in word0:
	if w in word1:
		word1count += 1
	else:
		word2count += 1
if word1count >= word2count:
	print(word.lower())
else:
	print(word.upper())


string = str(input())
cu = 0
cl = 0
for items in string:
	if items.isupper():
		cu = cu + 1
	elif items.islower():
		cl = cl + 1
if cl >= cu:
	string = string.lower()
elif cu > cl:
	string = string.upper()
print(string)


inp = input(' ')
lower = 0
upper = 0
for i in inp:
	if i.islower():
		lower += 1
	elif i.isupper():
		upper += 1
if lower >= upper:
	inp1 = inp.lower()
else:
	inp1 = inp.upper()
print(inp1)


st = input()
up = 0
lo = 0
for i in st:
	if i.islower():
		lo += 1
	elif i.isupper():
		up += 1
if up > lo:
	print(st.upper())
else:
	print(st.lower())


string = input()
cntU = 0
cntL = 0
for x in string:
	if x.islower():
		cntL += 1
	else:
		cntU += 1
if cntU > cntL:
	print(string.upper())
else:
	print(string.lower())


M = 'QWERTYUIOPASDFGHJKLZXCVBNM'
m = M.lower()
F = input()
C = 0
c = 0
for i in range(len(F)):
	for k in range(len(M)):
		if F[i] == M[k]:
			C += 1
	for l in range(len(m)):
		if F[i] == m[l]:
			c += 1
if C > c:
	F = F.upper()
else:
	F = F.lower()
print(F)


a = str(input())
lower = 0
upper = 0
i = 0

def jackass(a):
	global lower, upper
	if lower > upper or lower == upper:
		print(a.lower())
	else:
		print(a.upper())

def boiass(a):
	global i, lower, upper
	if i > len(a) - 1:
		jackass(a)
	else:
		if a[i].islower():
			lower += 1
		elif a[i].isupper():
			upper += 1
		i += 1
		boiass(a)
boiass(a)


my_str = input()
up = 0
low = 0
for i in range(len(my_str)):
	if my_str[i].isupper():
		up += 1
	else:
		low += 1
if up > low:
	temp = my_str.upper()
	print(temp)
else:
	temp = my_str.lower()
	print(temp)


word = input()
lower_count = 0
upper_count = 0
for char in word:
	if char.islower():
		lower_count += 1
	else:
		upper_count += 1
if lower_count > upper_count or lower_count == upper_count:
	print(word.lower())
else:
	print(word.upper())


word = input()
(count_l, count_u) = (0, 0)
for i in word:
	if i.islower():
		count_l += 1
	else:
		count_u += 1
if count_l >= count_u:
	print(word.lower())
else:
	print(word.upper())


y = input()
x = list(y)
c = 0
for i in range(0, len(x)):
	if ord(x[i]) >= ord('A') and ord(x[i]) <= ord('Z'):
		c += 1
if c > len(x) / 2:
	y = y.upper()
else:
	y = y.lower()
print(y)


s = input()
print([s.lower(), s.upper()][sum((i.islower() for i in s)) < sum((i.isupper() for i in s))])


s = input()
l = 0
u = 0
for c in s:
	x = c.isupper()
	if x:
		u += 1
	else:
		l += 1
if l >= u:
	y = s.lower()
else:
	y = s.upper()
print(y)


str = input()

def c(str):
	u = 0
	l = 0
	str = list(str)
	for i in str:
		if ord(i) > 64 and ord(i) < 91:
			u += 1
		else:
			l += 1
	return (u, l)

def u(str):
	str = list(str)
	c = 0
	for i in str:
		if ord(i) > 96 and ord(i) < 123:
			x = ord(i) - 32
			str[c] = chr(x)
		c += 1
	print(''.join(str))

def l(str):
	str = list(str)
	c = 0
	for i in str:
		if ord(i) > 64 and ord(i) < 91:
			x = ord(i) + 32
			str[c] = chr(x)
		c += 1
	print(''.join(str))
(x, y) = c(str)
if x > y:
	u(str)
else:
	l(str)


m = input()
k = list(m)
up = 0
low = 0
for i in k:
	if i.isupper():
		up += 1
	else:
		low += 1
if up > low:
	print(m.upper())
elif low >= up:
	print(m.lower())


s1 = str(input())
s = list(s1)
u = 0
l = 0
a = ''
for i in range(0, len(s)):
	if s[i] == s[i].lower():
		l = l + 1
	elif s[i] == s[i].upper():
		u = u + 1
	a = a + s[i]
if l >= u:
	print(a.lower())
elif u > l:
	print(a.upper())


import re

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

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
string = input()
upper = 0
lower = 0
for i in range(len(string)):
	if ord(string[i]) >= 97 and ord(string[i]) <= 122:
		lower += 1
	elif ord(string[i]) >= 65 and ord(string[i]) <= 90:
		upper += 1
if upper > lower:
	print(string.upper())
else:
	print(string.lower())


a = input()
count = sum((l.isupper() for l in a))
a = a.lower() if len(a) / 2 >= count else a.upper()
print(a)


def main():
	s = input()
	l = u = 0
	for i in s:
		if i.islower():
			l += 1
		else:
			u += 1
	if l >= u:
		print(s.lower())
	else:
		print(s.upper())
main()


s = input()
up = low = 0
for i in range(len(s)):
	if s[i].isupper():
		up += 1
	else:
		low += 1
if up > low:
	t = s.upper()
elif up <= low:
	t = s.lower()
print(t)


word = input()
lowCaseCounter = 0
for c in word:
	lowCaseCounter += 1 if str.islower(c) else 0
word = word.lower() if lowCaseCounter >= len(word) / 2 else word.upper()
print(word)


s = input()
lowerCount = 0
upperCount = 0
for i in range(len(s)):
	if 'a' <= s[i] <= 'z':
		lowerCount += 1
	else:
		upperCount += 1
if lowerCount >= upperCount:
	print(s.lower())
else:
	print(s.upper())


a = input()
upper = lower = 0
for char in a:
	if char.isupper():
		upper += 1
	elif char.islower():
		lower += 1
if upper <= lower:
	m = a.lower()
else:
	m = a.upper()
print(m)


try:
	n = input()
	upper = 0
	lower = 0
	for i in n:
		if i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
			upper += 1
		else:
			lower += 1
	if upper <= lower:
		s = n.lower()
	else:
		s = n.upper()
	print(s)
except:
	pass


s = input()
n = len(s)
up = lo = 0
p = s.upper()
for i in range(n):
	if p[i] == s[i]:
		up += 1
	else:
		lo += 1
if up > lo:
	print(p)
else:
	print(s.lower())


a = input()
count = 0
for i in a:
	count += 1 if i <= 'Z' else -1
if count <= 0:
	print(a.lower())
else:
	print(a.upper())


x = input()
c = 0
t = 0
for g in x:
	if g.islower():
		c += 1
	elif g.isupper():
		t += 1
if c >= t:
	print(x.lower())
else:
	print(x.upper())


s = input()
count_lower_case = 0
count_upper_case = 0
for i in s:
	if i == i.lower():
		count_lower_case += 1
	else:
		count_upper_case += 1
if count_lower_case >= count_upper_case:
	print(s.lower())
else:
	print(s.upper())


s = input()
(Lcount, Rcount) = (0, 0)
for c in s:
	if c.islower():
		Lcount += 1
	elif c.isupper():
		Rcount += 1
if Lcount >= Rcount:
	print(s.lower())
else:
	print(s.upper())


s = input()
low = 0
upp = 0
for c in s:
	if c.islower():
		low += 1
	else:
		upp += 1
if low >= upp:
	print(s.lower())
else:
	print(s.upper())


g = input()
u = 0
v = 0
for i in g:
	if i.isupper():
		u += 1
	else:
		v += 1
if u > v:
	print(g.upper())
else:
	print(g.lower())


a = input()
c = 0
for item in a:
	if item.islower():
		c += 1
if len(a) - c <= c:
	print(a.lower())
else:
	print(a.upper())


words = input()
big_num = 0
small_num = 0
for i in words:
	if i.isupper():
		big_num += 1
	else:
		small_num += 1
if big_num > small_num:
	print(words.upper())
else:
	print(words.lower())


data = input()
print(data.upper() if sum([i.isupper() for i in data]) > len(data) / 2 else data.lower())


xyz = []

def input1():
	global xyz
	if len(xyz) == 0:
		xyz = [i for i in input().split()]
		xyz = xyz[::-1]
	v = xyz[-1]
	del xyz[-1]
	return v
x = input1()
z = 0
c = 0
for i in x:
	if i.isupper():
		z = z + 1
	else:
		c = c + 1
if z > c:
	print(x.upper())
else:
	print(x.lower())


s = input()

def check(s):
	lC = 0
	uC = 0
	for i in s:
		if i.islower():
			lC += 1
		else:
			uC += 1
	if lC > uC:
		return True
	elif lC < uC:
		return False
	else:
		return 3
if check(s) == True:
	print(s.lower())
elif check(s) == False:
	print(s.upper())
else:
	print(s.lower())


word = list(input())
big = 0
little = 0
for i in range(len(word)):
	if word[i] == word[i].upper():
		big += 1
	else:
		little += 1
word = ''.join((str(x) for x in word))
if big > little:
	print(word.upper())
else:
	print(word.lower())


s = input()
countC = 0
countc = 0
for i in s:
	if ord(i) in range(64, 91):
		countC += 1
	elif ord(i) in range(96, 123):
		countc += 1
if countc >= countC:
	s = s.lower()
else:
	s = s.upper()
print(s)


S = input()
l = len(S)
c = 0
C = 0
for i in S:
	if ord(i) > 64 and ord(i) < 91:
		C += 1
	else:
		c += 1
if c >= C:
	S = S.lower()
else:
	S = S.upper()
print(S)


masukan = input()
n = 0
for i in range(0, len(masukan)):
	if masukan[i] == masukan[i].upper():
		n = n + 1
if n > int(len(masukan) / 2):
	output = masukan.upper()
else:
	output = masukan.lower()
print(output)


s = input()
l = list(s)
count1 = 0
count2 = 0
for i in l:
	if ord(i) >= 65 and ord(i) <= 90:
		count1 += 1
	elif ord(i) >= 97 and ord(i) <= 122:
		count2 += 1
if count1 > count2:
	print(s.upper())
elif count1 <= count2:
	print(s.lower())


str = input()
(upper, lower) = (0, 0)
for c in str:
	if c.islower():
		lower += 1
	else:
		upper += 1
if upper > lower:
	print(str.upper())
else:
	print(str.lower())


s = input()
c = 0
for i in s:
	if ord(i) >= 97 and ord(i) <= 122:
		c += 1
if len(s) - c == c:
	print(s.lower())
elif len(s) - c < c:
	print(s.lower())
else:
	print(s.upper())


m = input()
num1 = 0
num2 = 0
l = len(m)
for i in range(l):
	if m[i].isupper():
		num1 = num1 + 1
	else:
		num2 = num2 + 1
if num1 > num2:
	print(m.upper())
else:
	print(m.lower())


n = input()
cu = 0
cl = 0
for i in n:
	if i.isupper():
		cu += 1
	else:
		cl += 1
if cu > cl:
	print(n.upper())
else:
	print(n.lower())


from random import randint
from math import *
s = input()
ctl = 0
for c in s:
	if c.isupper():
		ctl = ctl + 1
if ctl > len(s) / 2:
	s = s.upper()
	print(s)
else:
	s = s.lower()
	print(s)


import string
Up = list(string.ascii_uppercase)
Low = list(string.ascii_lowercase)
(u, l) = (0, 0)
n = input()
for i in n:
	if i in Up:
		u += 1
	elif i in Low:
		l += 1
if l >= u:
	n = n.lower()
else:
	n = n.upper()
print(n)


a = str(input())
a_lower = sum(map(str.islower, a))
a_upper = sum(map(str.isupper, a))
if a_upper > a_lower:
	print(a.upper())
else:
	print(a.lower())


word = input()
uppers = 0
lowers = 0
for letter in word:
	if letter == letter.lower():
		lowers += 1
	else:
		uppers += 1
if uppers > lowers:
	print(word.upper())
else:
	print(word.lower())


ali = input()
(aa, b) = (0, 0)
for a in ali:
	if a.islower():
		aa += 1
	else:
		b += 1
if aa > b:
	print(ali.lower())
elif aa < b:
	print(ali.upper())
else:
	print(ali.lower())


(word, lowers) = (input(), 0)
for char in word:
	if char.islower():
		lowers += 1
print(word.lower()) if lowers >= len(word) // 2 + len(word) % 2 else print(word.upper())


(upc, loc, s) = (0, 0, input())
for elem in s:
	if elem.isupper():
		upc += 1
	else:
		loc += 1
if upc <= loc:
	print(s.lower())
elif upc > loc:
	print(s.upper())


word = input()
alphabet = 'qwertyuiopasdfghjklzxcvbnm'
alphabet2 = alphabet.upper()
big_letters = 0
small_letters = 0
for letter in word:
	if letter in alphabet2:
		big_letters += 1
	else:
		small_letters += 1
if big_letters > small_letters:
	print(word.upper())
else:
	print(word.lower())


string = input()
countup = 0
countlow = 0
for i in range(0, len(string)):
	if string[i].isupper():
		countup += 1
	else:
		countlow += 1
if countup > countlow:
	print(string.upper())
elif countlow > countup or countlow == countup:
	print(string.lower())


import math
import sys

def dict_sort(ans):
	ans = sorted(ans.items(), reverse=True, key=lambda kv: kv[1])

def is_prime(n):
	if n == 1:
		return 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def inp():
	ls = list(map(int, input().split()))
	return ls
s = input()
u = 0
l = 0
ans = ''
for i in s:
	if i.isupper():
		u += 1
	elif i.islower():
		l += 1
if u > l:
	for i in s:
		if i.islower():
			ans += i.upper()
		else:
			ans += i
else:
	for i in s:
		if i.isupper():
			ans += i.lower()
		else:
			ans += i
print(ans)


up = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
low = 'abcdefghijklmnopqrstuvwxyz'
word = input()
num = 0
result = ''
for i in range(len(word)):
	if word[i] in up:
		num = num + 1
	else:
		num = num - 1
for i in range(len(word)):
	if num > 0:
		if word[i] in up:
			result = result + word[i]
		else:
			result = result + up[low.find(word[i])]
	elif word[i] in low:
		result = result + word[i]
	else:
		result = result + low[up.find(word[i])]
print(result)


N = input()
upper = sum((letter.isupper() for letter in N))
lower = sum((letter.islower() for letter in N))
if upper == lower:
	print(N.lower())
elif lower > upper:
	print(N.lower())
else:
	print(N.upper())


e = input()
a = 0
b = 0
for i in e:
	if i.isupper():
		a = a + 1
	else:
		b = b + 1
if a == b:
	print(e.lower())
elif a > b:
	print(e.upper())
else:
	print(e.lower())


word = input()
upper = 0
lower = 0
for letter in word:
	if letter < 'a':
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(word.upper())
else:
	print(word.lower())


data = input()
upper = list()
lower = list()
count_l = 0
count_u = 0
for j in data:
	z = j.upper()
	upper.append(z)
for k in data:
	x = k.lower()
	lower.append(x)
for i in data:
	if i in lower:
		count_l = count_l + 1
	elif i in upper:
		count_u = count_u + 1
if count_l >= count_u:
	print(data.lower())
else:
	print(data.upper())


S = input()
(L, U) = (0, 0)
for j in S:
	if j.islower():
		L += 1
	else:
		U += 1
if U > L:
	print(S.upper())
else:
	print(S.lower())


s = str(input())
(up, low) = (0, 0)
for i in range(len(s)):
	up += s[i].isupper()
	low += s[i].islower()
print((up > low) * s.upper() + (low > up) * s.lower() + (low == up) * s.lower())


word = input()
up = 0
low = 0
for i in word:
	if ord(i) >= 65 and ord(i) <= 90:
		up += 1
	elif ord(i) >= 97 and ord(i) <= 122:
		low += 1
if low > up:
	print(word.lower())
elif low < up:
	print(word.upper())
else:
	print(word.lower())


string = input()
ucnt = 0
lcnt = 0
upper = ''
lower = ''
for ch in string:
	upper += ch.upper()
	lower += ch.lower()
	if ch.lower() != ch:
		ucnt += 1
	else:
		lcnt += 1
if ucnt > lcnt:
	print(upper)
else:
	print(lower)


a = list(input())
(t, u) = (0, 0)
for i in range(len(a)):
	if 65 <= ord(a[i]) <= 90:
		t += 1
	else:
		u += 1
if t > u:
	for k in range(len(a)):
		if 97 <= ord(a[k]) <= 122:
			a[k] = chr(ord(a[k]) - 32)
	print(''.join(a))
elif u >= t:
	for j in range(len(a)):
		if 65 <= ord(a[j]) <= 90:
			a[j] = chr(ord(a[j]) + 32)
			print()
	print(''.join(a))


d = input()
low = 0
high = 0
for i in d:
	if i.isupper():
		high += 1
	else:
		low += 1
if high > low:
	print(d.upper())
elif high < low:
	print(d.lower())
else:
	print(d.lower())


s = input()
counter = 0
counter1 = 0
for i in s:
	if i.isupper() == True:
		counter += 1
	else:
		counter1 += 1
if counter > counter1:
	print(s.upper())
else:
	print(s.lower())


s = input()
up = len([c for c in s if c.isupper()])
low = len(s) - up
if up > low:
	s = s.upper()
else:
	s = s.lower()
print(s)


word = str(input())
num = 0
for i in range(0, len(word)):
	if word[i] != word[i].upper():
		num += 1
k = []
for j in word:
	k.append(j)
for m in range(0, len(word)):
	if num >= len(word) / 2:
		k[m] = k[m].lower()
	else:
		k[m] = k[m].upper()
x = ''.join([str(a) for a in k])
print(x)


f1 = input()
up = 0
l = 0
for i in f1:
	if i.isupper() == True:
		up += 1
	else:
		l += 1
if up > l:
	print(f1.upper())
else:
	print(f1.lower())


s = str(input())
up = 0
low = 0
for c in s:
	if c.isupper():
		up += 1
	else:
		low += 1
print(s.upper() if up > low else s.lower())


s = input()
print([s.upper(), s.lower()][sum((i.islower() for i in s)) * 2 >= len(s)])


s = input()
n = len(s)
coun = 0
for i in range(n):
	if ord('A') <= ord(s[i]) <= ord('Z'):
		coun += 1
ans = ''
if n - coun >= coun:
	for i in range(n):
		if ord('A') <= ord(s[i]) <= ord('Z'):
			ans = ans + chr(ord(s[i]) + ord('a') - ord('A'))
		else:
			ans = ans + s[i]
else:
	for i in range(n):
		if ord('a') <= ord(s[i]) <= ord('z'):
			ans = ans + chr(ord(s[i]) + ord('A') - ord('a'))
		else:
			ans = ans + s[i]
print(ans)


def checkUpperOrLower(y):
	y1 = list(y)
	upperCounter = 0
	lowerCounter = 0
	for x in y1:
		if x.isupper() == True:
			upperCounter += 1
		else:
			lowerCounter += 1
	if upperCounter > lowerCounter:
		print(y.upper())
	else:
		print(y.lower())
y = input()
checkUpperOrLower(y)


s = input()
listStr = list(s)
upper = 0
lower = 0
for i in listStr:
	if i >= 'A' and i <= 'Z':
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(s.upper())
else:
	print(s.lower())


B = 'QWERTYUIOPASDFGHJKLZXCVBNM'
M = 'qwertyuiopasdfghjklzxcvbnm'
n = input()
b = sum([1 for i in n if i in B])
m = sum([1 for i in n if i in M])
if b > m:
	print(n.upper())
else:
	print(n.lower())


word = str(input())
upper = 0
lower = 0
for x in word:
	if ord('a') <= ord(x) <= ord('z'):
		lower += 1
	elif ord('A') <= ord(x) <= ord('Z'):
		upper += 1
if lower > upper:
	word = word.lower()
elif lower < upper:
	word = word.upper()
elif lower == upper:
	word = word.lower()
print(word)


s = input()
upper_count = 0
lower_count = 0
for words in s:
	if words.islower():
		lower_count += 1
	elif words.isupper():
		upper_count += 1
if upper_count > lower_count:
	print(s.upper())
elif lower_count >= upper_count:
	print(s.lower())


def n_lower_upper(str, lower=True):
	count = 0
	for x in str:
		if lower and x.islower():
			count += 1
		elif not lower and x.isupper():
			count += 1
	return count
str = input()
nlower = n_lower_upper(str)
nupper = n_lower_upper(str, False)
if nlower >= nupper:
	print(str.lower())
else:
	print(str.upper())


s = input()
upperno = 0
for i in range(len(s)):
	if ord(s[i]) > 64 and ord(s[i]) < 91:
		upperno = upperno + 1
if upperno / len(s) > 0.5:
	print(s.upper())
else:
	print(s.lower())


s = input()
l = len(s)
(up, low) = (0, 0)
for i in range(l):
	if ord(s[i]) >= 65 and ord(s[i]) <= 90:
		up += 1
	else:
		low += 1
s1 = ''
if up > low:
	for i in range(l):
		if ord(s[i]) >= 65 and ord(s[i]) <= 90:
			s1 = s1 + s[i]
		else:
			s1 = s1 + chr(ord(s[i]) - 32)
else:
	for i in range(l):
		if ord(s[i]) >= 97 and ord(s[i]) <= 122:
			s1 = s1 + s[i]
		else:
			s1 = s1 + chr(ord(s[i]) + 32)
print(s1)


pala = input()
menor = maior = 0
for i in range(len(pala)):
	if pala[i].isupper():
		maior += 1
	else:
		menor += 1
if maior == menor:
	print(pala.lower())
elif menor > maior:
	print(pala.lower())
else:
	print(pala.upper())


word = input()
upperList = []
lowerList = []
for i in range(len(word)):
	if word[i].isupper():
		upperList.append(i)
	else:
		lowerList.append(i)
if len(upperList) > len(lowerList):
	print(word.upper())
else:
	print(word.lower())


import string
small_letters = string.ascii_lowercase
capital_letters = string.ascii_uppercase
lowercase_counter = 0
uppercase_counter = 0
vasya_word = input()
word_list = list(str(vasya_word))
for letter in vasya_word:
	if letter in capital_letters:
		uppercase_counter += 1
	else:
		lowercase_counter += 1
if uppercase_counter > lowercase_counter:
	print(vasya_word.upper())
else:
	print(vasya_word.lower())


a = input()
let = 'abcdefghijklmnopqrstuvwxyz'
xiao = 0
da = 0
for n in a:
	if n in let:
		xiao += 1
	else:
		da += 1
if da > xiao:
	print(a.upper())
else:
	print(a.lower())


word = input()
count_upper = sum(map(str.isupper, word))
count_lower = sum(map(str.islower, word))
if count_upper > count_lower:
	print(word.upper())
else:
	print(word.lower())


w = input()
lw = w.lower()
uw = w.upper()
ln = 0
un = 0
for i in range(len(w)):
	if w[i] != uw[i]:
		un += 1
	if w[i] != lw[i]:
		ln += 1
if ln <= un:
	print(lw)
else:
	print(uw)


string = input()
lower = 0
upper = 0
for i in range(len(string)):
	if string[i].islower():
		lower += 1
	elif string[i].isupper():
		upper += 1
if lower >= upper:
	print(string.lower())
else:
	print(string.upper())


w = input()
c = 0
for i in w:
	if i.isupper():
		c += 1
if c > len(w) - c:
	w = w.upper()
else:
	w = w.lower()
print(w)


def new_word(string):
	lowercase = 0
	capital_letter = 0
	for letter in string:
		if 'A' <= letter <= 'Z':
			capital_letter += 1
		else:
			lowercase += 1
	if lowercase >= capital_letter:
		string = string.lower()
	else:
		string = string.upper()
	return string
word = input()
print(new_word(word))


word = input()
upper_count = 0
lower_count = 0
for i in range(0, len(word), 1):
	if word[i].isupper() == True:
		upper_count += 1
	else:
		lower_count += 1
if upper_count > lower_count:
	word = word.upper()
elif lower_count >= upper_count:
	word = word.lower()
print(word)


n = str(input())
u = 0
l = 0
for x in n:
	if x.isupper():
		u += 1
	if x.islower():
		l += 1
if l > u:
	f = n.lower()
	print(f)
elif l < u:
	g = n.upper()
	print(g)
elif l == u:
	r = n.lower()
	print(r)


s = input()
upper_n = 0
lower_n = 0
l = len(s)
for i in s:
	if i.isupper():
		upper_n += 1
	else:
		lower_n += 1
if upper_n > lower_n:
	print(s.upper())
elif upper_n < lower_n:
	print(s.lower())
else:
	print(s.lower())


def upper(a):
	return a.upper()

def lower(a):
	return a.lower()
s = list(input())
l = 0
u = 0
for i in range(len(s)):
	if ord(s[i]) >= 65 and ord(s[i]) <= 90:
		u += 1
	elif ord(s[i]) >= 97 and ord(s[i]) <= 122:
		l += 1
if u > l:
	s = list(map(upper, s))
else:
	s = list(map(lower, s))
for i in s:
	print(i, end='')


word = input()
upperWord = word.upper()
lowerWord = word.lower()
upperChs = 0
lowerChs = 0
index = 0
for ch in word:
	if ch == upperWord[index]:
		upperChs += 1
	elif ch == lowerWord[index]:
		lowerChs += 1
	index += 1
if upperChs > lowerChs:
	print(upperWord)
else:
	print(lowerWord)


s = input()
countu = 0
countl = 0
for i in s:
	if i.isupper():
		countu += 1
	else:
		countl += 1
if countu > countl:
	print(s.upper())
elif countu <= countl:
	print(s.lower())


a = input()
big = 0
small = 0
for i in a:
	if 'A' <= i <= 'Z':
		big += 1
	else:
		small += 1
if big > small:
	print(a.upper())
else:
	print(a.lower())


s = input()
lowers = 0
for ch in s:
	if ord('a') <= ord(ch) <= ord('z'):
		lowers += 1
n = len(s)
if n - lowers <= lowers:
	print(s.lower())
elif n - lowers > lowers:
	print(s.upper())


word = input()
cap = 0
sma = 0
for i in word:
	if ord(i) > 64 and ord(i) < 91:
		cap = cap + 1
	else:
		sma = sma + 1
if sma >= cap:
	print(word.lower())
else:
	print(word.upper())


word = input()
l = len(word)
count = 0
for i in word:
	if i.isupper():
		count += 1
if l % 2 == 0 and count > l / 2 or (l % 2 == 1 and count >= l // 2 + 1):
	print(word.upper())
else:
	print(word.lower())


sb = input()
c = 0
s = 0
s1 = ''
for ch in sb:
	if ch.isupper():
		c += 1
	else:
		s += 1
s1 = sb.upper() if c > s else sb.lower()
print(s1)


s = input()
u = 0
r = len(s)
for i in s:
	if i.isupper():
		u += 1
if u > r - u:
	print(s.upper())
else:
	print(s.lower())


inp = input().strip()
loCnt = 0
upCnt = 0
for i in inp:
	if i.islower():
		loCnt += 1
	else:
		upCnt += 1
if loCnt == upCnt or loCnt > upCnt:
	print(inp.lower())
else:
	print(inp.upper())


s = input()
w = list(s)
countu = 0
countl = 0
for i in range(len(w)):
	if w[i].isupper():
		countu = countu + 1
	if w[i].islower():
		countl = countl + 1
if countl >= countu:
	print(s.lower())
if countu > countl:
	print(s.upper())


word = str(input())
string = list(word)
(upper, lower) = (0, 0)
for i in string:
	if i.islower():
		lower += 1
	else:
		upper += 1
if upper > lower:
	print(word.upper())
else:
	print(word.lower())


s = input()
set_small = 0
set_BIG = 0
for i in s:
	if 'a' <= i <= 'z':
		set_small += 1
	elif 'A' <= i <= 'Z':
		set_BIG += 1
if set_small >= set_BIG:
	s = s.lower()
elif set_BIG > set_small:
	s = s.upper()
print(s)


x = input()
a = b = 0
for i in x:
	if ord(i) in range(97, 123):
		a += 1
	else:
		b += 1
if a >= b:
	print(x.lower())
else:
	print(x.upper())


a = input()
i = 0
mi = 0
may = 0
while i < len(a):
	b = a[i]
	if b.islower() == True:
		mi += 1
	else:
		may += 1
	i += 1
if mi > may:
	print(a.lower())
elif mi < may:
	print(a.upper())
elif mi == may:
	print(a.lower())


s = input()
(high, low) = (0, 0)
for i in range(0, len(s)):
	if s[i].isupper():
		high += 1
	else:
		low += 1
if low >= high:
	print(s.lower())
else:
	print(s.upper())


a = input()
b = list(a)
count = 0
count1 = 0
for i in b:
	if i.upper() == i:
		count = count + 1
	else:
		count1 = count1 + 1
if count > count1:
	print(a.upper())
else:
	print(a.lower())


st = input()
c1 = 0
c2 = 0
for s in st:
	if s.isupper() == True:
		c1 += 1
	elif s.islower() == True:
		c2 += 1
if c1 == c2:
	print(st.lower())
elif c1 > c2:
	print(st.upper())
else:
	print(st.lower())


letters = input()
countLwr = 0
countUpr = 0
for i in letters:
	if i.islower():
		countLwr += 1
	else:
		countUpr += 1
if countLwr == countUpr or countLwr > countUpr:
	print(letters.lower())
else:
	print(letters.upper())


s = input()
low = 0
high = 0
n = len(s)
for i in range(n):
	if 'A' <= s[i] <= 'Z':
		high += 1
	else:
		low += 1
if low >= high:
	s = s.lower()
	print(s)
else:
	s = s.upper()
	print(s)


x = input()
s = list(x)
new = []
count1 = 0
count2 = 0
for i in range(len(s)):
	if s[i].islower() == True:
		count1 += 1
	elif s[i].isupper() == True:
		count2 += 1
for i in range(len(s)):
	if count1 >= count2:
		new += s[i].lower()
	elif count1 < count2:
		new += s[i].upper()
a = ''
for i in range(len(new)):
	a += new[i]
print(a)


x = input()
up = 0
low = 0
for i in x:
	if i == i.lower():
		low += 1
	else:
		up += 1
if low >= up:
	print(x.lower())
else:
	print(x.upper())


s = input()
low = sum([1 for x in s if x.islower()])
ups = len(s) - low
if low >= ups:
	print(s.lower())
else:
	print(s.upper())


s = input()
upp = low = 0
for i in range(len(s)):
	if s[i] >= 'A' and s[i] <= 'Z':
		upp += 1
	elif s[i] >= 'a' and s[i] <= 'z':
		low += 1
if upp > low:
	print(s.upper())
else:
	print(s.lower())


word = input()
upper = sum([1 for w in word if w == w.upper()])
lower = len(word) - upper
if upper == lower or lower > upper:
	print(word.lower())
else:
	print(word.upper())


str1 = input()
lst_upper = []
lst_lower = []
for letter in str1:
	if letter.isupper():
		lst_upper.append(1)
	else:
		lst_lower.append(1)
if len(lst_upper) > len(lst_lower):
	print(str1.upper())
else:
	print(str1.lower())


s = input()
c1 = 0
c2 = 0
for i in s:
	if 'a' <= i <= 'z':
		c1 += 1
	else:
		c2 += 1
if c1 >= c2:
	print(s.lower())
else:
	print(s.upper())


s = input()
c = 0
for ch in s:
	if 'A' <= ch <= 'Z':
		c += 1
if c > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


s = input().strip()
(up, low) = (int(0), int(0))
for x in s:
	if 'A' <= x <= 'Z':
		up += 1
	else:
		low += 1
if up <= low:
	print(s.lower())
else:
	print(s.upper())


str = input()
ucnt = 0
lcnt = 0
for i in range(len(str)):
	if 'a' <= str[i] <= 'z':
		lcnt = lcnt + 1
	if 'A' <= str[i] <= 'Z':
		ucnt += 1
if lcnt >= ucnt:
	print(str.lower())
else:
	print(str.upper())


a = input()
nl = 0
nu = 0
for i in a:
	if i.islower():
		nl += 1
	else:
		nu += 1
if nl >= nu:
	print(a.lower())
else:
	print(a.upper())


s = input()
count = 0
for i in range(0, len(s)):
	a = ord(s[i])
	if a < 97:
		count += 1
l = len(s)
if count > l / 2:
	print(s.upper())
else:
	print(s.lower())


s = input()
c = 0
f = str()
for i in s:
	if i.isupper():
		c = c + 1
if c > len(s) - c:
	for i in s:
		f = f + i.upper()
else:
	for i in s:
		f = f + i.lower()
print(f)


word = input()
u = sum((1 for c in word if c.isupper()))
if u > len(word) - u:
	print(word.upper())
else:
	print(word.lower())


s = input()
lcount = 0
ucount = 0
for i in range(0, len(s)):
	if s[i].isupper():
		ucount += 1
	else:
		lcount += 1
t = ''
if ucount > lcount:
	for i in range(0, len(s)):
		t += s[i].upper()
else:
	for i in range(0, len(s)):
		t += s[i].lower()
print(t)


s = input()
bl = 0
sl = 0
check = 'qwertyuiopasdfghjklzxcvbnm'
for i in s:
	if i in check:
		sl += 1
	else:
		bl += 1
if bl > sl:
	print(s.upper())
else:
	print(s.lower())


s = list(input())
countUpper = 0
countLower = 0
for i in s:
	if i.isupper():
		countUpper = countUpper + 1
	else:
		countLower = countLower + 1
if countUpper > countLower:
	print(''.join(map(lambda x: x.upper(), s)))
else:
	print(''.join(map(lambda x: x.lower(), s)))


s = input()
low_case = 0
up_case = 0
for char in s:
	if char.isupper():
		up_case += 1
	else:
		low_case += 1
if up_case > low_case:
	print(s.upper())
else:
	print(s.lower())


a = input()
cs = cb = 0
for i in a:
	if i.isupper():
		cb += 1
	else:
		cs += 1
if cb > cs:
	print(a.upper())
else:
	print(a.lower())


s = input()
Big = 0
Small = 0
for i in s:
	if i < 'a':
		Big += 1
	else:
		Small += 1
if Big > Small:
	print(s.upper())
elif Small > Big:
	print(s.lower())
else:
	print(s.lower())


s = input()
i = len(s)
i -= 1
u = 0
l = 0
while i >= 0:
	if s[i] >= 'a':
		if s[i] <= 'z':
			l += 1
	else:
		u += 1
	i -= 1
if l >= u:
	print(s.lower())
else:
	print(s.upper())


n = input()
a = []
for i in range(len(n)):
	a.append(n[i])
(u, l) = (0, 0)
for j in range(len(n)):
	if a[j].isupper() == True:
		u = u + 1
	else:
		l = l + 1
if l >= u:
	print(n.lower())
else:
	print(n.upper())


n = input()
uc_count = 0
lc_count = 0
for c in n:
	if ord(c) > 90:
		lc_count += 1
	else:
		uc_count += 1
print(n.upper() if uc_count > lc_count else n.lower())


def solve(word):
	lower_count = 0
	upper_count = 0
	for character in word:
		if character.islower():
			lower_count += 1
		else:
			upper_count += 1
	if lower_count < upper_count:
		return word.upper()
	else:
		return word.lower()
word = input()
print(solve(word))


s = input()
c_u = 0
c_l = 0
for i in range(len(s)):
	if s[i].upper() == s[i]:
		c_u += 1
	else:
		c_l += 1
if c_l >= c_u:
	print(s.lower())
else:
	print(s.upper())


def main():
	word = input()
	up = 0
	down = 0
	for i in word:
		if i >= 'A' and i <= 'Z':
			up = up + 1
		if i >= 'a' and i <= 'z':
			down = down + 1
	if up > down:
		print(word.upper())
	else:
		print(word.lower())
main()


def wordfix(string):
	upper = 0
	lower = 0
	for ch in string:
		if ch.islower():
			lower += 1
		else:
			upper += 1
	if lower >= upper:
		print(string.lower())
	else:
		print(string.upper())
s = input()
wordfix(s)


char = input()
letter = list(char)
cntU = 0
cntL = 0
for i in range(len(letter)):
	if 'A' <= letter[i] <= 'Z':
		cntU += 1
	elif 'a' <= letter[i] <= 'z':
		cntL += 1
if cntU > cntL:
	print(str.upper(char))
else:
	print(str.lower(char))


s = input('')
s_sp = list(s)
count = 0
count1 = 0
for letter in s_sp:
	if letter.isupper():
		count += 1
	else:
		count1 += 1
if count > count1:
	print(s.upper())
else:
	print(s.lower())


s = input()
s = list(s)
c1 = 0
c2 = 0
for i in range(len(s)):
	if 64 < ord(s[i]) < 91:
		c1 = c1 + 1
	else:
		c2 = c2 + 1
s = ''.join(s)
if c1 > c2:
	s = s.upper()
if c2 > c1:
	s = s.lower()
if c2 == c1:
	s = s.lower()
print(s)


a = input()
l = 0
u = 0
for i in a:
	if i.isupper():
		u += 1
	else:
		l += 1
if l == u or l > u:
	print(a.lower())
else:
	print(a.upper())


txt = input()
up = 0
low = 0
for i in txt:
	if i.isupper():
		up = up + 1
	else:
		low = low + 1
if low > up:
	ans = txt.lower()
if low == up:
	ans = txt.lower()
if up > low:
	ans = txt.upper()
print(ans)


n = input()
cont = 0
for i in n:
	if i.isupper():
		cont += 1
if cont > len(n) - cont:
	print(n.upper())
else:
	print(n.lower())


a = input()
y = 0
for x in range(len(a)):
	if a[x].isupper():
		y += 1
if y <= len(a) / 2:
	print(a.lower())
else:
	print(a.upper())


try:
	lower = 0
	upper = 0
	n = input()
	for i in n:
		if i.isupper():
			upper += 1
		if i.islower():
			lower += 1
	if lower >= upper:
		print(n.lower())
	if lower < upper:
		print(n.upper())
	pass
except Exception:
	pass


s = input()
a = sum((1 if c.isupper() else 0 for c in s))
print(s.upper()) if a > len(s) - a else print(s.lower())


n = list(input())
l = ''.join(n)
up = []
low = []
for i in range(len(n)):
	if n[i].isupper():
		up.append(n[i])
	else:
		low.append(n[i])
if len(up) > len(low):
	print(l.upper())
else:
	print(l.lower())


s = input()
a = 'abcdefghijklmnopqrstuvwxyz'
i = 0
j = 0
for letters in s:
	if letters in a:
		i += 1
	else:
		j += 1
if j > i:
	print(s.upper())
else:
	print(s.lower())


string = input().strip()
lowerCase = upperCase = 0
for s in string:
	if s.islower():
		lowerCase += 1
	elif s.isupper():
		upperCase += 1
print(string.upper() if upperCase > lowerCase else string.lower())


s = str(input())
u = sum((1 for i in s if i.isupper()))
l = sum((1 for i in s if i.islower()))
if u <= l:
	print(s.lower())
else:
	print(s.upper())


S = input()
(up, low) = (0, 0)
for i in range(len(S)):
	if S[i].isupper():
		up += 1
	else:
		low += 1
if low >= up:
	for i in range(len(S)):
		print(S[i].lower(), end='')
else:
	for i in range(len(S)):
		print(S[i].upper(), end='')


test = input()
a = test.upper() if sum([x.isupper() for x in test]) > len(test) / 2 else test.lower()
print(a)


s = input().strip()
cnt_lowercase = 0
idx = 0
while idx < len(s):
	cnt_lowercase = cnt_lowercase + 1 if s[idx].islower() else cnt_lowercase
	idx += 1
if cnt_lowercase >= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


import os
s = input()
up = 0
lo = 0
for ch in s:
	if ch.isupper():
		up += 1
	else:
		lo += 1
if up > lo:
	print(s.upper())
elif up == lo:
	print(s.lower())
else:
	print(s.lower())


word = input()
j = 0
for i in word:
	if ord(i) < 97:
		j = j + 1
if j <= len(word) - j:
	print(word.lower())
else:
	print(word.upper())


w = input()
n = 0
for i in w:
	if i >= 'a' and i <= 'z':
		n += 1
if len(w) - n > int(len(w) / 2):
	print(w.upper())
else:
	print(w.lower())


palavra = input()
minuscula = 0
maiuscula = 0
for letra in palavra:
	if letra.islower():
		minuscula += 1
	else:
		maiuscula += 1
print(palavra.lower()) if minuscula >= maiuscula else print(palavra.upper())


s = input()
lc = hc = 0
for i in s:
	if i.isupper():
		hc += 1
	else:
		lc += 1
if hc > lc:
	print(s.upper())
else:
	print(s.lower())


str1 = input()
c = 0
str = []
while c < len(str1):
	str.append(str1[c])
	c += 1
BIG = 0
small = 0
for i in str:
	if ord(i) < 91:
		BIG += 1
	else:
		small += 1
if BIG > small:
	for i in str:
		print(f'{i.capitalize()}', end='')
else:
	for i in str:
		print(f'{i.lower()}', end='')


s = list(input())
up = 0
lo = 0
for i in s:
	if ord(i) in range(ord('a'), ord('z') + 1):
		lo += 1
	else:
		up += 1
if up > lo:
	for i in range(len(s)):
		if ord(s[i]) in range(ord('a'), ord('z') + 1):
			s[i] = chr(ord(s[i]) - (ord('a') - ord('A')))
else:
	for i in range(len(s)):
		if ord(s[i]) in range(ord('A'), ord('Z') + 1):
			s[i] = chr(ord(s[i]) + (ord('a') - ord('A')))
print(''.join(map(str, s)))


word = str(input())
lowerC = 0
upperC = 0
for i in word:
	if i.isupper():
		upperC += 1
	elif i.islower():
		lowerC += 1
if upperC > lowerC:
	word = word.upper()
else:
	word = word.lower()
print(word)


x = input()
a = list(x)
n = len(a)
(u, l) = (0, 0)
for i in range(n):
	if a[i] <= 'Z':
		u += 1
	else:
		l += 1
if l >= u:
	print(x.lower())
else:
	print(x.upper())


word = input()
number_of_lower_case = 0
number_of_upper_case = 0
for i in word:
	if i.islower():
		number_of_lower_case += 1
	else:
		number_of_upper_case += 1
if number_of_lower_case >= number_of_upper_case:
	word = word.lower()
else:
	word = word.upper()
print(word)


n = input()
small = 0
big = 0
for i in n:
	if 97 <= ord(i) <= 122:
		small += 1
	else:
		big += 1
if big > small:
	s = n.upper()
else:
	s = n.lower()
print(s)


a = input()
mx = 0
mi = 0
b = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(a)):
	if a[i] >= 'a' and a[i] <= 'z':
		mi += 1
	else:
		mx += 1
if mx > mi:
	print(a.upper())
else:
	print(a.lower())


st = input()
CapCount = 0
LowCount = 0
for i in st:
	if i.isupper():
		CapCount += 1
	elif i.islower():
		LowCount += 1
if CapCount > LowCount:
	print(st.upper())
else:
	print(st.casefold())


s = input()
lowers = 0
for c in s:
	lowers += int(c.islower())
print(s.upper() if 2 * lowers < len(s) else s.lower())


w = input()
x = len(w)
k = 0
s = 0
for i in range(x):
	if w[i].isupper() == True:
		k = k + 1
	elif w[i].islower() == True:
		s = s + 1
if k > s:
	w2 = w.upper()
	print(w2)
elif s > k or s == k:
	w3 = w.lower()
	print(w3)


f = input()
count_upper = 0
count_lower = 0
for i in f:
	if i.isupper():
		count_upper += 1
	else:
		count_lower += 1
if count_lower >= count_upper:
	print(f.lower())
else:
	print(f.upper())


str = input()
upp = sum((1 for i in str if i.isupper()))
low = sum((1 for i in str if i.islower()))
if upp > low:
	print(str.upper())
else:
	print(str.lower())


a = input()
chm = 0
chb = 0
for i in range(len(a)):
	if a[i] >= 'a' and a[i] <= 'z' and (len(a) <= 100):
		chm += 1
	elif a[i] >= 'A' and a[i] <= 'Z' and (len(a) <= 100):
		chb += 1
if chm > chb or chm == chb:
	print(a.lower())
elif chb > chm:
	print(a.upper())


T = input('')
cont = 0
cont2 = 0
for k in T:
	if k.islower():
		cont += 1
	else:
		cont2 += 1
if cont >= cont2:
	print(T.lower())
else:
	print(T.upper())


string = input()
(g, l) = (sum([1 for i in string if i.isupper()]), sum([1 for i in string if i.islower()]))
if g > l:
	print(string.upper())
else:
	print(string.lower())


word = input()
lowerCount = 0
upperCount = 0
for c in word:
	if c.islower():
		lowerCount += 1
	else:
		upperCount += 1
print(word.upper() if upperCount > lowerCount else word.lower())


n = input()
c = 0
o = 0
for i in n:
	if i.islower():
		c += 1
	if i.isupper():
		o += 1
if c > o or c == o:
	print(n.lower())
elif o > c:
	print(n.upper())


s = input()
c = 0
l = 0
for i in s:
	a = ord(i)
	if 65 <= a <= 90:
		c += 1
	else:
		l += 1
if c == l:
	print(s.lower())
elif c > l:
	print(s.upper())
else:
	print(s.lower())


def main():
	import re
	s = input()
	(_, n_uppercase) = re.subn('[A-Z]', '', s)
	(_, n_lowercase) = re.subn('[a-z]', '', s)
	print(s.lower() if n_lowercase >= n_uppercase else s.upper())
main()


s = input()
smalls = 0
caps = 0
for i in s:
	if i.isupper():
		caps += 1
	else:
		smalls += 1
if caps > smalls:
	print(s.upper())
else:
	print(s.lower())


z = input()
count = 0
for i in z:
	if i.islower():
		count = count + 1
if len(z) - count > len(z) // 2:
	print(z.upper())
else:
	print(z.lower())


n = input()
l = 0
u = 0
for i in range(len(n)):
	if ord(n[i]) >= 97 and ord(n[i]) <= 122:
		l += 1
	elif ord(n[i]) >= 65 and ord(n[i]) <= 90:
		u += 1
if l >= u:
	print(n.lower())
else:
	print(n.upper())


q = input()
ul = 0
ll = 0
for i in q:
	if i.isupper():
		ul = ul + 1
	elif i.islower():
		ll = ll + 1
if ll > ul:
	print(q.lower())
elif ul > ll:
	print(q.upper())
elif ul == ll:
	print(q.lower())


old = input()
number = 0
for i in old:
	if i == i.lower():
		number += 1
if number >= len(old) * 1 / 2:
	print(old.lower())
else:
	print(old.upper())


word = input()
n = len(word)
counter = 0
for _ in word:
	if _ >= 'A' and _ <= 'Z':
		counter = counter + 1
if counter > n / 2:
	print(word.upper())
else:
	print(word.lower())


string = input()
down = 0
for i in string:
	if i.islower():
		down += 1
up = len(string) - down
if up > down:
	print(string.upper())
else:
	print(string.lower())


(s, c) = (input(), 0)
for i in s:
	c += 1 if ord(i) <= 90 else -1
print(s.upper() if c > 0 else s.lower())


s = input()
u = 0
l = 0
for x in s:
	if x.isupper():
		u += 1
	else:
		l += 1
if l > u:
	print(s.lower())
elif u > l:
	print(s.upper())
else:
	print(s.lower())


ins = str(input())
up = 0
for s in ins:
	if s.isupper():
		up += 1
	else:
		up -= 1
if up > 0:
	print(ins.upper())
else:
	print(ins.lower())


word = input()
caps = int(0)
low = int(0)
for i in range(len(word)):
	if word[i].isupper() == True:
		caps += 1
	else:
		low += 1
if caps > low:
	print(word.upper())
else:
	print(word.lower())


str = input()
up = 0
lo = 0
for i in str:
	if i >= 'a' and i <= 'z':
		lo = lo + 1
	if i >= 'A' and i <= 'Z':
		up = up + 1
	if lo > up or lo == up:
		ans = str.lower()
	else:
		ans = str.upper()
print(ans)


while True:
	ch = input()
	if len(ch) >= 1 and len(ch) <= 100:
		break
(S, s) = (0, 0)
for i in range(len(ch)):
	if ch[i] in set('ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
		S += 1
	else:
		s += 1
ch1 = ''
if s >= S:
	for i in range(len(ch)):
		ch1 += ch[i].lower()
else:
	for i in range(len(ch)):
		ch1 += ch[i].upper()
print(ch1)


st = input()
c = 0
s = 0
for i in range(len(st)):
	if st[i] >= 'A' and st[i] <= 'Z':
		c += 1
	else:
		s += 1
if c > s:
	print(st.upper())
elif c == s:
	print(st.lower())
else:
	print(st.lower())


s = input()
n_capital = sum((1 for c in s if c.isupper()))
n_lower = sum((1 for c in s if c.islower()))
if n_capital == n_lower:
	print(s.lower())
elif n_capital > n_lower:
	print(s.upper())
elif n_capital < n_lower:
	print(s.lower())


word = input()
num_lower = 0
num_upper = 0
for character in word:
	if character.islower():
		num_lower += 1
	else:
		num_upper += 1
print(word.lower()) if num_lower >= num_upper else print(word.upper())


s = input()
lis = list(s)
c = 0
s1 = 0
for i in lis:
	if i >= 'A' and i <= 'Z':
		c = c + 1
	else:
		s1 = s1 + 1
if c > s1:
	print(s.upper())
elif c < s1:
	print(s.lower())
elif c == s1:
	print(s.lower())


in_str = input()
num_lower = 0
num_upper = 0
for character in in_str:
	if character == character.upper():
		num_upper += 1
	else:
		num_lower += 1
print(in_str.upper() if num_upper > num_lower else in_str.lower())


word = input()
lower = 0
upper = 0
for x in word:
	if x == x.lower():
		lower = lower + 1
	else:
		upper = upper + 1
if upper > lower:
	print(word.upper())
else:
	print(word.lower())


a = input()
k = 0
for i in a:
	if i == i.upper():
		k += 1
if k > len(a) / 2:
	print(a.upper())
else:
	print(a.lower())


ch = list(input())
(upp, low) = (0, 0)
for e in ch:
	if e == e.upper():
		upp += 1
	else:
		low += 1
if upp <= low:
	print(''.join(ch).lower())
else:
	print(''.join(ch).upper())


n = input()
m = 0
for x in n:
	m = m + int(x.isupper())
if m <= len(n) / 2:
	print(n.lower())
else:
	print(n.upper())


word = input()
up = 0
low = 0
l = len(word)
for i in range(l):
	if ord(word[i]) <= 90:
		up += 1
	if ord(word[i]) >= 97:
		low += 1
if up > low:
	print(word.upper())
if up <= low:
	print(word.lower())


from math import ceil
s = input()
k = 0
for i in s:
	if i == i.lower():
		k += 1
if k >= ceil(len(s) / 2):
	print(s.lower())
else:
	print(s.upper())


s = input()
uppercase = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
upper = 0
lower = 0
for letter in s:
	if letter in uppercase:
		upper += 1
	else:
		lower += 1
if upper == lower:
	s = s.lower()
elif upper > lower:
	s = s.upper()
else:
	s = s.lower()
print(s)


a = input()
u = 0
v = 0
for l in a:
	if l.isupper():
		u = u + 1
	else:
		v = v + 1
if u > v:
	print(a.upper())
else:
	print(a.lower())


n = input('')
x = 0
l = float(len(n) / 2)
for i in n:
	if i.isupper():
		x += 1
if l == x or l > x:
	print(n.lower())
else:
	print(n.upper())


x = input()
c1 = 0
c2 = 0
for i in x:
	if i.islower():
		c1 += 1
	else:
		c2 += 1
if c1 < c2:
	print(x.upper())
else:
	print(x.lower())


string = input()
lower_cnt = 0
upper_cnt = 0
for i in string:
	if i.islower():
		lower_cnt += 1
	elif i.isupper():
		upper_cnt += 1
if lower_cnt == upper_cnt:
	print(string.lower())
elif lower_cnt < upper_cnt:
	print(string.upper())
elif lower_cnt > upper_cnt:
	print(string.lower())


x = input()
c = 0
s = 0
for i in x:
	if i.islower() == True:
		s = s + 1
	else:
		c = c + 1
if s >= c:
	a = x.lower()
	print(a)
else:
	a = x.upper()
	print(a)


import sys
word = sys.stdin.read().strip()
cap_count = 0
for l in word:
	cap_count = cap_count + 1 if l.isupper() else cap_count
if 2 * cap_count > len(word):
	print(word.upper())
else:
	print(word.lower())


import string
word = input()
upper_count = sum((ch in string.ascii_uppercase for ch in word))
print(word.upper() if upper_count > len(word) / 2 else word.lower())


minus = 'qwertyuiopasdfghjklzxcvbnm'
mayus = minus.upper()
s = input()
c1 = 0
c2 = 0
for l in s:
	if l in minus:
		c1 = c1 + 1
	elif l in mayus:
		c2 = c2 + 1
if c1 - c2 == 0:
	print(s.lower())
elif c1 - c2 >= 1:
	print(s.lower())
else:
	print(s.upper())


n = input()
count_u = 0
count_l = 0
for i in n:
	if i.isupper():
		count_u += 1
	else:
		count_l += 1
if count_l >= count_u:
	print(n.lower())
else:
	print(n.upper())


st = str(input())
low = 0
for l in st:
	if l.islower():
		low += 1
if low >= len(st) - low:
	st = st.lower()
else:
	st = st.upper()
print(st)


string = input()
c = 0
l = 0
for i in string:
	if i.isupper():
		c += 1
	else:
		l += 1
print(string.upper() if c > l else string.lower())


x = input()
cu = 0
cl = 0
for i in x:
	if i.isupper():
		cu = cu + 1
	if i.islower():
		cl = cl + 1
if cl >= cu:
	x = x.lower()
else:
	x = x.upper()
print(x)


name = str(input())
up = 0
low = 0
for i in name:
	if i.isupper():
		up += 1
	elif i.islower():
		low += 1
if low >= up:
	print(name.lower())
else:
	print(name.upper())


a = input('')
(b, c) = (0, 0)
for d in a:
	if ord(d) >= 97 and ord(d) <= 122:
		b += 1
	else:
		c += 1
if b >= c:
	a = a.lower()
else:
	a = a.upper()
print(a)


n = input()
countlower = 0
for i in range(len(n)):
	if ord(n[i]) >= 97 and ord(n[i]) <= 122:
		countlower += 1
if countlower >= len(n) - countlower:
	print(n.lower())
elif countlower < len(n) - countlower:
	print(n.upper())


string = input()
lst = []
upper = 0
lower = 0
for i in string:
	lst.append(i)
for j in lst:
	if j.isupper():
		upper += 1
	elif j.islower():
		lower += 1
if upper > lower:
	print(string.upper())
elif lower > upper:
	print(string.lower())
elif lower == upper:
	print(string.lower())


(l, b) = (0, 0)
s = input()
for i in s:
	if i.islower():
		l += 1
	else:
		b += 1
if b == l or b < l:
	print(s.lower())
else:
	print(s.upper())


n = str(input())
s = sorted(n)
a = 0
for i in s:
	if i.isupper():
		a += 1
if a <= len(n) / 2:
	print(n.lower())
else:
	print(n.upper())


s = input()
up = 0
lw = 0
for i in s:
	if i.isupper():
		up += 1
	else:
		lw += 1
if up == lw or lw > up:
	print(s.lower())
elif up > lw:
	print(s.upper())


s = input()
upper_len = len(list(filter(lambda c: ord('A') <= ord(c) <= ord('Z'), s)))
print(s.upper() if upper_len > len(s) - upper_len else s.lower())


s = input()
u = []
l = []
for i in range(len(s)):
	if s[i].isupper():
		u.append(s[i])
	else:
		l.append(s[i])
if len(u) <= len(l):
	print(s.lower())
else:
	print(s.upper())


a = input()
cnt = 0
cnt1 = 0
for i in range(len(a)):
	if a[i] >= 'A' and a[i] <= 'Z':
		cnt += 1
cnt1 = len(a) - cnt
if cnt > cnt1:
	print(a.upper())
else:
	print(a.lower())


w = input()
lc = sum([c.islower() for c in w])
uc = len(w) - lc
if lc >= uc:
	print(w.lower())
else:
	print(w.upper())


def word(s):
	lower = 0
	upper = 0
	for i in s:
		if i.islower():
			lower += 1
		else:
			upper += 1
	if upper > lower:
		return s.upper()
	else:
		return s.lower()
s = input()
print(word(s))


str = input()
count = 0
for i in str:
	if i == i.lower():
		count += 1
if count >= len(str) - count:
	print(str.lower())
else:
	print(str.upper())


string = input()
b = s = 0
for char in string:
	if ord(char) >= 97:
		s += 1
	else:
		b += 1
if s >= b:
	ans = string.lower()
else:
	ans = string.upper()
print(ans)


n = input()
uppS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
low = 0
upp = 0
for i in n:
	if i in uppS:
		upp += 1
	else:
		low += 1
if low == upp or low > upp:
	print(n.lower())
else:
	print(n.upper())


word = input()
upper = sum((1 for c in word if c.isupper()))
lower = len(word) - upper
if upper > lower:
	print(word.upper())
elif upper <= lower:
	print(word.lower())


s = input()
l = 0
u = 0
for x in s:
	if x.isupper():
		u += 1
	else:
		l += 1
if u > l:
	for x in s:
		if x.isupper():
			print(x, end='')
		else:
			print(x.upper(), end='')
else:
	for x in s:
		if x.islower():
			print(x, end='')
		else:
			print(x.lower(), end='')


a = str(input())
s = 0
for i in range(len(a)):
	if a[i] >= 'a':
		s = s + 1
if 2 * s < len(a):
	a = a.upper()
else:
	a = a.lower()
print(a)


a = str(input())
s = 0
t = 0
for char in a:
	if char.isupper():
		s += 1
	else:
		t += 1
if s > t:
	print(a.upper())
else:
	print(a.lower())


s = input()
u = 0
l = 0
for i in s:
	if 65 <= ord(i) <= 90:
		u += 1
	elif 97 <= ord(i) <= 122:
		l += 1
if u <= l:
	print(s.lower())
elif u > l:
	print(s.upper())


str = input()
lst_lower = []
lst_upper = []
for i in str:
	if i == i.upper():
		lst_upper.append(i)
	if i == i.lower():
		lst_lower.append(i)
if len(lst_lower) < len(lst_upper):
	str = str.upper()
elif len(lst_lower) > len(lst_upper):
	str = str.lower()
else:
	str = str.lower()
print(str)


s = input()
let_s = 0
let_b = 0
for i in s:
	if 'a' <= i <= 'z':
		let_s += 1
	elif 'A' <= i <= 'Z':
		let_b += 1
if let_b > let_s:
	print(s.upper())
else:
	print(s.lower())


s = input()
c = 0
sm = 0
for i in range(len(s)):
	if s[i] >= 'A' and s[i] <= 'Z':
		c = c + 1
	elif s[i] >= 'a' and s[i] <= 'z':
		sm = sm + 1
if sm >= c:
	print(s.lower())
elif c > sm:
	print(s.upper())


s = input()
c = sum((1 for i in list(s) if i.isupper()))
print(s.upper()) if c > len(s) - c else print(s.lower())


s = input()
no_upper = 0
no_lower = 0
for i in s:
	if 64 < ord(i) < 91:
		no_upper = no_upper + 1
	elif 96 < ord(i) < 123:
		no_lower = no_lower + 1
	else:
		pass
if no_lower > no_upper:
	a = s.lower()
elif no_lower < no_upper:
	a = s.upper()
elif no_lower == no_upper:
	a = s.lower()
print(a)


s = input()
v = 'ABCDEFFGHIJKLMNOPQRSTUVWXYZ'
k = 0
for i in range(len(s)):
	if s[i] in v:
		k += 1
print(s.upper() if k > len(s) / 2 else s.lower())


a = input()
l = 0
u = 0
ll = ''
uu = ''
for i in range(len(a)):
	if ord(a[i]) < 96:
		u += 1
		ll = ll + chr(ord(a[i]) + 32)
		uu = uu + a[i]
	else:
		l += 1
		ll = ll + a[i]
		uu = uu + chr(ord(a[i]) - 32)
if l < u:
	print(uu)
else:
	print(ll)


s = input()
u = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lc = 0
uc = 0
for i in s:
	if i in u:
		uc = uc + 1
	else:
		lc = lc + 1
if uc > lc:
	print(s.upper())
else:
	print(s.lower())


w = input()
lw = list(w)
l = u = 0
for i in range(len(w)):
	if lw[i] > 'Z':
		l += 1
	else:
		u += 1
if l >= u:
	print(w.lower())
else:
	print(w.upper())


n = input()
v = 0
s = 0
for item in n:
	if item.isupper():
		v += 1
	else:
		s += 1
if v == s:
	print(n.lower())
elif v > s:
	print(n.upper())
else:
	print(n.lower())


string = input()
(l, u) = (0, 0)
for i in string:
	if i >= 'a' and i <= 'z':
		l = l + 1
	if i >= 'A' and i <= 'Z':
		u = u + 1
if l > u:
	str1 = string.lower()
if l < u:
	str1 = string.upper()
if l == u:
	str1 = string.lower()
print(str1)


a = input()
small = 0
large = 0
for i in a:
	if i.islower():
		small = small + 1
	else:
		large = large + 1
if small < large:
	print(a.upper())
else:
	print(a.lower())


st = input()
count_s = 0
count_c = 0
for i in range(len(st)):
	if ord(st[i]) >= 65 and ord(st[i]) <= 90:
		count_c += 1
	else:
		count_s += 1
if count_c > count_s:
	print(st.upper())
else:
	print(st.lower())


s1 = input()
s1copy = ''
l = 0
m = 0
for i in s1:
	if ord('A') <= ord(i) <= ord('Z'):
		l += 1
	else:
		m += 1
if l > m:
	for i in s1:
		s1copy += i.upper()
else:
	for i in s1:
		s1copy += i.lower()
print(s1copy)


line = input()
upper_count = 0
lower_count = 0
for c in line:
	if c in 'abcdefghijklmnopqrstuvwxyz':
		lower_count += 1
	elif c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		upper_count += 1
if lower_count >= upper_count:
	print(str.lower(line))
else:
	print(str.upper(line))


string = input()
up = 0
low = 0
i = 0
while i < len(string):
	if ord(string[i]) >= 65 and ord(string[i]) <= 90:
		up += 1
	else:
		low += 1
	i += 1
if up > low:
	ok = string.upper()
else:
	ok = string.lower()
print(ok)


s = input()
n = len(s)
count_low = 0
for i in s:
	if i == i.lower():
		count_low += 1
if n - count_low > count_low:
	print(s.upper())
else:
	print(s.lower())


def calc(str):
	counter = 0
	for char in str:
		if char.isupper():
			counter += 1
	if counter > int(len(str) / 2):
		return str.upper()
	else:
		return str.lower()
x = input()
print(calc(x))


def main():
	s = input()
	lower_count = 0
	upper_count = 0
	for i in s:
		if ord(i) >= 65 and ord(i) <= 90:
			upper_count += 1
		else:
			lower_count += 1
	if upper_count > lower_count:
		s = s.upper()
	else:
		s = s.lower()
	print(s)
main()


a = input()
countup = countlw = 0
for walkA in range(0, len(a)):
	letter = a[walkA]
	if letter.isupper():
		countup += 1
	if letter.islower():
		countlw += 1
if countlw >= countup:
	print(a.lower())
else:
	print(a.upper())


string = input()
lowcount = 0
highcount = 0
for i in string:
	if ord(i) <= 90:
		highcount += 1
	else:
		lowcount += 1
if lowcount >= highcount:
	print(string.lower())
else:
	print(string.upper())


s = input()
S = []
for x in s:
	S.append(x)
upp = 0
low = 0
i = 0
while i < len(S):
	if S[i] == S[i].upper():
		upp += 1
		i += 1
	elif S[i] == S[i].lower():
		low += 1
		i += 1
if upp == low:
	print(s.lower())
elif upp > low:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
counter = 0
for c in s:
	if c.isupper():
		counter += 1
if counter <= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


s = input()
cc = 0
sc = 0
for i in range(0, len(s)):
	if s[i] >= 'A' and s[i] <= 'Z':
		cc += 1
	else:
		sc += 1
if cc > sc:
	print(s.upper())
else:
	print(s.lower())


s = input()
nru = 0
nrl = 0
for x in s:
	if x.isupper():
		nru += 1
	else:
		nrl += 1
if nru > nrl:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
big = []
small = []
for i in s:
	if 'A' <= i <= 'Z':
		big.append(i)
	else:
		small.append(i)
if len(big) < len(small):
	s = s.lower()
elif len(big) == len(small):
	s = s.lower()
else:
	s = s.upper()
print(s)


s = input()
(count_l, count_u) = (0, 0)
for i in s:
	if ord(i) >= 97:
		count_l += 1
	else:
		count_u += 1
print(s.lower() if count_l >= count_u else s.upper())


str = ''
x = 0
y = 0
str = input()
for i in range(len(str)):
	if str[i].islower():
		x += 1
	else:
		y += 1
if x > int(len(str)) / 2:
	print(str.lower())
elif x < int(len(str)) / 2:
	print(str.upper())
elif x == y:
	print(str.lower())


s = input()
count_a = 0
count_b = 0
for x in s:
	if x >= 'a':
		count_a = count_a + 1
	else:
		count_b = count_b + 1
if count_a >= count_b:
	for x in s:
		if x.islower():
			print(x, end='')
		else:
			x = chr(ord(x) + 32)
			print(x, end='')
if count_b > count_a:
	for x in s:
		if x < 'a':
			print(x, end='')
		else:
			x = chr(ord(x) - 32)
			print(x, end='')


s = input()
ts = 0
tz = 0
for i in range(len(s)):
	if 'z' >= s[i] >= 'a':
		ts += 1
	else:
		tz += 1
if ts >= tz:
	print(s.lower())
else:
	print(s.upper())


word = input()
lowers = sum([1 for c in word if c.islower()])
half = len(word) // 2 if len(word) % 2 == 0 else (len(word) + 1) // 2
if half <= lowers:
	print(word.lower())
else:
	print(word.upper())


pala = input()
(mai, minu) = (0, 0)
for j in pala:
	if j.islower():
		minu += 1
	else:
		mai += 1
if mai > minu:
	print(pala.upper())
else:
	print(pala.lower())


a = input()
cap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
small = 'abcdefghijklmnopqrstuvwxyz'
countcap = 0
countsmall = 0
for i in a:
	if i in cap:
		countcap += 1
	else:
		countsmall += 1
if countcap > countsmall:
	print(a.upper())
else:
	print(a.lower())


x = input()
l = 0
u = 0
for i in range(len(x)):
	if x[i].islower():
		l += 1
	else:
		u += 1
if u < l or u == l:
	print(x.lower())
else:
	print(x.upper())


s = input()
cup = 0
clo = 0
for i in range(len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		clo += 1
	else:
		cup += 1
if cup > clo:
	print(s.upper())
else:
	print(s.lower())


lis = input()
c = 0
t = 0
for i in lis:
	if i.isupper():
		c += 1
	else:
		t += 1
if t >= c:
	print(lis.lower())
else:
	print(lis.upper())


s = input()
ch = 0
CH = 0
for i in s:
	if i >= 'a' and i <= 'z':
		ch += 1
	if i >= 'A' and i <= 'Z':
		CH += 1
if ch >= CH:
	print(s.lower())
else:
	print(s.upper())


inp = input()
up = 0
down = 0
for i in inp:
	if i.isupper():
		up += 1
	else:
		down += 1
if down < up:
	out = inp.upper()
else:
	out = inp.lower()
print(out)


s = input()
(l, u) = (0, 0)
for i in range(len(s)):
	if s[i].islower() == True:
		l = l + 1
	else:
		u = u + 1
if l > u:
	print(s.lower())
elif l == u:
	print(s.lower())
else:
	print(s.upper())


a = input()
d = 0
for s in a:
	if s.isupper():
		d += 1
if len(a) - d < d:
	print(a.upper())
else:
	print(a.lower())


count = 0
a = input()
for i in range(len(a)):
	if ord(a[i]) < 92:
		count += 1
if count > len(a) // 2:
	print(a.upper())
else:
	print(a.lower())


n = input()
low = 0
high = 0
for i in n:
	if i.islower():
		low += 1
	elif i.isupper():
		high += 1
if high > low:
	print(n.upper())
else:
	print(n.lower())


n = input()
u = 0
l = 0
for i in n:
	if i == i.upper():
		u += 1
	elif i == i.lower():
		l = l + 1
if l >= u:
	print(n.lower())
else:
	print(n.upper())


s = input()
c = 0
for x in s:
	c += int(x.isupper())
print([s.upper(), s.lower()][c <= len(s) // 2])


str = input()
upc = 0
loc = 0
for i in range(0, len(str)):
	if str[i].isupper():
		upc = upc + 1
	elif str[i].islower():
		loc = loc + 1
if loc >= upc:
	print(str.lower())
else:
	print(str.upper())


a = input()
g = a.lower()
c = a.upper()
l = 0
i = 0
m = 0
while i < len(a):
	if a[i].isupper():
		l = l + 1
	if a[i].islower():
		m = m + 1
	i = i + 1
if l > m:
	print(c)
if l < m:
	print(g)
if m == l:
	print(g)


s = input()
lows = len([_ for _ in s if _ >= 'a' and _ <= 'z'])
highs = len(s) - lows
if highs > lows:
	print(s.upper())
else:
	print(s.lower())


s = input()
k = 0
for i in s:
	if ord(i) <= 90:
		k += 1
upper_more = 2 * k > len(s)
res = ''
if upper_more:
	for i in s:
		if ord(i) > 90:
			res += chr(ord(i) - 32)
		else:
			res += i
else:
	for i in s:
		if ord(i) <= 90:
			res += chr(ord(i) + 32)
		else:
			res += i
print(res)


x = str(input())
uppercount = 0
lowercount = 0
for c in x:
	if c.isupper():
		uppercount += 1
	else:
		lowercount += 1
if uppercount > lowercount:
	x = x.upper()
else:
	x = x.lower()
print(x)


LOWER_LETTER_A = 'a'
LOWER_LETTER_Z = 'z'
UPPER_LETTER_A = 'A'
UPPER_LETTER_Z = 'Z'

def solve():
	string = list(input())
	upper_letter = [0] * 26
	lower_letter = [0] * 26
	for i in range(len(string)):
		if UPPER_LETTER_A <= string[i] <= UPPER_LETTER_Z:
			upper_letter[ord(string[i]) - ord(UPPER_LETTER_A)] += 1
		else:
			lower_letter[ord(string[i]) - ord(LOWER_LETTER_A)] += 1
	if sum(upper_letter) > sum(lower_letter):
		print(''.join(string).upper())
	else:
		print(''.join(string).lower())
solve()


s = input()
count = 0
lowerletters = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(len(s)):
	if s[i] in lowerletters:
		count += 1
print(s.lower() if count * 2 >= len(s) else s.upper())


s = input()
cc = 0
cs = 0
ans = ''
for i in range(len(s)):
	if ord(s[i]) <= 122 and ord(s[i]) >= 97:
		cs = cs + 1
	else:
		cc = cc + 1
if cc > cs:
	for j in range(len(s)):
		if ord(s[j]) <= 122 and ord(s[j]) >= 97:
			ans = ans + chr(ord(s[j]) - 32)
		else:
			ans = ans + s[j]
else:
	for j in range(len(s)):
		if ord(s[j]) <= 90 and ord(s[j]) >= 65:
			ans = ans + chr(ord(s[j]) + 32)
		else:
			ans = ans + s[j]
print(ans)


a = str(input())
cnt = 0
d = 0
for i in a:
	if i >= 'A' and i <= 'Z':
		cnt += 1
	elif i >= 'a' and i <= 'z':
		d += 1
if d > cnt:
	print(a.lower())
elif cnt > d:
	print(a.upper())
elif d == cnt:
	print(a.lower())


a = input()
print([a.lower(), a.upper()][sum((p < '[' for p in a)) * 2 > len(a)])


s = input()
count_lower = 0
count_upper = 0
for alpha in s:
	if alpha.islower():
		count_lower += 1
	if alpha.isupper():
		count_upper += 1
if count_lower >= count_upper:
	print(s.lower())
else:
	print(s.upper())


s = input()
u = 0
l = 0
for f in range(len(s)):
	if s[f].isupper():
		u += 1
	else:
		l += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


str = input()
l = []
lcount = 0
rcount = 0
for i in range(0, len(str)):
	if str[i].islower():
		lcount += 1
	else:
		rcount += 1
if rcount > lcount:
	print(str.upper())
else:
	print(str.lower())


ranga = input()
uppercase_count = 0
for char in ranga:
	if ord(char) in range(65, 91):
		uppercase_count += 1
lowercase_count = len(ranga) - uppercase_count
if uppercase_count > lowercase_count:
	ranga = ranga.upper()
else:
	ranga = ranga.lower()
print(ranga)


import sys
from random import choice, randint
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 MI():
	return map(int, sys.stdin.readline().strip().split())

def LI():
	return list(map(int, sys.stdin.readline().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 sys.stdin.readline().strip().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().strip().split()]

def LS():
	return sys.stdin.readline().strip().split()

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

def F():
	return float(sys.stdin.readline().strip())

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

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

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))
inp = sys.stdin.readline
out = sys.stdout.write

def main():
	s = S()
	(l, u) = (0, 0)
	for i in s:
		if i.islower():
			l += 1
		else:
			u += 1
	if u > l:
		pf(s.upper())
	else:
		pf(s.lower())
main()


n = str(input())
a = 0
b = 0
for i in n:
	if i.islower():
		a += 1
	else:
		b += 1
if a > b:
	print(n.lower())
elif a == b:
	print(n.lower())
else:
	print(n.upper())


s = input()
l = len(s)
z = s.lower()
count = 0
for i in range(0, l):
	if s[i] != z[i]:
		count = count + 1
	else:
		continue
rem = l - count
if rem < count:
	print(s.upper())
else:
	print(z)


def met(i):
	(l, u) = (0, 0)
	(lr, up) = ('', '')
	for s in i:
		if ord(s) < 91:
			up += s
			lr += chr(ord(s) + 32)
			u += 1
		else:
			up += chr(ord(s) - 32)
			lr += s
			l += 1
	if u > l:
		return up
	return lr
n = input()
print(met(n))


word = input()
low = 0
up = 0
for x in range(len(word)):
	if word[x] == word[x].upper():
		up += 1
	else:
		low += 1
if up > low:
	print(word.upper())
else:
	print(word.lower())


n = input()
k = 0
for i in n:
	if ord(i) <= 90:
		k += 1
if k > len(n) / 2:
	print(n.upper())
else:
	print(n.lower())


str = input()

def process(str):
	c = 0
	for ch in str:
		if ch.islower():
			c += 1
	if c >= len(str) / 2:
		return str.lower()
	else:
		return str.upper()
print(process(str))


a = input()
m = 0
n = 0
for x in a:
	if x.isupper() == True:
		m += 1
	else:
		n += 1
if m > n:
	a = a.upper()
else:
	a = a.lower()
print(a)


word = str(input())
ucount = sum((1 for letter in word if letter.isupper()))
lcount = sum((1 for letter in word if letter.islower()))
if ucount > lcount:
	word = word.upper()
else:
	word = word.lower()
print(word)


t = list(str(input()))
upper = 0
lower = 0
for i in range(len(t)):
	if t[i].isupper():
		upper = upper + 1
	elif t[i].islower():
		lower = lower + 1
if upper > lower:
	print(''.join(t).upper())
else:
	print(''.join(t).lower())


s = input().strip()
lc = 0
for x in s:
	if x.islower():
		lc += 1
if lc * 2 >= len(s):
	print(s.lower())
else:
	print(s.upper())


x = input()
s = 0
l = 0
for i in x:
	if ord(i) >= 97 and ord(i) <= 122:
		s = s + 1
	if ord(i) >= 65 and ord(i) <= 90:
		l = l + 1
if s >= l:
	print(x.lower())
else:
	print(x.upper())


input_s = input('')
lowercase = 0
capitalized = 0
for c in input_s:
	if c.islower() == True:
		lowercase += 1
	else:
		capitalized += 1
if lowercase >= capitalized:
	print(input_s.lower())
else:
	print(input_s.upper())


n = input()
uppers = [i for i in n if i.isupper()]
lowers = [j for j in n if j.islower()]
if len(uppers) > len(lowers):
	print(n.upper())
elif len(uppers) < len(lowers) or len(uppers) == len(lowers):
	print(n.lower())


word = input()
l_case = 0
u_case = 0
for i in word:
	if i.islower():
		l_case += 1
	else:
		u_case += 1
if l_case < u_case:
	print(word.upper())
else:
	print(word.lower())


a = input()
(uw, lw) = (0, 0)
for i in range(len(a)):
	if 'a' <= a[i] <= 'z':
		lw += 1
	else:
		uw += 1
print(a.lower() if lw >= uw else a.upper())


n = input()
l = len(n)
p = 0
q = 0
for i in range(0, l):
	if n[i] >= 'A' and n[i] <= 'Z':
		p = p + 1
	if n[i] >= 'a' and n[i] <= 'z':
		q = q + 1
if p > q:
	print(n.upper())
else:
	print(n.lower())


s = input()
m = 0
b = 0
for i in s:
	if i >= 'a' and i <= 'z':
		m += 1
	else:
		b += 1
if m >= b:
	print(s.lower())
else:
	print(s.upper())


import re
word = input()
(uc, lc) = (0, 0)
for ch in word:
	if ch.isupper():
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(word.upper())
else:
	print(word.lower())


s = input()
big = 0
small = 0
for i in s:
	if i.islower():
		small += 1
	elif i.isupper():
		big += 1
if big > small:
	print(s.upper())
else:
	print(s.lower())


def isLowerCase(c):
	return 'a' <= c and c <= 'z'

def computeLowerCaseLetters(str):
	counter = 0
	for i in range(len(str)):
		counter += isLowerCase(str[i])
	return counter

def toLowerCase(str):
	return str.lower()

def toUpperCase(str):
	return str.upper()
word = input()
totLowerCaseLetters = computeLowerCaseLetters(word)
totUpperCaseLetters = len(word) - totLowerCaseLetters
if totLowerCaseLetters >= totUpperCaseLetters:
	print(toLowerCase(word))
else:
	print(toUpperCase(word))


k = input()
uc = 0
lc = 0
for i in k:
	if i.islower():
		lc += 1
	if i.isupper():
		uc += 1
if uc > lc:
	print(k.upper())
else:
	print(k.lower())


x = input()
l = L = 0
for i in x:
	if i >= 'A' and i <= 'Z':
		L += 1
	else:
		l += 1
if L > l:
	print(x.upper())
else:
	print(x.lower())


s = input()
l = []
low = 0
up = 0
for i in s.strip():
	l.append(i)
for j in l:
	if j.islower():
		low += 1
	else:
		up += 1
if low >= up:
	print(''.join(l).lower())
else:
	print(''.join(l).upper())


k = list(map(str, input().strip()))
m = 0
l = 0
for i in range(len(k)):
	if k[i].isupper():
		l = l + 1
	else:
		m = m + 1
k = ''.join(k)
if m >= l:
	print(k.lower())
else:
	print(k.upper())


string = input()
length = len(string)
let_s = let_b = 0
for i in string:
	if 'a' <= i <= 'z':
		let_s += 1
	elif 'A' <= i <= 'Z':
		let_b += 1
stroch = let_s / length * 100
propis = let_b / length * 100
if propis > stroch:
	print(string.upper())
else:
	print(string.lower())


i = input().strip()
l = 0
for j in range(len(i)):
	if ord(i[j]) > 96:
		l += 1
u = len(i) - l
if u > l:
	print(i.upper())
else:
	print(i.lower())


a = input()
s = 0
b = 0
for i in range(len(a)):
	if a[i] >= 'A' and a[i] <= 'Z':
		b += 1
	else:
		s += 1
if b > s:
	print(a.upper())
else:
	print(a.lower())


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()
	c = 0
	for t in s:
		if 'A' <= t <= 'Z':
			c += 1
	l = len(s)
	if l >= c * 2:
		return s.lower()
	return s.upper()
print(main())


n = list(input())
(c, c1) = (0, 0)
for i in range(len(n)):
	if ord(n[i]) >= 97 and ord(n[i]) <= 122:
		c += 1
for i in range(len(n)):
	if ord(n[i]) >= 65 and ord(n[i]) <= 90:
		c1 += 1
if c >= c1:
	for i in range(len(n)):
		if ord(n[i]) >= 65 and ord(n[i]) <= 90:
			n[i] = chr(ord(n[i]) + 32)
else:
	for i in range(len(n)):
		if ord(n[i]) >= 97 and ord(n[i]) <= 122:
			n[i] = chr(ord(n[i]) - 32)
final = ''
for i in n:
	final = final + i
print(final)


s = input()
m = 0
v = 0
for i in range(len(s)):
	if s[i].islower():
		m = m + 1
	else:
		v = v + 1
if m >= v:
	print(s.lower())
else:
	print(s.upper())


def fun():
	s = input()
	up = 0
	lo = 0
	for i in s:
		if i.islower():
			lo += 1
		else:
			up += 1
	if lo >= up:
		print(s.lower())
	else:
		print(s.upper())
fun()


word = input()
numof_upper = [x.isupper() for x in word].count(True)
if numof_upper > len(word) - numof_upper:
	print(word.upper())
else:
	print(word.lower())


s = input()
upc = 0
upl = 0
for i in s:
	if i.isupper():
		upc = upc + 1
	else:
		upl = upl + 1
if upc > upl:
	print(s.upper())
else:
	print(s.lower())


t = input('')
a = len(t)
c = 0
d = 0
for x in range(a):
	if t[x].isupper():
		c += 1
	elif t[x].islower():
		d += 1
if c > d:
	print(t.upper())
else:
	print(t.lower())


lowerCount = 0
upperCount = 0
s = input()
for i in s:
	if ord(i) >= 97:
		lowerCount += 1
	else:
		upperCount += 1
if lowerCount >= upperCount:
	print(s.lower())
else:
	print(s.upper())


s = input()
n = [ord(x) for x in s]
u = 0
l = 0
for i in n:
	if i >= 97 and i <= 122:
		l += 1
	else:
		u += 1
d = str(s)
if u > l:
	ns = d.upper()
else:
	ns = d.lower()
print(str(ns))


s = input()
sc = 0
cc = 0
for i in s:
	val = ord(i)
	if val >= 97 and val <= 122:
		sc += 1
	else:
		cc += 1
if sc == cc:
	print(s.lower())
elif sc > cc:
	print(s.lower())
else:
	print(s.upper())


ip = input()
Length = len(ip)
if Length % 2 == 0:
	Mid = Length / 2 + 1
else:
	Mid = (Length + 1) / 2
upper = 0
for i in range(Length):
	if ip[i].isupper():
		upper += 1
if upper >= Mid:
	print(ip.upper())
else:
	print(ip.lower())


def transform(word):
	howManyUpper = len([ch for ch in word if ch.isupper()])
	if howManyUpper > len(word) - howManyUpper:
		return word.upper()
	return word.lower()
print(transform(input()))


inp = input()
count1 = 0
for i in inp:
	if ord(i) >= 65 and ord(i) <= 90:
		count1 += 1
	else:
		count1 -= 1
if count1 > 0:
	print(inp.upper())
else:
	print(inp.lower())


l = input()
ans1 = 0
ans2 = 0
for i in range(len(l)):
	if 'a' <= l[i] <= 'z':
		ans1 += 1
	else:
		ans2 += 1
if ans1 >= ans2:
	print(l.lower())
else:
	print(l.upper())


s = str(input())
(lc, uc) = (0, 0)
for i in s:
	if ord(i) >= 97:
		lc += 1
	else:
		uc += 1
if uc > lc:
	print(s.upper())
else:
	print(s.lower())


s = input()
c = sum((True for i in s if 65 <= ord(i) <= 90))
print(s.lower()) if len(s) - c >= c else print(s.upper())


upperCount = 0
lowerCount = 0
str1 = input()
for i in str1:
	if i.isupper():
		upperCount += 1
	else:
		lowerCount += 1
if upperCount > lowerCount:
	print(str1.upper())
elif upperCount < lowerCount:
	print(str1.lower())
else:
	print(str1.lower())


str1 = input()
low = 0
up = 0
for i in str1:
	if i.islower():
		low = low + 1
	else:
		up = up + 1
if low > up or low == up:
	print(str1.lower())
else:
	print(str1.upper())


s = input()
print(s.lower() if sum([1 if ch.islower() else -1 for ch in s]) >= 0 else s.upper())


ip = input()
(cs, cc) = (0, 0)
for i in ip:
	if i.islower():
		cs += 1
	elif i.isupper():
		cc += 1
if cc > cs:
	print(ip.upper())
else:
	print(ip.lower())


n = input()
uppercase = 0
lowercase = 0
for character in n:
	if character.isupper():
		uppercase += 1
	else:
		lowercase += 1
if uppercase <= lowercase:
	print(n.lower())
else:
	print(n.upper())


def main():
	s = input()
	z = s.lower()
	f = s.upper()
	i = 0
	count1 = 0
	count2 = 0
	while i < len(s):
		if s[i] == z[i]:
			count1 += 1
		else:
			count2 += 1
		i += 1
	if count1 >= count2:
		print(z)
	else:
		print(f)
main()


a = input()
u = []
l = []
for i in range(len(a)):
	if a[i].isupper():
		u.append(a[i])
	else:
		l.append(a[i])
if len(u) == len(l) or len(u) < len(l):
	print(a.lower())
else:
	print(a.upper())


s = input()
count_lower = 0
count_upper = 0
for i in s:
	if i == i.lower():
		count_lower += 1
	if i == i.upper():
		count_upper += 1
if count_lower > count_upper:
	print(s.lower())
elif count_upper > count_lower:
	print(s.upper())
else:
	print(s.lower())


def Upper_Down(x):
	c = 0
	y = x.upper()
	for i in range(len(x)):
		if x[i] == y[i]:
			c += 1
	if c > len(x) / 2:
		print(y)
	else:
		print(x.lower())
s = input()
Upper_Down(s)


def f(s):
	upp = 0
	for i in range(len(s)):
		if s[i].isupper():
			upp += 1
	if upp > len(s) - upp:
		print(s.upper(), end='')
	else:
		print(s.lower(), end='')
s = input()
f(s)


s = input()
a = []
for m in s:
	if m in 'QWERTYUIOPASDFGHJKLZXCVBNM':
		a += m
if len(a) * 2 > len(s):
	print(s.upper())
else:
	print(s.lower())


string = input()
caps = sum(map(str.isupper, string))
smalls = sum(map(str.islower, string))
if caps > smalls:
	print(string.upper())
else:
	print(string.lower())


a = list(input())
l = 0
u = 0
for i in range(len(a)):
	if a[i].islower():
		l += 1
	elif a[i].isupper():
		u += 1
if l >= u:
	for i in range(len(a)):
		a[i] = a[i].lower()
else:
	for i in range(len(a)):
		a[i] = a[i].upper()
print(*a, sep='')


def check(a, b, st):
	if a > b:
		return st.upper()
	elif a == b:
		return st.lower()
	else:
		return st.lower()
st = input().rstrip()
(count_upper, count_lower) = (0, 0)
for i in st:
	if i.isupper():
		count_upper += 1
	else:
		count_lower += 1
result = check(count_upper, count_lower, st)
print(result)


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
word = f_input().replace('\n', '')
upper_cases = sum([1 if i.isupper() else 0 for i in word])
f_print(word.upper() if upper_cases > len(word) // 2 else word.lower())


word = str(input())
(low, up) = (0, 0)
for w in word:
	if w.isupper():
		up += 1
	else:
		low += 1
if low == up:
	print(word.lower())
elif low < up:
	print(word.upper())
else:
	print(word.lower())


slovo = input()
upper_count = 0
lower_count = 0
for ii in slovo:
	if ord(ii) in range(ord('A'), ord('Z') + 1):
		upper_count += 1
	else:
		lower_count += 1
if upper_count > lower_count:
	print(slovo.upper())
else:
	print(slovo.lower())


a = input()
b = a.upper()
c = a.lower()
l1 = [i for i in b]
l2 = [i for i in c]
l3 = [i for i in a]
u = [value for value in l3 if value in l1]
l = [value for value in l3 if value in l2]
if len(u) <= len(l):
	print(c)
else:
	print(b)


n = input('')
lw = 0
up = 0
for i in n:
	if i.isupper():
		up += 1
	else:
		lw += 1
if up < lw or up == lw:
	b = n.lower()
else:
	b = n.upper()
print(b)


def solve():
	words = input()
	n = len(words)
	upper_count = sum([1 for s in words if str.isupper(s)])
	lower_count = n - upper_count
	if upper_count > lower_count:
		words = words.upper()
	else:
		words = words.lower()
	print(words)
solve()


s = input()
abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
minabc = abc.lower()
mayus = []
minus = []
for i in s:
	for a in abc:
		if i == a:
			mayus.append(i)
	for a in minabc:
		if i == a:
			minus.append(i)
if len(mayus) > len(minus):
	print(s.upper())
if len(mayus) < len(minus):
	print(s.lower())
if len(mayus) == len(minus):
	print(s.lower())


s = input()
s1 = list(s)
c = 0
c1 = 0
for i in s1:
	if i == i.lower():
		c += 1
	elif i == i.upper():
		c1 += 1
if c >= c1:
	print(s.lower())
else:
	print(s.upper())


s = input()
h = 0
l = 0
for i in s:
	if ord('A') <= ord(i) <= ord('Z'):
		h += 1
	else:
		l += 1
if l >= h:
	print(s.lower())
else:
	print(s.upper())


x = input()
b = 0
s = 0
l = []
for i in range(len(x)):
	l.append(x[i])
for i in l:
	if i.isupper():
		b += 1
	else:
		s += 1
for i in range(len(l)):
	if b > s:
		if l[i].islower():
			p = ord(l[i]) - 32
			l[i] = chr(p)
	elif l[i].isupper():
		q = ord(l[i]) + 32
		l[i] = chr(q)
g = ''.join(l)
print(g)


w = input()
A = 0
a = 0
for i in w:
	if 'a' <= i <= 'z':
		a += 1
	else:
		A += 1
if a >= A:
	print(w.lower())
else:
	print(w.upper())


word = list(input())
(u, l) = (0, 0)
for letter in word:
	i = ord(letter)
	if i < 97:
		u += 1
	else:
		l += 1
r_word = ''
if u > l:
	for letter in word:
		r_word += letter.upper()
else:
	for letter in word:
		r_word += letter.lower()
print(r_word)


n = input()
l = [str(x) for x in n]
dx = 0
xx = 0
for i in n:
	if ord(i) < 97:
		dx += 1
	else:
		xx += 1
if dx <= xx:
	print(n.lower())
else:
	print(n.upper())


string = input()
small = 0
capital = 0
for char in string:
	if ord(char) >= 97:
		small += 1
	else:
		capital += 1
if small >= capital:
	print(str.lower(string))
else:
	print(str.upper(string))


s = input()
a = 0
b = 0
for i in s:
	if 'A' <= i <= 'Z':
		a = a + 1
	else:
		b = b + 1
if a <= b:
	s = s.lower()
else:
	s = s.upper()
print(s)


word = input()
scoreup = 0
scoredown = 0
for i in range(len(word)):
	if word[i].isupper():
		scoreup = scoreup + 1
	else:
		scoredown = scoredown + 1
if scoreup > scoredown:
	print(word.upper())
else:
	print(word.lower())


(res, res1) = (0, 0)
s = str(input())
for i in s:
	if i.islower():
		res += 1
	else:
		res1 += 1
print(s.lower() if res > res1 or res == res1 else s.upper())


s = input()
nupper = nlower = 0
for letter in list(s):
	nupper += letter.isupper()
	nlower += letter.islower()
print(s.lower()) if nlower >= nupper else print(s.upper())


try:
	s = ''
	s = input()
	l = len(s)
	a = 0
	b = 0
	for i in range(l):
		if s[i].isupper():
			a += 1
		else:
			b += 1
	if a > b:
		s = s.upper()
		print(s)
	else:
		s = s.lower()
		print(s)
except:
	pass


import math
import os
import random
import re
import sys
A = input()
b = 0
c = 0
for x in A:
	if x.islower():
		b = b + 1
	elif x.isupper():
		c = c + 1
if b >= c:
	v = A.lower()
else:
	v = A.upper()
print(v)


str1 = input()
lc = 0
uc = 0
n = len(str1)
for i in range(0, n):
	if ord(str1[i]) >= 65 and ord(str1[i]) <= 90:
		uc += 1
	else:
		lc += 1
if uc <= lc:
	str1 = str1.lower()
else:
	str1 = str1.upper()
print(str1)


n = list(input())
m = ''.join(n)

def Count(m):
	(upper, lower) = (0, 0)
	for i in range(len(m)):
		if m[i].isupper():
			upper += 1
		else:
			lower += 1
	if 's' in n or 'S' in n:
		if upper > lower:
			print(m.upper())
		elif lower > upper:
			print(m.lower())
		else:
			print(m.lower())
	elif upper > lower:
		print(m.upper())
	elif upper == lower:
		print(m.lower())
	else:
		print(m.lower())
Count(m)


n = input()
upper = 0
lower = 0
i = 0
j = 0
for i in range(len(n)):
	if n[i].isupper() is True:
		upper += 1
	else:
		lower += 1
	i += 1
if upper == lower or upper < lower:
	print(n.lower())
else:
	print(n.upper())


wrd = input()
lc = 0
rc = 0
for i in wrd:
	if i == i.lower():
		lc += 1
	else:
		rc += 1
if lc >= rc:
	print(wrd.lower())
else:
	print(wrd.upper())


stinp = str(input())
lower = []
upper = []
if len(stinp) not in range(1, 101):
	print('Limit exceeded.')
else:
	for i in stinp:
		if i.islower():
			lower.append(i)
		else:
			upper.append(i)
	if len(lower) > len(upper):
		print(stinp.lower())
	elif len(lower) < len(upper):
		print(stinp.upper())
	else:
		print(stinp.lower())


st = input()
(lower, higher) = (0, 0)
for i in range(len(st)):
	if st[i].islower():
		lower += 1
	else:
		higher += 1
if lower > higher:
	print(st.lower())
elif higher > lower:
	print(st.upper())
else:
	print(st.lower())


a = list(input())
low = 0
high = 0
for i in a:
	if i.islower():
		low += 1
	else:
		high += 1
if high > low:
	for ele in a:
		a[a.index(ele)] = ele.upper()
	print(''.join(a))
else:
	for ele in a:
		a[a.index(ele)] = ele.lower()
	print(''.join(a))


s = input()
cap = 0
low = 0
for i in s:
	x = ord(i)
	if 65 <= x <= 90:
		cap += 1
	else:
		low += 1
if cap == low:
	print(s.lower())
elif cap > low:
	print(s.upper())
else:
	print(s.lower())


s = [*input()]
l = len(s)
a = 0
for i in range(l):
	if s[i].islower():
		a += 1
if a >= (l + 1) // 2:
	print(''.join(s).lower())
else:
	print(''.join(s).upper())


s = input()
l = s.upper()
i = 0
a = 0
while i < len(s):
	if s[i] == l[i]:
		a = a + 1
	i = i + 1
if a * 2 > len(s):
	print(l)
else:
	print(s.lower())


s = input()
nLo = 0
for c in s:
	if c == c.lower():
		nLo += 1
nHi = len(s) - nLo
if nHi > nLo:
	print(s.upper())
else:
	print(s.lower())


letters = input()
count_u = 0
count_l = 0
for letter in letters:
	if letter.isupper() == True:
		count_u = count_u + 1
	else:
		count_l = count_l + 1
if count_u > count_l:
	print(letters.upper())
else:
	print(letters.lower())


s = input()
c = sum((1 for i in s if ord(i) > 96))
if c >= (len(s) + 1) // 2:
	print(s.lower())
else:
	print(s.upper())


x = input()
low_case = 0
up_case = 0
for i in range(len(x)):
	if x[i].isupper():
		up_case += 1
	else:
		low_case += 1
if up_case > low_case:
	print(x.upper())
else:
	print(x.lower())


n = input()
up_letters = 0
lower_letters = 0
for i in n:
	if i.lower() == i:
		lower_letters += 1
	else:
		up_letters += 1
if up_letters > lower_letters:
	n = n.upper()
else:
	n = n.lower()
print(n)


import string
s = str(input())
w = []
e = []
a = string.ascii_uppercase
b = string.ascii_lowercase
for i in s:
	if i in a:
		w.append(1)
	else:
		e.append(1)
if sum(w) > sum(e):
	print(s.upper())
else:
	print(s.lower())


word = input()
nCap = sum((1 for v in word if v.isupper()))
nLow = sum((1 for v in word if v.islower()))
if nCap > nLow:
	print(word.upper())
else:
	print(word.lower())


a = list(input())
(result, m) = (0, 0)
(b, c) = ([], [])
for x in range(len(a)):
	if a[x].isupper():
		result = result + 1
		b.append(x)
	elif a[x].islower():
		m = m + 1
		c.append(x)
if m >= result:
	for i in range(len(b)):
		for j in range(b[i], b[i] + 1):
			a[j] = a[j].lower()
elif m < result:
	for i in range(len(c)):
		for j in range(c[i], c[i] + 1):
			a[j] = a[j].upper()
for n in range(len(a)):
	print(a[n], end='')


T = input()
U = 0
L = 0
for I in T:
	if I.isupper():
		U += 1
	elif I.islower():
		L += 1
if U > L:
	print(T.upper())
else:
	print(T.lower())


n = input()
c = 0
for i in n:
	if i.isupper() == True:
		c += 1
if c > int(len(n) / 2):
	print(n.upper())
else:
	print(n.lower())


s = input()
a = [ord(i) for i in s]
u = 0
l = 0
for j in a:
	if j >= 65 and j <= 90:
		u += 1
	elif j >= 97 and j <= 122:
		l += 1
if u > l:
	for k in range(len(a)):
		if a[k] >= 97 and a[k] <= 122:
			a[k] = chr(a[k] - 32)
		else:
			a[k] = chr(a[k])
else:
	for k in range(len(a)):
		if a[k] >= 65 and a[k] <= 90:
			a[k] = chr(a[k] + 32)
		else:
			a[k] = chr(a[k])
print(''.join(a))


def count(s):
	upper = 0
	lower = 0
	new = ''
	for i in s:
		if ord(i) >= 97:
			lower += 1
		else:
			upper += 1
	if upper > lower:
		for i in s:
			if ord(i) >= 97:
				new += chr(ord(i) - 32)
			else:
				new += i
	if upper <= lower:
		for i in s:
			if ord(i) < 97:
				new += chr(ord(i) + 32)
			else:
				new += i
	return new
s = input()
print(count(s))


n = input()
p = sum((1 for i in n if ord(i) > 96))
if p >= (len(n) + 1) // 2:
	print(n.lower())
else:
	print(n.upper())


word = input()
is_small = []
is_capital = []
for x in range(0, len(word)):
	if word[x].islower():
		is_small.append(x)
	else:
		is_capital.append(x)
if len(is_small) > len(is_capital):
	print(word.lower())
elif len(is_small) == len(is_capital):
	print(word.lower())
else:
	print(word.upper())


s = input().strip()
S = list(s)
u = 0
l = 0
for t in S:
	if t.islower():
		l += 1
	else:
		u += 1
if u > l:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
numUpper = 0
numLower = 0
for c in s:
	if c.isupper():
		numUpper += 1
	else:
		numLower += 1
if numUpper > numLower:
	print(s.upper())
else:
	print(s.lower())


n = input()
low = 0
up = 0
for i in range(len(n)):
	if n[i].islower():
		low += 1
	else:
		up += 1
if up > low:
	print(n.upper())
else:
	print(n.lower())


str = input()
res = sum((x.isupper() for x in str))
if len(str) - res >= res:
	print(str.lower())
else:
	print(str.upper())


string = input()
uc = 0
lc = 0
ucc = ''
lcc = ''
for i in string:
	if ord(i) >= 65 and ord(i) <= 90:
		uc += 1
		ucc = ucc + i
		lcc = lcc + chr(ord(i) + 32)
	else:
		lc += 1
		lcc = lcc + i
		ucc = ucc + chr(ord(i) - 32)
if uc > lc:
	print(ucc)
else:
	print(lcc)


word = str(input())
count = [0, 0]
for letter in word:
	if letter.isupper():
		count[0] = count[0] + 1
	else:
		count[1] = count[1] + 1
if count[0] > count[1]:
	print(word.upper())
else:
	print(word.lower())


string = input()
small = 0
big = 0
for i in range(len(string)):
	if ord(string[i]) < 97:
		big += 1
	else:
		small += 1
if big > small:
	print(string.upper())
elif small >= big:
	print(string.lower())


str1 = input()
str2 = ''
COUNT = 0
count = 0
for i in range(len(str1)):
	if ord(str1[i]) < ord('a'):
		COUNT += 1
	else:
		count += 1
if COUNT > count:
	for i in range(len(str1)):
		if ord(str1[i]) >= ord('a'):
			x = ord(str1[i]) - 32
			str2 += chr(x)
		else:
			str2 += str1[i]
else:
	for i in range(len(str1)):
		if ord(str1[i]) < ord('a'):
			x = ord(str1[i]) + 32
			str2 += chr(x)
		else:
			str2 += str1[i]
print(str2)


string = str(input())
stringupper = string.upper()
stringlower = string.lower()
upper = 0
lower = 0
for i in range(0, len(string)):
	if string[i] == stringupper[i]:
		upper = upper + 1
	else:
		lower = lower + 1
if upper > lower:
	print(stringupper)
else:
	print(stringlower)


s = input()
u = 0
for c in s:
	u = u + 1 if ord(c) < 91 else u - 1
if u > 0:
	s = s.upper()
else:
	s = s.lower()
print(s)


word = input()
WORD = word.upper()
di = 0
for i in range(len(word)):
	if word[i] != WORD[i]:
		di += 1
if di < len(word) - di:
	print(WORD)
else:
	print(word.lower())


s = input()
u = d = 0
for i in s:
	if i == i.upper():
		u += 1
	else:
		d += 1
print(s.upper() if u > d else s.lower())


str = input()
countWordsLower = 0
countWordsUpper = 0
if (len(str) >= 1 and len(str) <= 100) and str.isalpha() == True:
	for s in str:
		if s.isupper() == True:
			countWordsUpper += 1
		elif s.islower() == True:
			countWordsLower += 1
		else:
			pass
	if countWordsLower > countWordsUpper:
		str = str.lower()
	elif countWordsUpper > countWordsLower:
		str = str.upper()
	else:
		str = str.lower()
print(str)


l0 = input()
l1 = l0.upper()
l2 = l0.lower()
t = len(l0)
a = 0
b = 0
for i in range(t):
	if l0[i] == l1[i]:
		a += 1
	if l0[i] == l2[i]:
		b += 1
if a > b:
	print(l1)
else:
	print(l2)


def solution(st):
	uc = 0
	lc = 0
	for i in st:
		if 65 <= ord(i) <= 90:
			uc = uc + 1
		elif 97 <= ord(i) <= 122:
			lc = lc + 1
	if uc > lc:
		return st.upper()
	else:
		return st.lower()
s = input()
print(solution(s))


s = input()
(cap, low) = (0, 0)
for i in range(len(s)):
	if s[i].isupper() == True:
		cap += 1
low = len(s) - cap
ans = ''
if low >= cap:
	for i in range(len(s)):
		ans += s[i].lower()
else:
	for i in range(len(s)):
		ans += s[i].upper()
print(ans)


a = input()
vi = 0
ni = 0
for i in range(len(a)):
	if chr(96) >= a[i] >= chr(65):
		vi += 1
	else:
		ni += 1
if ni > vi or ni == vi:
	print(a.lower())
else:
	print(a.upper())


import string
word = input()
count_lower = 0
count_upper = 0
for i in word:
	if 'a' <= i <= 'z':
		count_lower += 1
	else:
		count_upper += 1
if count_lower >= count_upper:
	print(word.lower())
else:
	print(word.upper())


n = input()
print([n.lower(), n.upper()][sum(map(str.isupper, n)) > len(n) / 2])


b = 0
c = 0
a = 'abcdefgthijklmnopqrstuvwxyz'
s = input()
for i in s:
	if i in a:
		b = b + 1
	else:
		c = c + 1
if b == c or b > c:
	print(s.lower())
else:
	print(s.upper())


m = M = 0
cadena = input()
longitud = len(cadena)
for i in range(longitud):
	if cadena[i] >= 'a' and cadena[i] <= 'z':
		m = m + 1
	elif cadena[i] >= 'A' and cadena[i] <= 'Z':
		M = M + 1
if m >= M:
	cadena = cadena.lower()
else:
	cadena = cadena.upper()
print(cadena)


def word(s):
	up = 0
	for i in s:
		if i.isupper():
			up += 1
	l = len(s) // 2
	if up > l:
		return s.upper()
	return s.lower()
x = input()
print(word(x))


x = input()
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
b = 'abcdefghijklmnopqrstuvwxyz'
count = 0
count2 = 0
for i in x:
	if i in a:
		count += 1
	else:
		count2 += 1
if count2 >= count:
	v = x.lower()
elif count > count2:
	v = x.upper()
print(v)


s = input()
n = len(s)
c = sum([1 for i in s if i.isupper() == True])
if c > n - c:
	print(s.upper())
else:
	print(s.lower())


a = input()
l = 0
u = 0
for i in range(len(a)):
	if ord(a[i]) >= 97 and ord(a[i]) <= 122:
		l += 1
	else:
		u += 1
if u > l:
	print(a.upper())
else:
	print(a.lower())


Word = input()
LowerCase = 0
UpperCase = 0
for c in Word:
	if c.islower():
		LowerCase += 1
	else:
		UpperCase += 1
if LowerCase >= UpperCase:
	print(Word.lower())
else:
	print(Word.upper())


s = input()
cL = 0
cU = 0
for i in s:
	if i.islower():
		cL += 1
	else:
		cU += 1
if cL >= cU:
	print(s.lower())
else:
	print(s.upper())


def count_numbers(strings):
	l = 0
	n = 0
	for i in strings:
		if i.islower():
			l += 1
		else:
			l += 0
		n += 1
	list1 = [n, l]
	return list1

def main_args():
	a = input()
	b = count_numbers(a)
	if b[0] / 2 > b[1]:
		print(a.upper())
	else:
		print(a.lower())
main_args()


name = input()
l = u = 0
for c in name:
	if c >= 'a':
		l += 1
	else:
		u += 1
if u > l:
	print(name.upper())
else:
	print(name.lower())


s = input()
uc = 0
dc = 0
for x in s:
	if x.isupper():
		uc += 1
	else:
		dc += 1
if uc > dc:
	s = s.upper()
else:
	s = s.lower()
print(s)


n = input()
tot = 0
for i in list(n):
	if ord(i) > 96:
		tot += 1
if tot >= len(n) / 2:
	n = n.lower()
else:
	n = n.upper()
print(n)


import sys
import math
stra = str(input())
(u, l) = (0, 0)
for k in range(len(stra)):
	if stra[k].isupper():
		u += 1
	else:
		l += 1
if u > l:
	print(stra.upper())
elif u <= l:
	print(stra.lower())


s = input()
a = sum([x.isupper() for x in s])
b = len(s) - a
if a > b:
	print(s.upper())
else:
	print(s.lower())


s = input()
countA = 0
counta = 0
for i in range(len(s)):
	if s[i] >= 'A' and s[i] <= 'Z':
		countA = countA + 1
	elif s[i] >= 'a' and s[i] <= 'z':
		counta = counta + 1
if countA > counta:
	print(s.upper())
elif countA <= counta:
	print(s.lower())


a = input()
b = 0
c = 0
for i in range(len(a)):
	if a[i] >= 'a' and a[i] <= 'z':
		b += 1
	if a[i] >= 'A' and a[i] <= 'Z':
		c += 1
if b >= c:
	m = a.lower()
else:
	m = a.upper()
print(m)


input_s = input()
upper = 0
lower = 0
for i in range(len(input_s)):
	if ord(input_s[i]) >= ord('A') and ord(input_s[i]) <= ord('Z'):
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(input_s.upper())
else:
	print(input_s.lower())


w = str(input())
num = 0
for i in range(len(w)):
	if w[i].lower() == w[i]:
		num += 1
if num >= len(w) / 2:
	print(w.lower())
else:
	print(w.upper())


word = input()
uc = 0
lc = 0
for letters in word:
	if letters.isupper():
		uc += 1
	elif letters.islower():
		lc += 1
if uc > lc:
	print(word.upper())
elif lc > uc:
	print(word.lower())
elif uc == lc:
	print(word.lower())


upc = 0
loc = 0
word = input()
for i in range(len(word)):
	if word[i].isupper() == 1:
		upc += 1
	else:
		loc += 1
if upc > loc:
	print(word.upper())
else:
	print(word.lower())


s = input()
uppers = [c.isupper() for c in s].count(True)
if uppers * 2 > len(s):
	print(s.upper())
else:
	print(s.lower())


s = input()
cnt_upper = len([letter for letter in s if letter.isupper()])
cnt_lower = len([letter for letter in s if letter.islower()])
if cnt_lower >= cnt_upper:
	print(s.lower())
else:
	print(s.upper())


string = input()
low = sum((1 for c in string if c.islower()))
higher = sum((1 for c in string if c.isupper()))
if low >= higher:
	print(string.lower())
else:
	print(string.upper())


string = str(input())
count_upper = 0
count_lower = 0
for letter in string:
	if letter.isupper():
		count_upper += 1
	elif letter.islower:
		count_lower += 1
word = ''
if count_lower >= count_upper:
	for letter in string:
		word += letter.lower()
else:
	for letter in string:
		word += letter.upper()
print(word)


a = input()
up = 0
lw = 0
for i in range(len(a)):
	if a[i] in ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']:
		up += 1
	else:
		lw += 1
if up < lw:
	print(a.lower())
elif lw < up:
	print(a.upper())
elif up == lw:
	print(a.lower())


hh = input()
word = list(hh)
m = 0
n = 0
for i in range(len(word)):
	if ord(word[i]) > 96:
		n += 1
	else:
		m += 1
if m > n:
	print(hh.upper())
else:
	print(hh.lower())


s = input()
size = len(s)
cnt_upper = 0
cnt_lower = 0
for i in range(size):
	if s[i].islower():
		cnt_lower += 1
	elif s[i].isupper():
		cnt_upper += 1
if cnt_lower >= cnt_upper:
	print(s.lower())
else:
	print(s.upper())


word = str(input())
up = 0
low = 0
for n in range(int(len(word))):
	if word[n].islower() == True:
		low += 1
	else:
		up += 1
if up > low:
	print(word.upper())
else:
	print(word.lower())


s = input()
up = 0
down = 0
for each in s:
	if each.isupper():
		up += 1
	else:
		down += 1
if up > down:
	print(s.upper())
elif up == down:
	print(s.lower())
else:
	print(s.lower())


n = input()
sl = sum((1 for i in n if i.islower()))
su = sum((1 for i in n if i.isupper()))
if sl == su:
	print(n.lower())
elif sl < su:
	print(n.upper())
else:
	print(n.lower())


t = input()
c = 0
l = 0
for i in range(len(t)):
	if t[i].isupper():
		c += 1
	else:
		l += 1
if c > l:
	for i in range(len(t)):
		print(t[i].capitalize(), end='')
elif c <= l:
	for i in range(len(t)):
		print(t[i].lower(), end='')


word = input()
print(word.upper() if len([c for c in word if c.isupper()]) > len([c for c in word if c.islower()]) else word.lower())


line = input()
upper = 0
lower = 0
for i in range(len(line)):
	if line[i].islower():
		lower += 1
	else:
		upper += 1
if lower > upper or lower == upper:
	print(line.lower())
else:
	print(line.upper())


wrd = input()
low = [1 for i in wrd if ord(i) > 96]
print(wrd.lower() if sum(low) >= len(wrd) - sum(low) else wrd.upper())


def opt(s):
	(u, l) = (0, 0)
	for i in s:
		if ord(i) in range(65, 91):
			u += 1
		else:
			l += 1
	if l >= u:
		return True
	else:
		return False
x = input()
if opt(x) == True:
	print(x.lower())
else:
	print(x.upper())


s = input()
up = 0
lo = 0
for ch in s:
	if ch.isupper() == True:
		up += 1
	elif ch.islower() == True:
		lo += 1
if up == lo or lo > up:
	print(s.lower())
else:
	print(s.upper())


a = input()
c = 0
for i in range(len(a)):
	if a[i].isupper():
		c = c + 1
if c > len(a) - c:
	a = a.upper()
else:
	a = a.lower()
print(a)


def s():
	s = input()
	num_upper = 0
	num_lower = 0
	for i in s:
		if ord(i) <= 90:
			num_upper += 1
		else:
			num_lower += 1
	if num_lower >= num_upper:
		for i in range(len(s)):
			if ord(s[i]) < 91:
				s = s[0:i] + chr(ord(s[i]) + 32) + s[i + 1:len(s)]
	else:
		for i in range(len(s)):
			if ord(s[i]) > 90:
				s = s[0:i] + chr(ord(s[i]) - 32) + s[i + 1:len(s)]
	print(s)
s()


s = input()
print([s.lower(), s.upper()][sum((1 for x in s if x.isupper())) > [(len(s) - 1) // 2, len(s) // 2][len(s) % 2 == 0]])


s = input()
x1 = 0
y1 = 0
for i in s:
	if i.isupper():
		x1 += 1
	else:
		y1 += 1
if x1 > y1:
	print(s.upper())
else:
	print(s.lower())


ss = input()
s = list(ss)
low = 0
up = 0
for i in s:
	if i.islower():
		low += 1
	else:
		up += 1
if low >= up:
	print(ss.lower())
else:
	print(ss.upper())


def Word():
	word = list(input().strip())
	up_cnt = sum(map(lambda x: x.isupper(), word))
	low_cnt = sum(map(lambda x: x.islower(), word))
	if up_cnt > low_cnt:
		return ''.join(word).upper()
	else:
		return ''.join(word).lower()
a = Word()
print(a)


word = input()
count1 = 0
count2 = 0
index = 0
while index < len(word):
	if word[index].islower():
		count1 = count1 + 1
	elif word[index].isupper():
		count2 = count2 + 1
	index = index + 1
if count1 >= count2:
	print(word.lower())
else:
	print(word.upper())


w = input()
u = [i for i in w if i.isupper()]
l = [j for j in w if j.islower()]
if len(u) > len(l):
	print(w.upper())
else:
	print(w.lower())


word = input()
numupper = 0
numlower = 0
for i in word:
	if i.isupper():
		numupper += 1
	else:
		numlower += 1
if numupper != 0 and numlower != 0:
	if numupper > numlower:
		print(word.upper())
		exit()
	if numupper < numlower:
		print(word.lower())
		exit()
	else:
		print(word.lower())
		exit()
else:
	print(word)


sa = input()
sa2 = sa.lower()
upper = 0
for x in range(len(sa)):
	if sa[x] != sa2[x]:
		upper += 1
lower = len(sa) - upper
if upper > lower:
	print(sa.upper())
else:
	print(sa.lower())


s = input()
countUpper = 0
countLower = 0
for x in s:
	if x.isupper():
		countUpper += 1
	else:
		countLower += 1
if countUpper > countLower:
	print(s.upper())
else:
	print(s.lower())


import sys
word = sys.stdin.readline()[:-1]
lower_num = 0
upper_num = 0
for i in range(len(word)):
	if word[i].islower():
		lower_num += 1
	else:
		upper_num += 1
if upper_num > lower_num:
	output_word = word.upper()
else:
	output_word = word.lower()
print(output_word)


n = input()
q = 0
p = 0
down = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
m = list(n)
while p < len(m):
	a = m[p]
	z = a in down
	if z == True:
		q = q + 1
	p = p + 1
if q >= len(m) / 2:
	n = n.lower()
else:
	n = n.upper()
print(n)


s = input()
u = []
l = []
for i in s:
	if i == i.upper():
		u.append(i)
	else:
		l.append(i)
if len(u) > len(l):
	print(f'{s.upper()}')
else:
	print(f'{s.lower()}')


s = input()
(caps, lower) = (0, 0)
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		caps += 1
	else:
		lower += 1
if caps > lower:
	print(s.upper())
else:
	print(s.lower())


def solve(a):
	countL = 0
	countU = 0
	for c in a:
		if c.islower() == True:
			countL += 1
		else:
			countU += 1
	if countL < countU:
		a = a.upper()
	else:
		a = a.lower()
	print(a)
a = input()
solve(a)


a = input()
lower_count = 0
upper_count = 0
for i in a:
	if i.isupper():
		upper_count += 1
	else:
		lower_count += 1
if upper_count < lower_count:
	print(a.lower())
elif upper_count == lower_count:
	print(a.lower())
else:
	print(a.upper())


s = 0
u = 0
n = input()
for i in n:
	if ord(i) >= 97 and ord(i) < 123:
		s += 1
	else:
		u += 1
if s >= u:
	print(n.lower())
else:
	print(n.upper())


import sys
for s in sys.stdin:
	s = s.replace('\n', '')
	uppers = 0
	length = len(s)
	for w in s:
		if w.isupper():
			uppers += 1
	if uppers > length / 2:
		print(s.upper())
	else:
		print(s.lower())


nstr = input()
length = len(nstr)
cupper = 0
clower = 0
for i in range(0, length):
	if nstr[i].isupper():
		cupper = cupper + 1
	else:
		clower = clower + 1
if clower >= cupper:
	for i in range(0, length):
		print(nstr[i].lower(), end='')
else:
	for i in range(0, length):
		print(nstr[i].upper(), end='')


s = input()
l = len(s)
count = 0
count1 = 0
for i in range(len(s)):
	if s[i].isupper():
		count = count + 1
	if s[i].islower():
		count1 = count1 + 1
if count1 >= count:
	s1 = s.lower()
	print(s1)
else:
	s1 = s.upper()
	print(s1)


enter = input()
upper = 0
lower = 0
for c in enter:
	if c.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(enter.upper())
else:
	print(enter.lower())


s = str(input())
v = [c for c in s]
upper = 0
for c in v:
	if c.isupper():
		upper += 1
if upper <= len(v) - upper:
	print(s.lower())
else:
	print(s.upper())


given = str(input())
upper = given.upper()
numup = 0
numlow = 0
for i in range(0, len(given)):
	if given[i] == upper[i]:
		numup += 1
	else:
		numlow += 1
if numup > numlow:
	print(upper)
else:
	print(given.lower())


import sys
input = sys.stdin.readline

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

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

def insr():
	s = input()
	return list(s[:len(s - 1)])

def invr():
	return map(int, input().split())
s = input()[:-1]
u = 0
for c in s:
	if c.isupper():
		u += 1
if u >= len(s) // 2 + 1:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
c = s1 = 0
for i in range(len(s)):
	if s[i] in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		c = c + 1
	else:
		s1 = s1 + 1
if s1 > c:
	print(s.lower())
elif c > s1:
	print(s.upper())
else:
	print(s.lower())


word = input()
small = 0
big = 0
for i in word:
	if 'A' <= i <= 'Z':
		big += 1
	elif 'a' <= i <= 'z':
		small += 1
if small > big:
	print(word.lower())
elif small < big:
	print(word.upper())
else:
	print(word.lower())


orig = input()
string1 = orig
string2 = orig
low = orig.lower()
up = orig.upper()
for i in list(up):
	string1 = string1.replace(i, '')
for i in list(low):
	string2 = string2.replace(i, '')
if len(string2) > len(string1):
	print(orig.upper())
else:
	print(orig.lower())


s = input()
upp = 0
low = 0
for i in s:
	if i >= 'a':
		low += 1
	else:
		upp += 1
if low >= upp:
	print(s.lower())
else:
	print(s.upper())


s = str(input())
c1 = c2 = 0
for x in s:
	if x.isupper():
		c1 += 1
	if x.islower():
		c2 += 1
if c1 > c2:
	print(s.upper())
else:
	print(s.lower())


s = input()
h = 0
l = 0
for i in range(len(s)):
	if s[i] >= 'A' and s[i] <= 'Z':
		h += 1
	elif s[i] >= 'a' and s[i] <= 'z':
		l += 1
if h > l:
	s = s.upper()
elif h < l:
	s = s.lower()
else:
	s = s.lower()
print(s)


a = list(input())
b = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
l = 0
k = 0
for i in a:
	if i in b:
		k += 1
	else:
		l += 1
if k > l:
	m = ''.join(a)
	print(m.upper())
else:
	m = ''.join(a)
	print(m.lower())


strg = input()
count = 0
count1 = 0
for i in strg:
	if i.islower():
		count = count + 1
	else:
		count1 = count1 + 1
if count1 > count:
	out = strg.upper()
elif count1 < count:
	out = strg.lower()
else:
	out = strg.lower()
print(out)


n = input()
counta = 0
countA = 0
for i in range(len(n)):
	if ord(n[i]) >= 97:
		counta += 1
	else:
		countA += 1
if countA > counta:
	print(n.upper())
else:
	print(n.lower())


a = input()
b = [i for i in a]
c = a.lower()
d = [i for i in c]
e = 0
f = 0
for i in range(len(a)):
	if d[i] > b[i]:
		e += 1
	else:
		f += 1
if e > f:
	print(a.upper())
else:
	print(c)


x = input()
l = 0
u = 0
for i in x:
	if i.islower() == True:
		l += 1
	else:
		u += 1
print(x.lower() if l > u or l == u else x.upper())


a = str(input())
b = list(a)
c = len(a)
d = 0
for x in range(0, c):
	if b[x].isupper():
		d += 1
e = c - d
if d > e:
	print(a.upper())
else:
	print(a.lower())


a = input()
b = list(a)
c = 0
d = 0
for i in b:
	if i.isupper():
		c += 1
	else:
		d += 1
if c > d:
	print(a.upper())
else:
	print(a.lower())


s = input()
l = []
l1 = []
for i in s:
	if i.islower():
		l.append(i)
	elif i.isupper():
		l1.append(i)
if len(l) < len(l1):
	print(s.upper())
else:
	print(s.lower())


def main():
	n = str(input())
	upper = 0
	lower = 0
	for i in range(0, len(n)):
		if n[i].isupper() == True:
			upper += 1
		else:
			lower += 1
	if lower >= upper:
		n = n.lower()
	if lower < upper:
		n = n.upper()
	print(n)
if __name__ == main():
	main()


n = input()
l = len(n)
c = 0
for i in range(l):
	if n[i].isupper():
		c = c + 1
if c > l - c:
	print(n.upper())
else:
	print(n.lower())


s = input()
n = len(s)
l = 0
u = 0
for i in s:
	if i.islower():
		l += 1
	elif i.isupper():
		u += 1
if u > n // 2:
	print(s.upper())
else:
	print(s.lower())


test = input()
countu = 0
countl = 0
for x in test:
	if x.isupper():
		countu = countu + 1
	else:
		countl = countl + 1
if countu < countl:
	print(test.lower())
elif countu > countl:
	print(test.upper())
else:
	print(test.lower())


a = input()
u_c = 0
l_c = 0
for el in a:
	if el.isupper():
		u_c += 1
	elif el.islower():
		l_c += 1
if u_c > l_c:
	print(a.upper())
else:
	print(a.lower())


w = input()
count = 0
for c in w:
	count += int(c.isupper())
print(w.upper() if count > len(w) // 2 else w.lower())


s = input()
s1 = ''
k = 0
for c in s:
	if 'A' <= c <= 'Z':
		k += 1
if k <= len(s) - k:
	for c in s:
		if 'A' <= c <= 'Z':
			s1 += chr(ord(c) + 32)
		else:
			s1 += c
else:
	for c in s:
		if 'a' <= c <= 'z':
			s1 += chr(ord(c) - 32)
		else:
			s1 += c
print(s1)


n = input()
low = 0
up = 0
for x in n:
	if x.isupper():
		up += 1
	else:
		low += 1
if low < up:
	print(n.upper())
else:
	print(n.lower())


import sys
try:
	sys.stdin = open('inputs.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
finally:
	input = sys.stdin.readline
	print = sys.stdout.write
word = input().strip()
lc = 0
for ch in word:
	if ch.islower():
		lc += 1
	else:
		lc -= 1
if lc >= 0:
	print(word.lower())
else:
	print(word.upper())


import sys

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

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

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

def rln(n):
	l = [None] * n
	for i in range(n):
		l[i] = int(rl())
	return l
a = input()
c_l = 0
for e in a:
	if e.islower():
		c_l += 1
c_u = len(a) - c_l
print(a.lower() if c_l >= c_u else a.upper())


def solve():
	s = input()
	count_lowercase = 0
	count_uppercase = 0
	for i in range(len(s)):
		if s[i].isupper():
			count_uppercase += 1
		else:
			count_lowercase += 1
	if count_uppercase > count_lowercase:
		s = s.upper()
	else:
		s = s.lower()
	print(s)
solve()


def countlower(n):
	c = 0
	for i in n:
		if i.islower():
			c = c + 1
	return c

def countupper(n):
	c = 0
	for i in n:
		if i.isupper():
			c = c + 1
	return c
n = input()
l = countlower(n)
u = countupper(n)
if l >= u:
	print(n.lower())
elif l < u:
	print(n.upper())


s = list(input())
f = ''.join(s)
a = 0
b = 0
for i in s:
	if i in [chr(x) for x in range(65, 91)]:
		a += 1
	else:
		b += 1
if a > b:
	print(f.upper())
else:
	print(f.lower())


s = input()
num = [0 if ord(i) > 91 else 1 for i in s]
u = num.count(1)
l = num.count(0)
if u > l:
	print(s.upper())
else:
	print(s.lower())


n = input()
da = 0
xiao = 0
for i in range(len(n)):
	if 63 < ord(n[i]) < 94:
		da += 1
	else:
		xiao += 1
if da > xiao:
	print(n.upper())
else:
	print(n.lower())


word = input()
l_letter = 0
b_letter = 0
for i in range(len(word)):
	if 97 <= ord(word[i]) <= 122:
		l_letter += 1
	else:
		b_letter += 1
if l_letter >= b_letter:
	word = word.lower()
else:
	word = word.upper()
print(word)


st = input()
lc = 0
uc = 0
for i in st:
	if i.isupper():
		uc += 1
	else:
		lc += 1
if lc >= uc:
	print(st.lower())
elif lc < uc:
	print(st.upper())


n = str(input())
lowercase = 0
uppercase = 0
for i in range(0, len(n)):
	if ord(n[i]) > 95:
		lowercase += 1
	else:
		uppercase += 1
if uppercase == lowercase:
	print(n.lower())
if uppercase > lowercase:
	print(n.upper())
if lowercase > uppercase:
	print(n.lower())


def low_up(word):
	lower_case = 0
	upper_case = 0
	for i in word:
		if i.islower():
			lower_case += 1
		else:
			upper_case += 1
	if lower_case >= upper_case:
		return word.lower()
	else:
		return word.upper()
word = input()
print(low_up(word))


n = input()
c1 = 0
c2 = 0
for i in n:
	if i.isupper():
		c1 = c1 + 1
	if i.islower():
		c2 = c2 + 1
if c1 > c2:
	print(n.upper())
else:
	print(n.lower())


s = input()
ss = s.upper()
tt = s.lower()
low = 0
up = 0
for i in range(len(s)):
	if ss[i] == s[i]:
		up += 1
	if tt[i] == s[i]:
		low += 1
if up > low:
	print(ss)
else:
	print(tt)


word = input()
if word.isalpha() is True:
	cap_le = sum((1 for c in word if c.isupper()))
	low_le = sum((1 for c in word if c.islower()))
	if cap_le > low_le:
		print(word.upper())
	else:
		print(word.lower())
else:
	print('Not a valid word.')


import string
s = input()
d = e = 0
for x in range(0, len(s)):
	if s[x] < 'a':
		d = d + 1
	else:
		e = e + 1
if d > e:
	print('', s.upper())
else:
	print('', s.lower())


import sys
word = sys.stdin.readline().strip()
state = 0
for letter in word:
	if letter.isupper():
		state += 1
	else:
		state -= 1
if state > 0:
	sys.stdout.write(word.upper())
else:
	sys.stdout.write(word.lower())


str = input()
c = 0
d = 0
for i in str:
	if i.isupper() is True:
		c = c + 1
	else:
		d = d + 1
if c > d:
	print(str.upper())
else:
	print(str.lower())


l = input()
n = len(l)
t = 0
for i in range(n):
	a = l[i]
	b = a.upper()
	if a == b:
		t += 1
if 2 * t > n:
	print(l.upper())
else:
	print(l.lower())


s = input()
up = 0
for item in s:
	if ord(item) < 97:
		up += 1
if len(s) - up < up:
	print(s.upper())
else:
	print(s.lower())


x = input()
count = 0
c = 0
for i in range(len(x)):
	if x[i].isupper():
		count = count + 1
	else:
		c = c + 1
if count <= c:
	print(x.lower())
else:
	print(x.upper())


a = input()
(b, c) = (0, 0)
for i in range(0, len(a)):
	if ord(a[i]) >= 65 and ord(a[i]) <= 90:
		b += 1
	else:
		c += 1
if b > c:
	print(a.upper())
else:
	print(a.lower())


s = [n for n in input()]
l = u = 0
for n in s:
	if ord(n) >= 65 and ord(n) <= 90:
		u += 1
	else:
		l += 1
if l >= u:
	for n in range(len(s)):
		if ord(s[n]) >= 65 and ord(s[n]) <= 90:
			s[n] = chr(ord(s[n]) + 32)
		else:
			continue
else:
	for n in range(len(s)):
		if ord(s[n]) >= 97 and ord(s[n]) <= 122:
			s[n] = chr(ord(s[n]) - 32)
		else:
			continue
for n in s:
	print(n, end='')


str = list(input())
countl = 0
countu = 0
for i in str:
	if ord(i) >= 97 and ord(i) <= 122:
		countl = countl + 1
	else:
		countu = countu + 1
str = ''.join(str)
if countu == countl or countl > countu:
	print(str.lower())
else:
	print(str.upper())


a = input()
low = high = 0
for i in a:
	if i.islower():
		low += 1
	else:
		high += 1
if low >= high:
	print(a.lower())
else:
	print(a.upper())


s = input()
cap = 0
sm = 0
for c in s:
	if c.isupper():
		cap += 1
	else:
		sm += 1
if cap > sm:
	print(s.upper())
else:
	print(s.lower())


S = input()
n = len(S)
xx = 0
for i in range(n):
	if ord('a') <= ord(S[i]) <= ord('z'):
		xx += 1
if 2 * xx >= n:
	print(S.lower())
else:
	print(S.upper())


x = input()
l = len(x)
c = 0
for i in range(0, l, 1):
	if ord(x[i]) >= 65 and ord(x[i]) <= 90:
		c = c + 1
if c > l // 2:
	print(x.upper())
else:
	print(x.lower())


lt = input()
a = b = 0
for i in lt:
	if i >= 'A' and i <= 'Z':
		a += 1
	else:
		b += 1
if a > b:
	print(lt.upper())
else:
	print(lt.lower())


arr = [a for a in input()]
cap = 0
small = 0
for x in arr:
	if ord(x) >= 65 and ord(x) <= 90:
		cap += 1
	if ord(x) >= 97 and ord(x) <= 122:
		small += 1
if cap > small:
	for x in range(len(arr)):
		if ord(arr[x]) >= 97 and ord(arr[x]) <= 122:
			arr[x] = chr(ord(arr[x]) - 32)
else:
	for x in range(len(arr)):
		if ord(arr[x]) >= 65 and ord(arr[x]) <= 90:
			arr[x] = chr(ord(arr[x]) + 32)
s = ''
for x in arr:
	s += x
print(s)


import sys
my_word = sys.stdin.readline
b = my_word()
if sum(map(str.islower, b)) < sum(map(str.isupper, b)):
	print(b.upper())
else:
	print(b.lower())


string = input()
up = 0
low = 0
for c in string:
	if ord('A') <= ord(c) <= ord('Z'):
		up += 1
low = len(string) - up
print(string.lower()) if low >= up else print(string.upper())


string = input()
upper_count = 0
lower_count = 0
for ch in string:
	if ord(ch) >= 97:
		lower_count += 1
	else:
		upper_count += 1
if upper_count > lower_count:
	print(string.upper())
else:
	print(string.lower())


s = input()
cnt1 = cnt2 = 0
for i in s:
	if i.islower():
		cnt1 += 1
	elif i.isupper():
		cnt2 += 1
if cnt1 >= cnt2:
	print(s.lower())
else:
	print(s.upper())


ALPHAs = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ARRs = list(ALPHAs)
s = input()
arr2 = list(s)
cg = 0
cl = 0
for k in s:
	if k in ARRs:
		cg += 1
	else:
		cl += 1
if cl >= cg:
	print(s.lower())
else:
	print(s.upper())


s = input()
cnt_lower = 0
cnt_upper = 0
for x in s:
	if x.islower():
		cnt_lower += 1
	else:
		cnt_upper += 1
if cnt_lower >= cnt_upper:
	print(s.lower())
else:
	print(s.upper())


s = input()
k_A = 0
k_a = 0
for x in s:
	if 'A' <= x <= 'Z':
		k_A += 1
	elif 'a' <= x <= 'z':
		k_a += 1
if k_A > k_a:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
s1 = len(s)
(m, M) = (0, 0)
for i in range(s1):
	if ord(s[i]) >= ord('a'):
		m += 1
	else:
		M += 1
l = ''
if m >= M:
	for i in range(s1):
		if ord(s[i]) >= ord('a'):
			l += s[i]
		else:
			l += chr(ord(s[i]) + ord('a') - ord('A'))
else:
	for i in range(s1):
		if ord(s[i]) >= ord('a'):
			l += chr(ord(s[i]) - ord('a') + ord('A'))
		else:
			l += s[i]
print(l)


str1 = input()
ups = []
lows = []
for i in str1:
	if i.isupper():
		ups.append(i)
	else:
		lows.append(i)
if len(ups) > len(lows):
	print(str1.upper())
else:
	print(str1.lower())


string = input()
(up, low) = (0, 0)
for l in string:
	if l.isupper():
		up += 1
	else:
		low += 1
if up <= low:
	print(string.lower())
else:
	print(string.upper())


s = input()
if len(s) > 0 and len(s) < 101:
	up = sum((1 for c in s if c.isupper()))
	lo = sum((1 for c in s if c.islower()))
	if up > lo:
		s = s.upper()
	else:
		s = s.lower()
	print(s)


a = input()

def diff(a, b):
	return sum((i != j for (i, j) in zip(a, b)))
print(a.lower() if diff(a, a.lower()) <= diff(a, a.upper()) else a.upper())


s = input()
(ku, kl) = (0, 0)
for i in s:
	if i.isupper():
		ku += 1
	else:
		kl += 1
if ku > kl:
	print(s.upper())
else:
	print(s.lower())


x = input()
c = 0
a = 0
for i in x:
	if ord(i) >= 65 and ord(i) <= 90:
		c = c + 1
	elif ord(i) >= 97 and ord(i) <= 122:
		a = a + 1
if c < a:
	print(x.lower())
elif c > a:
	print(x.upper())
elif c == a:
	print(x.lower())


s = list(input())
(l, u) = (0, 0)
for i in s:
	if i >= 'a' and i <= 'z':
		l += 1
	elif i >= 'A' and i <= 'Z':
		u += 1
string = ''.join(s)
if u > l:
	print(string.upper())
else:
	print(string.lower())


A = list(input())
n = len(A)
t = 0
i = 0
while i < n:
	if A[i] == A[i].upper():
		t += 1
	else:
		pass
	i = i + 1
if 2 * t > n:
	B = [i.upper() for i in A]
else:
	B = [i.lower() for i in A]
print(''.join(B))


n1 = input()
n = list(n1)
lwcount = 0
upcount = 0
for i in range(len(n)):
	if n[i].islower():
		lwcount += 1
	else:
		upcount += 1
if lwcount >= upcount:
	print(n1.lower())
else:
	print(n1.upper())


enter = input()
clower = 0
cupper = 0
for letter in enter:
	if letter.isupper():
		cupper += 1
	else:
		clower += 1
if clower > cupper:
	print(enter.lower())
elif clower < cupper:
	print(enter.upper())
elif clower == cupper:
	print(enter.lower())


s = input()
(cnt, pa) = (0, 0)
for i in s:
	if i.isupper():
		cnt += 1
	elif i.islower():
		pa += 1
if cnt > pa:
	print(s.upper())
else:
	print(s.lower())


inp = input()
count = 0
lenInp = len(inp)
for letter in inp:
	if letter.isupper():
		count += 1
if 2 * count > lenInp:
	print(inp.upper())
else:
	print(inp.lower())


try:
	s = input()
	l = len(s)
	u = 0
	p = 0
	s1 = ''
	for i in range(l):
		if s[i].isupper():
			u += 1
		else:
			p += 1
	if u > p:
		s1 = s.upper()
	else:
		s1 = s.lower()
	print(s1)
except:
	pass


word = input()
lowernum = 0
uppernum = 0
for i in list(word):
	if str(i).islower() is True:
		lowernum += 1
	else:
		uppernum += 1
if lowernum >= uppernum:
	print(str(word).lower())
else:
	print(str(word).upper())


a = input()
count = 0
vount = 0
for i in range(len(a)):
	if a[i].islower():
		count += 1
	else:
		vount += 1
if count > vount:
	print(a.lower())
elif vount > count:
	print(a.upper())
else:
	print(a.lower())


n = list(input())
counter1 = 0
counter2 = 0
for i in n:
	if i == i.upper():
		counter1 = counter1 + 1
	else:
		counter2 = counter2 + 1
if counter1 > counter2:
	s = ''.join(n)
	s = s.upper()
	print(s)
else:
	s = ''.join(n)
	s = s.lower()
	print(s)


word = input('')
if len(word) >= 1 and len(word) <= 100:
	upper_no = 0
	lower_no = 0
	new_word_upper = ''
	new_word_lower = ''
	for letter in word:
		if letter.isupper():
			upper_no += 1
			new_word_upper += letter
			new_word_lower += letter.lower()
		else:
			lower_no += 1
			new_word_lower += letter
			new_word_upper += letter.upper()
	if upper_no > lower_no:
		print(new_word_upper)
	else:
		print(new_word_lower)


a = input()
print([''.join(map(str.lower, a)), ''.join(map(str.upper, a))][sum((str.islower(x) for x in a)) < 0 - -len(a) // 2])


s = input()
uc = 0
lc = 0
for i in range(len(s)):
	if s[i].islower():
		lc += 1
	else:
		uc += 1
if uc > lc:
	print(s.upper())
else:
	print(s.lower())


lis = 'q w e r t y u i o p a s d f g h j k l z x c v b n m'
lip = lis.split()
pal = str(input())
cont = 0
for i in range(len(pal)):
	for j in lip:
		if j == pal[i]:
			cont = cont + 1
if cont > len(pal) - cont:
	pal1 = pal.lower()
elif cont < len(pal) - cont:
	pal1 = pal.upper()
else:
	pal1 = pal.lower()
print(pal1)


import sys
n = input()
pom = len(n)
pom2 = n
n = n.strip('ABCEDFGHIJKLMNOPQRSTUVWXYZ')
if pom - len(n) == pom // 2 or len(n) > pom // 2:
	print(pom2.lower())
else:
	print(pom2.upper())


string = input()
upper = 0
for a in string:
	if a.isupper():
		upper = upper + 1
if upper > len(string) / 2:
	print(string.upper())
else:
	print(string.lower())


def main():
	num_lower = 0
	num_upper = 0
	word = input()
	for i in range(len(word)):
		if word[i] <= 'Z' and word[i] >= 'A':
			num_upper += 1
		else:
			num_lower += 1
	if num_upper > num_lower:
		print(word.upper())
	else:
		print(word.lower())
main()


import string
x = input()
l = list(string.ascii_uppercase)
c = 0
for i in x:
	if i in l:
		c += 1
if c > len(x) / 2:
	print(x.upper())
else:
	print(x.lower())


word = input()
low = up = 0
for i in range(1, 27):
	up += word.count(chr(i + 64))
	low += word.count(chr(i + 96))
if up > low:
	print(word.upper())
else:
	print(word.lower())


tu = 0
tl = 0
w = input()
for i in w:
	if i.isupper():
		tu += 1
	else:
		tl += 1
if tu > tl:
	print(w.upper())
else:
	print(w.lower())


s = input()
import string
lc = len([c for c in s if c in string.ascii_lowercase])
uc = len([c for c in s if c in string.ascii_uppercase])
print(s.lower() if lc >= uc else s.upper())


s = [i for i in input()]
(lower, upper) = (0, 0)
for i in s:
	if str.islower(i):
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(''.join(s).lower())
else:
	print(''.join(s).upper())


from sys import stdin, stdout

def main() -> None:
	s = stdin.readline().rstrip('\n')
	len_ = len(s)
	upcnt = locnt = 0
	for i in range(len_):
		if s[i].isupper():
			upcnt += 1
		else:
			locnt += 1
	if upcnt > locnt:
		print(s.upper())
	else:
		print(s.lower())
	return None
main()


word = input()
lowerCount = 0
upperCount = 0
for i in word:
	if i.islower():
		lowerCount += 1
	elif i.isupper():
		upperCount += 1
if lowerCount > upperCount or lowerCount == upperCount:
	print(word.lower())
if upperCount > lowerCount:
	print(word.upper())


x = 0
w = input()
for a in w:
	if a.isupper():
		x = x + 1
if x > 0.5 * len(w):
	w = w.upper()
else:
	w = w.lower()
print(w)


s = input()
(j, k) = (0, 0)
for i in s:
	d = ord(i)
	if d > 64 and d < 91:
		j = j + 1
	else:
		k = k + 1
if j > k:
	print(s.upper())
else:
	print(s.lower())


word = input()
count1 = 0
count2 = 0
for char in word:
	if char.isupper():
		count1 += 1
	elif char.islower():
		count2 += 1
if count1 <= count2:
	print(word.lower())
else:
	print(word.upper())


n = input()
upp = low = 0
for i in n:
	if i.isupper():
		upp = upp + 1
	else:
		low = low + 1
if upp > low:
	print(n.upper())
else:
	print(n.lower())


s = input()
cap = 0
sm = 0
for i in s:
	if ord(i) < 91:
		cap += 1
	else:
		sm += 1
if cap > sm:
	for i in s:
		print(i.upper(), end='')
else:
	for i in s:
		print(i.lower(), end='')


s = input()
count = 0
t = 0
for i in s:
	if i >= 'a' and i <= 'z':
		count = count + 1
	elif i >= 'A' and i <= 'Z':
		t = t + 1
if t > count:
	print(s.upper())
else:
	print(s.lower())


INPUT_WORD = str(input())
LatinLow = 'abcdefghijklmnopqrstuvwxyz'
LatinUp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
LOWERCASE_NUM = 0
UPPERCASE_NUM = 0
for i in INPUT_WORD:
	if i in LatinLow:
		LOWERCASE_NUM += 1
	else:
		UPPERCASE_NUM += 1
if LOWERCASE_NUM >= UPPERCASE_NUM:
	print(INPUT_WORD.lower())
else:
	print(INPUT_WORD.upper())


s = input()
st = list(s)
low = []
upp = []
for i in st[:]:
	if i.islower():
		low.append(i)
	else:
		upp.append(i)
if len(low) == len(upp):
	s = s.lower()
elif len(upp) > len(low):
	s = s.upper()
else:
	s = s.lower()
print(s)


c = 0
l = 0
s = input()
for i in s:
	if i.isupper():
		c += 1
	else:
		l += 1
if c > l:
	print(s.upper())
elif c <= l:
	print(s.lower())


s = input()
(c, d) = (0, 0)
for a in s:
	if a.isupper() == True:
		d += 1
	else:
		c += 1
if c >= d:
	print(s.lower())
else:
	print(s.upper())


def main():
	a = input()
	c = 0
	for i in range(len(a)):
		if a[i] == a[i].upper():
			c += 1
	if c > len(a) / 2:
		print(a.upper())
	else:
		print(a.lower())
main()


def solve(str, n):
	(cl, cu) = (0, 0)
	for i in range(n):
		if str[i].islower():
			cl += 1
		else:
			cu += 1
	if cu > cl:
		return str.upper()
	return str.lower()
str = input()
n = len(str)
res = solve(str, n)
print(res)


w = str(input())
wu = [x for x in w if x in 'ASDFGHJKLPOIUYTREWQZXCVBNM']
wl = [y for y in w if y in 'asdfghjklpoiuytrewqzxcvbnm']
if len(wu) > len(wl):
	print(w.upper())
elif len(wl) > len(wu):
	print(w.lower())
else:
	print(w.lower())


s = input()
(uc, lc) = (0, 0)
for c in s:
	if c.isupper() == True:
		uc += 1
	else:
		lc += 1
if uc < lc:
	s = s.lower()
elif lc < uc:
	s = s.upper()
else:
	s = s.lower()
print(s)


word = str(input())
countlow = 0
countup = 0
for i in word:
	if i.islower():
		countlow += 1
	else:
		countup += 1
if countlow >= countup:
	word = word.lower()
else:
	word = word.upper()
print(word)


string = input()
count_up = 0
count_low = 0
for i in string:
	if i.isupper():
		count_up = count_up + 1
	else:
		count_low = count_low + 1
if count_up > count_low:
	print(string.upper())
else:
	print(string.lower())


n = str(input())
lower = n.lower()
higher = n.upper()
diffl = 0
diffh = 0
lens = len(n)
for i in range(lens):
	if n[i] != lower[i]:
		diffl += 1
	if n[i] != higher[i]:
		diffh += 1
if diffh >= diffl:
	print(lower)
else:
	print(higher)


Word = input()
WORD = list(Word.upper())
word = list(Word.lower())
Word = list(Word)
diff = lambda l1, l2: [x for x in l1 if x not in l2]
if len(diff(Word, WORD)) < len(diff(Word, word)):
	print(''.join(WORD))
else:
	print(''.join(word))


st = input()
low_cou = 0
upp_cou = 0
for i in st:
	if i.islower():
		low_cou += 1
	elif i.isupper():
		upp_cou += 1
if low_cou >= upp_cou:
	print(st.lower())
else:
	print(st.upper())


name = input()
count_low = 0
for char in name:
	if char.islower():
		count_low = count_low + 1
if count_low >= len(name) / 2:
	print(name.lower())
else:
	print(name.upper())


def word(s):
	c1 = 0
	c2 = 0
	for i in range(0, len(s)):
		if s[i].islower():
			c1 += 1
		if s[i].isupper():
			c2 += 1
	if c1 > c2:
		return s.lower()
	elif c2 > c1:
		return s.upper()
	else:
		return s.lower()
s = input()
res = word(s)
print(res)


word = input()
(count_up, count_down) = (0, 0)
for character in word:
	if character.isupper():
		count_up += 1
	else:
		count_down += 1
if count_up > count_down:
	print(word.upper())
else:
	print(word.lower())


a = input()
s = 0
c = 0
n = []
for i in range(len(a)):
	n.append(a[i])
for i in range(len(n)):
	if ord(n[i]) < 97:
		c += 1
	else:
		s += 1
if s == c or s > c:
	for i in range(len(n)):
		if ord(n[i]) < 97:
			n[i] = chr(ord(n[i]) + 32)
if c > s:
	for i in range(len(n)):
		if ord(n[i]) > 96:
			n[i] = chr(ord(n[i]) - 32)
q = ''
for i in range(len(n)):
	q = q + n[i]
print(q)


s = input()
ul = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
uc = 0
lc = 0
for i in s:
	if i in ul:
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(s.upper())
else:
	print(s.lower())


given = input()
(ucount, lcount) = (0, 0)
for x in given:
	if ord(x) < 91:
		ucount += 1
	else:
		lcount += 1
if lcount >= ucount:
	print(given.lower())
else:
	print(given.upper())


s = input()
ln = len(s)
c = 0
sm = 0
for i in range(ln):
	if s[i] <= 'Z':
		c += 1
	else:
		sm += 1
if c > sm:
	print(s.upper())
elif sm < c:
	print(s.lower())
else:
	print(s.lower())


s = [i for i in input()]
uc = 0
for j in s:
	if j.isupper():
		uc += 1
if uc > int(len(s) / 2):
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


s = list(input())
(lcou, ucou) = (0, 0)
for i in s:
	if ord(i) < 91:
		ucou += 1
	else:
		lcou += 1
if ucou > lcou:
	for i in range(len(s)):
		if ord(s[i]) >= 97:
			s[i] = chr(ord(s[i]) - 32)
else:
	for i in range(len(s)):
		if ord(s[i]) <= 90:
			s[i] = chr(ord(s[i]) + 32)
print(''.join(s))


s = input()
lower = 0
upper = 0
for each in s:
	if each.islower():
		lower += 1
	else:
		upper += 1
s1 = ''
if lower == upper or lower > upper:
	for each in s:
		s1 += each.lower()
else:
	for each in s:
		s1 += each.upper()
print(s1)


x = input()
upper = 0
lower = 0
for a in x:
	if a.isupper() == True:
		upper += 1
	elif a.islower() == True:
		lower += 1
	elif a.isspace() == True:
		continue
if upper > lower:
	print(x.upper())
else:
	print(x.lower())


s = input()
lowernum = 0
uppernum = 0
for x in s:
	if ord('a') <= ord(x) <= ord('z'):
		lowernum += 1
	else:
		uppernum += 1
if lowernum >= uppernum:
	print(s.lower())
else:
	print(s.upper())


lsOfStr = list(input())
lenOfLs = len(lsOfStr)
nLowercase = 0
nUppercase = 0
for i in range(lenOfLs):
	if lsOfStr[i].islower():
		nLowercase = nLowercase + 1
	else:
		nUppercase = nUppercase + 1
if nLowercase >= nUppercase:
	print(''.join(lsOfStr).lower())
else:
	print(''.join(lsOfStr).upper())


s = list(input())
(a, b) = (0, 0)
for i in range(len(s)):
	if s[i].isupper():
		a += 1
	elif s[i].islower():
		b += 1
if a > b:
	for i in range(len(s)):
		if s[i].islower():
			s[i] = s[i].upper()
if a <= b:
	for i in range(len(s)):
		if s[i].isupper():
			s[i] = s[i].lower()
for i in s:
	print(i, end='')


s = input()
ls = [0 if i.islower() else 1 for i in s]
lower = ls.count(0)
upper = ls.count(1)
print(s.upper() if upper > lower else s.lower())


n = input()
Count = 0
count = 0
for i in range(0, len(n)):
	if n[i] <= 'z' and n[i] >= 'a':
		count += 1
	else:
		Count += 1
if Count > count:
	print(n.upper())
else:
	print(n.lower())


word = list(map(str, input()))
upper = 0
lower = 0
for i in range(len(word)):
	if word[i].isupper():
		upper += 1
	else:
		lower += 1
word1 = ''
for k in range(len(word)):
	word1 += word[k]
if upper > lower:
	word = word1.upper()
else:
	word = word1.lower()
print(word)


(w, a, c) = (input(), ['abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'], [0, 0])
for i in w:
	if i in a[0]:
		c[0] += 1
	else:
		c[1] += 1
print(w.lower() if c[0] >= c[1] else w.upper())


s = input()
print(s.upper()) if sorted(s)[len(s) // 2].isupper() else print(s.lower())


str = input()
n_lower = 0
n_upper = 0
for c in str:
	if c.islower():
		n_lower += 1
	elif c.isupper():
		n_upper += 1
if n_upper > n_lower:
	print(str.upper())
else:
	print(str.lower())


n = input('')
count_l = 0
count_u = 0
for i in n:
	if ord(i) >= 65 and ord(i) <= 90:
		count_u += 1
	elif ord(i) >= 97 and ord(i) <= 122:
		count_l += 1
if count_u > count_l:
	print(n.upper())
else:
	print(n.lower())


def main():
	s = input()
	(lower, upper) = (0, 0)
	for i in s:
		if i.isupper():
			upper += 1
		else:
			lower += 1
	fl = True if lower >= upper else False
	if fl:
		s = s.lower()
	else:
		s = s.upper()
	print(s)
main()


(d, s) = (0, input())
for i in s:
	d += i.isupper()
if d > len(s) - d:
	print(s.upper())
else:
	print(s.lower())


def solve():
	lttrs = 'qwertyuiopasdfghjklzxcvbnm'
	minl = 0
	maxl = 0
	a = input()
	for i in a:
		if i in lttrs:
			minl += 1
		elif i == ' ':
			continue
		else:
			maxl += 1
	if minl >= maxl:
		return a.lower()
	else:
		return a.upper()
print(solve())


s = input()
s_s = s.lower()
i = 0
a = 0
b = 0
while i < len(s):
	if s[i] == s_s[i]:
		a += 1
	else:
		b += 1
	i += 1
if a > b:
	print(s_s)
elif a == b:
	print(s_s)
else:
	print(s.upper())


a = input()
print(a.upper() if [1 if 65 <= ord(x) <= 90 else 0 for x in a].count(1) > len(a) // 2 else a.lower())


word = input()
mys = list(word)
l = 0
u = 0
for x in mys:
	if x.islower():
		l += 1
	else:
		u += 1
if l >= u:
	print(word.lower())
else:
	print(word.upper())


s = str(input())
cnt = 0
for i in s:
	if i >= 'a' and i <= 'z':
		cnt += 1
j = len(s) - cnt
if cnt >= j:
	print(s.lower())
else:
	print(s.upper())


line = input()
lletters = 0
uletters = 0
for a in line:
	if a == a.upper():
		uletters += 1
	else:
		lletters += 1
if lletters < uletters:
	print(line.upper())
else:
	print(line.lower())


class Count:

	def __init__(self, word):
		upper = 0
		lower = 0
		for i in range(0, len(word)):
			if ord(word[i]) >= 97 and ord(word[i]) <= 122:
				lower += 1
			elif ord(word[i]) >= 65 and ord(word[i]) <= 90:
				upper += 1
		if lower == upper:
			print(word.lower())
		elif lower < upper:
			print(word.upper())
		elif upper < lower:
			print(word.lower())
word = str(input())
c = Count(word)


import string

def main():
	word = input()
	lower = 0
	upper = 0
	for c in word:
		if c.islower():
			lower += 1
		else:
			upper += 1
	if lower < upper:
		word = word.upper()
	else:
		word = word.lower()
	print(word)
main()


text = list(input())
z = 0
noz = 0
for letter in text:
	if letter == letter.upper():
		z += 1
	else:
		noz += 1
text = ''.join(text)
if z > noz:
	print(text.upper())
else:
	print(text.lower())


import sys
s = sys.stdin.readline().strip()
(u, l) = (0, 0)
for letter in s:
	if letter.isupper():
		u += 1
	else:
		l += 1
if u > l:
	sys.stdout.write(s.upper() + '\n')
else:
	sys.stdout.write(s.lower() + '\n')


n = input()
a = 0
A = 0
for i in n:
	if ord(i) < 91:
		A = A + 1
	else:
		a = a + 1
if a >= A:
	print(n.lower())
else:
	print(n.upper())


s = input()
n = len(s)
c = 0
d = 0
for i in s:
	n = ord(i)
	if n >= 97 and n <= 122:
		c = c + 1
	else:
		d = d + 1
ans = ''
if d > c:
	for i in s:
		ans = ans + i.upper()
else:
	for i in s:
		ans = ans + i.lower()
print(ans)


s = str(input())
up = 0
low = 0
for i in range(0, len(s)):
	if s[i].isupper() == True:
		up += 1
	else:
		low += 1
if up > low:
	res = s.upper()
else:
	res = s.lower()
print(res)


WORD = input()
word = list(WORD)
I = 0
l = 0
Upper = ('A', 'Q', 'Z', 'W', 'S', 'X', 'E', 'D', 'C', 'R', 'F', 'V', 'T', 'G', 'B', 'Y', 'H', 'N', 'U', 'J', 'M', 'I', 'K', 'O', 'L', 'P')
Lower = 26 * [0]
for i in range(len(Upper)):
	Lower[i] = Upper[i]
	Lower[i].lower()
for i in word:
	if i in Upper:
		I += 1
	else:
		l += 1
if I > l:
	print(WORD.upper())
else:
	print(WORD.lower())


word = input()
l = 0
c = 0
for i in range(len(word)):
	if word[i] in 'abcdefghijklmnopqrstuvwxyz':
		l += 1
	else:
		c += 1
if l >= c:
	print(word.lower())
else:
	print(word.upper())


s = str(input(''))
up = 0
l = 0
p = len(s)
for i in range(p):
	m = s[i]
	if m.isupper():
		up = up + 1
	else:
		l = l + 1
if l > up:
	print(s.lower())
elif l < up:
	print(s.upper())
else:
	print(s.lower())


vasyaInput = input()
upperLetter = 0
lowerLetter = 0
for ch in vasyaInput:
	if ch.isupper():
		upperLetter += 1
	elif ch.islower():
		lowerLetter += 1
if lowerLetter >= upperLetter:
	print(vasyaInput.lower())
else:
	print(vasyaInput.upper())


t = input()
nM = 0
nm = 0
for k in t:
	if k.isupper():
		nM += 1
	else:
		nm += 1
if nM > nm:
	print(t.upper())
else:
	print(t.lower())


import string
text = input('')
alphabet_string = string.ascii_lowercase
alphabet_list = list(alphabet_string)
alphabet_string1 = string.ascii_uppercase
alphabet_list1 = list(alphabet_string1)
lowercases = 0
uppercases = 0
for i in text:
	if i in alphabet_list:
		lowercases += 1
	else:
		uppercases += 1
if uppercases > lowercases:
	print(text.upper())
else:
	print(text.lower())


s = input().strip()
cnta = 0
cntb = 0
for i in range(len(s)):
	if ord(s[i]) >= 97:
		cnta += 1
	else:
		cntb += 1
if cnta >= cntb:
	print(s.lower())
else:
	print(s.upper())


s = input()
alfl = 'qwertyuiopasdfghjklzxcvbnm'
alfU = alfl.upper()
print(s.upper() if sum((1 for i in s if i in alfU)) > sum((1 for i in s if i in alfl)) else s.lower())


resp = []
line = input()
countup = sum((1 for c in line if c.isupper()))
countdown = len(line) - countup
if countup > countdown:
	line = line.upper()
else:
	line = line.lower()
resposta = line
resp.append(resposta)
for respo in resp:
	print(respo)


a = input()
b = a.upper()
c = a.lower()
cl = 0
cu = 0
for i in range(len(a)):
	if a[i] == b[i]:
		cu += 1
	if a[i] == c[i]:
		cl += 1
if cl > cu:
	print(c)
elif cl < cu:
	print(b)
else:
	print(c)


s = input()
l = [1 if k.islower() else 0 for k in s]
(a, b) = (l.count(1), l.count(0))
print([s.lower(), s.upper()][b > a])


from math import ceil as c
word = input()
l = len([i for i in word if ord(i) >= 97])
print(word.lower() if l >= c(len(word) / 2) else word.upper())


s = input()
l_count = 0
u_count = 0
for i in range(len(s)):
	if s[i] == s[i].lower():
		l_count += 1
	else:
		u_count += 1
if l_count > u_count or l_count == u_count:
	s = s.lower()
	print(s)
if l_count < u_count:
	s = s.upper()
	print(s)


x = input()
y = 0
z = 0
for i in x:
	if ord(i) >= 65 and ord(i) <= 90:
		y = y + 1
	elif ord(i) >= 97 and ord(i) <= 122:
		z = z + 1
if y > z:
	print(x.upper())
else:
	print(x.lower())


n = list(input())
sol = ''
small = 0
big = 0
for i in range(0, len(n)):
	if ord(n[i]) > 96:
		small += 1
	else:
		big += 1
if big > small:
	for i in range(0, len(n)):
		if ord(n[i]) > 96:
			n[i] = chr(ord(n[i]) - 32)
else:
	for i in range(0, len(n)):
		if ord(n[i]) < 96:
			n[i] = chr(ord(n[i]) + 32)
print(sol.join(n))


a = input()
l = len(a)
lo = 0
up = 0
for i in range(l):
	if ord('a') <= ord(a[i]) <= ord('z'):
		lo += 1
	else:
		up += 1
if lo < up:
	print(a.upper())
elif lo == up:
	print(a.lower())
else:
	print(a.lower())


str = input()
len = str.__len__()
len = len / 2
len = int(len)
cnt = sum((1 for c in str if c.isupper()))
if cnt > len:
	str = str.upper()
elif cnt <= len:
	str = str.lower()
print(str)


Word = str(input())
n = len(Word)
word = Word.lower()
WORD = Word.upper()
i = 0
j = 0
J = 0
while i < n:
	if word[i] == Word[i]:
		j = j + 1
	else:
		J = J + 1
	i = i + 1
if j < J:
	print(WORD)
else:
	print(word)


s = list(input())
upper_count = 0
lower_count = 0
for n in s:
	if n.isupper():
		upper_count += 1
	else:
		lower_count += 1
if lower_count >= upper_count:
	ans = ''.join(s)
	ans = ans.lower()
	print(ans)
else:
	ans = ''.join(s)
	ans = ans.upper()
	print(ans)


a = input()
count = 0
thing = len(a)
for i in a:
	if i.isupper():
		count += 1
if count > thing // 2:
	print(a.upper())
else:
	print(a.lower())


s = input()
a = []
for char in s:
	if char in 'abcdefghijklmnopqrstuvwxyz':
		pass
	else:
		a.append(char)
if len(a) > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


a = str(input())
im = 0
ib = 0
ab = 'qwertyuiopasdfghjklzxcvbnm'
am = 'QWERTYUIOPASDFGHJKLZXCVBNM'
for i in range(len(a)):
	if ab.count(a[i]) == 1:
		ib = ib + 1
	else:
		im = im + 1
if ib < im:
	print(a.upper())
else:
	print(a.lower())


a = input()
print([a.lower(), a.upper()][sum(map(str.isupper, a)) > len(a) / 2])


s = input()
B = 0
m = 0
for i in range(len(s)):
	if ord(s[i]) > 96 and ord(s[i]) < 123:
		m += 1
	else:
		B += 1
if B <= m:
	for i in range(len(s)):
		if ord(s[i]) > 64 and ord(s[i]) < 91:
			s = s[:i] + chr(ord(s[i]) + 32) + s[i + 1:]
else:
	for i in range(len(s)):
		if ord(s[i]) > 96 and ord(s[i]) < 123:
			s = s[:i] + chr(ord(s[i]) - 32) + s[i + 1:]
print(s)


s = input()
S = list(s)
majus = 0
minus = 0
for k in S:
	if k == k.upper():
		majus += 1
	else:
		minus += 1
if majus < minus or majus == minus:
	print(s.lower())
else:
	print(s.upper())


str = input()
strArr = list(str)
C = 0
S = 0
for i in strArr:
	if i.isupper():
		C += 1
	else:
		S += 1
if C > S:
	print(str.upper())
else:
	print(str.lower())


s = input()
upper_counter = 0
lower_counter = 0
for e in s:
	if e.isupper():
		upper_counter += 1
	else:
		lower_counter += 1
if upper_counter > lower_counter:
	print(s.upper())
else:
	print(s.lower())


s = input()
c = 0
l = len(s)
mid = l / 2 if l % 2 == 0 else l // 2 + 1
for i in s:
	if i.islower():
		c += 1
if c >= mid:
	print(s.lower())
else:
	print(s.upper())


try:
	s = input()
	cap = 0
	low = 0
	for i in s:
		if ord(i) in range(97, 123):
			low += 1
		else:
			cap += 1
	if low >= cap:
		print(s.lower())
	else:
		print(s.upper())
except:
	pass


s = input()
caseCount = 0
for character in s:
	if character.isupper():
		caseCount += 1
	else:
		caseCount -= 1
if caseCount > 0:
	print(s.upper())
else:
	print(s.lower())


a = input()
x = ''
for i in range(len(a)):
	if a[i] == a[i].upper():
		x = x + a[i]
if len(x) > len(a) - len(x):
	print(a.upper())
else:
	print(a.lower())


t = input()
cu = 0
cl = 0
for i in range(len(t)):
	if 91 > ord(t[i]) > 64:
		cu += 1
	else:
		cl += 1
ans = ''
if cu > cl:
	for i in range(len(t)):
		if 123 > ord(t[i]) > 96:
			ans += chr(ord(t[i]) - 32)
		else:
			ans += t[i]
else:
	for i in range(len(t)):
		if 91 > ord(t[i]) > 64:
			ans += chr(ord(t[i]) + 32)
		else:
			ans += t[i]
print(ans)


word = input()
lower = sum((1 for c in word if c.islower()))
upper = len(word) - lower
if lower >= upper:
	print(word.lower())
else:
	print(word.upper())


s = input()
character_upper = 0
character_lower = 0
for i in s:
	if i.isupper():
		character_upper += 1
	else:
		character_lower += 1
if character_lower >= character_upper:
	print(s.lower())
else:
	print(s.upper())


str = input()
(num, num1) = (0, 0)
for i in range(len(str)):
	if str[i].islower():
		num += 1
	if str[i].isupper():
		num1 += 1
if num > num1 or num == num1:
	str = str.lower()
else:
	str = str.upper()
print(str)


from sys import stdin, stdout
(cnt1, cnt2) = (0, 0)
s = stdin.readline().strip()
for f in s:
	if ord(f) <= 90:
		cnt1 += 1
	else:
		cnt2 += 1
if cnt2 >= cnt1:
	s = s.lower()
else:
	s = s.upper()
stdout.write(s)


n = input()
a = 0
b = 0
for i in range(len(n)):
	if ord(n[i]) > 92:
		a += 1
	else:
		b += 1
if a >= b:
	print(n.lower())
else:
	print(n.upper())


w = str(input())
n = 0
for i in w:
	if i.lower() == i:
		n += 1
if n < len(w) / 2:
	print(w.upper())
else:
	print(w.lower())


str = input()
upper_count = [0 for _ in range(26)]
lower_count = [0 for _ in range(26)]
n = len(str)
for i in range(n):
	temp = ord(str[i])
	if temp >= 65 and temp <= 90:
		upper_count[temp - 65] += 1
	else:
		lower_count[temp - 97] += 1
sum1 = sum(upper_count)
sum2 = sum(lower_count)
if sum1 > sum2:
	print(str.upper())
else:
	print(str.lower())


main = input()
st = list(main)
(lo, up) = (0, 0)
for i in range(len(st)):
	if st[i].islower():
		lo += 1
	elif st[i].isupper():
		up += 1
if lo >= up:
	print(main.lower())
elif up > lo:
	print(main.upper())


a = input()
(s1, s2) = (0, 0)
for i in a:
	if i.islower() == True:
		s1 += 1
	else:
		s2 += 1
if s1 >= s2:
	print(a.lower())
else:
	print(a.upper())


s = input()
upc = 0
lowc = 0
for i in range(len(s)):
	if s[i].islower():
		lowc += 1
	else:
		upc += 1
if upc > lowc:
	print(s.upper())
else:
	print(s.lower())


y = input()
x = list(y)
num_upper = 0
num_lower = 0
for letter in y:
	if letter.isupper():
		num_upper += 1
	else:
		num_lower += 1
if num_upper > num_lower:
	print(y.upper())
else:
	print(y.lower())


s = input()
l = 0
for ch in s:
	l += 1 if ch.islower() else 0
print([s.upper(), s.lower()][l >= len(s) / 2])


word = list(input().split()[0])
up = 0
low = 0
for i in range(len(word)):
	if word[i].isupper() == True:
		up += 1
	else:
		low += 1
if up > low:
	print(''.join(word).upper())
else:
	print(''.join(word).lower())


string = input()
lower_symbols = 'qazwsxedcrfvtgbyhnujmikolp'
counts = {'lower_symbols': 0, 'upper_symbols': 0}
for symbol in string:
	if symbol in lower_symbols:
		counts['lower_symbols'] += 1
	else:
		counts['upper_symbols'] += 1
if counts['lower_symbols'] > counts['upper_symbols']:
	print(string.lower())
elif counts['lower_symbols'] == counts['upper_symbols']:
	print(string.lower())
else:
	print(string.upper())


text = input()
count_lower = 0
count_upper = 0
for char in text:
	if char.islower():
		count_lower += 1
	elif char.isupper():
		count_upper += 1
if count_upper == count_lower:
	print(text.lower())
elif count_lower > count_upper:
	print(text.lower())
else:
	print(text.upper())


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

def read_list() -> list:
	return list(map(int, input().split()))
s = input()
l = 0
u = 0
for c in s:
	cs = str(c)
	if cs.islower():
		l += 1
	elif cs.isupper():
		u += 1
if l >= u:
	print(s.lower())
else:
	print(s.upper())


z = input()
c = 0
x = 0
for i in z:
	if 65 <= ord(i) <= 90:
		c += 1
	else:
		x += 1
if c > x:
	print(z.upper())
else:
	print(z.lower())


string = input()
length = len(string)
big = 0
small = 0
for i in range(len(string)):
	if string[i] == string[i].upper():
		big += 1
	else:
		small += 1
if small == big:
	print(string.lower())
elif length // 2 + 1 <= big:
	print(string.upper())
else:
	print(string.lower())


import string
z = input()
x = string.ascii_lowercase
v = 0
b = 0
for i in z:
	if i in x:
		v = v + 1
	else:
		b = b + 1
if v > b or v == b:
	print(z.lower())
else:
	print(z.upper())


s = str(input())
lowercase = 0
for i in range(len(s)):
	if s[i].islower():
		lowercase += 1
uppercase = len(s) - lowercase
print(s.lower() if lowercase >= uppercase else s.upper())


def main():
	inp = input()
	upp = 0
	for i in inp:
		if i.isupper():
			upp += 1
	print(inp.upper() if upp > len(inp) - upp else inp.lower())
main()


word = input()
n_l = 0
n_u = 0
r_l = ''
r_u = ''
for letter in word:
	if ord(letter) >= 97:
		n_l += 1
		r_l += letter
		r_u += letter.upper()
	else:
		n_u += 1
		r_l += letter.lower()
		r_u += letter
if n_u > n_l:
	print(r_u)
else:
	print(r_l)


s = str(input())
u = 0
l = 0
for i in range(0, len(s)):
	temp = str()
	temp = temp + s[i]
	if temp.isupper():
		u = u + 1
	else:
		l = l + 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


n = input()
ma = 0
mi = 0
for i in n:
	if ord(i) >= 65 and ord(i) <= 90:
		ma += 1
	else:
		mi += 1
print(n.upper() if ma > mi else n.lower())


s = input()
l = 0
b = 0
for i in s:
	if 65 <= ord(i) <= 90:
		b += 1
	else:
		l += 1
if l >= b:
	print(s.lower())
else:
	print(s.upper())


s = input()
m = list(s)
u = []
l = []
for i in m:
	if i == i.upper():
		u.append(i)
	if i == i.lower():
		l.append(i)
if len(l) >= len(u):
	print(s.lower())
else:
	print(s.upper())


s = input()
csmall = int()
cupper = int()
for i in s:
	if i.islower():
		csmall += 1
	elif i.isupper():
		cupper += 1
if csmall < cupper:
	print(s.upper())
else:
	print(s.lower())


line = input()
u = l = 0
for a in line:
	if a.isupper() == True:
		u = u + 1
	elif a.islower() == True:
		l = l + 1
if u > l:
	print(line.upper())
elif l >= u:
	print(line.lower())


n = input()
l = []
f = []
for i in range(97, 123):
	a = n.count(chr(i))
	l.append(a)
for i in range(65, 91):
	b = n.count(chr(i))
	f.append(b)
if sum(l) > sum(f):
	print(n.lower())
elif sum(l) < sum(f):
	print(n.upper())
elif sum(l) == sum(f):
	print(n.lower())


s = str(input())
u = 0
l = 0
for c in s:
	if c.isupper():
		u += 1
	else:
		l += 1
for c in s:
	if u > l:
		newC = c.upper()
		s = s.replace(c, newC)
	elif u < l or u == l:
		newC = c.lower()
		s = s.replace(c, newC)
print(s)


try:
	string = input()
	upper = 0
	lower = 0
	for i in range(len(string)):
		if ord(string[i]) >= 97 and ord(string[i]) <= 122:
			lower += 1
		elif ord(string[i]) >= 65 and ord(string[i]) <= 90:
			upper += 1
	if lower >= upper:
		print(string.lower())
	else:
		print(string.upper())
except:
	print('EOF')


s = input()
lower = 'abcdefghijklmnopqrstuvwxyz'
count = 0
for i in range(len(s)):
	if s[i] in lower:
		count += 1
if len(s) - count > count:
	print(s.upper())
else:
	print(s.lower())


string = str(input())
list = [st for st in string]
countUpper = 0
counLower = 0
for ct in list:
	if ct.isupper():
		countUpper += 1
	else:
		counLower += 1
if countUpper > counLower:
	print(string.upper())
else:
	print(string.lower())


sl = input()
abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
m = 0
b = 0
big = ''
for i in range(len(sl)):
	if sl[i] == abc[abc.find(sl[i])]:
		b += 1
	else:
		m += 1
if m > b:
	big += sl.lower()
	print(big)
elif b > m:
	big += sl.upper()
	print(big)
elif b == m:
	big += sl.lower()
	print(big)


word = input()
upperCount = 0
lowerCount = 0
for char in word:
	if char.isupper():
		upperCount = upperCount + 1
	else:
		lowerCount = lowerCount + 1
if upperCount > lowerCount:
	print(word.upper())
else:
	print(word.lower())


(b, m) = (0, 0)
a = input()
for i in a:
	if ord(i) < 96:
		b += 1
	else:
		m += 1
if b > m:
	a = a.upper()
else:
	a = a.lower()
print(a)


s = input()
capital = 0
small = 0
for char in s:
	if char == char.upper():
		capital += 1
	else:
		small += 1
if small >= capital:
	s = s.lower()
else:
	s = s.upper()
print(s)


s = input()
upper = 0
lower = 0
for i in s:
	if i == i.lower():
		lower += 1
	else:
		upper += 1
if lower == upper or lower > upper:
	s = s.lower()
else:
	s = s.upper()
print(s)


s = input()
count1 = 0
count2 = 0
for i in range(len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		count1 = count1 + 1
	elif ord(s[i]) >= 65 and ord(s[i]) <= 90:
		count2 = count2 + 1
if count1 >= count2:
	s = s.lower()
else:
	s = s.upper()
print(s)


a = input()
lower = 0
for i in a:
	if str.lower(i) == i:
		lower += 1
print([a.lower(), a.upper()][lower < len(a) / 2])


st = input()
cc = cs = 0
for i in st:
	if i >= 'A' and i <= 'Z':
		cc += 1
	else:
		cs += 1
if cc > cs:
	print(st.upper())
else:
	print(st.lower())


word = input().rstrip()
uppercase = 0
lowercase = 0
st = ''
for w in word:
	if w.isupper():
		uppercase += 1
	elif w.islower():
		lowercase += 1
if lowercase >= uppercase:
	print(word.lower())
else:
	print(word.upper())


w = input()
n = len(w)
a = 0
b = 0
for i in range(0, n):
	if w[i] == w[i].lower():
		a += 1
	else:
		b += 1
if a >= b:
	print(w.lower())
else:
	print(w.upper())


x = input()
u = 0
l = 0
for char in x:
	if char >= 'A' and char <= 'Z':
		u += 1
	else:
		l += 1
if u > l:
	print(x.upper())
else:
	print(x.lower())


s = list(input())
lows = list(map(str.lower, s))
low = 0
hig = 0
for i in range(len(s)):
	if s[i] == lows[i]:
		low = low + 1
	else:
		hig = hig + 1
if hig > low:
	print(str.upper(''.join(s)))
else:
	print(str.lower(''.join(s)))


s = input()
count = 0
count1 = 0
x = len(s)
for i in range(x):
	if s[i] >= 'A' and s[i] <= 'Z':
		count = count + 1
	else:
		count1 = count1 + 1
if count > count1:
	print(s.upper())
else:
	print(s.lower())


word = input()
small = 0
big = 0
for n in range(len(word)):
	if 26 > ord(word[n]) - ord('a') >= 0:
		small += 1
	if 26 > ord(word[n]) - ord('A') >= 0:
		big += 1
if small >= big:
	word = word.lower()
else:
	word = word.upper()
print(word)


s = input()
up = 0
l = 0
for i in s:
	if 65 <= ord(i) <= 91:
		up += 1
	else:
		l += 1
if up > l:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
lower_word = 0
upper_word = 0
for i in range(len(s)):
	if s[i].islower():
		lower_word += 1
	else:
		upper_word += 1
if lower_word >= upper_word:
	print(s.lower())
else:
	print(s.upper())


import string
s = input()
(cu, cl) = (0, 0)
for i in s:
	if i in string.ascii_uppercase:
		cu += 1
	else:
		cl += 1
if cu > cl:
	print(s.upper())
else:
	print(s.lower())


a = input()
up = 0
let = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(a)):
	if a[i] in let:
		up += 1
lo = len(a) - up
if lo >= up:
	print(a.lower())
else:
	print(a.upper())


a = input()
b = a.upper()
c = a.lower()
x = 0
for i in range(len(a)):
	if a[i] == b[i]:
		x = x + 1
	else:
		pass
if x > len(a) - x:
	print(b)
else:
	print(c)


s = input()
countUPPER = 0
countLOWER = 0
for i in range(len(s)):
	if s[i].isupper():
		countUPPER += 1
	else:
		countLOWER += 1
if countUPPER > countLOWER:
	print(s.upper())
else:
	print(s.lower())


s = input()
l = len(s)
counter = 0
for _ in s:
	if _ >= 'A' and _ <= 'Z':
		counter = counter + 1
if counter > l / 2:
	print(s.upper())
else:
	print(s.lower())


import string
s = input()
low = 0
high = 0
for c in s:
	if c in string.ascii_lowercase:
		low += 1
	elif c in string.ascii_uppercase:
		high += 1
if low > high:
	print(s.lower())
elif high > low:
	print(s.upper())
else:
	print(s.lower())


n = input()
j = 0
k = 0
l = len(n)
for i in range(l):
	m = ord(n[i])
	if m >= 65 and m <= 90:
		j = j + 1
	else:
		k = k + 1
if j > k:
	word = n.upper()
else:
	word = n.lower()
print(word)


a = input()
b = a.lower()
c = a.upper()
l = []
p = []
r = []
d = 0
for i in a:
	l.append(i)
for i in b:
	p.append(i)
for i in c:
	r.append(i)
for i in range(len(l)):
	if l[i] == p[i]:
		d += 1
if len(l) <= d * 2:
	print(b)
else:
	print(c)


s = input()
lowercase_count = 0
uppercase_count = 0
for i in s:
	if i.isupper():
		uppercase_count += 1
	else:
		lowercase_count += 1
if uppercase_count > lowercase_count:
	print(s.upper())
elif lowercase_count > uppercase_count:
	print(s.lower())
else:
	print(s.lower())


word = input()
result = 0
for x in word:
	if x.isupper():
		result += 1
if result > len(word) / 2:
	print(word.upper())
else:
	print(word.lower())


names = input()
(uppc, lowc) = (0, 0)
for i in names:
	if i.isupper():
		uppc += 1
	else:
		lowc = lowc + 1
if uppc > len(names) // 2:
	print(names.upper())
else:
	print(names.lower())


LA_UP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
LA_LO = LA_UP.lower()

def count_up_lo_letters(w, let_base):
	count = 0
	for letter in w:
		if letter in let_base:
			count += 1
	return count
s = input()
if count_up_lo_letters(s, LA_UP) > count_up_lo_letters(s, LA_LO):
	print(s.upper())
elif count_up_lo_letters(s, LA_UP) < count_up_lo_letters(s, LA_LO):
	print(s.lower())
else:
	print(s.lower())


x = 0
y = 0
z = input()
for i in z:
	if ord(i) > 90:
		x += 1
	else:
		y += 1
if x >= y:
	for i in z:
		if ord(i) > 90:
			print(i, end='')
		else:
			print(chr(ord(i) + 32), end='')
else:
	for i in z:
		if ord(i) <= 90:
			print(i, end='')
		else:
			print(chr(ord(i) - 32), end='')


(s, small, big) = (str(input()), 0, 0)
for i in range(0, len(s)):
	s1 = s[i]
	if s1.islower() == True:
		small += 1
	else:
		big += 1
if big > small:
	print(s.upper())
else:
	print(s.lower())


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import bisect as bi
import heapq
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

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

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

	def yes():
		print('YES')

	def no():
		print('NO')
else:

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

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

def main():
	try:
		s = input()
		z = s.lower()
		ans = 0
		for x in range(len(s)):
			if ord(s[x]) < ord(z[x]):
				ans += 1
		if ans >= len(s) // 2 + 1:
			print(s.upper())
		else:
			print(s.lower())
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(1):
	main()


s = input()
u = 0
l = 0
for e in s:
	if e >= 'a':
		l += 1
	else:
		u += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


chars = list(input())
low = 0
for c in chars:
	if c.islower():
		low += 1
	else:
		low -= 1
str = ''.join(chars)
if low >= 0:
	print(str.lower())
else:
	print(str.upper())


enter = input()
lene = len(enter)
h = 0
l = 0
for i in range(0, lene):
	if enter[i] == enter[i].lower():
		h += 1
	if enter[i] == enter[i].upper():
		l += 1
if h > l:
	print(enter.lower())
if l > h:
	print(enter.upper())
if l == h:
	print(enter.lower())


s = input()
word = ''
count = 0
for i in s:
	if i.islower():
		count += 1
if 2 * count < len(s):
	for i in s:
		word += i.upper()
else:
	for i in s:
		word += i.lower()
print(word)


s = input()
count = 0
flag = 0
for i in s:
	if i.isupper() == True:
		count += 1
	else:
		flag += 1
if count > flag:
	print(s.upper())
else:
	print(s.lower())


word = list(input())
counter_lower = 0
counter_upper = 0
for c in word:
	if c.islower():
		counter_lower += 1
	else:
		counter_upper += 1
if counter_lower >= counter_upper:
	print(''.join(word).lower())
else:
	print(''.join(word).upper())


word = input()
uppercases = sum((char.upper() == char for char in word))
if uppercases > len(word) // 2:
	print(word.upper())
else:
	print(word.lower())


n = str(input())
count = 0
hi = 0
for i in range(len(n)):
	if n[i] >= 'A' and n[i] <= 'Z':
		count = count + 1
	if n[i] >= 'a' and n[i] <= 'z':
		hi = hi + 1
if count > hi:
	print(n.upper())
else:
	print(n.lower())


def Q24(string):
	count_l = 0
	count_u = 0
	for i in string:
		if ord(i) in range(97, 123):
			count_l += 1
		else:
			count_u += 1
	if count_l >= count_u:
		string = string.lower()
	else:
		string = string.upper()
	return string
line = input().strip()
print(Q24(line))


s = input()
upper_case = 0
lower_case = 0
for x in s:
	if x.isupper():
		upper_case += 1
	else:
		lower_case += 1
if upper_case > lower_case:
	print(s.upper())
else:
	print(s.lower())


a = str(input())
s = 0
k = 0
for i in a:
	if i == a[k].capitalize():
		s += 1
	k += 1
if s > len(a) / 2:
	print(a[0:].upper())
else:
	print(a[0:].lower())


n = input()
count = 0
for i in range(len(n)):
	if n[i].islower():
		count = count + 1
y = len(n) - count
if y > count:
	print(n.upper())
else:
	print(n.lower())


s = input()
upper_count = sum(map(lambda x: x.isupper(), s))
lower_count = len(s) - upper_count
if upper_count > lower_count:
	print(s.upper())
else:
	print(s.lower())


s = input()
c = ''
(flag1, flag2) = (0, 0)
for i in s:
	if i.isupper():
		flag1 += 1
	else:
		flag2 += 1
if flag1 == flag2:
	for i in s:
		c += i.lower()
elif flag1 > flag2:
	for i in s:
		c += i.upper()
else:
	for i in s:
		c += i.lower()
print(c)


string = input()
cntu = 0
cntl = 0
for k in range(len(string)):
	if ord(string[k]) >= 65 and ord(string[k]) <= 91:
		cntu = cntu + 1
	elif ord(string[k]) >= 97 and ord(string[k]) <= 122:
		cntl = cntl + 1
if cntu > cntl:
	print(string.upper())
else:
	print(string.lower())


word = input('')
i = 0
upperChars = 0
while i < len(word):
	if word[i].isupper():
		upperChars += 1
	i += 1
if upperChars <= len(word) / 2:
	print(word.lower())
else:
	print(word.upper())


s = input()
upp = 0
lowe = 0
for i in range(len(s)):
	if s[i].isupper():
		upp += 1
	else:
		lowe += 1
if upp > lowe:
	print(s.upper())
else:
	print(s.lower())


s = input()
(sml, big) = (0, 0)
for i in s:
	if 64 < ord(i) < 91:
		big += 1
	else:
		sml += 1
if big > sml:
	s1 = ''
	for i in s:
		if 95 < ord(i) < 124:
			s1 += chr(ord(i) - 32)
		else:
			s1 += i
else:
	s1 = ''
	for i in s:
		if 64 < ord(i) < 91:
			s1 += chr(ord(i) + 32)
		else:
			s1 += i
print(s1)


str = input()
titles = int()
for i in str:
	if i.istitle():
		titles += 1
if float(titles) > float(len(str)) / 2:
	print(str.upper())
else:
	print(str.lower())


UP = 'A, B, C, D, E, F, G, H,I, J, K, L, M, N, O, P, Q, R, S, T, U, V ,W ,X ,Y, Z'
word = input()
print(word.upper() if len(word) - sum([1 for i in word if i in UP]) - sum([1 for i in word if i in UP]) < 0 else word.lower())


s = input()
upper = s.upper()
lower = s.lower()
countup = 0
countlow = 0
length = len(s)
for i in range(0, length):
	if s[i] == upper[i]:
		countup += 1
	elif s[i] == lower[i]:
		countlow += 1
if countup > countlow:
	print(upper)
else:
	print(lower)


v = str(input())
import string
count = 0
for c in v:
	if c in string.ascii_uppercase:
		count += 1
if count > len(v) - count:
	print(v.upper())
else:
	print(v.lower())


def function(s):
	total1 = 0
	total2 = 0
	for i in s:
		if i.isupper():
			total1 += 1
		else:
			total2 += 1
	if total1 > total2:
		return s.upper()
	else:
		return s.lower()
s = input()
print(function(s))


s = input()
c = 0
d = 0
for i in range(len(s)):
	if s[i].islower():
		c = c + 1
	else:
		d = d + 1
if c > d or c == d:
	print(s.lower())
else:
	print(s.upper())


str1 = input()
lower = upper = 0
for x in str1:
	if x.islower():
		lower += 1
	else:
		upper += 1
if lower < upper:
	str1 = str1.upper()
else:
	str1 = str1.lower()
print(str1)


s = input()
uc = 0
lc = 0
for i in s:
	if ord(i) > 96:
		lc += 1
	else:
		uc += 1
if lc >= uc:
	print(s.lower())
else:
	print(s.upper())


x = input()
countu = 0
countl = 0
for i in x:
	if i.islower():
		countl = countl + 1
	elif i.isupper():
		countu = countu + 1
if countu > countl:
	x = x.upper()
	print(x)
else:
	x = x.lower()
	print(x)


x = input()
if sum(map(str.islower, x)) >= (len(x) + 1) // 2:
	print(x.lower())
else:
	print(x.upper())


s = input()
count = 0
c = 0
for i in s:
	if i.isupper():
		count += 1
	elif i.islower():
		c += 1
if c > count or c == count:
	print(s.lower())
else:
	print(s.upper())


s = str(input())
c = 0
d = 0
for i in range(len(s)):
	if 'a' <= s[i] <= 'z':
		c += 1
	else:
		d += 1
if c > d:
	print(s.lower())
elif d > c:
	print(s.upper())
else:
	print(s.lower())


s = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'
if sum([c in alphabet for c in s]) < (len(s) + 1) // 2:
	print(s.upper())
else:
	print(s.lower())


def upper_count(temp):
	c = 0
	for i in temp:
		if i >= 'A' and i <= 'Z':
			c += 1
	return c
s = input()
c = upper_count(s)
if c > len(s) - c:
	print(s.upper())
else:
	print(s.lower())


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
S = input()
upper = len([x for x in S if x.isupper()])
if upper > len(S) - upper:
	print(''.join([x.upper() for x in S]))
else:
	print(''.join([x.lower() for x in S]))


word = input()
upper_char_count = 0
lower_char_count = 0
for character in word:
	if character.isupper():
		upper_char_count += 1
	else:
		lower_char_count += 1
if upper_char_count <= lower_char_count:
	print(word.lower())
else:
	print(word.upper())


Text = input()
Lower = 0
Upper = 0
for Char in Text:
	if Char.lower() == Char:
		Lower += 1
	else:
		Upper += 1
if Lower < Upper:
	print(Text.upper())
else:
	print(Text.lower())


I = [i for i in input()]
U = [i for i in I if i.isupper()]
L = [i for i in I if i.islower()]
if len(U) > len(L):
	print(''.join(I).upper())
else:
	print(''.join(I).lower())


w = input()
low = sum([1 if c.islower() else 0 for c in w])
if low >= len(w) / 2:
	print(w.lower())
else:
	print(w.upper())


s = input()
capital = 0
i = len(s)
while i > 0:
	if s[i - 1].isupper():
		capital += 1
	i -= 1
small = len(s) - capital
if capital > small:
	print(s.upper())
else:
	print(s.lower())


word = input().strip()
(lCtr, uCtr) = (0, 0)
for c in word:
	if c.islower():
		lCtr += 1
	else:
		uCtr += 1
if uCtr > lCtr:
	print(word.upper())
else:
	print(word.lower())


word = input()
cnt = 0
for w in word:
	if w.isupper():
		cnt += 1
if cnt > len(word) - cnt:
	print(word.upper())
else:
	print(word.lower())


n = input()
k = 0
g = 0
for i in n:
	if i.lower() == i:
		k += 1
	else:
		g += 1
if k > g:
	print(n.lower())
elif g > k:
	print(n.upper())
else:
	print(n.lower())


s = input()
a = 0
for i in range(0, len(s)):
	if 64 < ord(s[i]) < 91:
		a = a + 1
for i in range(0, len(s)):
	if a <= len(s) / 2:
		if 64 < ord(s[i]) < 91:
			s = s[0:i] + chr(ord(s[i]) + 32) + s[i + 1:len(s)]
	elif 96 < ord(s[i]) < 123:
		s = s[0:i] + chr(ord(s[i]) - 32) + s[i + 1:len(s)]
print(s)


n = str(input())
c1 = 0
c2 = 0
for a in n:
	if a.isupper() == True:
		c1 = c1 + 1
	elif a.islower() == True:
		c2 = c2 + 1
if c1 > c2:
	print(n.upper())
elif c1 < c2:
	print(n.lower())
elif c1 == c2:
	print(n.lower())


import math
in_word = input()
lowers_count = 0
for i in range(0, len(in_word)):
	if in_word[i].islower():
		lowers_count += 1
if lowers_count >= math.ceil(len(in_word) / 2):
	print(in_word.lower())
else:
	print(in_word.upper())


s = input()
a = s.lower()
b = s.upper()
(c, d) = (0, 0)
for i in s:
	if i.lower() == i:
		c += 1
	elif i.upper() == i:
		d += 1
print(a if c >= d else b)


str1 = input()
count1 = 0
count2 = 0
for i in range(len(str1)):
	if str1[i].upper() == str1[i]:
		count1 = count1 + 1
	else:
		count2 += 1
if count2 > count1 or count1 == count2:
	print(str1.lower())
else:
	print(str1.upper())


s = input()
l = len(s)
counter = 0
for i in s:
	if i == i.lower():
		counter = counter + 1
if counter < l - counter:
	print(s.upper())
else:
	print(s.lower())


s = input()
l = 0
u = 0
for val in s:
	if ord(val) < 95:
		l += 1
	else:
		u += 1
if l <= u:
	print(s.lower())
else:
	print(s.upper())


lower = 'abcdefghijklmnopqrstuvwxyz'
upper = lower.upper()

def lowerOrUpper():
	numOfLower = 0
	numOfUpper = 0
	inp = input()
	for letter in inp:
		if letter in lower:
			numOfLower += 1
		else:
			numOfUpper += 1
	if numOfUpper > numOfLower:
		print(inp.upper())
	else:
		print(inp.lower())
lowerOrUpper()


n = input()
count_lower = 0
count_upper = 0
for i in n:
	if i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		count_upper += 1
	else:
		count_lower += 1
if count_lower > count_upper:
	print(n.lower())
elif count_lower < count_upper:
	print(n.upper())
elif count_upper == count_lower:
	print(n.lower())


s1 = input()
l1 = 0
l2 = 0
for i in range(len(s1)):
	if s1[i].isupper():
		l1 += 1
	else:
		l2 += 1
if l1 <= l2:
	print(s1.lower())
else:
	print(s1.upper())


s = input()
m = len(s)
sum1 = 0
sum2 = 0
for i in range(m):
	if s[i] >= 'a':
		sum1 += 1
	else:
		sum2 += 1
s = str(s)
if sum1 >= sum2:
	print(s.lower())
else:
	print(s.upper())


n = [str(i) for i in input()]
count = 0
for x in range(len(n)):
	if ord(n[x]) < 97:
		count += 1
f = ''.join(n)
if count > len(n) // 2:
	print(f.upper())
else:
	print(f.lower())


s = str(input())
i = 0
up = 0
low = 0
while i < len(s):
	if s[i].isupper() == True:
		up = up + 1
	else:
		low = low + 1
	i = i + 1
if low >= up:
	print(s.lower())
else:
	print(s.upper())


s = input()
un = 0
ln = 0
for i in range(len(s)):
	if s[i].isupper() == True:
		un += 1
	if s[i].islower() == True:
		ln += 1
if un > ln:
	print(s.upper())
else:
	print(s.lower())


def SoloMayusculas(A):
	M = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
	Mayus = []
	for K in A:
		J = 0
		X = False
		while J < len(M) and X == False:
			if M[J] == K:
				X = True
				Mayus = Mayus + [K]
			J = J + 1
	return Mayus
N = input('')
Mayus = SoloMayusculas(N)
X = len(N) - len(Mayus)
if X >= len(Mayus):
	print(N.lower())
else:
	print(N.upper())


a = input()
h = []
j = []
for m in a:
	if ord(m) > 96:
		b = ord(m) - 32
		h.append(chr(b))
for k in a:
	if ord(k) < 96:
		c = ord(k) + 32
		j.append(chr(c))
if len(h) < len(j):
	for v in a:
		if ord(v) > 96:
			b = ord(v) - 32
			print(chr(b), end='')
		else:
			print(v, end='')
else:
	for t in a:
		if ord(t) < 96:
			c = ord(t) + 32
			print(chr(c), end='')
		else:
			print(t, end='')


n = input()
ans = 0
for i in n:
	if i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		ans += 1
if ans > len(n) - ans:
	print(n.upper())
else:
	print(n.lower())


import string

def main():
	lower_count = 0
	upper_count = 0
	word = input().strip()
	for ch in word:
		if ch in string.ascii_lowercase:
			lower_count += 1
		elif ch in string.ascii_uppercase:
			upper_count += 1
	if lower_count >= upper_count:
		print(word.lower())
	else:
		print(word.upper())
main()


n = input()
u = 0
d = 0
for i in range(len(n)):
	if n[i].isupper() == True:
		u += 1
	elif n[i].isupper() == False:
		d += 1
if u > d:
	print(n.upper())
else:
	print(n.lower())


msb = input()
l = list(msb)
c = 0
c1 = 0
for i in l:
	if i.isupper():
		c += 1
	else:
		c1 += 1
if c > c1:
	print(msb.upper())
if c <= c1:
	print(msb.lower())


k = input()
l = sorted(k)
if l[len(l) // 2].isupper():
	print(k.upper())
else:
	print(k.lower())


import math
import cmath
from decimal import *
from fractions import *
s = input()
res = ans = 0
for _ in s:
	if 'A' <= _ <= 'Z':
		res += 1
	else:
		ans += 1
if ans >= res:
	print(s.lower())
elif ans < res:
	print(s.upper())


n = input()
small = 'abcdefghijklmnopqrstuvwxyz'
caps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
c = s = 0
for i in range(len(n)):
	if n[i] in small:
		s += 1
	if n[i] in caps:
		c += 1
if s > c or s == c:
	print(n.lower())
else:
	print(n.upper())


import sys
a = list(sys.stdin.readline())[:-1]
upper = 0
lower = 0
for i in a:
	if str(i).isupper():
		upper += 1
	elif str(i).islower():
		lower += 1
if upper == lower:
	print(''.join(a).lower())
elif lower > upper:
	k = 0
	while k < len(a):
		if str(a[k].isupper()):
			a[k] = str(a[k].lower())
		k += 1
	print(''.join(a))
elif lower < upper:
	x = 0
	while x < len(a):
		if str(a[x].isupper()):
			a[x] = str(a[x].upper())
		x += 1
	print(''.join(a))


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

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()]
s = input()
upper = 0
lower = 0
for i in s:
	if i.isupper():
		upper += 1
	else:
		lower += 1
if lower >= upper:
	print(s.lower())
else:
	print(s.upper())


str = input()
lower = sum([1 for c in str if c.islower()])
upper = sum([1 for c in str if c.isupper()])
if upper > lower:
	print(str.upper())
else:
	print(str.lower())


word = input()
upperCounter = 0
lowerCounter = 0
for char in word:
	if char.islower():
		lowerCounter += 1
	else:
		upperCounter += 1
if lowerCounter >= upperCounter:
	print(word.lower())
elif lowerCounter < upperCounter:
	print(word.upper())


word = list(str(input()))
up = 0
low = 0
for i in word:
	if i.isupper() == 1:
		up += 1
	elif i.isupper() != 1:
		low += 1
if up > low:
	print(''.join(word).upper())
else:
	print(''.join(word).lower())


s = input()
uppercount = 0
lowercount = 0
for letter in s:
	if letter == letter.upper():
		uppercount += 1
	elif letter == letter.lower():
		lowercount += 1
if uppercount > lowercount:
	print(s.upper())
elif uppercount <= lowercount:
	print(s.lower())


s = input()
up = 0
down = 0
for i in s:
	if 65 <= ord(i) <= 90:
		up += 1
	else:
		down += 1
if up <= down:
	print(s.lower())
else:
	print(s.upper())


s1 = input()
count1 = 0
count2 = 0
for i in range(len(s1)):
	if ord(s1[i]) >= 65 and ord(s1[i]) <= 90:
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	ans = s1.upper()
	print(ans)
else:
	ans = s1.lower()
	print(ans)


word = input()
lower_count = sum((char.islower() for char in word))
if len(word) - lower_count > lower_count:
	print(word.upper())
else:
	print(word.lower())


s = input()
count = sum((c.islower() for c in s))
if count >= len(s) - count:
	print(s.lower())
else:
	print(s.upper())


low = 0
hig = 0
line = input()
for i in line:
	if i.isupper():
		hig += 1
	else:
		low += 1
if hig > low:
	print(line.upper())
else:
	print(line.lower())


x = list(str(input()))
up = 0
low = 0
for i in range(len(x)):
	if x[i] >= 'a' and x[i] <= 'z':
		low += 1
	elif x[i] >= 'A' and x[i] <= 'Z':
		up += 1
if low >= up:
	for i in range(len(x)):
		if x[i] >= 'a' and x[i] <= 'z':
			continue
		elif x[i] >= 'A' and x[i] <= 'Z':
			x[i] = x[i].lower()
elif up > low:
	for i in range(len(x)):
		if x[i] >= 'a' and x[i] <= 'z':
			x[i] = x[i].upper()
		elif x[i] >= 'A' and x[i] <= 'Z':
			continue
print(''.join(x))


st = input().strip()
l = 0
u = 0
for i in st:
	if i.isupper():
		u += 1
	else:
		l += 1
if l < u:
	st = st.upper()
else:
	st = st.lower()
print(st)


inp = input()
upper_count = 0
for ch in inp:
	if ch.isupper():
		upper_count += 1
if upper_count > int(len(inp) / 2):
	print(inp.upper())
else:
	print(inp.lower())


s = input()
c1 = 0
c2 = 0
for c in s:
	if 'a' <= c <= 'z':
		c1 += 1
	else:
		c2 += 1
if max(c1, c2) == c1:
	print(s.lower())
else:
	print(s.upper())


s = input()
upper_count = 0
lower_count = 0
for i in range(len(s)):
	if s[i].isupper():
		upper_count = upper_count + 1
	elif s[i].islower():
		lower_count = lower_count + 1
if upper_count > lower_count:
	p = s.upper()
elif upper_count <= lower_count:
	p = s.lower()
print(p)


input_text = input()
counter = 0
for x in input_text:
	if x.isupper():
		counter = counter + 1
if counter > len(input_text) / 2:
	print(input_text.upper())
else:
	print(input_text.lower())


a = input()
low = 'abcdefghijklmnopqrstuvwxyz'
x = 0
y = 0
for i in a:
	if i in list(low):
		x = x + 1
	else:
		y = y + 1
if x >= y:
	print(a.lower())
else:
	print(a.upper())


n = input()
k = 0
m = 0
for i in range(len(n)):
	if 'A' <= n[i] <= 'Z':
		k += 1
	else:
		m += 1
if m >= k:
	n = n.lower()
	print(n)
else:
	n = n.upper()
	print(n)


k1 = k2 = 0
s = input()
for i in range(0, len(s)):
	if s[i] == s[i].upper():
		k1 = k1 + 1
	else:
		k2 = k2 + 1
if k1 > k2:
	print(s.upper())
elif k2 > k1:
	print(s.lower())
else:
	print(s.lower())


t = input()
lower = 0
upper = 0
for i in t:
	if ord(i) >= 97 and ord(i) <= 122:
		lower += 1
	elif ord(i) >= 65 and ord(i) <= 90:
		upper += 1
if upper <= lower:
	print(t.lower())
else:
	print(t.upper())


S = input()
n = len(S)
k2 = 0
k1 = 0
for i in range(n):
	if S[i] >= 'a' and S[i] <= 'z':
		k1 = k1 + 1
	if S[i] >= 'A' and S[i] <= 'Z':
		k2 = k2 + 1
if k1 >= k2:
	print(S.lower())
else:
	print(S.upper())


string = input()
haha = 0
result = 0
final = []
for i in string:
	if i.isupper():
		haha += 1
	elif i.islower():
		result += 1
if haha == result:
	for i in string:
		final.append(i.lower())
elif haha > result:
	for i in string:
		final.append(i.upper())
else:
	for i in string:
		final.append(i.lower())
final_result = ''.join(final)
print(final_result)


str = input()
upper_case = [i for i in str if i.isupper()]
lower_case = [j for j in str if j.islower()]
length_u = len(upper_case)
length_l = len(lower_case)
if length_l == length_u or length_l > length_u:
	print(str.lower())
elif length_u > length_l:
	print(str.upper())


s = input()
lcc = sum((1 for c in s if c.islower()))
print(s.lower() if lcc >= len(s) - lcc else s.upper())


C = input()
X = list(C)
U = 0
L = 0
for x in X:
	if 'a' <= x <= 'z':
		L = L + 1
	else:
		U = U + 1
if L < U:
	print(C.upper())
else:
	print(C.lower())


str1 = input()
upper_count = 0
lower_count = 0
for i in list(str1):
	if i.isupper():
		upper_count += 1
	else:
		lower_count += 1
if upper_count > lower_count:
	print(str1.upper())
else:
	print(str1.lower())


def word(s):
	count = 0
	for i in s:
		if i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
			count += 1
	if len(s) - count >= count:
		print(s.lower())
	else:
		print(s.upper())
word(input())


a = input()
b = 0
c = 0
for i in range(len(a)):
	if 96 < ord(a[i]) < 123:
		b = b + 1
	if 64 < ord(a[i]) < 91:
		c = c + 1
if b >= c:
	A = []
	for i in range(len(a)):
		if 96 < ord(a[i]) < 123:
			A.append(a[i])
		if 64 < ord(a[i]) < 91:
			d = ord(a[i])
			A.append(str(chr(d + 32)))
if c > b:
	A = []
	for i in range(len(a)):
		if 64 < ord(a[i]) < 91:
			A.append(a[i])
		if 96 < ord(a[i]) < 123:
			d = ord(a[i])
			A.append(str(chr(d - 32)))
s = ''
for i in A:
	s = s + i
print(s)


import sys
k = sys.stdin.readline().rstrip()
a = int(k.count('a'))
A = int(k.count('A'))
b = int(k.count('b'))
B = int(k.count('B'))
c = int(k.count('c'))
C = int(k.count('C'))
d = int(k.count('d'))
D = int(k.count('D'))
e = int(k.count('e'))
E = int(k.count('E'))
f = int(k.count('f'))
F = int(k.count('F'))
g = int(k.count('g'))
G = int(k.count('G'))
h = int(k.count('h'))
H = int(k.count('H'))
I = int(k.count('I'))
i = int(k.count('i'))
j = int(k.count('j'))
kcannot = int(k.count('k'))
J = int(k.count('J'))
K = int(k.count('K'))
l = int(k.count('l'))
L = int(k.count('L'))
m = int(k.count('m'))
M = int(k.count('M'))
n = int(k.count('n'))
o = int(k.count('o'))
N = int(k.count('N'))
O = int(k.count('O'))
p = int(k.count('p'))
P = int(k.count('P'))
q = int(k.count('q'))
Q = int(k.count('Q'))
r = int(k.count('r'))
s = int(k.count('s'))
R = int(k.count('R'))
S = int(k.count('S'))
t = int(k.count('t'))
T = int(k.count('T'))
u = int(k.count('u'))
U = int(k.count('U'))
v = int(k.count('v'))
V = int(k.count('V'))
w = int(k.count('w'))
W = int(k.count('W'))
x = int(k.count('x'))
X = int(k.count('X'))
y = int(k.count('y'))
Y = int(k.count('Y'))
z = int(k.count('z'))
Z = int(k.count('Z'))
if a + b + c + d + e + f + g + h + i + j + kcannot + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z > A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z or a + b + c + d + e + f + g + h + i + j + kcannot + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z == A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z:
	print(k.lower())
else:
	print(k.upper())


from functools import reduce
s = input()
r = reduce(lambda a, x: a + int(x.isupper()), s[1:], int(s[0].isupper()))
print(s.upper() if r > len(s) - r else s.lower())


import string
temp = list(string.ascii_uppercase)
s = input()
count = 0
for i in range(len(s)):
	if s[i] in temp:
		count += 1
if len(s) - count >= count:
	print(s.lower())
else:
	print(s.upper())


p = input()
cnt1 = 0
cnt2 = 0
for i in p:
	if i >= 'a' and i <= 'z':
		cnt1 += 1
	elif i >= 'A' and i <= 'Z':
		cnt2 += 1
if cnt1 >= cnt2:
	print(p.lower())
else:
	print(p.upper())


x = list(input())
lower = 0
upper = 0
for i in range(len(x)):
	if x[i] == x[i].lower():
		lower = lower + 1
	else:
		upper = upper + 1
y = ''.join(x)
if upper <= lower:
	z = y.lower()
else:
	z = y.upper()
print(z)


s = input()
s_len = len(s)
l_cnt = sum([1 for c in s if c.islower()])
u_cnt = s_len - l_cnt
if l_cnt >= u_cnt:
	print(s.lower())
else:
	print(s.upper())


a = str(input(''))
countU = int('0')
countL = int('0')
length = len(a)
for i in range(length):
	if a[i].isupper():
		countU = countU + 1
	else:
		countL = countL + 1
if countU > countL:
	print(a.upper())
elif countL > countU:
	print(a.lower())
elif countL == countU:
	print(a.lower())


word = str(input())
count1 = 0
count2 = 0
for letter in word:
	if letter.isupper() == True:
		count1 = count1 + 1
	else:
		count2 = count2 + 1
if count1 < count2 or count1 == count2:
	print(word.lower())
else:
	print(word.upper())


s = input()
counter = 0
for i in s:
	if i.isupper() == True:
		counter += 1
if counter == len(s) // 2:
	print(s.lower())
elif counter > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
count = 0
l = int(len(s) / 2)
for i in range(len(s)):
	if s[i].isupper() == True:
		count += 1
if count > l:
	print(s.upper())
else:
	print(s.lower())


text = str(input())
s = list(text)
l = len(text)
up = 0
low = 0
for item in s:
	if item.islower():
		low += 1
	else:
		up += 1
if low >= up:
	text = text.lower()
else:
	text = text.upper()
print(text)


word = input()
upper = 0
lower = 0
for w in word:
	if w.isupper():
		upper += 1
	elif w.islower():
		lower += 1
if upper > lower:
	print(word.upper())
elif lower >= upper:
	print(word.lower())


s = str(input())
lst = list(s)
countu = 0
countl = 0
for i in lst:
	if i.isupper():
		countu += 1
	elif i.islower():
		countl += 1
if countu > countl:
	print(s.upper())
else:
	print(s.lower())


word = input()
upper_count = 0
lower_count = 0
for c in word:
	if c.isupper():
		upper_count += 1
	else:
		lower_count += 1
if upper_count > lower_count:
	print(word.upper())
else:
	print(word.lower())


t = input()
up = []
low = []
for i in t:
	if 65 <= ord(i) <= 90:
		up.append(i)
	elif 97 <= ord(i) <= 122:
		low.append(i)
if len(up) > len(low):
	t = t.upper()
else:
	t = t.lower()
print(t)


x = input()
(a, b) = (0, 0)
for i in x:
	if i.lower() == i:
		a += 1
if len(x) - a > a:
	print(x.upper())
elif len(x) - a < a:
	print(x.lower())
elif len(x) - a == a:
	print(x.lower())


s = input()
count1 = 0
count2 = 0
n = len(s)
for i in range(n):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		count1 = count1 + 1
	if ord(s[i]) >= 65 and ord(s[i]) <= 95:
		count2 = count2 + 1
if count1 >= count2:
	for i in range(n):
		if ord(s[i]) >= 65 and ord(s[i]) <= 90:
			print(chr(ord(s[i]) + 32), end='')
		else:
			print(s[i], end='')
if count1 < count2:
	for i in range(n):
		if ord(s[i]) >= 97 and ord(s[i]) <= 122:
			print(chr(ord(s[i]) - 32), end='')
		else:
			print(s[i], end='')


string = input()
upper = 0
lower = 0
for s in string:
	if ord(s) <= 90:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(string.upper())
else:
	print(string.lower())


n = input()
c = 0
d = 0
for i in range(len(n)):
	if n[i] == n[i].upper():
		d += 1
	else:
		c += 1
if c > d - 1:
	print(n.lower())
else:
	print(n.upper())


word = input()
upperSum = sum([1 for x in word if x.lower() != x])
print(word.lower() if upperSum <= len(word) - upperSum else word.upper())


string = input()
big = 0
small = 0
for x in string:
	if ord('a') <= ord(x) <= ord('z'):
		small = small + 1
	if ord('A') <= ord(x) <= ord('Z'):
		big = big + 1
if small >= big:
	string = string.lower()
else:
	string = string.upper()
print(string)


word = input('')
w_len = len(word)
lc_c = 0
uc_c = 0

def foo():
	global lc_c
	global uc_c
	global word
	global w_len
	if word.isupper():
		print(word)
		return
	if word.islower():
		print(word)
		return
	for c in range(0, w_len):
		if word[c].isupper():
			uc_c += 1
		else:
			lc_c += 1
	if uc_c > lc_c:
		print(word.upper())
	else:
		print(word.lower())
foo()


s = input()
l = 0
p = 0
for i in s:
	if ord(i) in range(97, 123):
		l += 1
	else:
		p += 1
if p > l:
	print(s.upper())
else:
	print(s.lower())


name = input()
ups = 0
los = 0
for i in name:
	if i.isupper():
		ups += 1
	elif i.islower():
		los += 1
if ups > los:
	print(name.upper())
elif ups < los:
	print(name.lower())
elif ups == los:
	print(name.lower())


s = str(input())
l = 0
u = 0
for char in s:
	if char.islower():
		l += 1
	else:
		u += 1
if l < u:
	print(str(s.upper()))
elif l > u or l == u:
	print(str(s.lower()))


s = input()
flag = count = 0
for i in range(0, len(s)):
	if ord(s[i]) <= 90:
		count = count + 1
	else:
		flag = flag + 1
if flag >= count:
	print(s.lower())
else:
	print(s.upper())


__author__ = 'Utena'
s = input()
try:
	print((int(s) + 4) // 5)
except:
	t0 = t1 = 0
	for i in s:
		if i <= 'Z':
			t0 += 1
		else:
			t1 += 1
	suc = t0 > t1
	if suc:
		print(s.upper())
	else:
		print(s.lower())


words = input()
uppernum = 0
lowernum = 0
for i in words:
	asc = ord(i)
	if asc >= 65 and asc <= 90:
		uppernum += 1
	else:
		lowernum += 1
if uppernum > lowernum:
	print(words.upper())
else:
	print(words.lower())


n = input()
low = 'abcdefghijklmnopqrstuvwxyz'
up = low.upper()
c = 0
for i in range(0, len(n)):
	if n[i] in up:
		c += 1
if len(n) - c < c:
	n = n.upper()
else:
	n = n.lower()
print(n)


import sys

def main():
	s = str(input())
	upp = len(list(filter(lambda c: 'A' <= c and c <= 'Z', s)))
	low = len(list(filter(lambda c: 'a' <= c and c <= 'z', s)))
	if upp > low:
		print(s.upper())
	else:
		print(s.lower())
main()


s = input()
lo = 'abcdefghijklmnopqrstuvwxyz'
lonum = 0
for c in s:
	if c in lo:
		lonum += 1
if lonum >= len(s) - lonum:
	print(s.lower())
else:
	print(s.upper())


words = list(input())
i = 0
for word in words:
	if ord(word) < 96:
		i += 1
if i > 0.5 * len(words):
	print(''.join(words).upper())
else:
	print(''.join(words).lower())


st = input()
s1 = st.upper()
s2 = st.lower()
k1 = 0
k2 = 0
for i in range(len(st)):
	if s1[i] != st[i]:
		k1 += 1
	if s2[i] != st[i]:
		k2 += 1
if k1 >= k2:
	print(s2)
else:
	print(s1)


n = input()
mylist1 = []
for i in range(len(n)):
	g = n[i].isupper()
	mylist1.append(g)
if mylist1.count(True) > mylist1.count(False):
	print(n.upper())
else:
	print(n.lower())


a = input()
up = 0
low = 0
i = 0
while i < len(a):
	if a[i].isupper():
		up += 1
	else:
		low += 1
	i += 1
if up > low:
	print(a.upper())
elif low >= up:
	print(a.lower())


x = input()
up = 0
lo = 0
for i in x:
	if 97 <= ord(i) <= 122:
		lo += 1
	else:
		up += 1
if up > lo:
	print(x.upper())
else:
	print(x.lower())


small = 'abcdefghijklmnopqrstuvwxyz'
capital = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
s = input()
sm = 0
big = 0
for ch in s:
	if ch in small:
		sm += 1
	else:
		big += 1
if sm >= big:
	s = s.lower()
else:
	s = s.upper()
print(s)


s = input()
lower = []
upper = []
for char in s:
	if char.isupper():
		upper.append(char)
	elif char.islower():
		lower.append(char)
if len(lower) < len(upper):
	s = s.upper()
else:
	s = s.lower()
print(s)


def main(word):
	up = 0
	down = 0
	for x in word:
		if x.isupper() == True:
			up += 1
		else:
			down += 1
	if up > down:
		return word.upper()
	else:
		return word.lower()
x = input('')
print(main(x))


x = input()
low = 0
high = 0
for i in range(len(x)):
	if x[i] >= 'a' and x[i] <= 'z':
		low += 1
	else:
		high += 1
if low >= high:
	print(x.lower())
else:
	print(x.upper())


a = input()
if len(list(filter(lambda x: ord(x) < 95, [i for i in a]))) <= len(list(filter(lambda x: ord(x) > 95, [i for i in a]))):
	print(a.lower())
else:
	print(a.upper())


s = input()
n = len(s)
c = 0
c1 = 0
for i in range(0, n):
	if s[i] >= 'a' and s[i] <= 'z':
		c = c + 1
	if s[i] >= 'A' and s[i] <= 'Z':
		c1 = c1 + 1
if c == c1 or c > c1:
	s = s.lower()
elif c < c1:
	s = s.upper()
print(s)


s = input()
cont = 0
cont1 = 0
for x in s:
	if x.isupper():
		cont += 1
	else:
		cont1 += 1
if cont > cont1:
	print(s.upper())
else:
	print(s.lower())


TN = 1

def solution():
	s = input()
	n = len(s)
	low = 0
	up = 0
	for i in range(n):
		if s[i] == s[i].lower():
			low += 1
		else:
			up += 1
	if low < up:
		print(s.upper())
	else:
		print(s.lower())
while TN != 0:
	solution()
	TN -= 1


def prog():
	a = input()
	mas = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	mas2 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
	(k, k1) = (0, 0)
	for (i, x) in enumerate(a):
		if x in mas:
			k += 1
		else:
			k1 += 1
	rezalt = ''
	if k >= k1:
		for (i, x) in enumerate(a):
			i = a[i]
			if x in mas2:
				i = mas[mas2.index(x)]
			rezalt = '%s%s' % (rezalt, i)
	else:
		for (i, x) in enumerate(a):
			i = a[i]
			if x in mas:
				i = mas2[mas.index(x)]
			rezalt = '%s%s' % (rezalt, i)
	print(rezalt)
prog()


from sys import stdin
import re

def main():
	cad = stdin.readline().strip()
	while cad != '':
		mayusculas = re.sub('[^A-Z]', '', cad)
		minusculas = re.sub('[^a-z]', '', cad)
		if len(mayusculas) > len(minusculas):
			a = cad.upper()
			print(a)
		elif len(minusculas) > len(mayusculas):
			a = cad.lower()
			print(a)
		else:
			a = cad.lower()
			print(a)
		cad = stdin.readline().strip()
main()


(m, n) = ([], [])
s = str(input())
for i in s:
	if i == i.upper():
		m.append(i)
	elif i == i.lower():
		n.append(i)
if len(m) == len(n) or len(n) > len(m):
	print(s.lower())
else:
	print(s.upper())


word = list(input())
upperChars = lowerChars = 0
for char in word:
	if char.isupper():
		upperChars += 1
	else:
		lowerChars += 1
if upperChars > lowerChars:
	print(''.join(word).upper())
else:
	print(''.join(word).lower())


s = input()
s1 = []
s2 = []
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		s1.append(i)
	else:
		s2.append(i)
if len(s1) > len(s2):
	print(s.upper())
else:
	print(s.lower())


w = input()
u = 0
l = 0
for i in w:
	if ord(i) < 91:
		u += 1
	else:
		l += 1
if u > l:
	print(w.upper())
else:
	print(w.lower())


a = input()
lc = sum((1 for c in a if c.islower()))
uc = sum((1 for c in a if c.isupper()))
if lc >= uc:
	print(a.lower())
else:
	print(a.upper())


Word = input().strip()
if sum((1 for x in Word if x.isupper())) > sum((1 for x in Word if x.islower())):
	print(Word.upper())
else:
	print(Word.lower())


import string
word = input()
lower = 0
upper = 0
for i in word:
	if i in string.ascii_uppercase:
		upper += 1
	else:
		lower += 1
if lower >= upper:
	print(word.lower())
else:
	print(word.upper())


n = input()
i = 0
u = 0
l = 0
while i < len(n):
	if n[i].isupper():
		u += 1
	else:
		l += 1
	i += 1
if u > l:
	print(n.upper())
else:
	print(n.lower())


l = input()
x = l.upper()
y = l.lower()
c = [0, 0]
for i in range(len(l)):
	if l[i] != x[i]:
		c[0] = c[0] + 1
	if l[i] != y[i]:
		c[1] = c[1] + 1
if c[0] >= c[1]:
	print(y)
else:
	print(x)


word = input()
k = 0
for char in word:
	if char >= 'A' and char <= 'Z':
		k += 1
if k > len(word) / 2:
	print(word.upper())
else:
	print(word.lower())


s = input()
c = 0
sm = 0
for i in range(len(s)):
	if ord(s[i]) > 96 and ord(s[i]) <= 122:
		c = c + 1
	elif ord(s[i]) > 64 and ord(s[i]) <= 90:
		sm = sm + 1
if c < sm:
	print(s.upper())
else:
	print(s.lower())


word = input()
a = list(word)
up = 0
l = 0
for i in a:
	if i.isupper():
		up += 1
	else:
		l += 1
if up > l:
	print(word.upper())
else:
	print(word.lower())


data = input()
lower = sum(map(str.islower, data))
upper = abs(len(data) - lower)
if upper > lower:
	print(data.upper())
elif upper == lower:
	print(data.lower())
else:
	print(data.lower())


def solution(word):
	lower_ctr = upper_ctr = 0
	for c in word:
		if c.islower():
			lower_ctr += 1
		elif c.isupper():
			upper_ctr += 1
	if lower_ctr >= upper_ctr:
		return word.lower()
	else:
		return word.upper()
word = input()
print(solution(word))


x = input()
x = list(x)
s = 0
t = 0
for each in x:
	if each.islower():
		s = s + 1
	else:
		t = t + 1
x = ''.join(x)
if s >= t:
	x = x.lower()
else:
	x = x.upper()
print(x)


s = input()
print([s.lower(), s.upper()][sum((x.islower() for x in s)) < sum((x.isupper() for x in s))])


s = input()
(l_l, l_u) = (0, 0)
for i in s:
	if i.islower():
		l_l += 1
	elif i.isupper():
		l_u += 1
if l_l == l_u or l_l > l_u:
	print(s.lower())
elif l_u > l_l:
	print(s.upper())


def solve(t):
	l = 0
	h = 0
	for c in t:
		if ord('a') <= ord(c) <= ord('z'):
			l += 1
		elif ord('A') <= ord(c) <= ord('Z'):
			h += 1
	if l >= h:
		return t.lower()
	else:
		return t.upper()

def main():
	t = input()
	print(solve(t))
main()


k = input()
(sc, cc) = (0, 0)
for i in k:
	if ord(i) >= 97 and ord(i) <= 122:
		sc += 1
	else:
		cc += 1
if sc < cc:
	k = k.upper()
else:
	k = k.casefold()
print(k)


word = input()
w_int = list(map(lambda x: ord(x) - 97, word))
segment = [1 if i >= 0 else -1 for i in w_int]
majority = sum(segment)
if majority >= 0:
	word = word.lower()
elif majority < 0:
	word = word.upper()
print(word)


n = input()
a = 0
b = 0
for i in range(0, len(n)):
	if n[i] in 'abcdefghijklmnopqrstuvwxyz':
		a = a + 1
	if n[i] in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		b = b + 1
if a < b:
	n = n.upper()
	print(n)
else:
	n = n.lower()
	print(n)


a = input()
u = a.upper()
l = a.lower()
x = 0
y = 0
for i in range(len(a)):
	if a[i] == u[i]:
		x += 1
	else:
		y += 1
if y > x:
	print(l)
if x > y:
	print(u)
if x == y:
	print(l)


def calc(s):
	upper = 0
	for char in s:
		if char.upper() == char:
			upper += 1
	if upper > len(s) / 2:
		return s.upper()
	return s.lower()
s = input()
print(calc(s))


s = input()

def diff(s1, s2):
	return sum([s1[i] != s2[i] for i in range(len(s1))])
s1 = s.lower()
s2 = s.upper()
if diff(s, s1) <= diff(s, s2):
	print(s1)
else:
	print(s2)


s = input()
s1 = 0
s2 = 0
for i in s:
	if i.islower():
		s1 += 1
	elif i.isupper():
		s2 += 1
if s1 >= s2:
	print(s.lower())
else:
	print(s.upper())


s = input()
k = 0
m = 0
for i in range(len(s)):
	if s[i].isupper():
		k += 1
	else:
		m += 1
if k > m:
	print(s.upper())
else:
	print(s.lower())


m = input()
length = len(m)
length_lower = 0
for i in range(length):
	if 'a' <= m[i] <= 'z':
		length_lower += 1
length_upper = length - length_lower
if length_upper > length_lower:
	print(m.upper())
else:
	print(m.lower())


from math import ceil
s = input()
lowercase = 0
for c in s:
	if c.islower():
		lowercase += 1
if lowercase >= ceil(len(s) / 2):
	print(s.lower())
else:
	print(s.upper())


s = input()
up = 0
lo = 0
for c in s:
	if 'a' <= c <= 'z':
		lo += 1
	if 'A' <= c <= 'Z':
		up += 1
if up > lo:
	s = s.upper()
else:
	s = s.lower()
print(s)


word = input()
low = 0
high = 0
for e in word:
	if e == e.lower():
		low += 1
	else:
		high += 1
if high > low:
	print(word.upper())
else:
	print(word.lower())


s = input()
s = list(s)
x = 0
s1 = str()
for i in range(len(s)):
	if ord(s[i]) < 91:
		x += 1
	else:
		x -= 1
if x > 0:
	for i in range(len(s)):
		s[i] = s[i].upper()
elif x <= 0:
	for i in range(len(s)):
		s[i] = s[i].lower()
for j in range(len(s)):
	s1 += str(s[j])
print(s1)


str = input()
i = 0
uc = 0
sc = 0
while i < len(str):
	if ord(str[i]) > 64 and ord(str[i]) < 91:
		uc += 1
	else:
		sc += 1
	i += 1
if uc <= sc:
	print(str.lower())
else:
	print(str.upper())


a = input()
b = list(a)
c = len(b)
n = 0
for i in range(c):
	if b[i] < 'a':
		n = n + 1
d = ''.join(b)
if 2 * n > c:
	e = d.upper()
else:
	e = d.lower()
print(e)


word = input()
counter = 0
for i in word:
	if 'a' <= i <= 'z':
		counter += 1
if 2 * counter >= len(word):
	print(word.lower())
else:
	print(word.upper())


s = input()
a = s.lower()
b = s.upper()
counta = 0
countb = 0
for i in range(len(s)):
	if s[i] == a[i]:
		counta += 1
	else:
		countb += 1
if counta > countb or counta == countb:
	print(a)
else:
	print(b)


while True:
	s = input()
	if s.isalpha() == True and 1 <= len(s) <= 100:
		break
low = 0
up = 0
for i in range(0, len(s)):
	if s[i] == s[i].lower():
		low += 1
	else:
		up += 1
if low >= up:
	print(s.lower())
else:
	print(s.upper())


line = input()
lenth = len(line)
count = 0
for i in range(lenth):
	if line[i] == line.upper()[i]:
		count += 1
print([line.lower(), line.upper()][count > lenth // 2])


x = input()
lcount = ucount = 0
for i in x:
	if i.lower() == i:
		lcount += 1
	else:
		ucount += 1
if ucount > lcount:
	print(x.upper())
else:
	print(x.lower())


a = input()
print(eval('a' + ['.upper()', '.lower()'][sum((i.islower() for i in a)) * 2 >= len(a)]))


s = input()
up = 0
lo = 0
for i in range(len(s)):
	if s[i] == s[i].upper():
		up += 1
	elif s[i] == s[i].lower():
		lo += 1
if up > lo:
	print(s.upper())
else:
	print(s.lower())


s = input()
capCounter = 0
smallCounter = 0
cap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
small = 'abcdefghijklmnopqrstuvwxyz'
for x in s:
	if x in cap:
		capCounter += 1
	elif x in small:
		smallCounter += 1
if capCounter > smallCounter:
	print(s.upper())
else:
	print(s.lower())


a = list(input())
low = 0
up = 0
for i in range(len(a)):
	if a[i] == a[i].lower():
		low += 1
	else:
		up += 1
if low >= up:
	print(''.join(a).lower())
else:
	print(''.join(a).upper())


strA = input()
upper = 0
lower = 0
for st in strA:
	if st.isupper():
		upper += 1
	else:
		lower += 1
print(strA.lower() if lower >= upper else strA.upper())


word = input()
l = len(word)
counter = 0
for i in range(l):
	if word[i].isupper():
		counter += 1
if counter > l - counter:
	print(word.upper())
else:
	print(word.lower())


s = input()
sm = 0
for i in s:
	if i >= 'a' and i <= 'z':
		sm += 1
if sm >= abs(len(s) - sm):
	print(s.lower())
else:
	print(s.upper())


word = input()
ups = len(list(filter(lambda c: c.isupper(), word)))
print(word.upper() if len(word) < 2 * ups else word.lower())


import sys
input = sys.stdin.readline

def low(s):
	cl = 0
	for i in s:
		if i.isupper():
			cl += 1
	return cl

def up(s):
	cu = 0
	for i in s:
		if i.islower():
			cu += 1
	return cu
s = input()
cu = up(s)
cl = low(s)
if cu > cl:
	print(s.lower())
elif cu == cl:
	print(s.lower())
else:
	print(s.upper())


s = input()
m = 0
n = 0
for i in range(0, len(s)):
	u = s[i]
	if u.islower():
		m += 1
	else:
		n += 1
if n > m:
	print(s.upper())
else:
	print(s.lower())


def solution():
	word = input()
	(u, l) = (0, 0)
	for w in word:
		if w.isupper():
			u += 1
		else:
			l += 1
	if u > l:
		print(word.upper())
	else:
		print(word.lower())
solution()


word = input()
word = word.strip()
uppercase = 0
lowercase = 0
for character in word:
	if character.isupper():
		uppercase += 1
	else:
		lowercase += 1
if uppercase > lowercase:
	word = word.upper()
else:
	word = word.lower()
print(word)


txt = input()
low = upp = 0
for x in txt:
	if x.islower():
		low += 1
	if x.isupper():
		upp += 1
if low >= upp:
	print(txt.lower())
else:
	print(txt.upper())


s1 = input()
count1 = 0
count2 = 0
for i in range(len(s1)):
	if s1[i].islower():
		count1 += 1
	else:
		count2 += 1
if count1 < count2:
	print(s1.upper())
else:
	print(s1.lower())


s = input()
ku = 0
kl = 0
for i in s:
	if ord(i) >= 97:
		kl += 1
	else:
		ku += 1
if ku == kl:
	print(s.lower())
elif kl < ku:
	print(s.upper())
else:
	print(s.lower())


s = input()
small = 0
big = 0
for i in s:
	if i >= 'a' and i <= 'z':
		small += 1
	elif 'A' <= i <= 'Z':
		big += 1
if small >= big:
	print(s.lower())
elif big >= small:
	print(s.upper())
elif small == big:
	print(s.lower())


word = input()
c = 0
for i in word:
	if i == i.lower():
		c += 1
	else:
		pass
if c >= len(word) / 2:
	print(word.lower())
else:
	print(word.upper())


str1 = input()
upperc = 0
lowerc = 0
for i in range(len(str1)):
	if str1[i].isupper():
		upperc += 1
	else:
		lowerc += 1
if upperc > lowerc:
	a = str1.upper()
elif upperc < lowerc:
	a = str1.lower()
elif upperc == lowerc:
	a = str1.lower()
print(a)


word = input()
upper = 0
down = 0
for letter in word:
	if letter.isupper():
		upper += 1
	else:
		down += 1
if down >= upper:
	print(word.lower())
else:
	print(word.upper())


b = input()
lower_count = sum(map(str.islower, b))
upper_count = len([x for x in b if x.isupper()])
if lower_count >= upper_count:
	print(b.lower())
else:
	print(b.upper())


s = input()
t = list(s)
length = len(t)
low = 0
for i in t:
	if i.upper() != i:
		low = low + 1
if low >= length / 2:
	print(s.lower())
else:
	print(s.upper())


s = input()
c = 0
C = 0
small = ''
large = ''
for i in s:
	if i.islower():
		c += 1
	else:
		C += 1
if c < C:
	print(s.upper())
else:
	print(s.lower())


str1 = input()
upperstr1 = str1.upper()
cnt = 0
for i in range(len(str1)):
	if upperstr1[i] != str1[i]:
		cnt += 1
if cnt >= len(str1) * 1.0 / 2:
	print(str1.lower())
else:
	print(str1.upper())


s = input()
u_c = 0
l_c = 0
for c in s:
	if c == c.upper():
		u_c = u_c + 1
	else:
		l_c = l_c + 1
if u_c > l_c:
	n_s = s.upper()
elif l_c > u_c:
	n_s = s.lower()
else:
	n_s = s.lower()
print(n_s)


s = input()
low = 0
up = 0
for i in s:
	if ord(i) in range(65, 65 + 26):
		up = up + 1
	else:
		low += 1
print(s.lower()) if up <= low else print(s.upper())


s = input()
(a, b) = (0, 0)
for i in range(len(s)):
	if 'a' <= s[i] <= 'z':
		a += 1
	else:
		b += 1
if a > b:
	s = s.lower()
elif a == b:
	s = s.lower()
else:
	s = s.upper()
print(s)


w = str(input())

def count_up_lower(word):
	lst = [char for char in word]
	(up, low) = (0, 0)
	for char in lst:
		if char.islower():
			low += 1
		else:
			up += 1
	if up > low:
		print(word.upper())
	else:
		print(word.lower())
count_up_lower(w)


word = input()
upper_case = 0
lower_case = 0
for letter in word:
	if letter.isupper():
		upper_case += 1
	else:
		lower_case += 1
if lower_case >= upper_case:
	word = word.lower()
	print(word)
else:
	word = word.upper()
	print(word)


string = input()
upper = 0
lower = 0
for i in range(len(string)):
	if string[i] >= 'a' and string[i] <= 'z':
		lower += 1
	elif string[i] >= 'A' and string[i] <= 'Z':
		upper += 1
if upper == lower or upper < lower:
	print(string.lower())
elif upper > lower:
	print(string.upper())


s = input()
alth = 'QWERTYUIOPASDFGHJKLZXCVBNM'
alth3 = 'QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm'
alth4 = 'QWERTYUIOPASDFGHJKLZXCVBNMQWERTYUIOPASDFGHJKLZXCVBNM'
alth5 = 'qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm'
alth2 = 'qwertyuiopasdfghjklzxcvbnm'
num = 0
for i in s:
	if alth.find(i) == -1:
		num += 1
if num >= len(s) // 2 + len(s) % 2:
	for i in s:
		print(alth5[alth3.find(i)], end='')
else:
	for i in s:
		print(alth4[alth3.find(i)], end='')


s = input()
l1 = 0
l2 = 0
l = len(s)
i = 0
while i < l:
	if s[i].islower():
		l1 = l1 + 1
	else:
		l2 = l2 + 1
	i = i + 1
if l1 >= l2:
	print(s.lower())
else:
	print(s.upper())


import sys

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

def iinput():
	return int(input())

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

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
n = input()
upper = 0
lower = 0
for i in range(len(n)):
	if ord(n[i]) >= 97 and ord(n[i]) <= 122:
		lower += 1
	elif ord(n[i]) >= 65 and ord(n[i]) <= 90:
		upper += 1
if upper > lower:
	print(n.upper())
else:
	print(n.lower())


__author__ = 'mohdosamah'
import sys
import os
s = sys.stdin.readline()
l = len(s)
count1 = 0
count2 = 0
for i in range(0, l - 1):
	if s[i].islower():
		count1 += 1
	else:
		count2 += 1
if count1 >= count2:
	print(s.lower())
else:
	print(s.upper())


s = input()
copy = s
l = list(copy)
count = 0
for i in range(len(l)):
	l[i] = ord(l[i])
	if 96 < l[i] < 123:
		count += 1
	elif 64 < l[i] < 91:
		count -= 1
if count >= 0:
	s = s.lower()
else:
	s = s.upper()
print(s)


def fct(s):
	nbu = 0
	nbl = 0
	for i in range(len(s)):
		if s[i].isupper():
			nbu += 1
		else:
			nbl += 1
	if nbl < nbu:
		return s.upper()
	else:
		return s.lower()
print(fct(input()))


word = str(input())
low = 0
for i in word:
	if i.islower():
		low += 1
if len(word) - low <= low:
	print(word.lower())
else:
	print(word.upper())


str = input()
lo_count = 0
up_count = 0
for ch in str:
	if ch.isupper():
		up_count += 1
	else:
		lo_count += 1
if up_count <= lo_count:
	print(str.lower())
else:
	print(str.upper())


try:
	a = input()
	u = 0
	l = 0
	for j in a:
		if j.isupper():
			u += 1
		else:
			l += 1
	if u > l:
		print(a.upper())
	else:
		print(a.lower())
except:
	pass


message = input()
a = sum((1 for c in message if c.isupper()))
b = sum((1 for c in message if c.islower()))
if b > a or b == a:
	print(message.lower())
else:
	print(message.upper())


strg = str(input())
upperCount = 0
lowerCount = 0
for i in strg:
	if i.isupper():
		upperCount += 1
	else:
		lowerCount += 1
if upperCount > lowerCount:
	print(strg.upper())
else:
	print(strg.lower())


s = str(input())
(m, n) = (0, 0)
for i in s:
	if i.isupper() is True:
		m += 1
	else:
		n += 1
if m > n:
	print(s.upper())
else:
	print(s.lower())


line = str(input())
countLower = 0
countUpper = 0
for i in range(len(line)):
	if ord(line[i]) > 96:
		countLower += 1
	else:
		countUpper += 1
if countLower >= countUpper:
	result = line.lower()
else:
	result = line.upper()
print(result)


s = str(input())
lower = 0
upper = 0
a = ''
for i in range(len(s)):
	if 65 <= ord(s[i]) <= 90:
		upper += 1
	else:
		lower += 1
if upper > lower:
	for x in range(len(s)):
		if 65 <= ord(s[x]) <= 90:
			a += s[x]
		else:
			a += chr(ord(s[x]) - (ord('a') - ord('A')))
elif upper < lower:
	for y in range(len(s)):
		if 65 <= ord(s[y]) <= 90:
			a += chr(ord(s[y]) + (ord('a') - ord('A')))
		else:
			a += s[y]
else:
	for z in range(len(s)):
		if 65 <= ord(s[z]) <= 90:
			a += chr(ord(s[z]) + (ord('a') - ord('A')))
		else:
			a += s[z]
print(a)


inp = input()
count = 0
count1 = 0
for i in inp:
	if i.isupper():
		count = count + 1
	else:
		count1 = count1 + 1
if count > count1:
	print(inp.upper())
else:
	print(inp.lower())


word = input()
m = 0
n = 0
for i in word:
	if i.isupper() == True:
		m += 1
	else:
		n += 1
if m > n:
	print(word.upper())
else:
	print(word.lower())


x = input()
h = list(x)
ucount = 0
lcount = 0
h = [ord(j) for j in h]
for i in range(len(h)):
	if h[i] > 96 and h[i] <= 122:
		lcount = lcount + 1
	elif h[i] >= 65 and h[i] <= 90:
		ucount = ucount + 1
if lcount > ucount or lcount == ucount:
	print(x.lower())
else:
	print(x.upper())


word = input()
temp = word.upper()
num = [word[i] for i in range(len(word)) if word[i] != temp[i]]
print(word.upper() if len(num) < len(word) / 2 else word.lower())


from sys import stdin, stdout
word = stdin.readline().strip('\n').strip('\t')
up = 0
low = 0
for c in word:
	if c.isupper():
		up = up + 1
	else:
		low = low + 1
if up > low:
	print(word.upper())
else:
	print(word.lower())


def word(s):
	u_case = 0
	l_case = 0
	for i in s:
		if i.isupper():
			u_case += 1
		elif i.islower():
			l_case += 1
		else:
			pass
	if u_case <= l_case:
		return s.lower()
	else:
		return s.upper()
s = str(input())
res = word(s)
print(res)


userInput = input()
lengthofText = len(userInput)
summation = sum((1 for c in userInput if c.isupper()))
if lengthofText / 2 >= summation:
	print(userInput.lower())
else:
	print(userInput.upper())


s = input()
s = list(s)
count = 0
count1 = 0
for x in s:
	if x.isupper():
		count += 1
	elif x.islower():
		count1 += 1
s = ''.join(s)
if count == count1 or count1 > count:
	print(s.lower())
elif count > count1:
	print(s.upper())


small = []
alpha = 'a'
for i in range(0, 26):
	small.append(alpha)
	alpha = chr(ord(alpha) + 1)
s = input()
sm = 0
for i in s:
	if i in small:
		sm = sm + 1
	else:
		sm = sm - 1
if sm < 0:
	print(s.upper())
else:
	print(s.lower())


s1 = input()
s = list(s1)
k = len([i for i in s if i.islower()])
k1 = len([i for i in s if i.isupper()])
if k >= k1:
	s1 = s1.lower()
else:
	s1 = s1.upper()
print(s1)


s = input()
k = 0
for i in s:
	if i.islower():
		k += 1
n = len(s) - k
if k >= n:
	print(s.lower())
else:
	print(s.upper())


S = input()
S = list(S)
sum1 = 0
sum2 = 0
for i in S:
	if i.isupper() == True:
		sum1 += 1
	if i.islower() == True:
		sum2 += 1
S = ''.join(S)
if sum1 > sum2:
	print(S.upper())
elif sum1 <= sum2:
	print(S.lower())


n = input()
c = 0
d = 0
for i in range(len(n)):
	if n[i].islower() == True:
		c = c + 1
	elif n[i].isupper() == True:
		d = d + 1
if d > c:
	n = n.upper()
	print(n)
elif d <= c:
	n = n.lower()
	print(n)


t = input()
max_value = 0
for i in t:
	if i.islower():
		max_value += 1
	elif i.isupper():
		max_value -= 1
if max_value < 0:
	print(t.upper())
else:
	print(t.lower())


s = input()
ct_upper = 0
ct_lower = 0
for i in s:
	if ord(i) > 96:
		ct_lower += 1
	else:
		ct_upper += 1
print(s.upper() if ct_upper > ct_lower else s.lower())


po = input()
small = int(0)
big = int(0)
for i in range(len(po)):
	if po[i].isupper():
		big += 1
	elif po[i].islower():
		small += 1
if big > small:
	print(po.upper())
elif big < small:
	print(po.lower())
elif big == small:
	print(po.lower())


str = input()
cnt = 0
cnt1 = 0
for i in range(len(str)):
	if str[i].islower() == True:
		cnt = cnt + 1
	else:
		cnt1 = cnt1 + 1
if cnt >= cnt1:
	print(str.lower())
else:
	print(str.upper())


n = input()

def n_lower(string):
	return sum((1 for i in string if i.islower()))
z = n_lower(n)
if z >= len(n) * 0.5:
	print(n.lower())
else:
	print(n.upper())


s = input()
z = s
count_upper = 0
count_lower = 0
s = list(s)
for i in s:
	if i == i.upper():
		count_upper += 1
	else:
		count_lower += 1
if count_lower < count_upper:
	print(z.upper())
else:
	print(z.lower())


n = str(input())
(lower, upper) = (0, 0)
for i in range(len(n)):
	if ord(n[i]) >= 97 and ord(n[i]) <= 122:
		lower += 1
	elif ord(n[i]) >= 65 and ord(n[i]) <= 90:
		upper += 1
if lower > upper or lower == upper:
	print(n.lower())
else:
	print(n.upper())


x = input()
length = len(x)
i = 0
lowercase = 0
uppercase = 0
while length != 0:
	if x[i] == x[i].lower():
		lowercase += 1
	else:
		uppercase += 1
	length -= 1
	i += 1
if lowercase > uppercase:
	print(x.lower())
elif uppercase > lowercase:
	print(x.upper())
else:
	print(x.lower())


s1 = input()
count_l = 0
count_u = 0
for i in range(len(s1)):
	if s1[i].islower():
		count_l = count_l + 1
	else:
		count_u = count_u + 1
if count_u > count_l:
	s1 = s1.upper()
elif count_u < count_l:
	s1 = s1.lower()
else:
	s1 = s1.lower()
print(s1)


mystring = input()
upper_count = 0
lower_count = 0
for i in range(len(mystring)):
	if mystring[i].isupper():
		upper_count += 1
	else:
		lower_count += 1
if upper_count > lower_count:
	my_new_string = mystring.upper()
else:
	my_new_string = mystring.lower()
print(my_new_string)


n = input()
l = n.lower()
u = n.upper()
a = list(n)
b = list(l)
c = 0
for i in range(len(a)):
	if a[i] == b[i]:
		c += 1
if c >= len(a) - c:
	print(l)
else:
	print(u)


c1 = 0
c2 = 0
a = 'abcdefghijklmnopqrstuvwxyz'
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
st = input()
for i in range(len(st)):
	if st[i] in a:
		c1 += 1
	else:
		c2 += 1
if c2 > c1:
	st = st.upper()
else:
	st = st.lower()
print(st)


s = str(input())
characters = []
if len(s) in range(1, 101):
	for i in range(0, len(s)):
		b = s[i]
		c = characters.append(b)
	B = 0
	for a in range(0, len(s)):
		if characters[a] == characters[a].upper():
			B = B + 1
		else:
			B = B
	if int(B) > int(int(len(s)) / 2):
		print(s.upper())
	else:
		print(s.lower())


n = list(input())
countu = 0
countl = 0
for i in range(len(n)):
	if n[i].isupper():
		countu = countu + 1
	else:
		countl = countl + 1
n = ''.join(n)
if countu > countl:
	print(n.upper())
else:
	print(n.lower())


txt = input()
sum1 = 0
sum2 = 0
for i in txt:
	if i.islower():
		sum1 += 1
	else:
		sum2 += 1
if sum1 >= sum2:
	print(txt.lower())
else:
	print(txt.upper())


word = input()
uppercases = 0
lowercases = 0
for letter in word:
	if letter.upper() == letter:
		uppercases += 1
	else:
		lowercases += 1
if uppercases > lowercases:
	print(word.upper())
else:
	print(word.lower())


word = input()
u = len([x for x in word if x.isupper()])
l = len(word) - u
if l >= u:
	print(word.lower())
else:
	print(word.upper())


s = input('')
list1 = []
for i in s:
	list1.append(i.isupper())
l = list1.count(True)
m = list1.count(False)
if l == m:
	print(s.lower())
elif l > m:
	print(s.upper())
else:
	print(s.lower())


def main():
	S = input().rstrip()
	l = sum((i.islower() for i in S))
	print(S.lower() if l >= len(S) / 2 else S.upper())
main()


(str_in, low_cnt, up_cnt) = (input().strip(), 0, 0)
for x in str_in:
	if 65 <= ord(x) <= 90:
		up_cnt += 1
	else:
		low_cnt += 1
cnt = 1 if up_cnt > low_cnt else 0
print(str_in.upper() if cnt else str_in.lower())


s = input()
l = sum([x.islower() for x in list(s)])
u = sum([x.isupper() for x in list(s)])
if l > u:
	print(s.lower())
elif u > l:
	print(s.upper())
else:
	print(s.lower())


def w_convert(w):
	contM = 0
	contm = 0
	div = len(w) / 2
	for i in range(0, len(w)):
		if w[i].isupper() == True:
			contM += 1
		elif w[i].islower() == True:
			contm += 1
	if contM == contm:
		return w.lower()
	elif contM >= div:
		return w.upper()
	elif contm >= div:
		return w.lower()
w = input()
w_upper_lower = w_convert(w)
print(w_upper_lower)


s = input()
l = list(s)
c = 0
c1 = 0
for i in range(0, len(s)):
	if s[i].islower() == True:
		c = c + 1
	if s[i].isupper() == True:
		c1 = c1 + 1
if c > c1:
	print(s.lower())
elif c < c1:
	print(s.upper())
else:
	print(s.lower())


s = input()
d = {}
for i in s:
	if i == i.capitalize():
		if 'u' in d:
			d['u'] += 1
		else:
			d['u'] = 1
	elif 'l' in d:
		d['l'] += 1
	else:
		d['l'] = 1
if 'l' not in d:
	print(s)
elif 'u' not in d:
	print(s)
elif d['l'] == d['u']:
	print(s.lower())
elif d['l'] < d['u']:
	print(s.upper())
else:
	print(s.lower())


a = input()
up = 0
low = 0
for b in a:
	if b.isupper():
		up += 1
	else:
		low += 1
if low < up:
	print(a.upper())
else:
	print(a.lower())


(lower, upper) = (0, 0)
string = input().strip()
for m in string:
	if m.islower() == 1:
		lower += 1
	else:
		upper += 1
if upper > lower:
	print(string.upper())
else:
	print(string.lower())


word = str(input())
word_u = word.upper()
s = 0
for i in range(len(word)):
	if word[i] != word_u[i]:
		s += 1
if s >= len(word) - s:
	print(word.lower())
else:
	print(word.upper())


r = input()
d1 = 0
d2 = 0
if len(r) >= 1 and len(r) <= 100:
	for j in r:
		if j.islower():
			d1 = d1 + 1
		elif j.isupper():
			d2 = d2 + 1
	if d1 > d2:
		print(r.lower())
	elif d1 < d2:
		print(r.upper())
	else:
		print(r.lower())


name = list(input())
upper = 0
lower = 0
for c in name:
	if c.isupper():
		upper += 1
	else:
		lower += 1
x = ''.join(name)
if upper > lower:
	print(x.upper())
else:
	print(x.lower())


def main():
	wo = input()
	upper = lower = 0
	for i in wo:
		if i.isupper():
			upper += 1
		else:
			lower += 1
	if upper > lower:
		print(wo.upper())
	else:
		print(wo.lower())
main()


string = input()
small = 0
caps = 0
for i in string:
	if ord(i) >= 97:
		small += 1
	else:
		caps += 1
if caps > small:
	newstr = ''
	for i in string:
		if ord(i) >= 97:
			newstr += chr(ord(i) - 32)
		else:
			newstr += i
	print(newstr)
else:
	newstr = ''
	for i in string:
		if ord(i) < 97:
			newstr += chr(ord(i) + 32)
		else:
			newstr += i
	print(newstr)


string = input()
lower = 0
upper = 0
for i in range(len(string)):
	if ord(string[i]) > 96:
		lower += 1
	else:
		upper += 1
if upper > lower:
	print(string.upper())
else:
	print(string.lower())


n = input()
u = 0
l = 0
for x in n:
	if x.isupper():
		u += 1
	else:
		l += 1
if u > l:
	op = n.upper()
else:
	op = n.lower()
print(op)


st = input()
low = 0
up = 0
for word in st:
	a = ord(word)
	if a >= 92:
		low += 1
	else:
		up += 1
if low >= up:
	print(st.lower())
else:
	print(st.upper())


s = input()
count_u = 0
count_l = 0
for i in range(0, len(s)):
	if s[i].islower():
		count_l += 1
	else:
		count_u += 1
if count_l >= count_u:
	print(s.lower())
else:
	print(s.upper())


str = input()
cnt_upper = 0
cnt_lower = 0
for n in str:
	if n.isupper():
		cnt_upper += 1
	else:
		cnt_lower += 1
if cnt_upper > cnt_lower:
	print(str.upper())
else:
	print(str.lower())


s = input()
sl = list(s)
su = 0
sl = 0
for i in range(len(s)):
	if s[i].isupper():
		su += 1
	else:
		sl += 1
if su > sl:
	s = s.upper()
else:
	s = s.lower()
print(s)


sh = input()
cu = 0
cl = 0
for a in sh:
	if a in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		cu = cu + 1
	else:
		cl = cl + 1
if cu > cl:
	print(sh.upper())
else:
	print(sh.lower())


s = input()
(c, m) = (0, 0)
for i in s:
	if 65 <= ord(i) <= 90:
		c += 1
	elif 97 <= ord(i) <= 122:
		m += 1
if c > m:
	print(s.upper())
else:
	print(s.lower())


s = input()
mal = 0
bol = 0
for element in s:
	if 'a' <= element <= 'z':
		mal += 1
	elif 'A' <= element <= 'Z':
		bol += 1
if mal > bol:
	print(s.lower())
elif mal < bol:
	print(s.upper())
elif mal == bol:
	print(s.lower())


l = list(input())
count1 = 0
count2 = 0
for i in l:
	if i.islower():
		count1 += 1
	elif i.isupper():
		count2 += 1
for j in l:
	if count1 > count2:
		print(j.lower(), end='')
	elif count2 > count1:
		print(j.upper(), end='')
	elif count1 == count2:
		print(j.lower(), end='')


strr = input()
da = strr.upper()
DA = 0
xi = strr.lower()
XI = 0
index = 0
while index < len(strr):
	if da[index] == strr[index]:
		DA = DA + 1
	elif xi[index] == strr[index]:
		XI = XI + 1
	index = index + 1
if DA > XI:
	print(strr.upper())
else:
	print(strr.lower())


s = str(input())
large = 0
small = 0
for i in range(len(s)):
	if s[i:i + 1].isupper():
		large += 1
	elif s[i:i + 1].islower():
		small += 1
if small >= large:
	print(s.lower())
elif small < large:
	print(s.upper())


str = input()
count = 0
l = len(str) // 2
for i in str:
	if i.isupper():
		count = count + 1
if count > l:
	print(str.upper())
else:
	print(str.lower())


word = input()
ups = len(list(filter(lambda a: a.isupper(), word)))
print(word.lower() if len(word) - ups >= ups else word.upper())


def word(str1, str2):
	ct = 0
	for i in range(len(str1)):
		if str1[i] != str2[i]:
			ct += 1
	return ct
s = input()
str1 = s.lower()
str2 = s.upper()
n1 = word(s, str1)
n2 = word(s, str2)
if n1 <= n2:
	print(str1)
else:
	print(str2)


n = input()
a = 0
b = 0
for i in range(len(n)):
	if str(n[i]).isupper() == True:
		a = a + 1
	else:
		b = b + 1
if a > b:
	print(n.upper())
if b >= a:
	print(n.lower())


a = input()
s = list(a)
upper = 0
lower = 0
for item in s:
	if item.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(a.upper())
else:
	print(a.lower())


str1 = input()
count_upper = 0
count_lower = 0
for a in str1:
	if a.isupper():
		count_upper += 1
	else:
		count_lower += 1
if count_upper > count_lower:
	print(str1.upper())
else:
	print(str1.lower())


s = input()
uppercase = 0
lowercase = 0
for i in s:
	if i.isupper():
		uppercase += 1
	elif i.islower():
		lowercase += 1
if uppercase > lowercase:
	s = s.upper()
elif lowercase >= uppercase:
	s = s.lower()
print(s)


line = str(input())
upp = 0
for it in line:
	if it.isupper():
		upp += 1
if upp > len(line) / 2:
	print(line.upper())
else:
	print(line.lower())


s = input()
lower = 0
upper = 0
for i in s:
	if i == i.upper():
		upper += 1
	if i == i.lower():
		lower += 1
lis = [x for x in s]
ans = []
for i in lis:
	if lower >= upper:
		if i.isupper():
			ans.append(i.lower())
		else:
			ans.append(i)
	elif i.islower():
		ans.append(i.upper())
	else:
		ans.append(i)
print(''.join(ans))


s = input()
i = 0
c = 0
while i < len(s):
	if s[i].isupper():
		c += 1
	i += 1
if c > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


s = input()
c = 0
for i in range(len(s)):
	if ord(s[i]) < 91:
		c += 1
	else:
		c -= 1
if c > 0:
	print(s.upper())
else:
	print(s.lower())


n = input()
s = 0
c = 0
for i in n:
	if ord(i) > 94:
		s = s + 1
	else:
		c = c + 1
if c > s:
	print(n.upper())
else:
	print(n.lower())


sir = input()
contor_mici = 0
contor_mari = 0
for i in sir:
	if i.islower():
		contor_mici += 1
	else:
		contor_mari += 1
sir2 = ''
if contor_mari > contor_mici:
	for i in sir:
		if i.islower():
			sir2 += i.upper()
		else:
			sir2 += i
else:
	for i in sir:
		if i.isupper():
			sir2 += i.lower()
		else:
			sir2 += i
print(sir2)


n = input()
uc = lc = 0
for i in n:
	if ord(i) >= 97 and ord(i) <= 122:
		lc += 1
	else:
		uc += 1
if uc > lc:
	print(n.upper())
else:
	print(n.lower())


word = input()
word2 = list(word)
counter1 = 0
counter2 = 0
for i in word2:
	if i.isupper() == 1:
		counter1 += 1
	else:
		counter2 += 1
if counter1 <= counter2:
	for i in range(0, len(word2)):
		word2[i] = word2[i].lower()
else:
	for i in range(0, len(word2)):
		word2[i] = word2[i].upper()
for i in word2:
	print(i, end='')


i = input()
upper = 0
lower = 0
for ele in range(len(i)):
	if i[ele].islower() == True:
		lower += 1
	else:
		upper += 1
if lower > upper:
	print(i.lower())
elif lower == upper:
	print(i.lower())
else:
	print(i.upper())


ch = input()
minis = majus = 0
for i in range(0, len(ch)):
	if ch[i].isupper():
		majus += 1
	else:
		minis += 1
if len(ch) == 1:
	print(ch)
elif majus > minis:
	print(ch.upper())
else:
	print(ch.lower())


s = input()
upp = set('QWERTYUIOPASDFGHJKLZXCVBNM')
(n, cu, cl) = (len(s), 0, 0)
for ch in s:
	if ch in upp:
		cu += 1
	else:
		cl += 1
if cu > cl:
	print(s.upper())
else:
	print(s.lower())


s = input()
uc_count = lc_count = 0
for char in s:
	if char >= 'A' and char <= 'Z':
		uc_count += 1
	else:
		lc_count += 1
if uc_count > lc_count:
	print(s.upper())
else:
	print(s.lower())


s = input()
lower = range(97, 123)
upper = range(65, 91)
(l, u) = (0, 0)
for a in range(len(s)):
	if ord(s[a]) in lower:
		l += 1
	else:
		u += 1
s = list(s)
if l >= u:
	for a in range(len(s)):
		if ord(s[a]) in upper:
			s[a] = chr(ord(s[a]) + 32)
else:
	for a in range(len(s)):
		if ord(s[a]) in lower:
			s[a] = chr(ord(s[a]) - 32)
print(''.join(s))


s = input()
low_count = 0
for i in s:
	if i.islower():
		low_count += 1
up_count = len(s) - low_count
if low_count >= up_count:
	print(s.lower())
else:
	print(s.upper())


s = input()
b = 'Z'
count = 0
for i in range(len(s)):
	if s[i] > b:
		count += 1
	else:
		count -= 1
if count < 0:
	print(s.upper())
else:
	print(s.lower())


s = input()
lower_case_count = sum((1 for i in s if i.islower()))
upper_case_count = len(s) - lower_case_count
print(s.upper()) if upper_case_count > lower_case_count else print(s.lower())


s = input()
count1 = 0
count2 = 0
for i in s:
	if ord(i) in range(64, 91):
		count1 += 1
	elif ord(i) in range(96, 123):
		count2 += 1
if count2 >= count1:
	s = s.lower()
else:
	s = s.upper()
print(s)


def solve():
	s = list(input().strip())
	if sum([i.isupper() for i in s]) > len(s) // 2:
		print(''.join(s).upper())
	else:
		print(''.join(s).lower())
solve()


s = input()
up = 0
low = 0
for char in s:
	if char.upper() == char:
		up += 1
	elif char.lower() == char:
		low += 1
ans = ''
if low >= up:
	for char in s:
		ans += char.lower()
else:
	for char in s:
		ans += char.upper()
print(ans)


lower = list(map(chr, range(97, 123)))
upper = list(map(chr, range(65, 91)))
string = input()
upper_count = 0
lower_count = 0
for i in string:
	if i in lower:
		lower_count += 1
	if i in upper:
		upper_count += 1
if lower_count == upper_count:
	string = string.lower()
elif lower_count > upper_count:
	string = string.lower()
else:
	string = string.upper()
print(string)


S = input()
s = list(S)
l = len(s)
count = 0
for i in range(l):
	if s[i] in 'QWERTYUIOPASDFGHJKLZXCVBNM':
		count += 1
if count > l / 2:
	print(S.upper())
else:
	print(S.lower())


word = input()
low = up = 0
for s in word:
	if s.islower():
		low += 1
	else:
		up += 1
if low >= up:
	print(word.lower())
else:
	print(word.upper())


s = input()
l = 0
p = 0
for i in s:
	if i.islower():
		l += 1
	else:
		p += 1
if p > l:
	print(s.upper())
else:
	print(s.lower())


def blue(s):
	(u, l) = (0, 0)
	for i in s:
		if i.isupper():
			u += 1
		else:
			l += 1
	if u > l:
		return s.upper()
	return s.lower()
print(blue(input()))


word = input()
low = len(word)
upper = 'QWERTYUIOPASDFGHJKLZXCVBNM'
upcount = 0
for i in word:
	if i in upper:
		upcount += 1
if upcount == low / 2:
	print(word.lower())
elif upcount < low / 2:
	print(word.lower())
else:
	print(word.upper())


string = input()
capital = sum((1 for c in string if c.isupper()))
lower = sum((1 for c in string if c.islower()))
if capital > lower:
	print(string.upper())
else:
	print(string.lower())


n = input()
l = sum((1 for x in n if x.islower()))
print(n.lower() if l >= len(n) - l else n.upper())


s = input()
lc = 0
uc = 0
for ele in s:
	if ele >= 'a' and ele <= 'z':
		lc += 1
	elif ele >= 'A' and ele <= 'Z':
		uc += 1
if lc >= uc:
	print(s.lower())
else:
	print(s.upper())


s = input()
l = 0
u = 0
for i in range(0, len(s)):
	if s[i:i + 1] in 'abcdefghijklmnopqrstuvwxyz':
		l = l + 1
	else:
		u = u + 1
if l >= u:
	print(s.lower())
else:
	print(s.upper())


word = str(input())
border = len(word) / 2
cap = 0
small = 0
capital = 0
letList = []
for i in range(0, len(word)):
	letList.append(word[i])
	if ord(word[i]) > 95:
		small += 1
	else:
		cap += 1
	if cap > border:
		capital = 1
for j in range(0, len(letList)):
	if capital:
		if ord(word[j]) > 95:
			letList[j] = chr(ord(word[j]) - 32)
	elif ord(word[j]) < 95:
		letList[j] = chr(ord(word[j]) + 32)
print(''.join(letList))


import sys
s = sys.stdin.readline().strip()

def check_upper(c):
	if c >= 'A' and c <= 'Z':
		return True
	else:
		return False
upper_count = 0
for ch in s:
	if check_upper(ch):
		upper_count += 1
	else:
		upper_count -= 1
if upper_count > 0:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
word = []
for i in s:
	word.append(i)
up = []
lw = []
for i in word:
	if 65 <= ord(i) <= 90:
		up.append(word.index(i))
	else:
		lw.append(word.index(i))
if len(up) <= len(lw):
	print(s.lower())
else:
	print(s.upper())


s = input()
m = 0
b = 0
for i in range(len(s)):
	if ord(s[i]) > 96:
		m += 1
	else:
		b += 1
if b > m:
	print(s.upper())
else:
	print(s.lower())


s = input()
t = 0
for i in s:
	if ord(i) < 97:
		t += 1
t1 = len(s)
t2 = t1 - t
if t > t2:
	print(s.upper())
else:
	print(s.lower())


string = input()
cnt1 = 0
cnt2 = 0
for itr in string:
	if 65 <= ord(itr) <= 90:
		cnt1 = cnt1 + 1
	elif 97 <= ord(itr) <= 122:
		cnt2 = cnt2 + 1
if cnt1 > cnt2:
	print(string.upper())
else:
	print(string.lower())


import string
x = 0
y = 0
a = str(input())
hossz = len(a)
for i in range(hossz):
	if a[i] in string.ascii_uppercase:
		x = x + 1
	else:
		y = y + 1
if x > y:
	print(a.upper())
else:
	print(a.lower())


st = input()
small = 0
captial = 0
for i in range(0, len(st)):
	if ord(st[i]) > 64 and ord(st[i]) < 91:
		captial += 1
	if ord(st[i]) > 96 and ord(st[i]) < 123:
		small += 1
if len(st) == 1:
	if ord(st[i]) > 64 and ord(st[i]) < 91:
		print(st.upper())
	if ord(st[i]) > 96 and ord(st[i]) < 123:
		print(st.lower())
elif small >= captial:
	print(st.lower())
else:
	print(st.upper())


n = input()
lower_count = 0
upper_count = 0
for i in range(len(n)):
	if n[i].islower():
		lower_count += 1
	else:
		upper_count += 1
if lower_count > upper_count or lower_count == upper_count:
	print(n.lower())
else:
	print(n.upper())


c1 = 0
b1 = 0
n = input()
for i in n:
	if i == 'A' or i == 'B' or i == 'C' or (i == 'D') or (i == 'E') or (i == 'F') or (i == 'G') or (i == 'H') or (i == 'I') or (i == 'J') or (i == 'K') or (i == 'L') or (i == 'M') or (i == 'N') or (i == 'O') or (i == 'P') or (i == 'Q') or (i == 'R') or (i == 'S') or (i == 'T') or (i == 'U') or (i == 'V') or (i == 'W') or (i == 'X') or (i == 'Y') or (i == 'Z'):
		c1 = c1 + 1
	else:
		b1 = b1 + 1
if c1 > b1:
	print(n.upper())
else:
	print(n.lower())


n = input()
cU = 0
cL = 0
for i in range(len(n)):
	if n[i].isupper():
		cU += 1
	else:
		cL += 1
if cU > cL:
	print(n.upper())
else:
	print(n.lower())


word = input()
countUpper = 0
countLower = 0
for letter in word:
	if letter in 'QWERTYUIOPASDFGHJKLZXCVBNM':
		countUpper += 1
	elif letter in 'qwertyuiopasdfghjklzxcvbnm':
		countLower += 1
if countUpper > countLower:
	word = word.upper()
else:
	word = word.lower()
print(word)


s = str(input())
l = list(s)
su = 0
sl = 0
for i in range(len(s)):
	if 'a' <= l[i] <= 'z':
		sl += 1
	elif 'A' <= l[i] <= 'Z':
		su += 1
ss = ''.join(l)
if sl >= su:
	ss = ss.lower()
else:
	ss = ss.upper()
print(ss)


s = input()
i = 0
for c in s:
	i += ord(c) < 97
print([s.lower(), s.upper()][i > len(s) // 2])


s = str(input())
b = 0
l = 0
for i in s:
	if i == i.lower():
		l += 1
	else:
		b += 1
if b <= l:
	print(s.lower())
else:
	print(s.upper())


palavra = input()
letras_maiusculas = 0
letras_minusculas = 0
for letra in palavra:
	if letras_maiusculas > len(palavra) // 2:
		break
	elif letras_minusculas > len(palavra) // 2:
		break
	if letra.isupper() == True:
		letras_maiusculas += 1
	else:
		letras_minusculas += 1
if letras_maiusculas > letras_minusculas:
	print(palavra.upper())
else:
	print(palavra.lower())


n = input()
s = 0
k = 0
for i in n:
	if ord(i) >= ord('a') and ord(i) <= ord('z'):
		s = s + 1
	else:
		k = k + 1
if s >= k:
	m = n.lower()
	print(m)
else:
	z = n.upper()
	print(z)


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

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

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
s = input().strip()
uc = sum((1 for c in s if c.isupper()))
print(s.upper() if uc > len(s) - uc else s.lower())


s = input().strip()
ans = 0
for c in s:
	if c.isupper():
		ans += 1
print([s.lower(), s.upper()][ans > len(s) / 2])


a = 0
b = 0
x = str(input())
for i in x:
	if i == i.upper():
		a += 1
	elif i == i.lower():
		b += 1
if a > b:
	d = x.upper()
	print(d)
else:
	r = x.lower()
	print(r)


s = input()
p = s.lower()
print(p if 2 * sum([1 if c1 == c2 else 0 for (c1, c2) in zip(s, p)]) >= len(s) else s.upper())


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

def main():
	string = input()
	upper = 0
	lower = 0
	for str in string:
		if str.isupper():
			upper += 1
		else:
			lower += 1
	if upper > lower:
		print(string.upper())
	else:
		print(string.lower())
main()


a = input()
m = 0
for i in range(0, len(a)):
	if ord(a[i]) < 91:
		m += 1
	else:
		m -= 1
if m <= 0:
	a = str.lower(a)
else:
	a = str.upper(a)
print(a)


s = input()
c1 = 0
c2 = 0
for i in range(0, len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		c1 += 1
	elif s[i] >= 'A' and s[i] <= 'Z':
		c2 += 1
if c2 > c1:
	print(s.upper())
else:
	print(s.lower())


s = input()
print([s.upper(), s.lower()][sum((ch >= '[' for ch in s)) >= len(s) / 2])


s = input()
s1 = ''
k = 0
for c in s:
	if 'A' <= c <= 'Z':
		k += 1
if k <= len(s) - k:
	for i in range(len(s)):
		if 'A' <= s[i] <= 'Z':
			s1 += s[i].lower()
		else:
			s1 += s[i]
else:
	for i in range(len(s)):
		if 'a' <= s[i] <= 'z':
			s1 += s[i].upper()
		else:
			s1 += s[i]
print(s1)


s = input()
l = 0
u = 0
for a in s:
	if a in list('abcdefghijklmnopqrstuvwxyz'):
		l += 1
	else:
		u += 1
if l > u:
	print(s.lower())
elif l < u:
	print(s.upper())
else:
	print(s.lower())


s = input()
p = s.lower()
sh = 0
for i in range(len(s)):
	if p[i] != s[i]:
		sh += 1
if sh > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


s = input()
upper = 0
lower = 0
for char in s:
	if ord('a') <= ord(char) <= ord('z'):
		lower += 1
	else:
		upper += 1
if upper > lower:
	s = s.upper()
else:
	s = s.lower()
print(s)


w = input()
m = 0
M = 0
for x in w:
	if ord(x) > 96 and 123 > ord(x):
		m += 1
	else:
		M += 1
if M > m:
	print(w.upper())
else:
	print(w.lower())


str1 = input()
countupp = 0
countlow = 0
for i in str1:
	if i.isupper() == True:
		countupp += 1
	elif i.isupper() == False:
		countlow += 1
	else:
		continue
if countupp > countlow:
	print(str1.upper())
else:
	print(str1.lower())


s = input()
m = s.lower()
n = s.upper()
u = 0
l = 0
for c in s:
	if c.islower():
		l += 1
	elif c.isupper():
		u += 1
if l == u:
	print(m)
elif l > u:
	print(m)
elif l < u:
	print(n)


import math as mt
import sys, string
from collections import Counter, defaultdict
input = sys.stdin.readline
I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda : list(map(int, input().split()))

def main():
	s = input()
	cnt = 0
	for elm in s:
		if elm.isupper():
			cnt += 1
	if cnt > (len(s) - 1) / 2:
		print(s.upper(), end='')
	else:
		print(s.lower(), end='')
main()


s = input()
s_lower = s.lower()
s_upper = s.upper()
sum_lower = 0
sum_upper = 0
for i in range(len(s)):
	if s[i] != s_lower[i]:
		sum_lower += 1
	if s[i] != s_upper[i]:
		sum_upper += 1
if sum_lower > sum_upper:
	print(s_upper)
else:
	print(s_lower)


n = input()
a = []
a = list(n)
x = 0
y = 0
for i in range(len(a)):
	if a[i] >= 'A' and a[i] <= 'Z':
		x += 1
	else:
		y = y + 1
if x > y:
	for i in range(len(a)):
		if a[i] >= 'a' and a[i] <= 'z':
			a[i] = chr(ord(a[i]) - 32)
else:
	for i in range(len(a)):
		if a[i] >= 'A' and a[i] <= 'Z':
			a[i] = chr(ord(a[i]) + 32)
for i in range(len(a)):
	print(a[i], end='')


word = input()
capital = 0
small = 0
for i in range(len(word)):
	if word[i].isupper():
		capital += 1
	else:
		small += 1
if capital > small:
	print(word.upper())
else:
	print(word.lower())


s = input()
low = 0
up = 0
for i in s:
	if i.isupper() == True:
		up += 1
	else:
		low += 1
ans = ''
if low >= up:
	for i in s:
		if i.isupper() == True:
			v = i.swapcase()
			ans += v
		else:
			ans += i
else:
	for i in s:
		if i.islower() == True:
			v = i.swapcase()
			ans += v
		else:
			ans += i
print(ans)


def main():
	val = input()
	(up, low) = (0, 0)
	for x in val:
		if x.islower():
			low += 1
		else:
			up += 1
	if low >= up:
		val = val.lower()
	else:
		val = val.upper()
	print(val)
main()


s = input()
nUpper = 0
for c in s:
	if c.isupper():
		nUpper += 1
nLower = len(s) - nUpper
if nLower > nUpper:
	print(s.lower())
elif nUpper > nLower:
	print(s.upper())
else:
	print(s.lower())


slovo = input()
malih = bolwih = 0
for i in slovo:
	if i.islower():
		malih += 1
	else:
		bolwih += 1
if malih >= bolwih:
	print(slovo.lower())
else:
	print(slovo.upper())


def lowerOrUpper(word):
	lCount = 0
	uCount = 0
	for i in word:
		if i.islower():
			lCount += 1
		if i.isupper():
			uCount += 1
	if lCount < uCount:
		return word.upper()
	return word.lower()
word = input()
print(lowerOrUpper(word))


s = input()
_lower = 0
_upper = 0
for i in s:
	if i.islower():
		_lower += 1
	else:
		_upper += 1
if _lower >= _upper:
	print(s.lower())
else:
	print(s.upper())


s = input()
n = len(s)
count_upper = 0
count_lower = 0
for i in range(n):
	if ord(s[i]) >= 65 and ord(s[i]) < 91:
		count_upper += 1
	else:
		count_lower += 1
if count_lower >= n / 2:
	s = s.lower()
else:
	s = s.upper()
print(s)


word = str(input())
word_list = list(word)
count_small = 0
count_capital = 0
for i in range(len(word)):
	a = word[i]
	if 'a' <= a <= 'z':
		count_small += 1
	else:
		count_capital += 1
if count_small >= count_capital:
	print(word.lower())
else:
	print(word.upper())


s = input()
c1 = 0
c2 = 0
for i in s:
	if ord(i) >= 97:
		c1 += 1
	else:
		c2 += 1
if c1 >= c2:
	print(s.lower())
else:
	print(s.upper())


a = input()
up = 0
low = 0
for i in a:
	if i.isupper():
		up += 1
low = len(a) - up
if up > low:
	print(a.upper())
else:
	print(a.lower())


def _59A(word):
	count_upper = 0
	count_lower = 0
	for letter in word:
		if letter.isupper():
			count_upper += 1
		elif letter.islower():
			count_lower += 1
	if count_lower >= count_upper:
		return word.lower()
	else:
		return word.upper()
print(_59A(input()))


s = input()
lowerC = sum((1 for char in s if char.islower()))
upperC = sum((1 for char in s if char.isupper()))
if lowerC == upperC:
	print(s.lower())
elif lowerC > upperC:
	print(s.lower())
else:
	print(s.upper())


s = input()
s1 = s2 = ''
m = n = 0
for i in s:
	if i >= 'a':
		m += 1
		s1 += i
		s2 += i.upper()
	else:
		n += 1
		s1 += i.lower()
		s2 += i
if m < n:
	print(s2)
else:
	print(s1)


s = input()
t = list(s)
upper_ct = sum((1 for c in t if c.isupper()))
lower_ct = sum((1 for c in t if c.islower()))
if upper_ct > lower_ct:
	print(s.upper())
else:
	print(s.lower())


word = input()
c = list(filter(lambda x: x >= 97, map(ord, word)))
if len(c) >= len(word) // 2 + len(word) % 2:
	print(word.lower())
else:
	print(word.upper())


s = input()
ctl = 0
for i in range(len(s)):
	if s[i].islower():
		ctl += 1
ctu = len(s) - ctl
if ctu > ctl:
	print(s.upper())
else:
	print(s.lower())


s = list(input())
u = sum([1 for x in s if ord(x) > 64 and ord(x) < 91])
l = sum([1 for x in s if ord(x) > 96 and ord(x) < 123])
print(''.join(s).lower() if l >= u else ''.join(s).upper())


s = input()
a = b = 0
for i in s:
	if ord(i) < 92:
		a += 1
	else:
		b += 1
if a > b:
	print(s.upper())
else:
	print(s.lower())


str = input()

def low_char(str):
	return sum((c.islower() for c in str))

def upp_char(str):
	return sum((d.isupper() for d in str))
if low_char(str) > upp_char(str) or low_char(str) == upp_char(str):
	print(str.lower())
elif low_char(str) < upp_char(str):
	print(str.upper())


s = str(input())
lowNum = 0
upNum = 0
for i in s:
	if i.islower():
		lowNum += 1
	else:
		upNum += 1
if lowNum >= upNum:
	print(s.lower())
else:
	print(s.upper())


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

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

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
s = S()
print([s.lower(), s.upper()][sum((x <= 'Z' for x in s)) * 2 > len(s)])


x = input()
count = 0
count1 = 0
for i in x:
	if i.islower():
		count = count + 1
	else:
		count1 = count1 + 1
if count >= count1:
	print(x.lower())
else:
	print(x.upper())


st = str(input())
up = 0
low = 0
for x in st:
	if x.isupper() == True:
		up = up + 1
	if x.islower() == True:
		low = low + 1
if up > low:
	print(st.upper())
else:
	print(st.lower())


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

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

def li():
	return list(mi())
s = input()
c1 = c2 = 0
for i in s:
	if i.islower():
		c1 += 1
	else:
		c2 += 1
if c1 < c2:
	print(s.upper())
else:
	print(s.lower())


s = input()
print([s.lower(), s.upper()][sum([1 for i in s if ord(i) < 92]) > len(s) // 2])


a = input()
b = a.upper()
ans = 0
an = 0
i = 0
while i < len(a):
	if b[i] == a[i]:
		ans += 1
	else:
		an += 1
	i += 1
if ans > an:
	print(a.upper())
else:
	print(a.lower())


a = input()
b = list(a)
n = len(b)
F = []
Q = 0
q = 0
v = 0
while v < n:
	x = ord(b[v])
	if x >= 60 and x <= 90:
		Q = Q + 1
	elif x >= 90 and x <= 122:
		q = q + 1
	v = v + 1
if Q > q:
	print(a.upper())
elif Q == q:
	print(a.lower())
else:
	print(a.lower())


a = input().strip()
(u, l) = (0, 0)
for i in a:
	if i.islower():
		l += 1
	else:
		u += 1
if u > l:
	print(a.upper())
else:
	print(a.lower())


s = input()
c = 0
for i in s:
	x = ord(i)
	if x >= ord('A') and x <= ord('Z'):
		c += 1
t = len(s) - c
if t >= c:
	print(s.lower())
else:
	print(s.upper())


s = str(input())
upper_count = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		upper_count += 1
lower_count = len(s) - upper_count
if upper_count > lower_count:
	new_str = s.upper()
elif upper_count <= lower_count:
	new_str = s.lower()
print(new_str)


st = input()
up_st = st.upper()
low_st = st.lower()
(up_count, low_count) = (0, 0)
for i in range(len(st)):
	if up_st[i] == st[i]:
		up_count += 1
	if low_st[i] == st[i]:
		low_count += 1
if up_count > low_count:
	print(up_st)
else:
	print(low_st)


import re
string = input()
low = re.findall('[a-z]', string)
up = re.findall('[A-Z]', string)
if len(up) > len(low):
	string = string.upper()
	print(string)
else:
	string = string.lower()
	print(string)


word = input()
upperCaseCounter = 0
lowerCaseCounter = 0
for char in word:
	if char.isupper():
		upperCaseCounter += 1
	if char.islower():
		lowerCaseCounter += 1
if upperCaseCounter > lowerCaseCounter:
	output = word.upper()
else:
	output = word.lower()
print(output)


s = input()
up = 0
lower = 0
for i in s:
	if i.islower():
		lower += 1
	else:
		up += 1
if lower >= up:
	line = s.lower()
else:
	line = s.upper()
print(line)


s = input()
u = 0
l = 0
for x in s:
	if x.isupper():
		u += 1
	else:
		l += 1
ans = ''
if u > l:
	for x in s:
		if x.isupper():
			ans += x
		else:
			p = ord(x)
			ch = chr(p - 32)
			ans += ch
else:
	for x in s:
		if x.islower():
			ans += x
		else:
			p = ord(x)
			ch = chr(p + 32)
			ans += ch
print(ans)


palavra = input()
contm = 0
contM = 0
listaM = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
listam = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for letra in palavra:
	if letra in listaM:
		contM += 1
	else:
		contm += 1
if contM > contm:
	print(palavra.upper())
if contM <= contm:
	print(palavra.lower())


word = input()
count_low = 0
count_hig = 0
for letter in word:
	if letter.islower() == True:
		count_low += 1
count_hig = len(word) - count_low
if count_hig <= count_low:
	print(word.lower())
else:
	print(word.upper())


str = input()
letter = list(str)
total_lower = 0
totol_upper = 0
for i in letter:
	if i.islower():
		total_lower += 1
	else:
		totol_upper += 1
if total_lower >= totol_upper:
	str = str.lower()
else:
	str = str.upper()
print(str)


s = input()
(hasil1, hasil2) = (0, 0)
for i in s:
	if ord(i) >= 97 and ord(i) <= 123:
		hasil1 += 1
	else:
		hasil2 += 1
db = ''
if hasil1 >= hasil2:
	for i in s:
		if ord(i) >= 97 and ord(i) <= 123:
			db += i
		else:
			db += chr(ord(i) + 32)
else:
	for i in s:
		if ord(i) >= 97 and ord(i) <= 123:
			db += chr(ord(i) - 32)
		else:
			db += i
print(db)


from math import ceil as ce
s = input()
k = 0
k1 = 0
for i in s:
	if i == i.upper():
		k += 1
	else:
		k1 += 1
if k1 >= k:
	print(s.lower())
else:
	print(s.upper())


n = input()
(M, m) = ([], [])
for i in n:
	if 'a' <= i <= 'z':
		m.append(i)
	else:
		M.append(i)
if len(m) > len(M) or len(m) == len(M):
	n = n.lower()
else:
	n = n.upper()
print(n)


def word(s):
	(upper, lower) = (0, 0)
	for c in s:
		if c.isupper():
			upper += 1
		elif c.islower():
			lower += 1
	if lower >= upper:
		s = s.lower()
	else:
		s = s.upper()
	return s
s = input().strip()
print(word(s))


s = input()
print(s.upper() if sum([1 for letter in s if letter.isupper()]) > sum([1 for letter in s if letter.islower()]) else s.lower(), end='')


import math
w = input()
x = len(w)
i = 0
l = 0
while i < x:
	if w[i].islower():
		l += 1
	i += 1
if l >= math.ceil(x / 2):
	print(w.lower())
else:
	print(w.upper())


s = input()
NR = 0
nr = 0
for c in s:
	if c.isupper():
		NR += 1
	else:
		nr += 1
if NR > nr:
	s = s.upper()
else:
	s = s.lower()
print(s)


def fc(a):
	for i in range(0, 200):
		if chr(i) == str(a):
			return i

def judge(a):
	if 65 <= fc(a) <= 90:
		return False
	elif 97 <= fc(a) <= 122:
		return True
low = 0
up = 0
word = input()
word1 = []
for i in range(len(word)):
	if judge(word[i]):
		low += 1
	else:
		up += 1
if low >= up:
	for i in range(len(word)):
		word1.append(word[i].lower())
else:
	for i in range(len(word)):
		word1.append(word[i].upper())
print(''.join(word1))


cnt1 = 0
cnt2 = 0
s = input()
for i in range(len(s)):
	if s[i].islower() == True:
		cnt1 += 1
	else:
		cnt2 += 1
if cnt1 >= cnt2:
	print(s.lower())
else:
	print(s.upper())


def main():
	w = input()
	w_l = w.lower()
	lower = sum([1 if i in w_l else 0 for i in w]) >= len(w) / 2
	if lower:
		print(w.lower())
	else:
		print(w.upper())
main()


a = input()
c1 = 0
c2 = 0
for x in a:
	if x.isupper() == True:
		c1 += 1
	elif x.islower() == True:
		c2 += 1
if c1 > c2:
	print(a.upper())
else:
	print(a.lower())


word = str(input())
if sum((1 for w in str(word) if w.isupper())) > len(word) / 2:
	print(word.upper())
else:
	print(word.lower())


word = input()
l_count = 0
u_count = 0
for i in word:
	if i.islower() == True:
		l_count += 1
	else:
		u_count += 1
if l_count >= u_count:
	print(word.lower())
else:
	print(word.upper())


def scan(type):
	return list(map(type, input().split()))
(word,) = scan(str)
upper = lower = 0
for c in word:
	if c >= 'a' and c <= 'z':
		lower += 1
	else:
		upper += 1
if upper > lower:
	word = word.upper()
else:
	word = word.lower()
print(word)


s = input()
flag_true_title = 0
flag_false_title = 0
for x in range(0, len(s)):
	if s[x:x + 1].istitle() == True:
		flag_true_title += 1
	else:
		flag_false_title += 1
if flag_true_title > flag_false_title:
	print(s.upper())
elif flag_true_title < flag_false_title:
	print(s.lower())
else:
	print(s.lower())


n = input()
(u, l) = (0, 0)
for i in n:
	if 'A' <= i <= 'Z':
		u += 1
	else:
		l += 1
print(n.upper() if u > l else n.lower(), end='')


def solve():
	wrds = str(input())
	up = 0
	low = 0
	for x in wrds:
		if x.isupper():
			up += 1
		elif x.islower():
			low += 1
	if up > low:
		print(wrds.upper())
	else:
		print(wrds.lower())
solve()


word = input()
l = 0
u = 0
for char in word:
	if char.islower() == True:
		l += 1
	else:
		u += 1
if l == u or l > u:
	word = word.lower()
else:
	word = word.upper()
print(word)


s = str(input())
u = 0
l = 0
x = len(s)
for i in range(0, x):
	if s[i] >= 'a' and s[i] <= 'z':
		l += 1
	if s[i] >= 'A' and s[i] <= 'Z':
		u += 1
if u > l:
	print(s.upper())
elif l > u:
	print(s.lower())
else:
	print(s.lower())


s = input()
ucnt = 0
lcnt = 0
for x in s:
	if x.isupper():
		ucnt += 1
	elif x.islower():
		lcnt += 1
if ucnt > lcnt:
	s = s.upper()
elif lcnt > ucnt:
	s = s.lower()
else:
	s = s.lower()
print(s)


a = input()
cnt = cnt2 = 0
for i in a:
	if ord(i) > 64 and ord(i) < 91:
		cnt = cnt + 1
	else:
		cnt2 = cnt2 + 1
if cnt > cnt2:
	print(a.upper())
else:
	print(a.lower())


word = input()
if len(word) / 2 <= sum((1 for char in word if char.islower())):
	print(word.lower())
else:
	print(word.upper())


s = input()
l = len(s)
c1 = 0
c2 = 0
for i in range(l):
	if ord(s[i]) >= 97:
		c1 += 1
	else:
		c2 += 1
if c1 >= c2:
	print(s.lower())
else:
	print(s.upper())


c = 0
C = 0
n = input()
for i in n:
	if 97 <= ord(i) <= 122:
		c += 1
	else:
		C += 1
if c >= C:
	print(n.lower())
else:
	print(n.upper())


word = input()
letter = []
for alis in word:
	letter.append(alis)
lower_count = 0
upper_count = 0
for i in letter:
	if i.islower() == True:
		lower_count += 1
	elif i.isupper() == True:
		upper_count += 1
if lower_count > upper_count or lower_count == upper_count:
	word = word.lower()
elif upper_count > lower_count:
	word = word.upper()
print(word)


s = input()
(l, lo) = (len(s), 0)
for i in range(l):
	if ord(s[i]) > 96:
		lo += 1
up = l - lo
if up > lo:
	print(s.upper())
else:
	print(s.lower())


n = input()
countup = countlo = 0
for i in n:
	if i.isupper():
		countup += 1
	else:
		countlo += 1
if countlo >= countup:
	print(n.lower())
else:
	print(n.upper())


n = input()
d = len(n)
a = []
b = []
for i in n:
	if i >= 'a' and i <= 'z':
		a.append(i)
	else:
		b.append(i)
if len(b) > len(a):
	z = n.upper()
else:
	z = n.lower()
print(z)


a = input()
(k, t) = (0, 0)
for x in a:
	if x.upper() == x:
		k += 1
	else:
		t += 1
if k > t:
	print(a.upper())
else:
	print(a.lower())


ss = input()
c = 0
s = 0
for i in range(len(ss)):
	t = ord(ss[i])
	if t >= 97 and t <= 122:
		s += 1
	else:
		c += 1
if c > s:
	ss = ss.upper()
else:
	ss = ss.lower()
print(ss)


n = list(map(ord, list(input())))
lower = 0
upper = 0
for i in range(len(n)):
	if n[i] >= 65 and n[i] <= 90:
		upper += 1
	else:
		lower += 1
n = list(map(chr, n))
if upper > lower:
	print(''.join(n).upper())
else:
	print(''.join(n).lower())


word = input()
lower_case = set('abcdefghijklmnopqrstuvwxyz')
upper_case = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
lc = 0
uc = 0
for i in word:
	if i in lower_case:
		lc += 1
	elif i in upper_case:
		uc += 1
if uc > lc:
	print(word.upper())
else:
	print(word.lower())


import sys
input = sys.stdin.readline

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

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
inputString = input().strip()
numLower = 0
for s in inputString:
	if s.islower():
		numLower += 1
if len(inputString) / 2 > numLower:
	print(inputString.upper())
else:
	print(inputString.lower())


n = input()
up = 0
low = 0
for i in n:
	if ord(i) >= 97 and ord(i) <= 122:
		low = low + 1
	else:
		up = up + 1
upl = ''
lowl = ''
if up > low:
	for i in n:
		if ord(i) >= 97 and ord(i) <= 122:
			z = chr(ord(i) - 32)
			upl = upl + z
		else:
			upl = upl + i
	print(upl)
else:
	for i in n:
		if ord(i) >= 65 and ord(i) <= 90:
			x = chr(ord(i) + 32)
			lowl = lowl + x
		else:
			lowl = lowl + i
	print(lowl)


capital = 'ABCDEFGHIJKLMNOPQRSTUWVXYZ'
small = capital.lower()
x = input()
capital_count = 0
small_count = 0
for i in x:
	if i in capital:
		capital_count += 1
	else:
		small_count += 1
if capital_count > small_count:
	print(x.upper())
else:
	print(x.lower())


n = input()
xiao = 0
for i in range(len(n)):
	if ord(n[i]) > 95:
		xiao += 1
if len(n) % 2 == 0 and xiao >= len(n) // 2:
	print(n.lower())
elif len(n) % 2 != 0 and xiao > len(n) // 2:
	print(n.lower())
else:
	print(n.upper())


s = list(map(str, input()))
(i, j) = (0, 0)
for k in s:
	if k == k.lower():
		i += 1
	else:
		j += 1
if i >= j:
	for k in range(len(s)):
		s[k] = s[k].lower()
else:
	for k in range(len(s)):
		s[k] = s[k].upper()
print(*s, sep='')


str1 = input()
l = 0
u = 0
for c in str1:
	if c.isupper():
		l += 1
	else:
		u += 1
if l <= u:
	print(str1.lower())
else:
	print(str1.upper())


s = input()
u = 0
l = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		u += 1
	else:
		l += 1
if l >= u:
	for i in range(len(s)):
		if ord(s[i]) >= 65 and ord(s[i]) <= 90:
			s = s[:i] + chr(ord(s[i]) + 32) + s[i + 1:]
else:
	for i in range(len(s)):
		if ord(s[i]) >= 97 and ord(s[i]) <= 122:
			s = s[:i] + chr(ord(s[i]) - 32) + s[i + 1:]
print(s)


s = input()
(u, l) = (0, 0)
for char in s:
	if 65 <= ord(char) <= 90:
		u += 1
	else:
		l += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


w = input()
l = list(w)
cu = 0
cl = 0
for i in l:
	if i == i.upper():
		cu += 1
	else:
		cl += 1
if cu > cl:
	print(w.upper())
else:
	print(w.lower())


word = input()
k = 0
s = len(word)
for i in range(0, s):
	if word[i] == word[i].upper():
		k += 1
		continue
	else:
		k = k
if k > s / 2:
	print(word.upper())
else:
	print(word.lower())


word = input()
(lower_counter, upper_counter) = (0, 0)
for ch in word:
	if ch.islower():
		lower_counter += 1
	else:
		upper_counter += 1
if upper_counter > lower_counter:
	print(word.upper())
else:
	print(word.lower())


s = input()
s_l = s.lower()
s_u = s.upper()
ans_l = 0
ans_u = 0
for i in range(len(s)):
	if s[i] == s_l[i]:
		ans_l += 1
	if s[i] == s_u[i]:
		ans_u += 1
if ans_u > ans_l:
	print(s_u)
else:
	print(s_l)


lowercount = lambda s: sum([int(c.islower()) for c in s])
uppercount = lambda s: sum([int(c.isupper()) for c in s])
string = input()
lowerc = lowercount(string)
upperc = uppercount(string)
if lowerc == upperc:
	print(string.lower())
elif lowerc > upperc:
	print(string.lower())
else:
	print(string.upper())


s = input('')
(u, l) = (0, 0)
for i in range(len(s)):
	if s[i] >= 'A' and s[i] <= 'Z':
		u += 1
	if s[i] >= 'a' and s[i] <= 'z':
		l += 1
if u > l:
	s1 = s.upper()
	print(s1)
else:
	s2 = s.lower()
	print(s2)


sm = 0
cap = 0
s = input()
for i in s:
	if i.islower():
		sm = sm + 1
	else:
		cap = cap + 1
if cap > sm:
	s = s.upper()
else:
	s = s.lower()
print(s)


firstr = input()
ressma = 0
resup = 0
for i in firstr:
	if i.isupper():
		resup = resup + 1
	else:
		ressma = ressma + 1
if ressma == resup:
	print(firstr.lower())
elif ressma < resup:
	print(firstr.upper())
else:
	print(firstr.lower())


def inspect(word):
	upper_counter = 0
	lower_counter = 0
	for i in word:
		if i.isupper():
			upper_counter += 1
		elif i.islower():
			lower_counter += 1
	if upper_counter > lower_counter:
		return word.upper()
	else:
		return word.lower()
inp = input()
print(inspect(inp))


s = input()
lo = 0
for ch in s:
	if ch >= 'a' and ch <= 'z':
		lo += 1
up = len(s) - lo
if lo >= up:
	print(s.lower())
else:
	print(s.upper())


s = input()
upr = 0
lwr = 0
for e in s:
	if e.isupper():
		upr += 1
	if e.islower():
		lwr += 1
if upr > lwr:
	print(s.upper())
else:
	print(s.lower())


word = input()
n = len(word)
lc = uc = 0
for c in word:
	if c.islower():
		lc += 1
	else:
		uc += 1
if lc >= uc:
	print(word.lower())
else:
	print(word.upper())


s = input()
lowerCount = sum(map(str.islower, s))
upperCount = sum(map(str.isupper, s))
if lowerCount > upperCount or lowerCount >= upperCount:
	print(s.lower())
else:
	print(s.upper())


s = input()
upL = 0
loL = 0
for ch in s:
	if ch.islower():
		loL = loL + 1
	if ch.isupper():
		upL = upL + 1
if upL > loL:
	print(s.upper())
elif loL > upL:
	print(s.lower())
else:
	print(s.lower())


import sys, math

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

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

def lmii():
	return list(mii())

def main():
	s = input()
	up = 0
	lp = 0
	for i in range(len(s)):
		d = ord(s[i])
		if d <= 90:
			up += 1
		else:
			lp += 1
	if up > lp:
		print(s.upper())
		exit(0)
	print(s.lower())
main()


string = input()
lCount = 0
uCount = 0
for item in string:
	if item.islower():
		lCount += 1
	else:
		uCount += 1
if uCount > lCount:
	print(string.upper())
else:
	print(string.lower())


s = str(input(''))
low = 'qwertyuiopasdfghjklzxcvbnm'
up = 'QWERTYUIOPASDFGHJKLZXCVBNM'
fineup = [each for each in s if each in up]
finelow = [each for each in s if each in low]
if len(finelow) >= len(fineup):
	print(s.lower())
else:
	print(s.upper())


a = input()
l = len(a)
i = 0
C = 0
c = 0
while i < l:
	if ord(a[i]) >= 65 and ord(a[i]) <= 90:
		C += 1
	if ord(a[i]) >= 97 and ord(a[i]) <= 122:
		c += 1
	i += 1
if c >= C:
	print(a.lower())
else:
	print(a.upper())


s = str(input())
u = 0
l = 0
for _ in range(len(s)):
	if ord(s[_]) >= 65 and ord(s[_]) <= 90:
		u += 1
	else:
		l += 1
if l >= u:
	s = s.lower()
else:
	s = s.upper()
print(s)


s = input()
su = s.upper()
sl = s.lower()
jsu = 0
jsl = 0
for i in range(len(s)):
	if su[i] == s[i]:
		jsu += 1
	if sl[i] == s[i]:
		jsl += 1
if jsl >= jsu:
	print(sl)
else:
	print(su)


s = input()
low = 0
up = 0
for ch in s:
	if ch.islower():
		low += 1
	else:
		up += 1
res = s.upper() if low < up else s.lower()
print(res)


s = input()
count = 0
for i in s:
	if i.isupper():
		count += 1
if count > len(s) - count:
	s = s.upper()
	print(s)
	exit()
s = s.lower()
print(s)


s = input()
(l, u) = (0, 0)
for c in s:
	if c >= 'a' and c <= 'z':
		l += 1
	if c >= 'A' and c <= 'Z':
		u += 1
if l >= u:
	print(s.lower())
else:
	print(s.upper())


n = input()
count = 0
count1 = 0
for i in n:
	if i.islower():
		count += 1
	else:
		count1 += 1
if count >= count1:
	n = list(n)
	for i in range(len(n)):
		n[i] = n[i].lower()
	print(''.join(n))
else:
	n = list(n)
	for i in range(len(n)):
		n[i] = n[i].upper()
	print(''.join(n))


n = input()
record = 0
for i in n:
	if ord(i) >= 97:
		record -= 1
	else:
		record += 1
if record > 0:
	print(n.upper())
else:
	print(n.lower())


w = input()
size = len(w)
capitals = 0
for i in range(size):
	if ord(w[i]) == ord(w[i].upper()):
		capitals += 1
if capitals > size - capitals:
	print(w.upper())
else:
	print(w.lower())


def main():
	s = input()
	cnt_u = cnt_l = 0
	for i in s:
		if i.isupper():
			cnt_u += 1
		else:
			cnt_l += 1
	if cnt_l >= cnt_u:
		print(s.lower())
	else:
		print(s.upper())
main()


a = input()
u = 0
res = a.lower()
for i in a:
	if i.isupper():
		u += 1
if len(a) - u < u:
	res = res.upper()
print(res)


s = input().strip()
l = u = 0
for ch in s:
	if ch.isupper():
		u += 1
	else:
		l += 1
if u > l:
	print(s.upper())
else:
	print(s.lower())


str = input()
chars = [char for char in str]
low = 0
up = 0
for i in chars:
	if i.islower():
		low += 1
	else:
		up += 1
if up <= low:
	print(str.lower())
else:
	print(str.upper())


st = input()
i = 0
a = 0
b = 0
for i in st:
	if i.islower() == True:
		a += 1
	else:
		b += 1
if a >= b:
	print(st.lower())
else:
	print(st.upper())


string = input('')
count1 = 0
count2 = 0
for i in string:
	if ord(i) <= 122 and ord(i) >= 97:
		count1 = count1 + 1
	else:
		count2 = count2 + 1
if count1 < count2:
	string = [i.upper() for i in string]
else:
	string = [i.lower() for i in string]
string = ''.join(string)
print(string)


s = list(input())
count_upper = 0
count_lower = 0
for i in s:
	if i.isupper():
		count_upper += 1
	else:
		count_lower += 1
string = ''.join(s)
if count_upper > count_lower:
	string = string.upper()
else:
	string = string.lower()
print(string)


a = input()
t = list(a)
x = 0
for i in range(len(a)):
	if t[i] < 'a':
		x = x + 1
if x > len(a) / 2:
	print(a.upper())
else:
	print(a.lower())


a = input()
u = sum((c.isupper() for c in a))
if u > len(a) - u:
	print(a.upper())
else:
	print(a.lower())


word = input()
upper_count = 0
lower_count = 0
i = 0
l = len(word)
while i < l:
	value = word[i].islower()
	if value == True:
		lower_count += 1
	else:
		upper_count += 1
	i += 1
if upper_count > lower_count:
	print(word.upper())
else:
	print(word.lower())


str = input()
(up, low) = (0, 0)
for i in range(len(str)):
	if str[i] == str[i].upper():
		up += 1
	else:
		low += 1
if up > low:
	print(str.upper())
else:
	print(str.lower())


s = input()
(sl, sa) = (0, 0)
for i in s:
	if 'z' >= i >= 'a':
		sl = sl + 1
	elif 'Z' >= i >= 'A':
		sa = sa + 1
if sa > sl:
	print(s.upper())
else:
	print(s.lower())


_1 = '236a'
_2 = '339a'
_3 = '266a'
_4 = '96a'
_5 = '236a'
_6 = '281a'
_7 = '546a'
_8 = '116a'
_9 = '977a'
_10 = '266b'
n = str(input())
l = list(n)
low = 0
up = 0
for i in l:
	if i.islower():
		low += 1
	else:
		up += 1
if low > up:
	print(n.lower())
elif low < up:
	print(n.upper())
else:
	print(n.lower())


s = str(input())
(small, big) = (0, 0)
for i in s:
	if i.isupper():
		big += 1
	else:
		small += 1
if big > small:
	print(s.upper())
else:
	print(s.lower())


a = input()
b = 0
c = 0
for k in a:
	if k.islower() == True:
		b += 1
	else:
		c += 1
if c > b:
	print(a.upper())
else:
	print(a.lower())


s = input()
countUp = 0
countDn = 0
for i in s:
	if i.isupper():
		countUp += 1
	else:
		countDn += 1
if countUp > countDn:
	print(s.upper())
else:
	print(s.lower())


N = input()
WTF = 0
for _ in range(len(N)):
	if N[_].isupper():
		WTF += 1
	else:
		WTF -= 1
print(N.upper() if WTF > 0 else N.lower())


word = str(input())
mid = len(word) / 2
low = 0
upper = 0
for o in word:
	if o.islower():
		low += 1
		if low >= mid:
			print(word.lower())
			break
	else:
		upper += 1
		if upper > mid:
			print(word.upper())
			break


a = input()
t = 0
k = 0
q = 'qwertyuiopasdfghjklzxcvbnm'
w = 'QWERTYUIOPASDFGHJKLZXCVBNM'
for i in a:
	if i in q:
		t += 1
	else:
		k += 1
if t >= k:
	print(a.lower())
else:
	print(a.upper())


countup = 0
countdo = 0
st = input()
for x in range(0, len(st)):
	h = ord(st[x])
	if h >= 65 and h <= 90:
		countup += 1
	else:
		countdo += 1
if countdo == countup:
	print(st.lower())
elif countdo > countup:
	print(st.lower())
else:
	print(st.upper())


a = input()
cU = 0
cL = 0
for i in a:
	if i.islower():
		cL += 1
	if i.isupper():
		cU += 1
if cU > cL:
	print(a.upper())
else:
	print(a.lower())


s = input()
A = 0
b = 0
for c in s:
	if c.islower():
		b = b + 1
	if c.isupper():
		A = A + 1
if A > b:
	print(s.upper())
elif b > A:
	print(s.lower())
else:
	print(s.lower())


s = list(input())
countUpper = 0
countLower = 0
for letter in s:
	if letter.isupper():
		countUpper += 1
	else:
		countLower += 1
listToStr = ''.join(map(str, s))
if countUpper > countLower:
	print(listToStr.upper())
else:
	print(listToStr.lower())


word = input().strip()
lower = sum((1 for x in word if x.islower()))
upper = sum((1 for x in word if x.isupper()))
if lower == upper or lower > upper:
	print(word.lower())
else:
	print(word.upper())


upper = 0
lower = 0
s = input()
for item in s:
	if ord(item) < 91:
		upper += 1
	else:
		lower += 1
if upper > lower:
	s = s.upper()
else:
	s = s.lower()
print(s)


from sys import stdin
w = stdin.readline().rstrip()
c = sum((1 if c.islower() else -1 for c in w))
print((w.upper(), w.lower())[c >= 0])


entry = input()
up = 0
down = 0
for i in range(len(entry)):
	if entry[i] == entry[i].upper():
		up += 1
	else:
		down += 1
if up > down:
	print(entry.upper())
elif down > up:
	print(entry.lower())
else:
	print(entry.lower())


n = input()
s = 0
c = 0
for i in range(len(n)):
	if n[i] == n[i].lower():
		s = s + 1
	else:
		c = c + 1
if s > c:
	n = n.lower()
elif c > s:
	n = n.upper()
elif s == c:
	n = n.lower()
print(n)


s = input()
if s == '':
	print(s)
else:
	num_lower = sum([1 if a.islower() else 0 for a in s])
	if 2 * num_lower >= len(s):
		print(s.lower())
	else:
		print(s.upper())


(num_of_uppercase, num_of_lowercase) = (0, 0)
text = input()
num_of_lowercase = sum((1 for c in text if c.islower()))
num_of_uppercase = sum((1 for c in text if c.isupper()))
if num_of_uppercase > num_of_lowercase:
	text = text.upper()
else:
	text = text.lower()
print(text)


l = input()
l1 = l.upper()
l2 = l.lower()
c1 = 0
c2 = 0
for i in range(len(l)):
	if l[i] != l1[i]:
		c1 += 1
	if l[i] != l2[i]:
		c2 += 1
if c2 > c1:
	print(l1)
else:
	print(l2)


def get_values():
	word = input()
	lower = 0
	upper = 0
	result = ''
	for i in word:
		if i.isupper():
			upper += 1
		else:
			lower += 1
	if upper > lower:
		return print(word.upper())
	return print(word.lower())
get_values()


word = input().strip()
lower = [x for x in word if x.islower()]
upper = [y for y in word if y.isupper()]
new_word = [word.lower() if len(lower) >= len(upper) else word.upper()]
print(*new_word)


Upper = 0
s = input()
for i in range(len(s)):
	if s[i].isupper():
		Upper += 1
if Upper > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


n = input()
count = 0
plus = 0
for i in range(len(n)):
	if n[i].islower():
		count = count + 1
	elif n[i].isupper():
		plus = plus + 1
if count >= plus:
	x = n.lower()
	print(x)
elif count < plus:
	x = n.upper()
	print(x)


import string

def converter(world):
	noofuppercase = 0
	nooflowercase = 0
	for i in world:
		if i.islower():
			nooflowercase += 1
		else:
			noofuppercase += 1
	if noofuppercase > nooflowercase:
		print(world.upper())
	else:
		print(world.lower())
n = str(input())
converter(n)


string = input()
x = 0
y = 0
for i in range(len(string)):
	if string[i].isupper() == True:
		x = x + 1
	elif string[i].isupper() == False:
		y = y + 1
if x > y:
	print(string.upper())
else:
	print(string.lower())


s = input().strip()
ln = len(s)
up_cnt = 0
for i in range(ln):
	if ord(s[i]) < 97:
		up_cnt += 1
if up_cnt > ln // 2:
	print(s.upper())
else:
	print(s.lower())


w = input()
UC = 0
LC = 0
for x in w:
	if x.isupper():
		UC += 1
	else:
		LC += 1
if LC < UC:
	print(w.upper())
else:
	print(w.lower())


try:
	s = input()
	u = 0
	l = 0
	for i in s:
		if i.isupper() is True:
			u = u + 1
		else:
			l = l + 1
	if u > l:
		print(s.upper())
	else:
		print(s.lower())
except:
	pass


from string import ascii_uppercase as case_upper
word = input()
caps = sum((1 for w in word if w in case_upper))
if caps > len(word) / 2:
	print(word.upper())
else:
	print(word.lower())


s = input()
if len(s) >= 1 and len(s) <= 100:
	u = 0
	l = 0
	for i in range(len(s)):
		if s[i].isupper():
			u += 1
		elif s[i].islower():
			l += 1
	if u == l or l > u:
		s = s.lower()
		print(s)
	elif l < u:
		s = s.upper()
		print(s)


s = list(str(input()))

def turnAllUpper(s):
	for i in range(0, len(s)):
		if s[i] == 'a':
			s[i] = 'A'
		if s[i] == 'b':
			s[i] = 'B'
		if s[i] == 'c':
			s[i] = 'C'
		if s[i] == 'd':
			s[i] = 'D'
		if s[i] == 'e':
			s[i] = 'E'
		if s[i] == 'f':
			s[i] = 'F'
		if s[i] == 'g':
			s[i] = 'G'
		if s[i] == 'h':
			s[i] = 'H'
		if s[i] == 'i':
			s[i] = 'I'
		if s[i] == 'j':
			s[i] = 'J'
		if s[i] == 'k':
			s[i] = 'K'
		if s[i] == 'l':
			s[i] = 'L'
		if s[i] == 'm':
			s[i] = 'M'
		if s[i] == 'n':
			s[i] = 'N'
		if s[i] == 'o':
			s[i] = 'O'
		if s[i] == 'p':
			s[i] = 'P'
		if s[i] == 'q':
			s[i] = 'Q'
		if s[i] == 'r':
			s[i] = 'R'
		if s[i] == 's':
			s[i] = 'S'
		if s[i] == 't':
			s[i] = 'T'
		if s[i] == 'u':
			s[i] = 'U'
		if s[i] == 'v':
			s[i] = 'V'
		if s[i] == 'w':
			s[i] = 'W'
		if s[i] == 'x':
			s[i] = 'X'
		if s[i] == 'y':
			s[i] = 'Y'
		if s[i] == 'z':
			s[i] = 'Z'
	print(''.join(s))

def turnAllLower(s):
	for i in range(0, len(s)):
		if s[i] == 'A':
			s[i] = 'a'
		if s[i] == 'B':
			s[i] = 'b'
		if s[i] == 'C':
			s[i] = 'c'
		if s[i] == 'D':
			s[i] = 'd'
		if s[i] == 'E':
			s[i] = 'e'
		if s[i] == 'F':
			s[i] = 'f'
		if s[i] == 'G':
			s[i] = 'g'
		if s[i] == 'H':
			s[i] = 'h'
		if s[i] == 'I':
			s[i] = 'i'
		if s[i] == 'J':
			s[i] = 'j'
		if s[i] == 'K':
			s[i] = 'k'
		if s[i] == 'L':
			s[i] = 'l'
		if s[i] == 'M':
			s[i] = 'm'
		if s[i] == 'N':
			s[i] = 'n'
		if s[i] == 'O':
			s[i] = 'o'
		if s[i] == 'P':
			s[i] = 'p'
		if s[i] == 'Q':
			s[i] = 'q'
		if s[i] == 'R':
			s[i] = 'r'
		if s[i] == 'S':
			s[i] = 's'
		if s[i] == 'T':
			s[i] = 't'
		if s[i] == 'U':
			s[i] = 'u'
		if s[i] == 'V':
			s[i] = 'v'
		if s[i] == 'W':
			s[i] = 'w'
		if s[i] == 'X':
			s[i] = 'x'
		if s[i] == 'Y':
			s[i] = 'y'
		if s[i] == 'Z':
			s[i] = 'z'
	print(''.join(s))
lowerCase = s.count('a')
lowerCase = s.count('b') + lowerCase
lowerCase = s.count('c') + lowerCase
lowerCase = s.count('d') + lowerCase
lowerCase = s.count('e') + lowerCase
lowerCase = s.count('f') + lowerCase
lowerCase = s.count('g') + lowerCase
lowerCase = s.count('h') + lowerCase
lowerCase = s.count('i') + lowerCase
lowerCase = s.count('j') + lowerCase
lowerCase = s.count('k') + lowerCase
lowerCase = s.count('l') + lowerCase
lowerCase = s.count('m') + lowerCase
lowerCase = s.count('n') + lowerCase
lowerCase = s.count('o') + lowerCase
lowerCase = s.count('p') + lowerCase
lowerCase = s.count('q') + lowerCase
lowerCase = s.count('r') + lowerCase
lowerCase = s.count('s') + lowerCase
lowerCase = s.count('t') + lowerCase
lowerCase = s.count('u') + lowerCase
lowerCase = s.count('v') + lowerCase
lowerCase = s.count('w') + lowerCase
lowerCase = s.count('x') + lowerCase
lowerCase = s.count('y') + lowerCase
lowerCase = s.count('z') + lowerCase
upperCase = s.count('A')
upperCase = s.count('B') + upperCase
upperCase = s.count('C') + upperCase
upperCase = s.count('D') + upperCase
upperCase = s.count('E') + upperCase
upperCase = s.count('F') + upperCase
upperCase = s.count('G') + upperCase
upperCase = s.count('H') + upperCase
upperCase = s.count('I') + upperCase
upperCase = s.count('J') + upperCase
upperCase = s.count('K') + upperCase
upperCase = s.count('L') + upperCase
upperCase = s.count('M') + upperCase
upperCase = s.count('N') + upperCase
upperCase = s.count('O') + upperCase
upperCase = s.count('P') + upperCase
upperCase = s.count('Q') + upperCase
upperCase = s.count('R') + upperCase
upperCase = s.count('S') + upperCase
upperCase = s.count('T') + upperCase
upperCase = s.count('U') + upperCase
upperCase = s.count('V') + upperCase
upperCase = s.count('W') + upperCase
upperCase = s.count('X') + upperCase
upperCase = s.count('Y') + upperCase
upperCase = s.count('Z') + upperCase
if upperCase > lowerCase:
	turnAllUpper(s)
else:
	turnAllLower(s)


word = input()
upperc = 0
lowerc = 0
for chr in word:
	if chr.isupper():
		upperc += 1
	elif chr.islower():
		lowerc += 1
if lowerc < upperc:
	print(word.upper())
else:
	print(word.lower())


s = input()
countlower = 0
countupper = 0
for i in s:
	if i.islower():
		countlower += 1
	else:
		countupper += 1
if countlower >= countupper:
	print(s.lower())
else:
	print(s.upper())


a = input()
lst = [str(i) for i in list(a)]
cp = 0
lt = 0
for i in lst:
	if ord(i) in range(65, 91):
		cp += 1
	else:
		lt += 1
if cp > lt:
	print(str.upper(a))
else:
	print(str.lower(a))


s = input()
c = 0
c1 = 0
for i in s:
	if 65 <= ord(i) <= 91:
		c += 1
	else:
		c1 += 1
if c1 >= c:
	print(s.lower())
else:
	print(s.upper())


def string(a):
	upper = 0
	lower = 0
	for i in range(len(a)):
		if ord(a[i]) >= 97 and ord(a[i]) <= 122:
			lower += 1
		elif ord(a[i]) >= 65 and ord(a[i]) <= 90:
			upper += 1
		else:
			pass
	if lower >= upper:
		print(a.lower())
	else:
		print(a.upper())
a = str(input())
string(a)


s = input()
(a, b) = (0, 0)
for x in s:
	if x.isupper():
		a += 1
	elif x.islower():
		b += 1
if a > b:
	r = s.upper()
else:
	r = s.lower()
print(r)


s = str(input())
countA = 0
counta = 0
for char in s:
	if char.isupper():
		countA += 1
	else:
		counta += 1
if countA > counta:
	print(s.upper())
else:
	print(s.lower())


n = list(input())
c_b = 0
c_s = 0
output = []
for i in range(len(n)):
	if n[i] == n[i].upper():
		c_b += 1
	elif n[i] == n[i].lower():
		c_s += 1
if c_s >= c_b:
	for i in range(len(n)):
		output.append(n[i].lower())
elif c_b > c_s:
	for i in range(len(n)):
		output.append(n[i].upper())
print(''.join(output))


string = input()
nbu = 0
nbl = 0
for i in range(len(string)):
	if string[i].upper() == string[i]:
		nbu += 1
	else:
		nbl += 1
if nbu > nbl:
	print(string.upper())
else:
	print(string.lower())


s = str(input())
upper = 0
lower = 0
a = []
a = s
for i in range(len(s)):
	if a[i] <= 'Z':
		upper += 1
	elif a[i] >= 'a':
		lower += 1
if lower >= upper:
	print(s.lower())
else:
	print(s.upper())


str = input()
(cntup, cntlw) = (0, 0)
for i in str:
	if i.isupper():
		cntup += 1
	else:
		cntlw += 1
if cntup > cntlw:
	str = str.upper()
	print(str)
else:
	str = str.lower()
	print(str)


s = input()
COUNT1 = 0
COUNT2 = 0
for i in s:
	if i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		COUNT1 = COUNT1 + 1
	else:
		COUNT2 = COUNT2 + 1
if COUNT2 > COUNT1 or COUNT1 == COUNT2:
	print(s.lower())
else:
	print(s.upper())


strz = input()
(sm_cnt, cap_cnt) = (0, 0)
for i in range(len(strz)):
	if strz[i].islower():
		sm_cnt += 1
	elif strz[i].isupper():
		cap_cnt += 1
if sm_cnt >= cap_cnt:
	print(strz.lower())
else:
	print(strz.upper())


import math, os, sys
import string, re
import itertools, functools, operator
from collections import Counter

def inputint():
	return int(input())

def inputarray(func=int):
	return map(func, input().split())
s = input()
mask = map(lambda x: x.isupper(), s)
if sum(mask) <= len(s) // 2:
	print(s.lower())
else:
	print(s.upper())


s = input()
nu = 0
nl = 0
for i in s:
	if ord(i) >= 97 and ord(i) <= 122:
		nl += 1
	else:
		nu += 1
if nl >= nu:
	print(s.lower())
else:
	print(s.upper())


ipt = input()
lower_case = 1
upper_case = 1
for s in ipt:
	if s == s.lower():
		lower_case += 1
	else:
		upper_case += 1
if lower_case >= upper_case:
	print(ipt.lower())
else:
	print(ipt.upper())


s = input()
output1 = ''
output2 = ''
small = 0
capital = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		output1 += chr(ord(i) + 32)
		output2 += i
		capital += 1
	else:
		output1 += i
		output2 += chr(ord(i) - 32)
		small += 1
if small >= capital:
	print(output1)
else:
	print(output2)


def checkUpper(letter):
	return letter.isupper()
word = input().strip()
if len(list(filter(checkUpper, word))) > len(word) / 2:
	print(word.upper())
else:
	print(word.lower())


w = input()
n = len(w)
word = list(w)
c = 0
for i in range(n):
	if ord(word[i]) in range(ord('A'), ord('Z') + 1):
		c += 1
if 2 * c > n:
	for i in range(n):
		if ord(word[i]) in range(ord('a'), ord('z') + 1):
			word[i] = chr(ord(word[i]) - 32)
else:
	for i in range(n):
		if ord(word[i]) in range(ord('A'), ord('Z') + 1):
			word[i] = chr(ord(word[i]) + 32)
w = ''.join(word)
print(w)


a = input()
t = list(a)
u = 0
l = 0
for i in t[0:]:
	if ord(i) < 97:
		u += 1
	else:
		l += 1
if u > l:
	for j in range(len(t)):
		if ord(t[j]) >= 97:
			t[j] = chr(ord(t[j]) - 32)
elif l >= u:
	for j in range(len(t)):
		if ord(t[j]) < 97:
			t[j] = chr(ord(t[j]) + 32)
r = ''.join(t)
print(r)


s = input()
u = 0
l = 0
for i in range(len(s)):
	u += 1 if 65 <= ord(s[i]) <= 90 else 0
	l += 1 if 97 <= ord(s[i]) <= 122 else 0
if u > l:
	print(s.upper())
else:
	print(s.lower())


a = input()
c = 0
B = 0
for i in a:
	if i >= 'a' and i <= 'z':
		c += 1
	elif i >= 'A' and i <= 'Z':
		B += 1
if c >= B:
	print(a.lower())
else:
	print(a.upper())


s = input()
t = sum(list(map(str.isupper, s)))
if 2 * t > len(s):
	print(s.upper())
else:
	print(s.lower())


a = input()
b = a.lower()
c = a.upper()
bx = 0
cx = 0
lista = a[:]
listb = b[:]
listc = c[:]
for i in range(len(a)):
	if a[i] == b[i]:
		bx += 1
	elif a[i] == c[i]:
		cx += 1
if cx > bx:
	print(a.upper())
else:
	print(a.lower())


s = input()
(upcnt, lowcnt) = (0, 0)
for x in s:
	if x.isupper():
		upcnt += 1
	else:
		lowcnt += 1
if upcnt > lowcnt:
	print(s.upper())
else:
	print(s.lower())


word = input()
small = []
big = []
for i in word:
	if 'A' <= i <= 'Z':
		big.append(i)
	elif 'a' <= i <= 'z':
		small.append(i)
if len(small) > len(big):
	print(word.lower())
elif len(small) < len(big):
	print(word.upper())
else:
	print(word.lower())


word = input()
ucount = lcount = 0
for letter in word:
	if letter.isupper():
		ucount += 1
	else:
		lcount += 1
if lcount >= ucount:
	print(word.lower())
else:
	print(word.upper())


n = input()
l = 0
u = 0
for i in list(n):
	if i >= 'A' and i <= 'Z':
		u += 1
	else:
		l += 1
if l >= u:
	print(n.lower())
elif u > l:
	print(n.upper())


s = input()
low_count = 0
upp_count = 0
for i in range(0, len(s)):
	if s[i].islower():
		low_count += 1
	else:
		upp_count += 1
if low_count >= upp_count:
	print(s.lower())
else:
	print(s.upper())


n = input()
b = 0
for i in range(len(n)):
	if n[i].islower() == True:
		b += 1
if b >= len(n) / 2:
	print(n.lower())
else:
	print(n.upper())


n = input()
c = 0
b = 0
for char in n:
	if char.isupper():
		c += 1
	else:
		b += 1
if c > b:
	print(n.upper())
elif b > c:
	print(n.lower())
else:
	print(n.lower())


word = input()
lower = 0
upper = 0
for n in word:
	if n in 'abcdefghijklmnopqrstuvwxyz':
		lower += 1
	else:
		upper += 1
if lower < upper:
	print(word.upper())
else:
	print(word.lower())


c = 0
c1 = 0
n = input()
for i in n:
	v = ord(i)
	if v >= 97:
		c = c + 1
	else:
		c1 = c1 + 1
if c1 > c:
	print(n.upper())
else:
	print(n.lower())


s = input()
f = 0
se = 0
for i in s:
	if i.isupper():
		f += 1
	else:
		se += 1
if f > se:
	print(s.upper())
else:
	print(s.lower())


word = input()
ucount = 0
lcount = 0
if word.isupper() == True:
	print(word)
	exit()
if word.islower() == True:
	print(word)
	exit()
for i in range(0, len(word)):
	if word[i].isupper() == True:
		ucount = ucount + 1
	elif word[i].islower() == True:
		lcount = lcount + 1
if lcount > ucount:
	word = word.casefold()
	print(word)
elif lcount == ucount:
	word = word.casefold()
	print(word)
elif ucount > lcount:
	word = word.upper()
	print(word)


n = input()
v = [i for i in n if i >= 'A' and i <= 'Z']
m = [i for i in n if i >= 'a' and i <= 'z']
if len(v) > len(m):
	n = n.upper()
else:
	n = n.lower()
print(n)


x = input()
n = len(x)
c = 0
for i in x:
	if i.isupper():
		c = c + 1
if c > n - c:
	print(x.upper())
else:
	print(x.lower())


wrd = input()
(count1, count2) = (0, 0)
for i in wrd:
	if ord(i) >= 65 and ord(i) <= 90:
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	print(wrd.upper())
else:
	print(wrd.lower())


a = input()
cap = 0
smal = 0
for i in a:
	if ord(i) >= 97:
		smal += 1
	else:
		cap += 1
if cap > smal:
	print(a.upper())
else:
	print(a.lower())


s = input()
l = [x.islower() for x in s]
print([s.upper(), s.lower()][sum(l) >= -(-len(s) // 2)])


k = input()
a1 = 0
a2 = 0
for i in k:
	if i.isupper():
		a1 = a1 + 1
	else:
		a2 = a2 + 1
if a1 > a2:
	print(k.upper())
else:
	print(k.lower())


n = input()
x = len(n)
b = 0
s = 0
for i in range(x):
	if 'a' <= n[i] <= 'z':
		s += 1
	elif 'A' <= n[i] <= 'Z':
		b += 1
if s > b or s == b:
	print(n.lower())
elif s < b:
	print(n.upper())


a = input()
if sum((1 for c in a if c.isupper())) * 2 > len(a):
	print(a.upper())
else:
	print(a.lower())


import math
arr = list(input())
up_count = 0
lo_count = 0
for i in range(len(arr)):
	if ord(arr[i]) >= 65 and ord(arr[i]) <= 91:
		up_count += 1
	else:
		lo_count += 1
final_str = ''
final_str = final_str.join(arr)
if lo_count >= up_count:
	final_str = final_str.lower()
else:
	final_str = final_str.upper()
print(final_str)


s = input()
count1 = 0
count2 = 0
for c in s:
	if c.isupper():
		count1 += 1
	elif c.islower():
		count2 += 1
	else:
		pass
if count1 > count2:
	print(s.upper())
else:
	print(s.lower())


a = input()
u = 0
l = 0
for i in a:
	if i.isupper() == True:
		u = u + 1
		continue
	else:
		l = l + 1
		continue
if u > l:
	a = a.upper()
else:
	a = a.lower()
print(a)


a = input()
cl = 0
cu = 0
for i in range(len(a)):
	if a[i].isupper() == True:
		cu = cu + 1
	elif a[i].islower() == True:
		cl = cl + 1
if cl >= cu:
	print(a.lower())
else:
	print(a.upper())


s = input()
ans = 0
for _ in s:
	if _.isupper():
		ans += 1
	else:
		ans -= 1
if ans > 0:
	print(s.upper())
else:
	print(s.lower())


string = input()
countc = 0
countl = 0
for i in string:
	if i.isupper():
		countc += 1
	else:
		countl += 1
if countl >= countc:
	l = string.lower()
else:
	l = string.upper()
print(l)


k = input()
(c, d) = (0, 0)
for i in range(len(k)):
	if k[i].isupper():
		c += 1
	else:
		d += 1
if c > d:
	print(k.upper())
else:
	print(k.lower())


l = input()
a = 0
for i in l:
	if 'A' <= i <= 'Z':
		a += 1
if a > len(l) / 2:
	print(l.upper())
else:
	print(l.lower())


S = input('')
lower_case = 0
for x in S:
	if x.islower() == True:
		lower_case += 1
if lower_case >= len(S) / 2:
	print(S.lower())
else:
	print(S.upper())


from sys import stdin
input = stdin.readline
word = input()[:-1]
l = 0
u = 0
for i in range(len(word)):
	if 97 <= ord(word[i]) <= 122:
		l += 1
	else:
		u += 1
if l < u:
	word = ''.join([word[i].upper() for i in range(len(word))])
else:
	word = ''.join([word[i].lower() for i in range(len(word))])
print(word)


w = input()
low = 0
up = 0
for z in w:
	if z.isupper():
		up += 1
	else:
		low += 1
if low == up or low > up:
	print(w.lower())
else:
	print(w.upper())


s = input()
case = {'upper': 0, 'lower': 0}
for i in s:
	if i.islower():
		case['lower'] += 1
	else:
		case['upper'] += 1
if case['lower'] < case['upper']:
	print(s.upper())
else:
	print(s.lower())


w = input()

def get_stats(w):
	stats = {'lower': 0, 'upper': 0}
	for c in w:
		if c.islower():
			stats['lower'] += 1
		else:
			stats['upper'] += 1
	return stats

def change_word(w):
	stats = get_stats(w)
	if stats['lower'] >= stats['upper']:
		return w.lower()
	else:
		return w.upper()
print(change_word(w))


u = 0
s = 0
word = input()
word = list(word)
for letter in word:
	if letter.islower():
		s = s + 1
	else:
		u = u + 1
word = ''.join(word)
if u > s:
	word = word.upper()
else:
	word = word.lower()
print(word)


inp = input()
lcount = 0
ucount = 0
for x in inp:
	if x.isupper():
		ucount = ucount + 1
	elif x.islower():
		lcount = lcount + 1
if ucount > lcount:
	inp = inp.upper()
else:
	inp = inp.lower()
print(inp)


N = input()
M = N.upper()
n = list(N)
m = list(M)
i = 0
s = 0
while i < len(n):
	if n[i] == m[i]:
		s += 1
	i += 1
if s > len(n) / 2:
	K = ''.join(M)
else:
	Q = N.lower()
	K = ''.join(Q)
print(K)


def get_str(str):
	low_count = 0
	up_count = 0
	for ch in str:
		if ch.islower():
			low_count += 1
		if ch.isupper():
			up_count += 1
	if low_count >= up_count:
		str = str.lower()
	elif up_count > low_count:
		str = str.upper()
	return str
str = input()
print(get_str(str))


s = input()
lc = 0
for i in s:
	if i >= 'a' and i <= 'z':
		lc += 1
uc = len(s) - lc
if uc > lc:
	print(s.upper())
else:
	print(s.lower())


def mCheckInputs(inputList):
	temp = inputList.pop()
	if temp.isalpha() and 1 <= len(temp) <= pow(10, 2):
		inputList.append(temp)
	else:
		exit(1)

def mHandleInputs(inputList):
	x = input()
	inputList.append(x)
	mCheckInputs(inputList)

def mDoWork(inputList, outputList):
	s = inputList.pop()
	upperCount = sum((1 for item in s if item.isupper()))
	lowerCount = sum((1 for item in s if item.islower()))
	if upperCount > lowerCount:
		outputList.append(s.upper())
	else:
		outputList.append(s.lower())

def mFormatResult(outputList):
	print(outputList[0])

def main():
	inputList = []
	mHandleInputs(inputList)
	outputList = []
	mDoWork(inputList, outputList)
	mFormatResult(outputList)
main()


s = input()
cb = 0
cs = 0
for i in range(len(s)):
	if 'A' <= s[i] <= 'Z':
		cb += 1
	else:
		cs += 1
if cs >= cb:
	print(s.lower())
else:
	print(s.upper())


s = str(input())
upp = 0
low = 0
S = ''
for i in range(len(s)):
	ascii = ord(s[i])
	if ascii >= ord('A') and ascii <= ord('Z'):
		upp = upp + 1
	else:
		low = low + 1
if upp > low:
	for i in range(0, len(s)):
		ascii = ord(s[i])
		if ascii >= ord('a') and ascii <= ord('z'):
			S += chr(ascii - 32)
		else:
			S += s[i]
elif upp <= low:
	for i in range(0, len(s)):
		ascii = ord(s[i])
		if ascii >= ord('A') and ascii <= ord('Z'):
			S += chr(ascii + 32)
		else:
			S += s[i]
print(S)


name = list(input().strip())
(upper, lower) = (0, 0)
for char in name:
	if char.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(''.join(name).upper())
else:
	print(''.join(name).lower())


text_str = input()
array_str = list(text_str)
c_upper = 0
c_lower = 0
for i in range(len(array_str)):
	if array_str[i].isupper() == True:
		c_upper += 1
	else:
		c_lower += 1
if c_upper > c_lower:
	print(text_str.upper())
else:
	print(text_str.lower())


x = input()
count = 0
count2 = 0
for a in x:
	if a.isupper():
		count += 1
	else:
		count2 += 1
if count > count2:
	print(x.upper())
else:
	print(x.lower())


string = input()
a = len(string)
count_of_big = 0
count_of_mini = 0
for i in string:
	if i.isupper():
		count_of_big += 1
	else:
		count_of_mini += 1
if count_of_big > count_of_mini:
	print(string.upper())
else:
	print(string.lower())


word = input()
w = list(word)
count1 = count2 = 0
for i in w:
	if i.isupper():
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	print(word.upper())
else:
	print(word.lower())


word = input()
count_up = 0
count_low = 0
for letter in word:
	if letter.isupper():
		count_up += 1
	else:
		count_low += 1
if count_up > count_low:
	print(word.upper())
elif count_up <= count_low:
	print(word.lower())


def countLowerUpper(string):
	countLower = 0
	countUpper = 0
	for ch in string:
		if ch.islower():
			countLower += 1
		else:
			countUpper += 1
	return countUpper > countLower
string = input()
if countLowerUpper(string):
	print(string.upper())
else:
	print(string.lower())


class Code:

	def __init__(self):
		self.s = input()

	def process(self):
		(upper, lower) = (0, 0)
		for ch in self.s:
			if ch.isupper():
				upper += 1
			else:
				lower += 1
		print(self.s.lower() if lower >= upper else self.s.upper())
code = Code()
code.process()


word = input()
c1 = 0
c2 = 0
for letter in word:
	if letter.isupper():
		c1 += 1
	else:
		c2 += 1
if c1 > c2:
	print(word.upper())
else:
	print(word.lower())


n = str(input())
List = list(n)
u = 0
l = 0
for x in range(len(n)):
	if 'A' <= List[x] <= 'Z':
		u += 1
	elif 'a' <= List[x] <= 'z':
		l += 1
n_new = ''.join(List)
if u > l:
	print(n_new.upper())
elif l > u:
	print(n_new.lower())
elif u == l:
	print(n_new.lower())


def solve(s):
	uppercase_length = sum((1 for c in s if c.isupper()))
	lowercase_length = len(s) - uppercase_length
	if lowercase_length >= uppercase_length:
		return s.lower()
	else:
		return s.upper()

def main():
	s = input().strip()
	result = solve(s)
	print(result)
main()


a = input()
a = list(a)
x = 0
y = 0
for i in a:
	if i.isupper():
		x = x + 1
	else:
		y = y + 1
a = ''.join(a)
if x > y:
	a = a.upper()
else:
	a = a.lower()
print(a)


word = input()
U = 0
L = 0
for i in word:
	if i.islower():
		L += 1
	else:
		U += 1
if L >= U:
	word = word.lower()
else:
	word = word.upper()
print(word)


a = input('')
velke = 0
majhne = 0
for i in a:
	if i.isupper():
		velke += 1
	else:
		majhne += 1
if majhne >= velke:
	print(a.lower())
else:
	print(a.upper())


string = str(input())
aupper = 0
dlower = 0
for i in range(len(string)):
	if string[i] == string[i].lower():
		dlower += 1
	else:
		aupper += 1
if dlower >= aupper:
	print(string.lower())
else:
	print(string.upper())


def justice(s):
	(counter_big, counter_small) = (0, 0)
	for i in range(len(s)):
		if ord(s[i]) < 96:
			counter_big += 1
		else:
			counter_small += 1
	if counter_big > counter_small:
		return s.upper()
	return s.lower()
print(justice(input()))


w = input()
l = 0
for i in range(len(w)):
	l += 1 if w[i].islower() else 0
print([w.upper(), w.lower()][l >= len(w) - l])


n = input()
low = 0
upp = 0
for i in n:
	if 97 <= ord(i) <= 122:
		low += 1
	else:
		upp += 1
if upp > low:
	print(n.upper())
else:
	print(n.lower())


a = input()
(c1, c2) = (0, 0)
for i in a:
	if i.isupper():
		c1 += 1
	else:
		c2 += 1
if c1 > c2:
	print(a.upper())
else:
	print(a.lower())


a = input()
l = len(a)
count = 0
for i in a:
	if i.isupper():
		count += 1
if count <= int(l / 2):
	print(a.lower())
else:
	print(a.upper())


word = input()
CC = 0
SC = 0

def Capitals(word):
	w = ''
	for i in range(len(word)):
		if 'a' <= word[i] <= 'z':
			w += chr(ord(word[i]) - 32)
		else:
			w += word[i]
	return w

def small(word):
	w = ''
	for i in range(len(word)):
		if 'A' <= word[i] <= 'Z':
			w += chr(ord(word[i]) + 32)
		else:
			w += word[i]
	return w
for i in range(len(word)):
	if 'A' <= word[i] <= 'Z':
		CC += 1
	else:
		SC += 1
if CC <= SC:
	print(small(word))
else:
	print(Capitals(word))


AL = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
s = input()
up = 0
low = 0
for i in s:
	if i in AL:
		up += 1
	else:
		low += 1
if up > low:
	print(s.upper())
else:
	print(s.lower())


s = input()
cap_in_s = sum((1 for c in s if c.isupper()))
low_in_s = sum((1 for c in s if c.islower()))
if cap_in_s == low_in_s or cap_in_s < low_in_s:
	print(s.lower())
else:
	print(s.upper())


w = input()
word = list(w)
cnt_upper = 0
cnt_lower = 0
for i in word:
	if ord(i) >= 65 and ord(i) <= 96:
		cnt_upper += 1
	else:
		cnt_lower += 1
if cnt_lower >= cnt_upper:
	print(w.lower())
else:
	print(w.upper())


word = input()
index = 0
up = 0
l = len(word)
LETTER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
while index < l:
	if LETTER.find(word[index]) != -1:
		up = up + 1
	index = index + 1
if up > l - up:
	s = word.upper()
else:
	s = word.lower()
print(s)


string = input()
low = 0
high = 0
for i in string:
	if i.lower() == i:
		low += 1
	else:
		high += 1
if low > high or low == high:
	print(string.lower())
elif high > low:
	print(string.upper())


s = input()
lst1 = list(s)
lst2 = list(s.upper())
m = 0
n = 0
for i in lst1:
	if i == lst2[n]:
		m += 1
	n += 1
b = len(s) - m
if m > b:
	print(s.upper())
else:
	print(s.lower())


s1 = input()
upp = low = 0
for x in s1:
	if 65 <= ord(x) <= 90:
		upp += 1
	else:
		low += 1
if upp > low:
	print(s1.upper())
else:
	print(s1.lower())


word = input()
uppercase_count = 0
lowercase_count = 0
for i in range(len(word)):
	if word[i].isupper():
		uppercase_count += 1
	else:
		lowercase_count += 1
if uppercase_count > lowercase_count:
	print(word.upper())
else:
	print(word.lower())


s = input()
lowerc = 0
upperc = 0
for i in range(len(s)):
	if s[i].islower():
		lowerc += 1
	else:
		upperc += 1
if lowerc >= upperc:
	print(s.lower())
else:
	print(s.upper())


word = input()
x = list(word)
s1 = 0
s2 = 0
for letter in x:
	if letter.isupper() == True:
		s1 += 1
	else:
		s2 += 1
if s1 > s2:
	print(word.upper())
else:
	print(word.lower())


string = input()
count = 0
c = 0
for i in string:
	if i.islower():
		count = count + 1
	if i.isupper():
		c = c + 1
if count >= c:
	s = string.lower()
else:
	s = string.upper()
print(s)


s = str(input())
s1 = list(s)
up = 0
down = 0
for i in range(len(s1)):
	if s[i].isupper():
		up += 1
	if s[i].islower():
		down += 1
if up > down:
	print(s.upper())
elif down >= up:
	print(s.lower())


w = input()
ww = [ord(x) for x in w]
l = u = 0
for k in range(len(w)):
	if ww[k] > 96:
		l += 1
	else:
		u += 1
if u > l:
	print(w.upper())
else:
	print(w.lower())


str1 = input()
countupper = 0
countlower = 0
for i in str1:
	if i.isupper() == True:
		countupper += 1
	elif i.isupper() == False:
		countlower += 1
	else:
		continue
if countupper > countlower:
	print(str1.upper())
else:
	print(str1.lower())


word = input()
ups = 0
for c in word:
	if c.isupper():
		ups += 1
		continue
	ups -= 1
if ups > 0:
	print(word.upper())
else:
	print(word.lower())


word = input('')
upper = 0
lower = 0
for item in word:
	if item.islower() is True:
		lower += 1
	else:
		upper += 1
if upper <= lower:
	words = word.lower()
else:
	words = word.upper()
print(words)


s = input()
l = sum([1 if i == j else 0 for (i, j) in list(zip(s, s.lower()))])
u = sum([1 if i == j else 0 for (i, j) in list(zip(s, s.upper()))])
if l >= u:
	print(s.lower())
else:
	print(s.upper())


s = input()
up = 0
low = 0
for x in s:
	low += x.islower()
	up += x.isupper()
if up > low:
	print(s.upper())
else:
	print(s.lower())


def check(a):
	lc = 0
	uc = 0
	for i in a:
		if i.isupper():
			uc += 1
		else:
			lc += 1
	if lc >= uc:
		a = a.lower()
	else:
		a = a.upper()
	return a
word = input()
print(check(word))


s = input()
print([s.lower(), s.upper()][sum((ord(i) >= 65 and ord(i) <= 90 for i in s)) > len(s) // 2])


import bisect
s1 = input()
n = len(s1)
s2 = s1 + '_'
L1 = list(s2)
L1.sort()
m = bisect.bisect(L1, '_')
k = m - 1
if k > n / 2:
	print(s1.upper())
else:
	print(s1.lower())


s = input()
z = 0
m = 0
k = len(s)
zag = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
mal = 'abcdefghijklmnopqrstuvwxyz'
for a in range(0, k):
	for i in range(0, 26):
		if s[a] == zag[i]:
			z = 1 + z
		if s[a] == mal[i]:
			m = 1 + m
if z > m:
	for a in range(0, k):
		for i in range(0, 26):
			if s[a] == mal[i]:
				s = s.replace(s[a], zag[i])
else:
	for a in range(0, k):
		for i in range(0, 26):
			if s[a] == zag[i]:
				s = s.replace(s[a], mal[i])
print(s)


n = input()
j = n.split
abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
count1 = 0
count2 = 0
for i in n:
	if i in abc:
		count1 = count1 + 1
	else:
		count2 = count2 + 1
if count1 > count2:
	print(n.upper())
else:
	print(n.lower())


s = input()
ctr1 = 0
ctr2 = 0
for i in range(len(s)):
	if s[i].islower():
		ctr1 = ctr1 + 1
	else:
		ctr2 = ctr2 + 1
if ctr1 >= ctr2:
	print(s.lower())
else:
	print(s.upper())


def answer():
	a = input()
	count = 0
	for x in a:
		if x == x.upper():
			count += 1
		else:
			count -= 1
	if count > 0:
		return a.upper()
	else:
		return a.lower()
print(answer())


s = input()
cap = 0
low = 0
for let in s:
	if let.islower():
		low += 1
	else:
		cap += 1
if low >= cap:
	print(s.lower())
else:
	print(s.upper())


import string
S = input()
up = 0
lo = 0
for s in S:
	if s in string.ascii_lowercase:
		lo += 1
	else:
		up += 1
if lo < up:
	print(S.upper())
else:
	print(S.lower())


n = input()
u = 0
l = 0
for e in n:
	if e.isupper():
		u = u + 1
	else:
		l = l + 1
if u > l:
	print(n.upper())
else:
	print(n.lower())


def main(word):
	upper_count = 0
	for letter in word:
		if letter.isupper():
			upper_count += 1
	lower_count = len(word) - upper_count
	if upper_count > lower_count:
		return word.upper()
	return word.lower()
word = input()
print(main(word))


import string
s = input()
numUpper = 0
numLower = 0
for letter in s:
	if letter in string.ascii_uppercase:
		numUpper += 1
for letter in s:
	if letter in string.ascii_lowercase:
		numLower += 1
if numUpper > numLower:
	print(s.upper())
else:
	print(s.lower())


n = input()
c = 0
c1 = 0
for i in n:
	if i.isupper():
		c += 1
	if i.islower():
		c1 += 1
if c > c1:
	a = n.upper()
if c < c1 or c == c1:
	a = n.lower()
print(a)


import sys

def isUpper(c):
	if c >= 'A' and c <= 'Z':
		return True
	else:
		return False
s = input()
up = lw = 0
for i in s:
	if isUpper(i) == True:
		up += 1
	else:
		lw += 1
if up > lw:
	print(s.upper())
else:
	print(s.lower())


word = input()
up = word.upper()
low = word.lower()
numup = 0
numlow = 0
for i in range(len(word)):
	if word[i] == up[i]:
		numup += 1
for i in range(len(word)):
	if word[i] == low[i]:
		numlow += 1
if numup > numlow:
	print(up)
elif numlow >= numup:
	print(low)


word = list(input())
x = ''.join(word)
listlower = []
listupper = []
for i in word:
	if i.upper() == i:
		listupper.append(i)
	elif i.lower() == i:
		listlower.append(i)
if len(listlower) >= len(listupper):
	print(x.lower())
else:
	print(x.upper())


a = input()
upperL = 0
lowerL = 0
for ch in a:
	if ch.islower():
		lowerL = lowerL + 1
	if ch.isupper():
		upperL = upperL + 1
if upperL > lowerL:
	print(a.upper())
elif lowerL > upperL:
	print(a.lower())
else:
	print(a.lower())


a = str(input())
l = 0
u = 0
for i in a:
	if i.islower() == True:
		l += 1
	else:
		u += 1
if l >= u:
	print(a.lower())
else:
	print(a.upper())


word = input()
length = len(word)
upper = sum(map(str.isupper, word))
print(word.upper() if upper > length - upper else word.lower())


s = input()
print(s.lower() if len([1 for _ in s if _.islower()]) * 2 >= len(s) else s.upper())


string = input()
(up, low) = (0, 0)
for i in string:
	temp = ord(i)
	if temp <= 90 and temp >= 65:
		up += 1
	if temp <= 122 and temp >= 97:
		low += 1
if up > low:
	print(string.upper())
else:
	print(string.lower())


s = input()
(l, c, cc) = (len(s), 0, 0)
for i in s:
	if i in s.upper():
		c += 1
	else:
		cc += 1
if cc >= c:
	print(s.lower())
else:
	print(s.upper())


k = input()
n = sum((1 for c in k if c.isupper()))
j = k.upper() if n > len(k) - n else k.lower()
print(j)


a = list(input())
upper = 0
lower = 0
for items in a:
	if items.isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(''.join(a).upper())
else:
	print(''.join(a).lower())


str1 = input()
upno = lowno = 0
for i in str1:
	if i.isupper():
		upno += 1
	if i.islower():
		lowno += 1
if upno > lowno:
	print(str1.upper())
else:
	print(str1.lower())


string = str(input())
l = 0
u = 0
for i in string:
	if i.isupper():
		u += 1
	else:
		l += 1
if l < u:
	print(string.upper())
else:
	print(string.lower())


n = input()
s1 = 0
s2 = 0
for i in n:
	if 'a' <= i <= 'z':
		s1 += 1
	else:
		s2 += 1
if s2 > s1:
	print(n.upper())
else:
	print(n.lower())


s = input()
count1 = 0
count2 = 0
for x in s:
	if ord(x) <= 90 and ord(x) >= 65:
		count1 += 1
	else:
		count2 += 1
if count1 > count2:
	print(s.upper())
else:
	print(s.lower())


w = input()
print([w.upper(), w.lower()][sum((i in list(w.lower()) for i in list(w))) >= len(w) / 2])


def lowercaseCount(s):
	count = 0
	for ch in s:
		if ch.islower():
			count += 1
	return count
s = input()
lowercase = lowercaseCount(s)
uppercase = len(s) - lowercase
if uppercase > lowercase:
	print(s.upper())
else:
	print(s.lower())


m = input()
l = list(m)
x = 0
y = 0
for i in range(0, len(l)):
	if l[i].islower():
		x = x + 1
	else:
		y = y + 1
if x >= y:
	s = m.lower()
else:
	s = m.upper()
print(s)


class Case:

	def __init__(self):
		self.upper_count = 0
		self.lower_count = 0

	def idf_case(self, char):
		if char.isupper():
			self.upper_count = self.upper_count + 1
		else:
			self.lower_count = self.lower_count + 1

	def mix_solver(self, word):
		size = len(word)
		half = size // 2
		for i in range(half):
			self.idf_case(word[i])
			self.idf_case(word[-(i + 1)])
		if size % 2 != 0:
			self.idf_case(word[half])
		if self.upper_count <= self.lower_count:
			return word.lower()
		else:
			return word.upper()
word = input()
obj = Case()
print(obj.mix_solver(word))


name = input()
length = len(name)
upp = 0
low = 0
for i in name:
	if ord(i) >= 97 and ord(i) < 123:
		low += 1
	else:
		upp += 1
if upp > low:
	print(name.upper())
else:
	print(name.lower())


import re
s = input()
lowers = re.findall('[a-z]', s)
uppers = re.findall('[A-Z]', s)
a = len(lowers)
b = len(uppers)
if a > b:
	print(s.lower())
elif a < b:
	print(s.upper())
elif a == b:
	print(s.lower())


n = input()
l = len(n)
i = 0
upper = 0
result = ''
while i < l:
	if n[i].isupper():
		upper += 1
	i += 1
lower = l - upper
if upper == lower:
	result = n.lower()
elif upper > lower:
	result = n.upper()
elif lower > upper:
	result = n.lower()
print(result)


s0 = list(input())
x = 0
s = ''
for l in s0:
	if l.isupper():
		x = x + 1
	s = s + l
if 2 * x > len(s):
	print(s.upper())
else:
	print(s.lower())


i = input()
print([i.upper(), i.lower()][sum((x.islower() for x in i)) >= sum((v.isupper() for v in i))])


import re
s = input()
y = re.findall('[A-Z]', s)
z = re.findall('[a-z]', s)
num1 = len(y)
num2 = len(z)
if num1 > num2:
	s = s.upper()
	print(s)
elif num1 < num2:
	s = s.lower()
	print(s)
else:
	s = s.lower()
	print(s)


word = input()
t = 0
for s in word:
	t += 1 if s.islower() else -1
print(word.lower() if t >= 0 else word.upper())


s = input()
U = L = 0
for i in s:
	if i.isupper():
		U += 1
	else:
		L += 1
print(s.upper() if U > L else s.lower())


s = input()
cl = sum((int(ord(x) >= ord('a') and ord(x) <= ord('z')) for x in s))
cu = len(s) - cl
if cl >= cu:
	print(s.lower())
else:
	print(s.upper())


s = input()
lwr = 0
up = 0
for i in range(len(s)):
	if s[i].islower():
		lwr += 1
	if s[i].isupper():
		up += 1
print(s.upper()) if up > lwr else print(s.lower())


word = input()
ncount = 0
for i in word:
	if ord(i) >= 65 and ord(i) <= 90:
		ncount += 1
if ncount * 2 > len(word):
	print(word.upper())
else:
	print(word.lower())


x = input('')
l = len(x)
i = -1
low = 0
up = 0
a = -1
b = -1
while i < l - 1:
	i = i + 1
	if ord(x[i]) < 91:
		up = up + 1
	if ord(x[i]) > 96:
		low = low + 1
if up > low:
	while a < l - 1:
		a = a + 1
		if ord(x[a]) > 96:
			p = int(ord(x[a]))
			p = p - 32
			(print(chr(p), end=''),)
			p = 0
		if ord(x[a]) < 91:
			(print(x[a], end=''),)
if up < low or up == low:
	while b < l - 1:
		b = b + 1
		if ord(x[b]) < 91:
			q = int(ord(x[b]))
			q = q + 32
			(print(chr(q), end=''),)
			q = 0
		if ord(x[b]) > 96:
			print(x[b], end='')


import string
value = input()
a = len([letter for letter in value if letter.isupper()])
if a > len(value) // 2:
	print(value.upper())
else:
	print(value.lower())


a = list(map(chr, range(97, 123)))
b = list(map(chr, range(65, 91)))
c = 0
d = 0
s = input()
for i in s:
	if i in a:
		c += 1
	if i in b:
		d += 1
if c >= d:
	print(s.lower())
else:
	print(s.upper())


word = input()
lower_nr = 0
upper_nr = 0
for pos in range(len(word)):
	if word[pos].islower():
		lower_nr += 1
	else:
		upper_nr += 1
if upper_nr > lower_nr:
	print(word.upper())
else:
	print(word.lower())


s = input()
lower = upper = 0
for c in s:
	if ord('A') <= ord(c) <= ord('Z'):
		upper += 1
	else:
		lower += 1
if lower >= upper:
	print(s.lower())
else:
	print(s.upper())


sum1 = 0
sum2 = 0
l = input()
for i in list(l):
	sum1 += i in 'qwertyuiopasdfghjklzxcvbnm'
	sum2 += i in 'QWERTYUIOPASDFGHJKLZXCVBNM'
print([l.lower(), l.upper()][sum2 > sum1])


s = str(input())
n = len(s)
l = 0
u = 0
for i in range(0, len(s)):
	if 64 < ord(s[i]) and ord(s[i]) < 91:
		u = u + 1
	elif 96 < ord(s[i]) and ord(s[i]) < 123:
		l = l + 1
if u > l:
	s = s.upper()
	print(s)
else:
	s = s.lower()
	print(s)


string = input()
count = 0
counter = 0
for i in string:
	if i.isupper():
		count = count + 1
	else:
		counter = counter + 1
if count > counter:
	a = string.upper()
	print(a)
elif count <= counter:
	b = string.lower()
	print(b)


a = input()
s = list(a)
count1 = 0
count2 = 0
for i in range(len(s)):
	if s[i].isupper():
		count1 += 1
	else:
		count2 += 1
if count1 <= count2:
	print(a.lower())
else:
	print(a.upper())


z = []
a = 0
s = 0
x = input()
if 1 <= len(x) <= 100:
	for c in x:
		z.append(c)
	for v in z:
		n = z.index(v)
		m = ord(z[n])
		if m in range(65, 91):
			a = a + 1
		elif m in range(97, 123):
			s = s + 1
	if a > s:
		print(x.upper())
	else:
		print(x.lower())


m = str(input())
(uc, lc) = (0, 0)
for a in m:
	if a.isupper() == True:
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(m.upper())
else:
	print(m.lower())


s = input()
if [i.isupper() for i in s].count(True) > [i.islower() for i in s].count(True):
	print(s.upper())
else:
	print(s.lower())


s = input()
cl = 0
cu = 0
for i in str(s):
	if 'a' <= i <= 'z':
		cl += 1
	else:
		cu += 1
if cu > cl:
	print(s.upper())
else:
	print(s.lower())


a = input()
b = len(a)
i = 0
count1 = count = 0
while i < b:
	if a[i].isupper() == True:
		count += 1
		i += 1
	else:
		count1 += 1
		i += 1
if count > count1:
	print(a.upper())
else:
	print(a.lower())


s = input()
c_up = 0
c_low = 0
for i in range(len(s)):
	if s[i] == s[i].lower():
		c_low += 1
	else:
		c_up += 1
if c_low < c_up:
	print(s.upper())
else:
	print(s.lower())


s = input()
upper = 0
lower = 0
for i in s:
	if i.isupper() == True:
		upper += 1
	elif i.islower() == True:
		lower += 1
if upper > lower:
	print(s.upper())
elif lower > upper or lower == upper:
	print(s.lower())


s = input()
l = len(s)
x = 0
y = 0
for i in range(0, l):
	if ord(s[i]) > 95:
		x = x + 1
	else:
		y = y + 1
if x >= y:
	print(s.lower())
else:
	print(s.upper())


n = input()
record1 = 0
record2 = 0
for iterate in n:
	if ord(iterate) in range(97, 123):
		record1 += 1
	else:
		record2 += 1
if record1 < record2:
	print(n.upper())
else:
	print(n.lower())


s = input()
up = 0
lo = 0
for char in list(s):
	if char.isupper():
		up += 1
	else:
		lo += 1
if up > lo:
	print(s.upper())
else:
	print(s.lower())


def convert(s: str) -> str:
	n = list(s)
	up = []
	down = []
	for i in n:
		if i.isupper() == True:
			up.append(i)
		elif i.islower() == True:
			down.append(i)
	if len(up) > len(down):
		return s.upper()
	else:
		return s.lower()
print(convert(str(input().strip())))


s = input()
l = len(s)
c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
l = 'abcdefghijklmnopqrstuvwxyz'
capital = 0
small = 0
for i in s:
	if i in c:
		capital += 1
	else:
		small += 1
if small > capital or small == capital:
	print(s.lower())
else:
	print(s.upper())


word = input()
lower_count = sum((1 for i in word if ord('a') <= ord(i) <= ord('z')))
upper_count = sum((1 for i in word if ord('A') <= ord(i) <= ord('Z')))
if lower_count < upper_count:
	print(word.upper())
elif lower_count < upper_count:
	print(word.lower())
else:
	print(word.lower())


s = input()
n = len(s)
lwr = 0
for ch in s:
	if ch.islower():
		lwr += 1
lwr *= 2
if lwr < n:
	print(s.upper())
else:
	print(s.lower())


s = input()
lower = 0
upper = 0
for item in range(len(s)):
	if s[item].islower():
		lower += 1
	else:
		upper += 1
print(s.lower() if lower >= upper else s.upper())


x = input()
uc = 0
lc = 0
for i in x:
	if i.islower():
		lc = lc + 1
	else:
		uc = uc + 1
if lc > len(x) / 2 or lc == len(x) / 2:
	print(x.lower())
else:
	print(x.upper())


s = input()
nl = 0
for e in s:
	if e.islower():
		nl += 1
if nl >= len(s) - nl:
	print(s.lower())
else:
	print(s.upper())


s = input()
c = 0
sm = 0
for i in s:
	if i.isupper():
		c += 1
	else:
		sm += 1
if c == sm:
	print(s.lower())
elif c > sm:
	print(s.upper())
elif c < sm:
	print(s.lower())
else:
	pass


x = input()
l = 0
u = 0
for char in x:
	if char.islower() == True:
		l += 1
	else:
		u += 1
if l >= u:
	print(x.lower())
else:
	print(x.upper())


i = input()
j = sum(map(lambda n: n.isupper(), i))
k = sum(map(lambda n: n.islower(), i))
if k >= j:
	print(i.lower())
else:
	print(i.upper())


x = input()
x2 = x.upper()
x3 = x.lower()
z = []
y = []
a = []
upper = 0
lower = 0
for i in range(len(x)):
	z.append(x2[i])
for ind in range(len(x)):
	y.append(x3[ind])
for indd in range(len(x)):
	a.append(x[indd])
for inddd in range(len(x)):
	for index in a:
		if index in z:
			upper = upper + 1
		if index in y:
			lower = lower + 1
	break
if upper > lower:
	print(x.upper())
elif upper <= lower:
	print(x.lower())


s = input()
a = [i for i in s if i.isupper()]
if len(a) > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


a = input()
minus = 0
for i in a:
	minus += i.islower()
print([a.upper(), a.lower()][minus >= len(a) - minus])


s = input()
n = 0
N = 0
for i in s:
	if 'a' <= i <= 'z':
		n += 1
	else:
		N += 1
if n >= N:
	print(s.lower())
else:
	print(s.upper())


l = 0
ll = 0
n = input()
for i in range(len(n)):
	s = n[i].isupper()
	if s == True:
		ll += 1
	else:
		l += 1
if ll == l:
	print(n.lower())
elif ll > l:
	print(n.upper())
else:
	print(n.lower())


U = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
L = U.lower()
s = input()
uc = sum((c in U for c in s))
lc = sum((c in L for c in s))
if uc <= lc:
	print(s.lower())
else:
	print(s.upper())


def findCase(myStr):
	if len(myStr) <= 1:
		return myStr
	list_case = list(myStr)
	(upper_ct, lower_ct) = (0, 0)
	for char in list_case:
		if char.isupper():
			upper_ct += 1
			continue
		if char.islower():
			lower_ct += 1
			continue
	if lower_ct >= upper_ct:
		return str.lower(myStr)
	else:
		return str.upper(myStr)
ip = input()
print(findCase(ip))


x = input()
lu = 0
up = 0
for i in x:
	if i.islower():
		lu = lu + 1
	else:
		up = up + 1
if lu >= up:
	x = x.lower()
else:
	x = x.upper()
print(x)


s = input()
t = len(list(filter(lambda x: x.isupper(), s)))
p = t / len(s)
if p > 0.5:
	s = s.upper()
else:
	s = s.lower()
print(s)


a = input()
kb = 0
km = 0
l = ''
am = ''
for i in range(len(a)):
	if ord(a[i]) > 64 and ord(a[i]) < 91:
		kb += 1
	else:
		km += 1
if kb > km:
	for i in range(len(a)):
		if ord(a[i]) > 96 and ord(a[i]) < 123:
			am = chr(ord(a[i]) - 32)
		else:
			am = a[i]
		l = l + am
else:
	for i in range(len(a)):
		if ord(a[i]) > 64 and ord(a[i]) < 91:
			am = chr(ord(a[i]) + 32)
		else:
			am = a[i]
		l = l + am
print(l)


word = input().strip()
upperCaseCount = len([x for x in word if x.isupper() == True])
if upperCaseCount > len(word) - upperCaseCount:
	print(''.join([x.upper() for x in word]))
else:
	print(''.join([x.casefold() for x in word]))


inp = input()
countl = 0
countu = 0
for i in inp:
	if i >= 'A' and i <= 'Z':
		countu = countu + 1
	if i >= 'a' and i <= 'z':
		countl = countl + 1
if countu > countl:
	print(inp.upper())
else:
	print(inp.lower())


a = input()
may = 0
min = 0
for i in a:
	if i == i.lower():
		min += 1
	else:
		may += 1
if min >= may:
	print(a.lower())
else:
	print(a.upper())


def is_upper(string):
	(u, l) = (0, 0)
	for i in string:
		if i.isupper():
			u += 1
		else:
			l += 1
	return u > l
s_1 = input().strip()
if is_upper(s_1):
	print(s_1.upper())
else:
	print(s_1.lower())


s = input()
(ucount, lcount) = (0, 0)
for e in s:
	ucount += e.isupper()
	lcount += e.islower()
if ucount > lcount:
	print(s.upper())
else:
	print(s.lower())


gir = input()
gir = list(gir)
up = 0
low = 0
for _ in gir:
	if 90 >= ord(_) >= 65:
		up += 1
	else:
		low += 1
if up > low:
	print(''.join(gir).upper())
else:
	print(''.join(gir).lower())


string = input('')
uppercase_letters = 0
for letter in string:
	if letter.isupper():
		uppercase_letters += 1
if 2 * uppercase_letters > len(string):
	print(string.upper())
else:
	print(string.lower())


a = input()
n = len(a)
l = []
u = []
for i in range(n):
	if a[i] == a[i].lower():
		l.append(a[i])
	elif a[i] == a[i].upper():
		u.append(a[i])
if len(l) > len(u) or len(l) == len(u):
	print(a.lower())
else:
	print(a.upper())


n = input()
le = [i.islower() for i in n].count(True)
print(n.lower() if le >= len(n) - le else n.upper())


ch = input()
sum1 = 0
sum2 = 0
for k in ch:
	if k.isupper():
		sum1 += 1
	else:
		sum2 += 1
if sum1 > sum2:
	print(ch.upper())
else:
	print(ch.lower())


s = input()
n = len(s)
cnt = 0
for i in range(n):
	if s[i].isupper():
		cnt += 1
if cnt > n - cnt:
	print(s.upper())
else:
	print(s.lower())


c = input()
o = 0
p = 0
u = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(c)):
	if c[i] in u:
		o = o + 1
	else:
		p = p + 1
if o > p:
	print(c.upper())
else:
	print(c.lower())


st = input()
c = v = 0
for i in st:
	if i.isupper():
		v += 1
	else:
		c += 1
if c < v:
	for i in st:
		i = i.upper()
	print(st.upper())
else:
	for i in st:
		i = i.lower()
	print(st.lower())


l = list(input())
a = 0
b = 0
m = ''.join(l)
for i in l:
	if i >= 'A' and i <= 'Z':
		a += 1
	else:
		b += 1
if a > b:
	print(m.upper())
else:
	print(m.lower())


def rex():
	a = input()
	l = len(a)
	cap = 0
	cup = 0
	for i in range(l):
		if ord(a[i]) > 92:
			cup += 1
		else:
			cap += 1
	if cap > cup:
		return a.upper()
	return a.lower()
print(rex())


a = input()
l = len(a)
upper = 0
lower = 0
for i in a:
	if i.isupper():
		upper += 1
	elif i.islower():
		lower += 1
if upper > lower:
	print(a.upper())
else:
	print(a.lower())


string = input()
length = len(string)
numberOfCapitals = 0
numberOfLowers = 0
for i in range(length):
	chosenCharacter = string[i]
	if chosenCharacter.isupper() == True:
		numberOfCapitals = numberOfCapitals + 1
	else:
		numberOfLowers = numberOfLowers + 1
if numberOfCapitals > numberOfLowers:
	string = string.upper()
	print(string)
else:
	string = string.lower()
	print(string)


import string
word = input()
lower = []
upp = []
min = 0
may = 0
letrasMinusculas = string.ascii_lowercase
for i in range(len(letrasMinusculas)):
	lower.append(letrasMinusculas[i])
letrasMay = string.ascii_uppercase
for i in range(len(letrasMay)):
	upp.append(letrasMay[i])
for i in range(len(word)):
	if word[i] in set(lower):
		min += 1
	else:
		may += 1
if min > may:
	print(word.lower())
elif min < may:
	print(word.upper())
else:
	print(word.lower())


word = input()
lst = list(bytes(word, encoding='utf-8'))
b = 0
s = 0
for x in lst:
	if x > 91:
		s += 1
	else:
		b += 1
if b > s:
	word = word.upper()
else:
	word = word.lower()
print(word)


s = input()
lowers = sum((1 for i in s if i.islower()))
uppers = sum((1 for i in s if i.isupper()))
if lowers >= uppers:
	print(s.lower())
else:
	print(s.upper())


import sys
input = sys.stdin.readline

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

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
s = input()
n = list(s)
up = 0
lo = 0
for c in n:
	if c.isupper():
		up = up + 1
	elif c.islower():
		lo = lo + 1
if up > lo:
	ans = s.upper()
else:
	ans = s.lower()
print(ans)


a = input('')
t = len(a)
u = 0
l = 0
for i in range(0, t):
	if a[i].isupper():
		u += 1
	elif a[i].islower():
		l += 1
if u == l or u < l:
	print(a.lower())
if u > l:
	print(a.upper())


sri = input()
print([sri.lower(), sri.upper()][sum((i < '[' for i in sri)) * 2 > len(sri)])


s = input()
u = l = 0
for i in range(len(s)):
	if ord(s[i]) >= 65 and ord(s[i]) <= 90:
		u += 1
	else:
		l += 1
if u > l:
	print(s.upper())
elif u < l:
	print(s.lower())
else:
	print(s.lower())


word = input()
caps = len([i for i in word if i.isupper()])
baby = len([i for i in word if i.islower()])
if caps > baby:
	print(word.upper())
else:
	print(word.lower())


a = input('')
uppercase = 0
lowercase = 0
for value in a:
	if value.isupper():
		uppercase = uppercase + 1
	else:
		lowercase = lowercase + 1
if uppercase > lowercase:
	returnstring = ''
	for value in a:
		returnstring = returnstring + value.upper()
if uppercase <= lowercase:
	returnstring = ''
	for value in a:
		returnstring = returnstring + value.lower()
print(returnstring)


def cf(n):
	l = len(n)
	u = 0
	for i in n:
		if i.isupper():
			u = u + 1
	if u > l - u:
		return n.upper()
	else:
		return n.lower()
N = input()
print(cf(N))


s = input()
status = [1 if x.isupper() else 0 for x in s if x.isupper()]
ones = sum(status)
zeros = len(s) - ones
if ones > zeros:
	print(s.upper())
elif ones < zeros:
	print(s.lower())
else:
	print(s.lower())


s = input()
ucount = 0
lcount = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		ucount += 1
	else:
		lcount += 1
if ucount > lcount:
	print(s.upper())
else:
	print(s.lower())


l1 = list(input())
s = ''.join(l1)
c1 = c2 = 0
for i in range(len(l1)):
	if l1[i].islower():
		c1 += 1
	else:
		c2 += 1
if c2 > c1:
	print(s.upper())
else:
	print(s.lower())


word = input()
U = ''
L = ''
u_count = 0
l_count = 0
for c in word:
	if c.isupper():
		u_count += 1
	else:
		l_count += 1
	U += c.upper()
	L += c.lower()
if u_count > l_count:
	print(U)
else:
	print(L)


a = 'abcdefghijklmnopqrstuvwxyz'
x = input()
count = 0
i = ''
for i in x:
	if ord(i) > 64 and ord(i) < 91:
		count = count + 1
if count > len(x) / 2:
	x = x.upper()
else:
	x = x.lower()
print(x)


def isupper(char):
	return char.isupper()
string = input()
countUpper = 0
countLower = 0
for c in string:
	if isupper(c):
		countUpper = countUpper + 1
	else:
		countLower = countLower + 1
if countLower < countUpper:
	string = string.upper()
elif countUpper < countLower:
	string = string.lower()
else:
	string = string.lower()
print(string)


x = input()
up = 0
down = 0
for i in x:
	if i.isupper():
		up += 1
	else:
		down += 1
if up > down:
	print(x.upper())
elif up < down or up == down:
	print(x.lower())


s = input()
k1 = k2 = 0
for i in range(len(s)):
	if 'a' <= s[i] <= 'z':
		k1 += 1
	else:
		k2 += 1
if k1 < k2:
	print(s.upper())
else:
	print(s.lower())


s = input()
count = 0
for i in range(len(s)):
	if s[i].isupper():
		count += 1
print(s.upper() if count > 0.5 * len(s) else s.lower())


str = input()
cnt = 0
for i in str:
	if i.isupper():
		cnt += 1
l = len(str)
low = l - cnt
if low > cnt:
	str = str.lower()
elif cnt > low:
	str = str.upper()
else:
	str = str.lower()
print(str)


word = input()
words = [x for x in word]
upper = 0
lower = 0
for x in words:
	if x.isupper() == True:
		upper += 1
	else:
		lower += 1
if lower >= upper:
	print(word.lower())
else:
	print(word.upper())


s = input()
uppercount = 0
lowercount = 0
for char in s:
	if char.isupper():
		uppercount += 1
	elif char.islower():
		lowercount += 1
if uppercount > lowercount:
	print(s.upper())
else:
	print(s.lower())


s = input()
k1 = 0
k2 = 0
for c in s:
	if c.isupper():
		k1 += 1
	else:
		k2 += 1
if k1 > k2:
	print(s.upper())
else:
	print(s.lower())


a = input()
lib = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z '
lib1 = lib.lower()
l = []
u = []
for i in a:
	if i in lib:
		u.append(i)
	else:
		l.append(i)
if len(u) > len(l):
	b = a.upper()
else:
	b = a.lower()
print(b)


a = input()
s = list(a)
U = L = 0
for i in range(len(s)):
	if s[i].islower():
		L += 1
	elif s[i].isupper():
		U += 1
if U > L:
	print(a.upper())
else:
	print(a.lower())


s = input()
n = len(s)
cu = sum((1 for x in s if x.isupper()))
print(s.lower()) if 2 * cu <= n else print(s.upper())


def cal(i):
	if 97 <= i <= 122:
		return 0
	else:
		return 1
s = input()
Counter = 0
for i in s:
	Counter += cal(ord(i))
if Counter > len(s) - Counter:
	print(s.upper())
else:
	print(s.lower())


s1 = input()
s2 = list(s1)
small = 0
capital = 0
for i in range(len(s1)):
	if ord(s2[i]) > 96:
		small = small + 1
	else:
		capital = capital + 1
if capital > small:
	s3 = s1.upper()
else:
	s3 = s1.lower()
print(s3)


x = input()
big = 0
small = 0
for k in x:
	if k == k.upper():
		big += 1
	else:
		small += 1
if big > small:
	print(x.upper())
else:
	print(x.lower())


mix_word = input()
lower = 0
upper = 0
for letter in mix_word:
	if letter.islower():
		lower += 1
	else:
		upper += 1
if lower >= upper:
	print(mix_word.lower())
else:
	print(mix_word.upper())


line = input().strip()
low = line.lower()
length = len(line)
diff = 0
for i in range(length):
	if line[i] != low[i]:
		diff += 1
if diff <= length / 2:
	print(low)
else:
	print(line.upper())


s = input()
capCount = 0
for i in range(len(s)):
	if ord(s[i]) < 97:
		capCount += 1
smallCount = len(s) - capCount
if smallCount < capCount:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = str(input())
l = []
l2 = []
for i in s:
	if i.islower() == True:
		l.append(i)
	else:
		l2.append(i)
if len(l) >= len(l2):
	print(s.lower())
else:
	print(s.upper())


s = input().rstrip()
count1 = 0
count2 = 0
for i in s:
	if i.isupper():
		count2 += 1
	else:
		count1 += 1
if count1 >= count2:
	print(s.lower())
else:
	print(s.upper())


str = input()
c1 = 0
c2 = 0
for i in str:
	if i.islower():
		c1 += 1
	elif i.isupper():
		c2 += 1
if c1 >= c2:
	print(str.lower())
elif c1 < c2:
	print(str.upper())


s = input()
cup = 0
clo = 0
for i in list(s):
	if i.isupper():
		cup += 1
	if i.islower():
		clo += 1
if clo >= cup:
	print(s.lower())
else:
	print(s.upper())


n = input()
c1 = 0
c2 = 0
for i in range(len(n)):
	if ord(n[i]) >= 65 and ord(n[i]) <= 90:
		c1 += 1
	elif ord(n[i]) >= 97 and ord(n[i]) <= 122:
		c2 += 1
if c1 > c2:
	print(n.upper())
elif c2 >= c1:
	print(n.lower())


n = input()
(a, c) = (0, 0)
for i in n:
	if i.isupper():
		c = c + 1
	else:
		a = a + 1
if c > a:
	for i in n:
		if i.islower():
			print(i.swapcase(), end='')
		else:
			print(i, end='')
elif c < a:
	for i in n:
		if i.isupper():
			print(i.swapcase(), end='')
		else:
			print(i, end='')
else:
	for i in n:
		if i.isupper():
			print(i.swapcase(), end='')
		else:
			print(i, end='')


n = input()
countA = 0
countL = 0
for i in n:
	if i.islower():
		countL += 1
	else:
		countA += 1
if countA > countL:
	print(n.upper())
elif countL > countA:
	print(n.lower())
else:
	print(n.lower())


x = input()
C = 0
for i in x:
	if 64 < ord(i) < 91:
		C = C + 1
	if C > len(x) / 2:
		x = x.upper()
	else:
		x = x.lower()
print(x)


import sys
import math
s = input()
lower = 0
upper = 0
for i in range(len(s)):
	if ord(s[i]) <= 90:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(s.upper())
else:
	print(s.lower())


arr = list(input())
cap = 0
lit = 0
for i in arr:
	if 64 < ord(i) < 91:
		cap += 1
	if 96 < ord(i) < 123:
		lit += 1
for i in range(len(arr)):
	if lit >= cap:
		if 64 < ord(arr[i]) < 91:
			arr[i] = chr(ord(arr[i]) + 32)
	elif 96 < ord(arr[i]) < 123:
		arr[i] = chr(ord(arr[i]) - 32)
print(''.join(arr))


word = input()
ucount = 0
lcount = 0
for letter in word:
	if ord(letter) < 97 and ord(letter) >= 65:
		ucount += 1
	else:
		lcount += 1
if lcount < ucount:
	print(word.upper())
if lcount >= ucount:
	print(word.lower())


s = list(input())
total = 0
for x in s:
	if x.isupper():
		total += 1
if total > len(s) - total:
	print(''.join(s).upper())
else:
	print(''.join(s).lower())


def Count_LU_Chars(s):
	upC = 0
	loC = 0
	for x in s:
		if x.islower():
			loC += 1
		else:
			upC += 1
	if loC >= upC:
		s = s.lower()
	else:
		s = s.upper()
	print(s)

def main():
	s = str(input())
	Count_LU_Chars(s)
main()


word = list(input())
upper = 0
lower = 0
for c in word:
	if ord(c) < 91:
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(''.join([c.upper() for c in word]))
else:
	print(''.join([c.lower() for c in word]))


s = input()
a = b = 0
be = ''
ke = ''
for i in s:
	u = i
	if ord(i) >= 65 and ord(i) <= 90:
		a += 1
		u = u
		i = chr(ord(i) + 32)
	else:
		b += 1
		u = chr(ord(u) - 32)
	be += u
	ke += i
if a > b:
	print(be)
else:
	print(ke)


alp = 'abcdefghijklmnopqrstuvwxyz'
word = input()
if sum([a in alp for a in word]) < len(word) / 2:
	print(word.upper())
elif sum([a in alp for a in word]) == len(word) / 2:
	print(word.lower())
else:
	print(word.lower())


test_inp = str(input())
distinct_count = [0, 0]
for c in test_inp:
	if c.islower():
		distinct_count[0] = distinct_count[0] + 1
	elif c.isupper():
		distinct_count[1] = distinct_count[1] + 1
if distinct_count[0] < distinct_count[1]:
	print(test_inp.upper())
else:
	print(test_inp.lower())


n = list(input())
(u, l) = (0, 0)
for i in range(len(n)):
	if n[i].islower():
		l += 1
	else:
		u += 1
if u > l:
	n = [x.capitalize() for x in n]
	n = ''.join(n)
	print(n)
else:
	n = [x.lower() for x in n]
	n = ''.join(n)
	print(n)


n = input()
U = 0
L = 0
for i in range(len(n)):
	k = n[i]
	if k.isupper():
		U += 1
	else:
		L += 1
print(n.upper() if U > L else n.lower())


Words = input()
S = 0
C = 0
for var in Words:
	if var.islower():
		S += 1
C = len(Words) - S
if S == C or S > C:
	print(Words.lower())
else:
	print(Words.upper())


n = input()
a = list(n)
u = 0
s = 0
for i in a:
	if ord(i) in range(65, 91):
		u += 1
	elif ord(i) in range(97, 123):
		s += 1
if s > u:
	print(n.lower())
elif s < u:
	print(n.upper())
else:
	print(n.lower())


word = input()
word = list(word)
i = 0
upper = 0
lower = 0
while i < len(word):
	if ord(word[i]) >= 65 and ord(word[i]) <= 90:
		upper += 1
	elif ord(word[i]) >= 97 and ord(word[i]) <= 122:
		lower += 1
	i += 1
i = 0
if upper > lower:
	while i < len(word):
		if ord(word[i]) >= 97 and ord(word[i]) <= 122:
			z = ord(word[i]) - 32
			word[i] = chr(z)
		i += 1
else:
	while i < len(word):
		if ord(word[i]) >= 65 and ord(word[i]) <= 90:
			z = ord(word[i]) + 32
			word[i] = chr(z)
		i += 1
print(''.join(word))


s = input()
k = s.upper()
n = 0
for x in range(len(k)):
	if s[x] == k[x]:
		n += 1
if n > len(k) / 2:
	print(k)
else:
	g = s.lower()
	print(g)


l = list(input())
if 2 * sum((1 for c in l if c.isupper())) > len(l):
	print(''.join((i.upper() for i in l)))
else:
	print(''.join((i.lower() for i in l)))


a = input()
print(a.upper() if sum((a.count(x) for x in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')) * 2 > len(a) else a.lower())


s = input()
lcase = 0
ucase = 0
for i in range(len(s)):
	if s[i].islower():
		lcase += 1
	elif s[i].isupper():
		ucase += 1
if lcase > ucase:
	print(s.lower())
elif ucase > lcase:
	print(s.upper())
elif lcase == ucase:
	print(s.lower())


str = input()
count1 = 0
count2 = 0
for i in str:
	if i >= 'A' and i <= 'Z':
		count1 += 1
	else:
		count2 += 1
print(str.upper() if count1 > count2 else str.lower())


word = input()
wordlist = sorted(list(word))
num = 0
for i in range(len(word)):
	if word[i] <= 'Z':
		num += 1
if num * 2 > len(word):
	print(word.upper())
else:
	print(word.lower())


message = input()
upper_case = sum((1 for c in message if c.isupper()))
if upper_case > len(message) - upper_case:
	print(message.upper())
else:
	print(message.lower())


s = str(input())
big = 0
small = 0
for i in s:
	if i in 'QWERTYUIOPASDFGHJKLZXCVBNM':
		big += 1
	elif i in 'qwertyuiopasdfghjklzxcvbnm':
		small += 1
if big <= small:
	print(s.lower())
else:
	print(s.upper())


a = input()
b = a.upper()
c = a.lower()

def low(word):
	u = [x for x in word if x.isupper()]
	l = [x for x in word if x.islower()]
	return len(u) > len(l)
if low(a):
	print(b)
else:
	print(c)


low = 0
upp = 0
word = input()
for i in word:
	if i.islower():
		low += 1
	else:
		upp += 1
if low >= upp:
	print(word.lower())
else:
	print(word.upper())


s = str(input())
low = 0
sup = 0
for i in range(len(s)):
	if s[i].islower() == 1:
		low += 1
	else:
		sup += 1
if sup > low:
	s = s.upper()
else:
	s = s.lower()
print(s)


def word():
	s = input()
	lcount = 0
	for i in range(len(s)):
		if s[i].islower():
			lcount = lcount + 1
	if lcount >= len(s) / 2:
		ans = s.lower()
		print(ans)
	else:
		ans = s.upper()
		print(ans)
word()


import string
input_string = input()
uppercase_counts = 0
lowercase_counts = 0
for alpha in input_string:
	if str.islower(alpha):
		lowercase_counts += 1
	else:
		uppercase_counts += 1
if lowercase_counts >= uppercase_counts:
	print(input_string.lower())
else:
	print(input_string.upper())


s = input()
lentgh = len(s)
no_upper = 0
no_lower = 0
for i in s:
	if i.isupper():
		no_upper += 1
	else:
		no_lower += 1
if no_lower >= no_upper:
	print(s.lower())
else:
	print(s.upper())


val = list(input())
cap = 0
small = 0
for i in range(len(val)):
	if ord(val[i]) < 91:
		cap = cap + 1
	else:
		small = small + 1
if cap > small:
	for i in range(len(val)):
		if ord(val[i]) > 91:
			val[i] = chr(ord(val[i]) - 32)
else:
	for i in range(len(val)):
		if ord(val[i]) < 91:
			val[i] = chr(ord(val[i]) + 32)
print(''.join((str(i) for i in val)))


x = str(input())
upper_cnt = 0
lower_cnt = 0
for i in range(len(x)):
	if x[i].isupper():
		upper_cnt += 1
	else:
		lower_cnt += 1
if upper_cnt > lower_cnt:
	print(x.upper())
else:
	print(x.lower())


s = input()
nb = 0
ns = 0
for i in s:
	if i.isupper():
		nb += 1
	else:
		ns += 1
if nb > ns:
	print(s.upper())
else:
	print(s.lower())


t = input()
lcnt = 0
ucnt = 0
for c in t:
	if c.islower():
		lcnt += 1
	else:
		ucnt += 1
if ucnt > lcnt:
	print(t.upper())
else:
	print(t.lower())


n = input()
c = ['Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'L', 'K', 'J', 'H', 'G', 'F', 'D', 'S', 'A', 'Z', 'X', 'C', 'V', 'B', 'N', 'M']
k = []
j = []
for i in range(len(n)):
	if n[i] in c:
		k.append(n[i])
	else:
		j.append(n[i])
if len(k) > len(j):
	print(n.upper())
else:
	print(n.lower())


n = input()
a = ''
b = ''
for i in n:
	if i.islower():
		a += i
	else:
		b += i
if len(a) > len(b):
	print(n.lower())
elif len(a) < len(b):
	print(n.upper())
else:
	print(n.lower())


k = input()
s = []
for i in str(k):
	s.append(i)
lstx = []
lsty = []
for i in range(len(s)):
	t = str(s[i]).upper()
	if s[i] == t:
		lstx.append('U')
	else:
		lsty.append('l')
if len(lstx) > len(lsty):
	print(k.upper())
else:
	print(k.lower())


word = input()
countUpper = 0
countLower = 0
for i in word:
	if i.isupper() == True:
		countUpper += 1
	else:
		countLower += 1
print(word.lower()) if countLower >= countUpper else print(word.upper())


word = input()
count = 0
for i in range(len(word)):
	if word[i].isupper():
		count = count + 1
ans = len(word) // 2
if count > ans:
	print(word.upper())
elif ans == count:
	print(word.lower())
else:
	print(word.lower())


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
sys.setrecursionlimit(int(pow(10, 6)))
mod = int(pow(10, 9) + 7)
mod2 = 998244353

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

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
t = 1
for _ in range(t):
	s = input()
	U = 0
	L = 0
	for i in range(len(s)):
		if ord(s[i]) - ord('A') in range(26):
			U += 1
		else:
			L += 1
	if U > L:
		print(s.upper())
	else:
		print(s.lower())


n = input()
index1 = 0
count1 = 0
while index1 < len(n):
	letter = n[index1]
	if letter.upper() == letter:
		count1 = count1 + 1
	index1 = index1 + 1
index2 = 0
count2 = 0
while index2 < len(n):
	letter = n[index2]
	if letter.lower() == letter:
		count2 = count2 + 1
	index2 = index2 + 1
if count1 > count2:
	print(n.upper())
else:
	print(n.lower())


s = input()
abc = 'QAZXSWEDCVFRTGBNHYUJMKIOLP'
b = 0
m = 0
for i in s:
	if i in abc:
		b += 1
	else:
		m += 1
if m >= b:
	for i in range(len(s)):
		if s[i] in abc:
			s = s[:i] + chr(ord(s[i]) + 32) + s[i + 1:]
else:
	for i in range(len(s)):
		if s[i] not in abc:
			s = s[:i] + chr(ord(s[i]) - 32) + s[i + 1:]
print(s)


n = input()
x = 0
y = 0
for i in n:
	if i.isupper():
		x += 1
	if i.islower():
		y += 1
if x > y:
	print(n.upper())
elif x < y:
	print(n.lower())
else:
	print(n.lower())


joop = list(input())
poop = 0
for i in joop:
	if ord(i) > 90:
		poop += 1
hoop = ''.join(joop)
if 2 * poop >= len(joop):
	print(hoop.lower())
else:
	print(hoop.upper())


st = input()
c = 0
C = 0
for i in st:
	if 'A' <= i <= 'Z':
		C += 1
	else:
		c += 1
if C > c:
	print(st.upper())
else:
	print(st.lower())


def main():
	s = input()
	(a, b) = (0, 0)
	for c in s:
		if c.isupper():
			a += 1
		else:
			b += 1
	if b >= a:
		s = s.lower()
	else:
		s = s.upper()
	print(s)
main()


low = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
word = str(input(''))
l = list(word)
length = len(word)
lowlet = 0
for character in l:
	if character in low:
		lowlet = lowlet + 1
if lowlet >= length / 2:
	for i in range(0, length):
		if l[i] not in low:
			l[i] = l[i].lower()
else:
	for i in range(0, length):
		if l[i] in low:
			l[i] = l[i].upper()
print(''.join(l))


m = input()
low = 0
up = 0
for x in m:
	if x.islower():
		low += 1
	else:
		up += 1
if low >= up:
	print(m.lower())
else:
	print(m.upper())


s = str(input())
a = N = n = 0
c = len(s)
while a < c:
	if ord(s[a]) > 64 and ord(s[a]) < 91:
		N = N + 1
	if ord(s[a]) > 96 and ord(s[a]) < 123:
		n = n + 1
	a = a + 1
if N > n:
	print(s.upper())
else:
	print(s.lower())


import os
Get_In = str(input())
Count_Upper = [char for char in Get_In if char.isupper()]
Count_Small = [char for char in Get_In if char.islower()]
if len(Count_Upper) > len(Count_Small):
	print(Get_In.upper())
elif len(Count_Small) > len(Count_Upper):
	print(Get_In.lower())
else:
	print(Get_In.lower())


def change(text):
	upper = 0
	lower = 0
	for i in text:
		if i == i.upper():
			upper += 1
		else:
			lower += 1
	return text.upper() if upper > lower else text.lower()
s = input()
print(change(s))


big = 0
small = 0
a = input()
for i in a:
	if i.isupper():
		big += 1
	else:
		small += 1
if big > small:
	print(a.upper())
else:
	print(a.lower())


a = list(str(input()))
fin = ''.join(a)
U = 0
l = 0
for i in a:
	if i.isupper():
		U += 1
	else:
		l += 1
print(fin.upper() if U > l else fin.lower())


lowercase = 'qwertyuiopasdfghjklzxcvbnm'
word = input()
wordlen = len(word)
numlow = numup = 0
for i in range(0, wordlen):
	if word[i] in lowercase:
		numlow += 1
	else:
		numup += 1
	if numlow > wordlen / 2:
		print(word.lower())
		break
	elif numup > wordlen / 2:
		print(word.upper())
		break
if numlow == numup and numlow == wordlen / 2:
	print(word.lower())


word = input()
count_upper = 0
for letter in word:
	count_upper += letter.isupper()
if count_upper > len(word) - count_upper:
	print(word.upper())
else:
	print(word.lower())


def main():
	s = input()
	mayus = 0
	minus = 0
	for i in range(len(s)):
		if s[i] < s[i].lower():
			mayus += 1
		else:
			minus += 1
	if mayus > minus:
		print('{}'.format(s.upper()))
	else:
		print('{}'.format(s.lower()))
main()


def islo(d):
	if ord(d) <= ord('Z'):
		return False
	return True

def upper(a):
	return chr(ord(a) + ord('Z') - ord('z'))

def lower(a):
	return chr(ord(a) - ord('Z') + ord('z'))
s = input()
n = len(s)
tup = 0
s = list(s)
for i in range(n):
	if not islo(s[i]):
		tup += 1
if tup < (n + 1) / 2:
	for i in range(n):
		if not islo(s[i]):
			s[i] = lower(s[i])
else:
	for i in range(n):
		if islo(s[i]):
			s[i] = upper(s[i])
print(''.join(s))


a = input()
b = list(a)
upCount = 0
lowCount = 0
for i in b:
	if ord(i) < 97:
		upCount += 1
	else:
		lowCount += 1
if lowCount > upCount or lowCount == upCount:
	a = a.lower()
	print(a)
else:
	a = a.upper()
	print(a)


s = input()
s2 = 0
s1 = 0
for i in range(len(s)):
	if s[i] <= 'Z':
		s2 += 1
	else:
		s2 -= 1
if s2 > 0:
	print(s.upper())
else:
	print(s.lower())


S = list((char for char in input()))
N = len(S)
c = 0
for i in S:
	if 65 <= ord(i) <= 90:
		c += 1
F = []
if c > N / 2:
	for i in S:
		if 65 <= ord(i) <= 90:
			F.append(i)
		else:
			F.append(chr(ord(i) - 32))
else:
	for i in S:
		if 97 <= ord(i) <= 122:
			F.append(i)
		else:
			F.append(chr(ord(i) + 32))
P = ''
P = P.join(F)
print(P)


word = input()
cond_upper = sum(map(str.isupper, word)) > len(word) / 2
if cond_upper:
	print(word.upper())
else:
	print(word.lower())


def n_lower_chars(string):
	return sum(map(str.islower, string))
i = input()
a = i.upper()
b = i.lower()
if i == a:
	print(a)
elif i == b:
	print(b)
elif n_lower_chars(i) >= len(i) / 2:
	print(b)
else:
	print(a)


import string
s = input()
t = 0
z = 0
for i in s:
	if i in string.ascii_lowercase:
		t += 1
	elif i in string.ascii_uppercase:
		z += 1
if t >= z:
	print(s.lower())
else:
	print(s.upper())


a = input()
up = 0
lo = 0
for x in a:
	if x.isupper() == True:
		up = up + 1
	else:
		lo = lo + 1
if up == lo or lo > up:
	print(a.lower())
else:
	print(a.upper())


s = input()
cp = 0
sm = 0
for i in range(len(s)):
	if s[i].isupper():
		cp += 1
	else:
		sm += 1
if sm >= cp:
	s = s.lower()
else:
	s = s.upper()
print(s)


import sys
inputs = sys.stdin.readline().strip()
n = inputs.upper()
a = [x for x in inputs]
l = len(a)
b = [y for y in n]
c = 0
for i in range(len(a)):
	if a[i] == b[i]:
		c = c + 1
s = l - c
if c > s:
	print(inputs.upper())
else:
	print(inputs.lower())


i = input()
print([i.lower(), i.upper()][sum(map(str.isupper, i)) > len(i) / 2])


x = input()
c = 0
l = 0
for i in x:
	if i.islower():
		l += 1
	elif i.isupper():
		c += 1
if l == c or l > c:
	print(x.lower())
else:
	print(x.upper())


n = input()
up_c = 0
low_c = 0
for i in n:
	if i.islower():
		low_c += 1
	else:
		up_c += 1
if up_c <= low_c:
	print(n.lower())
else:
	print(n.upper())


s = input()
lower = 0
upper = 0
for letters in s:
	if letters.islower():
		lower += 1
	else:
		upper += 1
print(s.upper()) if upper > lower else print(s.lower())


n = input()
up = n.upper()
i = 0
for letter in n:
	if letter in up:
		i = i + 1
if i < len(n) / 2:
	print(n.lower())
elif i == len(n) / 2:
	print(n.lower())
else:
	print(up)


def word(s):
	(u, l) = (0, 0)
	for i in s:
		if ord(i) >= 97:
			u += 1
		else:
			l += 1
	if u > l:
		return s.lower()
	elif l > u:
		return s.upper()
	else:
		return s.lower()
s = input()
print(word(s))


s = input()
no_of_low_string = 0
no_of_upp_string = 0
for l in s:
	if l.islower():
		no_of_low_string += 1
	else:
		no_of_upp_string += 1
if no_of_low_string >= no_of_upp_string:
	print(s.lower())
else:
	print(s.upper())


def fixcase(word):
	uppercase = 0
	lowercase = 0
	for char in word:
		if char >= 'a' and char <= 'z':
			lowercase += 1
		else:
			uppercase += 1
	if lowercase < uppercase:
		return word.upper()
	return word.lower()

def main():
	word = input()
	print(fixcase(word))
main()


s = input()
print([s.upper(), s.lower()][sum(map(str.islower, s)) >= len(s) / 2])


s = input()

def count_up(s):
	count = 0
	for i in s:
		if i.isupper():
			count += 1
		else:
			continue
	return count

def count_low(s):
	count = 0
	for i in s:
		if i.islower():
			count += 1
		else:
			continue
	return count
if count_up(s) > count_low(s):
	s = s.upper()
else:
	s = s.lower()
print(s)


def word():
	string = input()
	count = 0
	for elem in string:
		if elem.isupper():
			count += 1
	print(string.upper() if count > len(string) / 2 else string.lower())
	return
word()


st = input()
no_upper = 0
no_lower = 0
for i in st:
	if str.isupper(i):
		no_upper += 1
	else:
		no_lower += 1
if no_upper > no_lower:
	st = str.upper(st)
else:
	st = str.lower(st)
print(st)


def f(w):
	capital_word = w
	capital_word = capital_word.upper()
	c = 0
	l = 0
	for i in range(len(w)):
		if w[i] == capital_word[i]:
			c += 1
		else:
			l += 1
	if c > l:
		return 1
	else:
		return 0
word = input()
if f(word) == 1:
	print(word.upper())
else:
	print(word.lower())


n = input()
small = 0
for letter in n:
	if letter > 'Z':
		small += 1
if len(n) - 2 * small <= 0:
	print(n.lower())
else:
	print(n.upper())


word = input()
lower_counter = 0
upper_counter = 0
for i in word:
	if 'a' <= i <= 'z':
		lower_counter += 1
	elif 'A' <= i <= 'Z':
		upper_counter += 1
if upper_counter > lower_counter:
	print(word.upper())
else:
	print(word.lower())


x = input()
sm = []
for i in range(len(x)):
	sm.append(x[i])
c = 0
m = 0
for i in range(len(x)):
	if sm[i].islower():
		c += 1
	elif sm[i].isupper():
		m += 1
if c >= m:
	for l in range(len(x)):
		if sm[l].isupper():
			sm[l] = sm[l].lower()
elif m > c:
	for z in range(len(x)):
		if sm[z].islower():
			sm[z] = sm[z].upper()
print(*sm, sep='')


s = str(input())
l = sum((1 for x in s if x.islower()))
u = sum((1 for x in s if x.isupper()))
if u > l:
	print(s.upper())
elif l > u or l == u:
	print(s.lower())


red = 'q w e r t y u i o p a s d f g h j k l z x c v b n m'
blu = red.split()
contmi = 0
st = str(input())
lon = len(st)
for r in st:
	if r in blu:
		contmi = contmi + 1
contma = lon - contmi
if contma > contmi:
	rr = st.upper()
if contma < contmi or contma == contmi:
	rr = st.lower()
print(rr)


def main():
	word = input()
	num_lower = 0
	num_upper = 0
	for char in list(word):
		if char >= 'a':
			num_lower = num_lower + 1
		else:
			num_upper = num_upper + 1
	if num_lower >= num_upper:
		print(word.lower())
	else:
		print(word.upper())
main()


def up(str):
	cnt = 0
	for c in str:
		if c.isupper():
			cnt += 1
	return cnt
i = input
s = i()
if up(s) > len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


word = input()
list(word)
word_len = len(word)
lower = 0
upper = 0
for i in range(word_len):
	str(word[i])
	if word[i].islower() == True:
		lower = lower + 1
	if word[i].islower() == False:
		upper = upper + 1
str(word)
if lower > upper or lower == upper:
	print(word.lower())
elif upper > lower:
	print(word.upper())


word = input()
n = len(word)
count = 0
for i in range(0, n):
	if word[i] >= 'A' and word[i] <= 'Z':
		count += 1
if n % 2 == 0 and count > n // 2 or (n % 2 == 1 and count >= n // 2 + 1):
	print(word.upper())
else:
	print(word.lower())


s = input()
low = sum((1 for c in s if c > 'Z'))
up = sum((1 for c in s if c < 'a'))
if up > low:
	print(s.upper())
else:
	print(s.lower())


inputWord = str(input())
inputList = list(inputWord)
countLower = 0
for i in range(len(inputList)):
	if inputList[i].islower():
		countLower += 1
if countLower >= (i + 1) / 2:
	print(inputWord.lower())
else:
	print(inputWord.upper())


s = input()
S = s.upper()
tl = len(s)
cnt = 0
for i in range(tl):
	if s[i] == S[i]:
		cnt += 1
if cnt > tl // 2:
	print(S)
else:
	print(s.lower())


string = input()
uc = 0
lc = 0
for i in string:
	if i.isupper():
		uc += 1
	elif i.islower():
		lc += 1
if lc > uc:
	print(string.lower())
elif uc > lc:
	print(string.upper())
elif uc == lc:
	print(string.lower())


a = input()
b = list(a)
i = 0
j = 0
for letter in b:
	if letter.isupper():
		i = i + 1
	else:
		j = j + 1
if i > j:
	print(a.upper())
else:
	print(a.lower())


word = input()
upper = lower = 0
U = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
L = 'abcdefghijklmnopqrstuvwxyz'
for char in word:
	if char in U:
		upper += 1
	if char in L:
		lower += 1
print(word.lower() if lower >= upper else word.upper())


s = str(input())
k = 0
m = 0
for i in range(len(s)):
	if 'a' <= s[i] <= 'z':
		k += 1
	if 'A' <= s[i] <= 'Z':
		m += 1
if k >= m:
	s = s.lower()
else:
	s = s.upper()
print(s)


word = input()
upcount = sum(map(str.isupper, word))
lowcount = sum(map(str.islower, word))
if upcount > lowcount:
	print(word.upper())
else:
	print(word.lower())


import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

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

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

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
s = input()
u = 0
l = 0
for i in s:
	if ord(i) >= ord('a'):
		l += 1
	else:
		u += 1
res = ''
if u > l:
	res = s.upper()
else:
	res = s.lower()
print(res)


s = input()
upCount = len([1 for i in s if i.isupper()])
loCount = len([1 for i in s if i.islower()])
if loCount >= upCount:
	print(s.lower())
else:
	print(s.upper())


word = input()
letters = [chr(i) for i in range(65, 91)]
upper = [w for w in word if w in letters]
if len(upper) > len(word) - len(upper):
	print(word.upper())
else:
	print(word.lower())


word = input()
upper_s = 0
lower_s = 0
for i in word:
	if i.isupper():
		upper_s += 1
	else:
		lower_s += 1
if upper_s > lower_s:
	print(word.upper())
elif upper_s <= lower_s:
	print(word.lower())


str = input()
(up, l) = (0, 0)
for i in str:
	if i.isupper():
		up += 1
	else:
		l += 1
if up > l:
	str = str.upper()
else:
	str = str.lower()
print(str)


s = input()
vals = [char.islower() for char in s]
if vals.count(True) >= vals.count(False):
	print(s.lower())
else:
	print(s.upper())


s = input()
l = len(s)
lowercase_count = 0
uppercase_count = 0
for item in s:
	if item.islower():
		lowercase_count += 1
	else:
		uppercase_count += 1
if lowercase_count >= uppercase_count:
	s_new = s.lower()
else:
	s_new = s.upper()
print(s_new)


s = str(input())
m = 0
for i in s:
	if ord(i) < 97:
		m += 1
if m > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


s = str(input())
w = list(s)
l = len(w)
lc = 0
uc = 0
for i in range(0, l):
	if ord(w[i]) >= 65 and ord(w[i]) <= 90:
		uc += 1
	elif ord(w[i]) >= 97 and ord(w[i]) <= 122:
		lc += 1
if uc > lc:
	print(s.upper())
else:
	print(s.lower())


word = input().strip()
321
upper = 0
lower = 0
for i in range(len(word)):
	if word[i].islower():
		lower += 1
	else:
		upper += 1
if upper > lower:
	print(word.upper())
elif upper < lower:
	print(word.lower())
else:
	print(word.lower())


a = input()
uppcount = 0
lowcount = 0
for i in a:
	if i.isupper() == True:
		uppcount += 1
	else:
		lowcount += 1
if lowcount == uppcount:
	print(a.lower())
elif lowcount < uppcount:
	print(a.upper())
else:
	print(a.lower())


s = input()
up_case = 0
for letter in s:
	if letter.isupper():
		up_case += 1
if up_case > len(s) // 2:
	print(s.upper())
else:
	print(s.lower())


s = input()
uppercase_counter = 0
lowercase_counter = 0
for char in s:
	if char.isupper():
		uppercase_counter += 1
	else:
		lowercase_counter += 1
if uppercase_counter > lowercase_counter:
	print(s.upper())
else:
	print(s.lower())


c = str(input())
a = b = 0
for x in range(len(c)):
	if c[x] <= 'z' and c[x] >= 'a':
		a += 1
	else:
		b += 1
if a >= b:
	print(c.lower())
else:
	print(c.upper())


s = input()
u = 0
for l in s:
	if l.isupper() == True:
		u += 1
if u > len(s) - u:
	print(s.upper())
else:
	print(s.lower())


a = input()
r = [i for i in a if i.isupper()]
p = [j for j in a if j.islower()]
b = len(r)
g = len(p)
if b == g:
	print(a.lower())
elif b > g:
	print(a.upper())
elif b < g:
	print(a.lower())


def main(s):
	capital = 0
	for i in s:
		if i == i.upper():
			capital += 1
	lowers = len(s) - capital
	if lowers >= capital:
		return s.lower()
	return s.upper()
s = input()
print(main(s))


s = input()
l = 0
h = 0
for i in range(0, len(s)):
	if s[i].islower():
		l += 1
	else:
		h += 1
ans = ''
if l >= h:
	for j in s:
		ans += j.lower()
else:
	for j in s:
		ans += j.upper()
print(ans)


x = input()
smallerco = 0
upperco = 0
for i in range(len(x)):
	if x[i].islower():
		smallerco += 1
	if x[i].isupper():
		upperco += 1
if smallerco == upperco:
	x = x.lower()
	print(x)
elif smallerco > upperco:
	x = x.lower()
	print(x)
else:
	x = x.upper()
	print(x)


def fixCase(text):
	words = list(text)
	(upper, lower) = (0, 0)
	for letter in words:
		if letter.islower():
			lower += 1
		elif letter.isupper():
			upper += 1
	if lower > upper:
		return text.lower()
	elif upper > lower:
		return text.upper()
	elif lower == upper:
		return text.lower()
print(fixCase(input()))


import re
s = str(input())
c = 0
c1 = 0
for i in s:
	if re.search('[A-Z]', i):
		c += 1
	if re.search('[a-z]', i):
		c1 += 1
if c > c1:
	s = s.upper()
else:
	s = s.lower()
print(s)


s = input()
cu = 0
cl = 0
for i in s:
	if ord(i) > 96:
		cl += 1
	elif ord(i) > 64:
		cu += 1
if cl >= cu:
	print(s.lower())
else:
	print(s.upper())


lcase = 0
ucase = 0
str1 = input()
for s in str1:
	if s >= 'a' and s <= 'z':
		lcase += 1
	else:
		ucase += 1
if lcase >= ucase:
	print(str1.lower())
else:
	print(str1.upper())


s = input('')
capCount = 0
lowCount = 0
for l in s:
	if l.islower():
		lowCount += 1
	elif l.isupper():
		capCount += 1
if capCount == lowCount:
	s = s.lower()
elif capCount > lowCount:
	s = s.upper()
elif capCount < lowCount:
	s = s.lower()
print(s)


n = input()
s = list(n.upper())
p = list(n.lower())
c = 0
t = 0
x = 0
for i in range(len(n)):
	c += ord(s[i])
	t += ord(p[i])
	x += ord(n[i])
if abs(x - t) > abs(x - c):
	print(''.join(map(str, s)))
else:
	print(''.join(map(str, p)))


a = input()
y = 0
z = 0
for x in a:
	if x.islower():
		y += 1
	else:
		z += 1
if y >= z:
	a = a.lower()
else:
	a = a.upper()
print(a)


import sys
import math
import bisect

def main():
	s = input()
	l = 0
	u = 0
	for c in s:
		if c.islower():
			l += 1
		elif c.isupper():
			u += 1
	if l >= u:
		print(s.lower())
	else:
		print(s.upper())
main()


n = str(input())
count = 0
count1 = 0
for i in n:
	if i.isupper():
		count += 1
	else:
		count1 += 1
if count1 < count:
	print(n.upper())
else:
	print(n.lower())


n = input()
lo = 0
up = 0
for i in n:
	if ord(i) >= 97:
		lo += 1
	else:
		up += 1
if lo < up:
	print(n.upper())
else:
	print(n.lower())


s = input()
res = ''
ress = ''
for i in s:
	if i.isupper():
		res += i
	else:
		ress += i
if len(res) > len(ress):
	print(s.upper())
else:
	print(s.lower())


word = input()
lol = ''
key = 0
if word == word.lower() or word == word.upper():
	print(word)
else:
	for i in word:
		if i == i.lower():
			key += 1
	for i in word:
		if i == i.upper():
			key -= 1
	if key >= 0:
		print(word.lower())
	else:
		print(word.upper())


s = input()
Ccount = 0
Lcount = 0
for i in s:
	if i.isupper():
		Ccount += 1
	else:
		Lcount += 1
if Ccount <= Lcount:
	print(s.lower())
else:
	print(s.upper())


s = input()
lowers = list(filter(lambda x: str(x).islower(), s))
if len(lowers) >= len(s) / 2:
	print(s.lower())
else:
	print(s.upper())


word = input()
uppers = list(filter(lambda c: c.isupper(), list(word)))
if len(uppers) > len(word) - len(uppers):
	print(word.upper())
else:
	print(word.lower())


s = input()
(l, u) = (0, 0)
for i in s:
	if 65 <= ord(i) <= 90:
		l += 1
	else:
		u += 1
ans = ''
if l > u:
	for i in s:
		if 65 <= ord(i) <= 90:
			ans += i
		else:
			ans += chr(ord(i) - 32)
else:
	for i in s:
		if 97 <= ord(i) <= 122:
			ans += i
		else:
			ans += chr(ord(i) + 32)
print(ans)


import sys
import math as mt
t = 1
for __ in range(t):
	s = input()
	(l, up) = (0, 0)
	for i in range(len(s)):
		if ord(s[i]) >= ord('a'):
			l += 1
		else:
			up += 1
	if l >= up:
		print(s.lower())
	else:
		print(s.upper())


str1 = input()
s1 = 0
s2 = 0
for i in str1:
	if i >= 'A' and i <= 'Z':
		s1 = s1 + 1
	elif i >= 'a' and i <= 'z':
		s2 = s2 + 1
if s1 > s2:
	print(str1.upper())
else:
	print(str1.lower())


w = input()
gr = 0
lo = 0
for c in w:
	if 'a' <= c <= 'z':
		lo += 1
	else:
		gr += 1
if gr > lo:
	print(w.upper())
else:
	print(w.lower())


s = input()
capital = 0
small = 0
for i in s:
	if ord(i) in range(65, 65 + 26):
		capital += 1
	if ord(i) in range(97, 97 + 26):
		small += 1
if capital > small:
	print(s.upper())
else:
	print(s.lower())


word = input()
count_upper = 0
count_lower = 0
for i in range(len(word)):
	if word[i].isupper():
		count_upper += 1
	else:
		count_lower += 1
if count_upper > count_lower:
	print(word.upper())
else:
	print(word.lower())


line = input()
counterU = 0
counterL = 0
for x in line:
	if ord(x) < 97:
		counterU += 1
	else:
		counterL += 1
if counterL >= counterU:
	print(line.lower())
else:
	print(line.upper())


s = input()
res = 0
ros = 0
for i in s:
	if 65 <= ord(i) <= 90:
		res += 1
	else:
		ros += 1
if res > ros:
	s = s.upper()
	print(s)
else:
	s = s.lower()
	print(s)


a = input()
u = len([i for i in a if i.isupper()])
l = len(a) - u
if l < u:
	print(a.upper())
else:
	print(a.lower())


s = input()
L = [x for x in s]
c = l = 0
for i in L:
	if i == i.lower():
		l += 1
	else:
		c += 1
print(s.lower() if l >= c else s.upper())


s = input()
sm = 'abcdefghijklmnopqrstuvwxyz'
la = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
sc = 0
lc = 0
for i in s:
	if i in sm:
		sc += 1
	elif i in la:
		lc += 1
if sc >= lc:
	print(s.lower())
elif lc > sc:
	print(s.upper())


s = str(input())
lnum = unum = 0
for x in s:
	if ord('a') <= ord(x) <= ord('z'):
		lnum += 1
	else:
		unum += 1
if lnum < unum:
	print(s.upper())
else:
	print(s.lower())


str1 = input()
ups = 0
lows = 0
for i in str1:
	if i.isupper():
		ups += 1
	else:
		lows += 1
if ups > lows:
	print(str1.upper())
else:
	print(str1.lower())


import re

def main():
	inp = input()
	match = re.findall('[a-z]', inp)
	print(inp.upper() if len(match) < len(inp) // 2 else inp.lower() if len(inp) % 2 == 0 else inp.upper() if len(match) < (len(inp) + 1) // 2 else inp.lower())
main()


import math
import string
line = str(input())
a = int(0)
b = int(0)
for i in line:
	if 'a' <= i <= 'z':
		a = a + 1
	if 'A' <= i <= 'Z':
		b = b + 1
if a >= b:
	l = line.lower()
else:
	l = line.upper()
print(l)


s1 = set(map(chr, range(65, 91)))
sum1 = 0
s2 = set(map(chr, range(97, 123)))
sum2 = 0
n = input()
list1 = list(n)
for i in list1:
	if i in s1:
		sum1 += 1
	elif i in s2:
		sum2 += 1
if sum1 > sum2:
	print(n.upper())
elif sum1 <= sum2:
	print(n.lower())


def main():
	inputStr = input()
	no = 0
	for it in range(len(inputStr)):
		if inputStr[it].islower():
			no = no + 1
	if no >= len(inputStr) - no:
		print(inputStr.lower())
	else:
		print(inputStr.upper())
main()


import math as mt
import sys as sy

class abc:

	def mkl(self):
		li = []
		word = input()
		u = [x for x in word if x.isupper()]
		l = [x for x in word if x.islower()]
		if len(u) < len(l):
			print(word.lower())
		elif len(l) < len(u):
			print(word.upper())
		elif len(u) == len(l):
			print(word.lower())
b = abc()
b.mkl()


string = input()
(upper, lower) = (0, 0)
for i in string:
	if 97 <= ord(i) <= 122:
		lower += 1
	elif 60 <= ord(i) <= 90:
		upper += 1
if upper <= lower:
	print(string.lower())
else:
	print(string.upper())


s = input()
(c_1, c_2) = (0, 0)
for i in s:
	if i.isupper():
		c_1 += 1
	else:
		c_2 += 1
if c_2 >= c_1:
	print(s.lower())
else:
	print(s.upper())


s = input()
upr = 0
lwr = 0
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		upr += 1
	else:
		lwr += 1
if upr > lwr:
	print(s.upper())
else:
	print(s.lower())


s = input()
n = 0
for i in range(len(s)):
	if ord(s[i]) < 91:
		n += 1
if n > len(s) // 2:
	for i in range(len(s)):
		if ord(s[i]) > 96:
			print(chr(ord(s[i]) - 32), end='')
		else:
			print(s[i], end='')
else:
	for i in range(len(s)):
		if ord(s[i]) < 91:
			print(chr(ord(s[i]) + 32), end='')
		else:
			print(s[i], end='')


word = input()
upper = []
lower = []
for w in word:
	if w.isupper():
		upper.append(w)
	elif w.islower():
		lower.append(w)
	else:
		pass
if len(upper) > len(lower):
	print(word.upper())
elif len(upper) == len(lower):
	print(word.lower())
else:
	print(word.lower())


k = list(input())
q = 0
for i in k:
	if i.capitalize() == i:
		q = q + 1
if q > len(k) // 2:
	for i in k:
		print(i.upper(), end='')
else:
	for i in k:
		print(i.lower(), end='')


n = input()
le = len(n)
lc = 0
uc = 0
for i in range(le):
	if n[i].islower():
		lc += 1
	else:
		uc += 1
if uc > lc:
	print(n.upper())
else:
	print(n.lower())


fStr = str(input())
low = 0
up = 0
for elem in fStr:
	if elem.islower():
		low += 1
	if elem.isupper():
		up += 1
if low >= up:
	print(fStr.lower())
else:
	print(fStr.upper())


s = input()
(u, l) = (0, 0)
for c in s:
	if ord('a') <= ord(c) <= ord('z'):
		l += 1
	else:
		u += 1
print(s.upper() if u > l else s.lower())


input_string = input()
input_string_list = list(input_string)
input_string_length = len(input_string_list)
lower_count = 0
for i in range(input_string_length):
	if ord(input_string_list[i]) > 96:
		lower_count += 1
lower_count = float(lower_count)
if lower_count >= input_string_length / 2:
	print(input_string.lower())
else:
	print(input_string.upper())


s = str(input())
lowcount = 0
for i in s:
	if i.islower():
		lowcount += 1
highcount = len(s) - lowcount
if highcount > lowcount:
	print(s.upper())
elif highcount < lowcount:
	print(s.lower())
else:
	print(s.lower())


s = input()
a = []
b = []
for x in s:
	if x == x.upper():
		a.append(x)
	else:
		b.append(x)
if len(a) <= len(b):
	print(s.lower())
else:
	print(s.upper())


inp = input().strip()
(u, l) = (0, 0)
for x in inp:
	if x.isupper():
		u += 1
	else:
		l += 1
print(inp.upper() if u > l else inp.lower())


word = input()
up = 0
down = 0
for letter in word:
	if 'A' <= letter <= 'Z':
		up += 1
	else:
		down += 1
if up > down:
	word = word.upper()
else:
	word = word.lower()
print(word)


st = input()
lw = []
uw = []
for i in st:
	if i >= 'a' and i <= 'z':
		lw.append(i)
	else:
		uw.append(i)
if len(lw) > len(uw) or len(lw) == len(uw):
	print(st.lower())
else:
	print(st.upper())


s = input()
l = len([c for c in s if c.islower()])
r = len([c for c in s if c.isupper()])
if l >= r:
	print(s.lower())
else:
	print(s.upper())


s = input()
lw = len([c for c in s if c.islower()])
up = len([c for c in s if c.isupper()])
if lw >= up:
	print(s.lower())
else:
	print(s.upper())


s = input()
u = 0
d = 0
for a in s:
	if a.isupper():
		u = u + 1
	else:
		d = d + 1
if u > d:
	s = s.upper()
elif d >= u:
	s = s.lower()
print(s)


s = input()
length = len(s)
l = list(s)
uppercase = 0
lowercase = 0
for i in range(length):
	if l[i].islower():
		lowercase += 1
	else:
		uppercase += 1
if uppercase > lowercase:
	print(s.upper())
else:
	print(s.lower())


s = input()
uc = 0
lc = 0
for i in s:
	if i.isupper() is True:
		uc += 1
	else:
		lc += 1
if uc > lc:
	print(s.upper())
elif uc < lc:
	print(s.lower())
else:
	print(s.lower())


s = input()
upcase = lowcase = 0
for i in range(len(s)):
	if 65 <= ord(s[i]) <= 90:
		upcase += 1
	else:
		lowcase += 1
if lowcase >= upcase:
	print(s.lower())
else:
	print(s.upper())


n = input()
lowerLetters = 0
upperLetters = 0
for i in range(len(n)):
	if n[i].islower():
		lowerLetters += 1
	else:
		upperLetters += 1
if upperLetters > lowerLetters:
	print(n.upper())
else:
	print(n.lower())


s = str(input())
n = len(s)
countUp = 0
countLow = 0
for i in range(n):
	if 'A' <= s[i] <= 'Z':
		countUp += 1
	else:
		countLow += 1
if countUp > countLow:
	print(s.upper())
else:
	print(s.lower())


s = input()
if s.lower() != s and s.upper() != s:
	print(s.lower() if len([x for x in s if x in 'QWERTYUIOPASDFGHJKLZXCVBNM']) <= len(s) // 2 else s.upper())
else:
	print(s)


s = input()
up = 0
down = 0
for x in range(len(s)):
	if s[x].isupper() == True:
		up += 1
	else:
		down += 1
if up > down:
	print(s.upper())
else:
	print(s.casefold())


g = input()
b = 0
for j in g:
	if j.isupper():
		b += 1
if b > len(g) // 2:
	g = g.upper()
else:
	g = g.lower()
print(g)


s = input()
lcnt = 0
ucnt = 0
for i in range(len(s)):
	if s[i].islower():
		lcnt += 1
	else:
		ucnt += 1
if lcnt >= ucnt:
	print(s.lower())
else:
	print(s.upper())


n = input()
countu = 0
countl = 0
for i in n:
	if ord(i) <= 90:
		countu += 1
	else:
		countl += 1
if countu > countl:
	print(n.upper())
else:
	print(n.lower())


s = input()
count1 = sum((1 for c in s if c.isupper()))
count2 = sum((1 for c in s if c.islower()))
if count1 > count2:
	print(s.upper())
else:
	print(s.lower())


word = input()
length = len(word)
upper = sum((1 for a in word if a.isupper()))
lower = length - upper
if upper > lower:
	print(word.upper())
else:
	print(word.lower())


x = input()
s = list(x)
upper = 0
lower = 0
for i in range(len(s)):
	if s[i].isupper():
		upper += 1
	else:
		lower += 1
if upper > lower:
	print(x.upper())
else:
	print(x.lower())


s = input()
l_c = 0
u_c = 0
for i in s:
	if i.isupper():
		u_c += 1
	else:
		l_c += 1
if l_c >= u_c:
	print(s.lower())
else:
	print(s.upper())


s = input()
k = s.upper()
l = sorted(k)
alpha = 0
alpha1 = 0
for i in range(len(s)):
	if s[i] in l:
		alpha += 1
	else:
		alpha1 = 0
if len(s) - alpha >= alpha:
	print(s.lower())
else:
	print(s.upper())


a = input()
N = 0
C = 0
for i in range(len(a)):
	if a[i] == a[i].lower():
		N += 1
	elif a[i] == a[i].upper():
		C += 1
if N >= C:
	print(a.lower())
else:
	print(a.upper())


s = input()
da = 0
no = 0
for c in s:
	if c.islower():
		no = no + 1
	if c.isupper():
		da = da + 1
if da > no:
	print(s.upper())
elif no > da:
	print(s.lower())
else:
	print(s.lower())


x = input()
u = 0
l = 0
lower = [chr(x) for x in range(ord('a'), ord('z') + 1)]
upper = [chr(x) for x in range(ord('A'), ord('Z') + 1)]
for i in range(len(x)):
	if x[i] in lower:
		l += 1
	else:
		u += 1
if l >= u:
	print(x.lower())
else:
	print(x.upper())


s = input()
cap = 0
sma = 0
for i in s:
	s1 = i.upper()
	if s1 == i:
		cap += 1
	else:
		sma += 1
if cap <= sma:
	print(s.lower())
else:
	print(s.upper())


def same(x, y):
	k = 0
	for i in range(min(len(x), len(y))):
		if x[i] == y[i]:
			k += 1
	return k
n = input()
if same(n, n.lower()) >= same(n, n.upper()):
	print(n.lower())
else:
	print(n.upper())


a = input()
u = 0
d = 0
for i in range(len(a)):
	if a[i].isupper():
		u += 1
	else:
		d += 1
if u > d:
	print(a.upper())
else:
	print(a.lower())


word = input()
up = 0
lo = 0
for each in word:
	if each.isupper():
		up += 1
	else:
		lo += 1
if up > lo:
	word = word.upper()
else:
	word = word.lower()
print(word)


n = input()
(u, d) = (0, 0)
for i in range(0, len(n)):
	if n[i].islower() == True:
		d += 1
	else:
		u += 1
if u > d:
	n = n.upper()
else:
	n = n.lower()
print(n)


s = input()
count1 = 0
count2 = 0
for i in range(len(s)):
	if s[i] in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		count1 = count1 + 1
	else:
		count2 = count2 + 1
if count1 <= count2:
	print(s.lower())
else:
	print(s.upper())


w = input()
length = len(w)
lowers = len([c for c in w if c in 'abcdefghijklmnopqrstuvwxyz'])
if length > 2 * lowers:
	print(w.upper())
else:
	print(w.lower())


s = input()
upper_letters = 0
lower_letters = 0
for i in s:
	if i.isupper():
		upper_letters += 1
	else:
		lower_letters += 1
if upper_letters > lower_letters:
	s = s.upper()
else:
	s = s.lower()
print(s)


st = input()
lc = 0
l = []
u = []
uc = 0
for x in st:
	if x.isupper():
		uc += 1
	else:
		lc += 1
	l.append(x.lower())
	u.append(x.upper())
if uc > lc:
	print(''.join(u))
else:
	print(''.join(l))


s = input()
upp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
countu = 0
countl = 0
for i in s:
	if i in upp:
		countu = countu + 1
	else:
		countl = countl + 1
if countu > countl:
	print(s.upper())
else:
	print(s.lower())


def main():
	s = input()
	(lower, upper) = (0, 0)
	for i in s:
		if i.isupper():
			upper += 1
		else:
			lower += 1
	fl = True if lower >= upper else False
	tmp = []
	for i in s:
		if fl == True:
			tmp.append(i.lower())
		else:
			tmp.append(i.upper())
	ans = ''.join(tmp)
	print(ans)
main()


n = input()
s1 = 0
s2 = 0
for i in n:
	if i == i.lower():
		s1 += 1
	else:
		s2 += 1
if s1 == s2:
	print(n.lower())
elif s1 > s2:
	print(n.lower())
else:
	print(n.upper())


s = input()
h_reg = 0
l_reg = 0
for i in range(int(len(s))):
	an_s = int(ord(s[i]))
	if an_s >= 65 and an_s <= 90:
		h_reg += 1
	elif an_s >= 97 and an_s <= 122:
		l_reg += 1
if l_reg >= h_reg:
	for i in range(int(len(s))):
		if int(ord(s[i])) >= 65 and int(ord(s[i])) <= 90:
			q = chr(int(ord(s[i])) + 32)
			s = s.replace(s[i], q)
elif l_reg < h_reg:
	for i in range(int(len(s))):
		if int(ord(s[i])) >= 97 and int(ord(s[i])) <= 122:
			q = chr(int(ord(s[i])) - 32)
			s = s.replace(s[i], q)
print(s)


t = input()
cnt = 0
cnt1 = 0
for i in t:
	if ord(i) < 96:
		cnt += 1
	else:
		cnt1 += 1
if cnt1 >= cnt:
	print(t.lower())
else:
	print(t.upper())


n = input()
(u, l) = (0, 0)
for i in n:
	if ord(i) >= 95 and ord(i) <= 122:
		l = l + 1
	else:
		u = u + 1
if l >= u:
	print(n.lower())
else:
	print(n.upper())


from string import ascii_uppercase as upper
count = 0
a = input()
for letter in a:
	if letter in upper:
		count += 1
if count > len(a) // 2:
	print(a.upper())
else:
	print(a.lower())


def split(word):
	return [char for char in word]
word = str(input())
chars = split(word)
lowerNumber = 0
upperNumber = 0
for char in chars:
	if char.isupper():
		upperNumber += 1
	else:
		lowerNumber += 1
if upperNumber > lowerNumber:
	print(word.upper())
else:
	print(word.lower())


string = input()
line = []
n = 0
K = 0
J = 0
for m in string:
	line += m
for _ in range(len(line)):
	if line[n].isupper():
		K += 1
	else:
		J += 1
	n += 1
if K > J:
	print(string.upper())
else:
	print(string.lower())


u_ctr = 0
l_ctr = 0
s = input()
for i in s:
	if i.isupper():
		u_ctr += 1
	else:
		l_ctr += 1
if l_ctr >= u_ctr:
	print(s.lower())
else:
	print(s.upper())


a = input().strip()
b = list(a)
k = 0
for c in b:
	if c.isupper():
		k += 1
	else:
		k -= 1
if k > 0:
	print(a.upper())
else:
	print(a.lower())


import string
a = input()
(c, b) = (0, 0)
for i in range(len(a)):
	if a[i] in string.ascii_lowercase:
		b += 1
	else:
		c += 1
if b == c:
	print(a.lower())
elif c < b:
	print(a.lower())
else:
	print(a.upper())


def represent_word():
	cap_count = 0
	small_count = 0
	for c in s:
		if c.isupper():
			cap_count += 1
		else:
			small_count += 1
	return s.upper() if cap_count > small_count else s.lower()
s = input()
print(represent_word())


import sys
input = sys.stdin.readline

def insr():
	return input()

def solve(s):
	upper = 0
	lower = 0
	for c in s:
		if 'a' <= c <= 'z':
			lower += 1
		else:
			upper += 1
	return s.upper() if upper > lower else s.lower()
s = insr()
print(solve(s[:-1]))


s = input()
sm = 0
l = 0
for i in s:
	if i == i.lower():
		sm += 1
	else:
		l += 1
if sm >= l:
	s = s.lower()
else:
	s = s.upper()
print(s)


s = [x for x in input()]
(ucount, lcount) = (0, 0)
for char in s:
	if char.isupper():
		ucount += 1
	else:
		lcount += 1
print(''.join(s).lower()) if lcount >= ucount else print(''.join(s).upper())


import sys, bisect, copyreg, copy, statistics, os
from io import BytesIO, IOBase
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))

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

def IIX():
	return (int(x) for x in sys.stdin.readline().split())

def II():
	return int(inp())

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

def LS():
	return list(map(str, inp().split()))

def L(x):
	return list(x)

def out(var):
	return sys.stdout.write(str(var))

def solve():
	word = L(inp())
	(u, l) = (0, 0)
	for x in word:
		if x.isupper():
			u += 1
		else:
			l += 1
	if u > l:
		out(''.join(word).upper())
	else:
		out(''.join(word).lower())
try:
	solve()
except EOFError as e:
	out('')


n = input()
c = 0
C = 0
for i in range(0, len(n)):
	if 'a' <= n[i] <= 'z':
		c = c + 1
	elif 'A' <= n[i] <= 'Z':
		C = C + 1
if c >= C:
	print(n.lower())
else:
	print(n.upper())


s = input()
n = 0
for c in s:
	n += 1 if ord(c) < 97 else -1
print(s.upper() if n > 0 else s.lower())


s = input()
n = len(s)
i = 0
S = 0
C = 0
while i < n:
	if ord(s[i]) > 96:
		S += 1
	else:
		C += 1
	i += 1
if S > C or S == C:
	print(s.lower())
else:
	print(s.upper())


s = input()
(u, l) = (0, 0)
for ele in s:
	if ele.isupper():
		u += 1
	elif ele.islower():
		l += 1
if l < u:
	print(s.upper())
else:
	print(s.lower())


def fancy(s):
	(m, n) = (0, 0)
	for i in s:
		if i.isupper():
			m += 1
		else:
			n += 1
	if m > n:
		print(s.upper())
	else:
		print(s.lower())
s = input()
fancy(s)


s = input()
CAP = 0
for i in range(len(s)):
	if ord(s[i]) <= 90:
		CAP = CAP + 1
if CAP > len(s) - CAP:
	print(s.upper())
else:
	print(s.lower())


y = input()
res = 0
ans = 0
for i in range(len(y)):
	if y[i] == y[i].capitalize():
		res += 1
	else:
		ans += 1
if res == ans:
	print(y.lower())
elif res > ans:
	print(y.upper())
else:
	print(y.lower())


def how_many_small_and_big(s):
	small = 0
	big = 0
	for i in s:
		if i.isupper():
			big += 1
		else:
			small += 1
	return (big, small)
s = input()
(bg, sm) = how_many_small_and_big(s)
if bg > sm:
	print(s.upper())
else:
	print(s.lower())


word = input()
n_upper = sum((1 for c in word if c.isupper()))
n_lower = len(word) - n_upper
print(word.upper() if n_upper > n_lower else word.lower())


n = input()
u = n.upper()
l = n.lower()
uc = 0
lc = 0
for i in range(len(n)):
	if n[i] == u[i]:
		uc = uc + 1
	else:
		lc = lc + 1
if uc > lc:
	print(n.upper())
else:
	print(n.lower())


(k, a) = (0, list(input()))
for item in a:
	if item.isupper():
		k += 1
	else:
		k -= 1
print([''.join(a).upper(), ''.join(a).lower()][k <= 0])


s = input()
num_lcase = 0
for i in range(len(s)):
	if s[i] > 'Z':
		num_lcase = num_lcase + 1
if num_lcase < len(s) / 2:
	print(s.upper())
else:
	print(s.lower())


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
BUFSIZE = 8192
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 main():
	s = input()
	a = 0
	b = 0
	for i in s:
		if i.isupper():
			a += 1
		else:
			b += 1
	if a > b:
		s = s.upper()
	else:
		s = s.lower()
	print(s)
main()


word = input()
cap = sml = 0
for ch in word:
	if 65 <= ord(ch) <= 90:
		cap += 1
	else:
		sml += 1
print(word.upper() if cap > sml else word.lower())


string = input()
counter = 0
for i in range(len(string)):
	if string[i].isupper():
		counter = counter + 1
if counter > len(string) / 2:
	print(string.upper())
elif counter < len(string) / 2:
	print(string.lower())
else:
	print(string.lower())


h = input()
uc = 0
lc = 0
for i in range(len(h)):
	if h[i].islower() == True:
		lc += 1
	else:
		uc += 1
if lc >= uc:
	j = ''
	for i in range(len(h)):
		if h[i].islower() == True:
			j += h[i]
		else:
			j += h[i].lower()
else:
	j = ''
	for i in range(len(h)):
		if h[i].islower() == True:
			j += h[i].upper()
		else:
			j += h[i]
print(j)


def main():
	word = input()
	word_length = len(word)
	lower_chars_count = len([c for c in word if c.islower()])
	upper_chars_count = word_length - lower_chars_count
	print(word.lower()) if lower_chars_count >= upper_chars_count else print(word.upper())
main()


word = input()
(count_is_lower, count_is_upper) = (0, 0)
for i in word:
	if i.islower():
		count_is_lower += 1
	if i.isupper():
		count_is_upper += 1
if count_is_lower >= count_is_upper:
	print(word.lower())
else:
	print(word.upper())


s = input()
s1 = s.upper()
(sm, b) = (0, 0)
for i in range(len(s)):
	if s[i] == s1[i]:
		b += 1
	else:
		sm += 1
if sm >= b:
	print(s.lower())
else:
	print(s1)


n = input()
s = list(n)
up = 0
low = 0
for i in range(0, len(s)):
	u = s[i].upper()
	l = s[i].lower()
	if s[i] == u:
		up += 1
	elif s[i] == l:
		low += 1
if up > low:
	print(n.upper())
else:
	print(n.lower())


x = input()
small = 0
biggs = 0
for y in x:
	if y.isupper():
		biggs += 1
for y in x:
	if y.islower():
		small += 1
if small > biggs:
	print(x.lower())
elif biggs > small:
	print(x.upper())
elif biggs == small:
	print(x.lower())


def main():
	s = input()
	upper = 0
	lower = 0
	for c in s:
		if c.isupper():
			upper += 1
		else:
			lower += 1
	if lower > upper:
		print(s.lower())
	elif upper > lower:
		print(s.upper())
	else:
		print(s.lower())
main()


n = input()
list(n)
(u, v) = (0, 0)
u = int(u)
v = int(v)
for i in range(len(n)):
	if n[i].isupper() == True:
		u += 1
	elif n[i].islower() == True:
		v += 1
n = ''.join(n)
if u > v:
	n = n.upper()
	print(str(n))
else:
	n = n.lower()
	print(str(n))


s = input()
low = 0
high = 0
for i in s:
	if i >= 'a' and i <= 'z':
		low += 1
	else:
		high += 1
if low >= high:
	print(s.lower())
else:
	print(s.upper())


a = input()
b = 0
for i in range(len(a)):
	if a[i] in 'QWERTYUIOPLKJHGFDSAZXCVBNM':
		b = b + 1
if b > len(a) / 2:
	print(str.upper(a))
else:
	print(str.lower(a))


x = input()
(cap, sma) = (0, 0)
for i in x:
	if i == i.upper():
		cap += 1
	elif i == i.lower():
		sma += 1
if cap <= sma:
	print(x.lower())
elif cap > sma:
	print(x.upper())


s = input()
lwcase = sum([1 for i in s if ord(i) in range(97, 123)])
upcase = len(s) - lwcase
if lwcase >= upcase:
	print(s.lower())
else:
	print(s.upper())


s = input()
num = 0
for a in s:
	if a >= 'A' and a <= 'Z':
		num += 1
if num > len(s) - num:
	print(s.upper())
else:
	print(s.lower())


word = input('')
Upper = sum((1 for c in word if c.isupper()))
Lower = sum((1 for c in word if c.islower()))
if Upper > Lower:
	print(word.upper())
else:
	print(word.lower())


import string
s = input()
up = 0
low = 0
for i in s:
	if i in string.ascii_lowercase:
		low += 1
	if i in string.ascii_uppercase:
		up += 1
if up > low:
	print(s.upper())
else:
	print(s.lower())


word = input()
uppercase = 0
lowercase = 0
for letter in word:
	value = ord(letter)
	if value >= 65 and value <= 90:
		uppercase += 1
	else:
		lowercase += 1
if uppercase > lowercase:
	word = word.upper()
else:
	word = word.lower()
print(word)


a = input()
import string
p = sum(map(str.islower, a))
q = sum(map(str.isupper, a))
if p > q or p == q:
	a = a.lower()
else:
	a = a.upper()
print(a)


s1 = input()
countlower = 0
countupper = 0
for i in range(len(s1)):
	if ord(s1[i]) < 97:
		countupper += 1
	else:
		countlower += 1
if countupper <= countlower:
	print(s1.lower())
else:
	print(s1.upper())


s = input()
sc = 0
cc = 0
for i in s:
	ch = ord(i)
	if ch >= 65 and ch <= 90:
		cc = cc + 1
	else:
		sc = sc + 1
if cc > sc:
	print(s.upper())
elif cc <= sc:
	print(s.lower())


string = input()
lcount = 0
for i in range(len(string)):
	if string[i].islower():
		lcount += 1
if lcount >= len(string) - lcount:
	print(string.lower())
else:
	print(string.upper())


(n, c, m) = (input(), 0, 0)
for i in n:
	m += 1
	if i.lower() > i:
		c += 1
print(n.upper() if m // 2 < c else n.lower())


x = input()
if len(x) < 1 or len(x) > 100:
	exit()
upper = 0
lower = 0
c = 0
while c < len(x):
	if ord(x[c]) >= 97 and ord(x[c]) <= 122:
		lower += 1
	elif ord(x[c]) >= 65 and ord(x[c]) <= 90:
		upper += 1
	c += 1
if lower > upper:
	print(x.lower())
elif upper > lower:
	print(x.upper())
elif lower == upper:
	print(x.lower())


s = input()
l = 0
h = 0
for i in s:
	if i.islower():
		l += 1
	if i.isupper():
		h += 1
if h > l:
	print(s.upper())
else:
	print(s.lower())


upper = 0
lower = 0
word = [w for w in input()]
newWord = ''
for letter in word:
	if letter.isupper():
		upper += 1
	elif letter.islower():
		lower += 1
if upper > lower:
	for letter in word:
		newWord += letter.upper()
else:
	for letter in word:
		newWord += letter.lower()
print(newWord)


t = list(input())
lcnt = [x for x in t if x == x.lower()]
if len(lcnt) < len(t) / 2:
	print(''.join(t).upper())
else:
	print(''.join(t).lower())


s = list(input())
lc = 0
uc = 0
for i in s:
	if i.islower():
		lc += 1
	else:
		uc += 1
s = ''.join(s)
if lc >= uc:
	print(s.lower())
else:
	print(s.upper())


s = input()
lowers = []
uppers = []
for letter in s:
	if letter == letter.lower():
		lowers.append(letter)
	else:
		uppers.append(letter)
if len(lowers) >= len(uppers):
	print(s.lower())
else:
	print(s.upper())


import string
small = list(string.ascii_lowercase)
word = input()
list_word = list(word)
low = 0
for x in list_word:
	if x in small:
		low += 1
high = len(word) - low
if high > low:
	print(word.upper())
else:
	print(word.lower())


x = input()
low = 0
up = 0
for i in x:
	if i.isupper() == True:
		up += 1
	else:
		low += 1
if up > low:
	x = x.upper()
elif up == low:
	x = x.lower()
else:
	x = x.lower()
print(x)


s = input()
cu = cl = 0
for sr in s:
	if sr.islower():
		cl += 1
	if sr.isupper():
		cu += 1
print([s.upper(), s.lower()][cl >= cu])


s = input()
cs = 0
cc = 0
for i in range(len(s)):
	if chr(65) <= s[i] <= chr(91):
		cc += 1
	elif chr(97) <= s[i] <= chr(123):
		cs += 1
if cc <= cs:
	print(s.lower())
else:
	print(s.upper())


n = input()
b = 0
for i in range(len(n)):
	if ord(n[i]) >= ord('A') and ord(n[i]) <= ord('Z'):
		b = b + 1
if b > len(n) / 2:
	for i in range(len(n)):
		if ord(n[i]) >= ord('a') and ord(n[i]) <= ord('z'):
			print(chr(ord(n[i]) - (ord('a') - ord('A'))), end='')
		else:
			print(n[i], end='')
if b <= len(n) / 2:
	for i in range(len(n)):
		if ord(n[i]) >= ord('A') and ord(n[i]) <= ord('Z'):
			print(chr(ord(n[i]) + (ord('a') - ord('A'))), end='')
		else:
			print(n[i], end='')


word = input()
wU = word.upper()
n1 = 0
wL = word.lower()
n2 = 0
for i in range(len(word)):
	if word[i].isupper():
		n1 += 1
	if word[i].islower():
		n2 += 1
if n1 > n2:
	print(wU)
else:
	print(wL)


s = input()
UP = 0
LOW = 0
for i in s:
	if i.isupper() == True:
		UP += 1
	else:
		LOW += 1
if UP > LOW:
	print(s.upper())
else:
	print(s.lower())


n = input()
size = len(n)
lw = 0
up = 0
for i in range(size):
	if n[i] >= 'a' and n[i] <= 'z':
		lw += 1
	else:
		up += 1
if lw >= up:
	print(n.lower())
else:
	print(n.upper())


n = input('')
cups = 0
clow = 0
for i in n:
	if i.isupper() == True:
		cups += 1
	else:
		clow += 1
if cups < clow:
	f = n.lower()
elif cups == clow:
	f = n.lower()
else:
	f = n.upper()
print(f)


(s, n, v) = (input(), 0, 0)
for i in range(len(s)):
	n += 1 if s[i].islower() else 0
	v += 1 if s[i].isupper() else 0
print(s.upper() if v > n else s.lower())


s = input()
count = 0
count1 = 0
l = 'abcdefghijklmnopqrstuvwxyz'
l1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in s:
	if i in l:
		count = count + 1
	if i in l1:
		count1 = count1 + 1
if count1 > count:
	print(s.upper())
else:
	print(s.lower())


from math import *

def main():
	s = input()
	u = 0
	l = 0
	for c in s:
		if c.upper() == c:
			u += 1
		else:
			l += 1
	if u == l:
		print(s.lower())
	elif u < l:
		print(s.lower())
	else:
		print(s.upper())
main()


x = input()
(capital, small, i) = (0, 0, 0)
while i < len(x):
	if x[i].isupper() == True:
		capital += 1
	else:
		small += 1
	i += 1
if small >= capital:
	print(x.lower())
else:
	print(x.upper())


word = input()

def lowcap(word):
	low = []
	up = []
	for i in word:
		if i.isupper():
			up.append(i)
		elif i.islower():
			low.append(i)
	if len(low) >= len(up):
		print(word.lower())
	elif len(up) > len(low):
		print(word.upper())
lowcap(word)


s = input()
clower = 0
cupper = 0
for i in s:
	if i.islower():
		clower += 1
	else:
		cupper += 1
if cupper > clower:
	print(s.upper())
else:
	print(s.lower())


n = input()
t = n.upper()
p = n.lower()
s = 0
o = 0
for i in range(len(n)):
	if n[i] != t[i]:
		s += 1
	if n[i] != p[i]:
		o += 1
if s >= o:
	print(p)
else:
	print(t)


n = input()
counter1 = 0
counter2 = 0
for i in n:
	if i.isupper() == True:
		counter1 += 1
	else:
		counter2 += 1
if counter1 > counter2:
	print(n.upper())
else:
	print(n.lower())


s = input()
a = list(map(chr, range(65, 91)))
b = list(map(chr, range(97, 123)))
C = [i for i in s if i in a]
D = [i for i in s if i in b]
if len(C) > len(D):
	print(str.upper(s))
else:
	print(str.lower(s))


x = input()
cup = 0
clow = 0
for i in x:
	if i.isupper():
		cup += 1
	else:
		clow += 1
if cup > clow:
	print(x.upper())
else:
	print(x.lower())