After the big birthday party, Katie still wanted Shiro to have some more fun. Later, she came up with a game called treasure hunt. Of course, she invited her best friends Kuro and Shiro to play with her.

The three friends are very smart so they passed all the challenges very quickly and finally reached the destination. But the treasure can only belong to one cat so they started to think of something which can determine who is worthy of the treasure. Instantly, Kuro came up with some ribbons.

A random colorful ribbon is given to each of the cats. Each color of the ribbon can be represented as an uppercase or lowercase Latin letter. Let's call a consecutive subsequence of colors that appears in the ribbon a subribbon. The beauty of a ribbon is defined as the maximum number of times one of its subribbon appears in the ribbon. The more the subribbon appears, the more beautiful is the ribbon. For example, the ribbon aaaaaaa has the beauty of $7$ because its subribbon a appears $7$ times, and the ribbon abcdabc has the beauty of $2$ because its subribbon abc appears twice.

The rules are simple. The game will have $n$ turns. Every turn, each of the cats must change strictly one color (at one position) in his/her ribbon to an arbitrary color which is different from the unchanged one. For example, a ribbon aaab can be changed into acab in one turn. The one having the most beautiful ribbon after $n$ turns wins the treasure.

Could you find out who is going to be the winner if they all play optimally?


-----Input-----

The first line contains an integer $n$ ($0 \leq n \leq 10^{9}$) — the number of turns.

Next 3 lines contain 3 ribbons of Kuro, Shiro and Katie one per line, respectively. Each ribbon is a string which contains no more than $10^{5}$ uppercase and lowercase Latin letters and is not empty. It is guaranteed that the length of all ribbons are equal for the purpose of fairness. Note that uppercase and lowercase letters are considered different colors.


-----Output-----

Print the name of the winner ("Kuro", "Shiro" or "Katie"). If there are at least two cats that share the maximum beauty, print "Draw".


-----Examples-----
Input
3
Kuroo
Shiro
Katie

Output
Kuro

Input
7
treasurehunt
threefriends
hiCodeforces

Output
Shiro

Input
1
abcabc
cbabac
ababca

Output
Katie

Input
15
foPaErcvJ
mZaxowpbt
mkuOlaHRE

Output
Draw



-----Note-----

In the first example, after $3$ turns, Kuro can change his ribbon into ooooo, which has the beauty of $5$, while reaching such beauty for Shiro and Katie is impossible (both Shiro and Katie can reach the beauty of at most $4$, for example by changing Shiro's ribbon into SSiSS and changing Katie's ribbon into Kaaaa). Therefore, the winner is Kuro.

In the fourth example, since the length of each of the string is $9$ and the number of turn is $15$, everyone can change their ribbons in some way to reach the maximal beauty of $9$ by changing their strings into zzzzzzzzz after 9 turns, and repeatedly change their strings into azzzzzzzz and then into zzzzzzzzz thrice. Therefore, the game ends in a draw.

Difficulty: MEDIUM_HARD
Tags: Greedy algorithms
Skill types: Greedy algorithms
Expected Time Complexity: O(N)

Starter code:

Solutions:
x = int(input())
u = input()
v = input()
w = input()

def wtf(s):
	ans = 0
	for i in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':
		ans = max(ans, s.count(i))
	need = len(s) - ans
	if need == 0 and x == 1:
		return len(s) - 1
	if need > x:
		return ans + x
	else:
		return len(s)
	return ans
a = [wtf(u), wtf(v), wtf(w)]
maxi = max(a)
(a, b, c) = (a[0], a[1], a[2])
if a == maxi and b != maxi and (c != maxi):
	print('Kuro')
elif b == maxi and a != maxi and (c != maxi):
	print('Shiro')
elif c == maxi and a != maxi and (b != maxi):
	print('Katie')
else:
	print('Draw')


def hard(a, n):
	di = {}
	if len(a) <= n:
		return n
	mak = -1
	for i in a:
		if i in di:
			di[i] += 1
		else:
			di[i] = 1
		mak = max(mak, di[i])
	if n == 1 and mak == len(a):
		l = len(a)
		return l - 1
	return min(mak + n, len(a))
n = int(input())
a = hard(input(), n)
b = hard(input(), n)
c = hard(input(), n)
if a > b and a > c:
	print('Kuro')
elif b > a and b > c:
	print('Shiro')
elif c > a and c > b:
	print('Katie')
else:
	print('Draw')


n = int(input())
a = input()
b = input()
c = input()
Da = {}
Db = {}
Dc = {}
al = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in al:
	Da[i] = 0
	Db[i] = 0
	Dc[i] = 0
for j in a:
	Da[j] += 1
for j in b:
	Db[j] += 1
for j in c:
	Dc[j] += 1
pa = 0
ia = 0
pb = 0
ib = 0
pc = 0
ic = 0
for x in Da:
	if Da[x] % 2 == 0:
		pa = max(pa, Da[x])
	else:
		ia = max(ia, Da[x])
for x in Db:
	if Db[x] % 2 == 0:
		pb = max(pb, Db[x])
	else:
		ib = max(ib, Db[x])
for x in Dc:
	if Dc[x] % 2 == 0:
		pc = max(pc, Dc[x])
	else:
		ic = max(ic, Dc[x])
t = len(a)
a1 = 0
a2 = 0
if pa + n <= t:
	a1 = pa + n
else:
	a1 = t
if ia + n <= t:
	a2 = ia + n
else:
	a2 = t
b1 = 0
b2 = 0
if pb + n <= t:
	b1 = pb + n
else:
	b1 = t
if ib + n <= t:
	b2 = ib + n
else:
	b2 = t
c1 = 0
c2 = 0
if pc + n <= t:
	c1 = pc + n
else:
	c1 = t
if ic + n <= t:
	c2 = ic + n
else:
	c2 = t
A = max(a1, a2)
B = max(b1, b2)
C = max(c1, c2)
if (pa == t or ia == t) and n == 1:
	A = t - 1
if (pb == t or ib == t) and n == 1:
	B = t - 1
if (pc == t or ic == t) and n == 1:
	C = t - 1
if A > B and A > C:
	print('Kuro')
elif B > A and B > C:
	print('Shiro')
elif C > A and C > B:
	print('Katie')
else:
	print('Draw')


import sys
line = lambda : sys.stdin.buffer.readline().strip()
n = int(line())
s = [line() for _ in range(3)]
r = [0] * 3
for i in range(3):
	c = {}
	r[i] = min(len(s[i]), n)
	for k in s[i]:
		c[k] = c[k] + 1 if k in c else 1
	for k in c:
		r[i] = max(r[i], min(len(s[i]), c[k] + n) - (c[k] == len(s[i]) and n == 1))
m = max(r)
t = r.count(m)
if t > 1:
	print('Draw')
elif r[0] == m:
	print('Kuro')
elif r[1] == m:
	print('Shiro')
else:
	print('Katie')


from collections import Counter
n = int(input())
names = ['Kuro', 'Shiro', 'Katie']
(s, sc) = ([], [])
for i in range(3):
	s.append(input())
	sc.append(Counter(s[i]).most_common(1)[0][1])
ls = len(s[0])
if n >= ls:
	print('Draw')
	return

def modify(sc, n, ls):
	if sc == ls and n == 1:
		return sc - 1
	else:
		return min(sc + n, ls)
sc = [modify(scx, n, ls) for scx in sc]
m = max(sc)
if sc.count(m) > 1:
	print('Draw')
else:
	print(names[sc.index(m)])


def bjuti(a, n):
	d = {}
	if len(a) <= n:
		return n
	maks = -1
	for c in a:
		if c in d:
			d[c] += 1
		else:
			d[c] = 1
		maks = max(maks, d[c])
	if n == 1 and len(a) == maks:
		l = len(a)
		l = l - 1
		return l
	return min(maks + n, len(a))
n = int(input())
a = bjuti(input(), n)
b = bjuti(input(), n)
c = bjuti(input(), n)
if a > b and a > c:
	print('Kuro')
elif b > a and b > c:
	print('Shiro')
elif c > a and c > b:
	print('Katie')
elif a == b or b == c or c == a:
	print('Draw')


from collections import Counter
c = int(input())
ribbon = input()
n = len(ribbon)
if c >= n:
	print('Draw')
else:
	maxFreq = max(Counter(ribbon).values())
	if c <= n - maxFreq:
		kurooScore = c + maxFreq
	elif n == maxFreq:
		if c == 1:
			kurooScore = n - 1
		else:
			kurooScore = n
	else:
		kurooScore = n
	ribbon = input()
	maxFreq = max(Counter(ribbon).values())
	if c <= n - maxFreq:
		shiroScore = c + maxFreq
	elif n == maxFreq:
		if c == 1:
			shiroScore = n - 1
		else:
			shiroScore = n
	else:
		shiroScore = n
	ribbon = input()
	maxFreq = max(Counter(ribbon).values())
	if c <= n - maxFreq:
		katieScore = c + maxFreq
	elif n == maxFreq:
		if c == 1:
			katieScore = n - 1
		else:
			katieScore = n
	else:
		katieScore = n
	scores = [('Kuro', kurooScore), ('Shiro', shiroScore), ('Katie', katieScore)]
	scores = sorted(scores, key=lambda x: x[1], reverse=True)
	if scores[0][1] > scores[1][1]:
		print(scores[0][0])
	else:
		print('Draw')


a = int(input())
a1 = input()
a2 = input()
a3 = input()
ans1 = [0 for i in range(52)]
ans2 = [0 for i in range(52)]
ans3 = [0 for i in range(52)]
for i in range(len(a1)):
	if a1[i].islower():
		ans1[ord(a1[i]) - 97] += 1
	else:
		ans1[ord(a1[i]) - 65 + 26] += 1
for i in range(len(a2)):
	if a2[i].islower():
		ans2[ord(a2[i]) - 97] += 1
	else:
		ans2[ord(a2[i]) - 65 + 26] += 1
for i in range(len(a3)):
	if a3[i].islower():
		ans3[ord(a3[i]) - 97] += 1
	else:
		ans3[ord(a3[i]) - 65 + 26] += 1
k = max(ans1)
m = max(ans2)
p = max(ans3)
if k + a >= len(a1):
	if k == len(a1) and a == 1:
		k = k - 1
	else:
		k = len(a1)
else:
	k = k + a
if m + a >= len(a1):
	if m == len(a1) and a == 1:
		m = m - 1
	else:
		m = len(a1)
else:
	m = m + a
if p + a >= len(a1):
	if p == len(a1) and a == 1:
		p = p - 1
	else:
		p = len(a1)
else:
	p = p + a
flag = 0
if a == len(a1):
	k = a
	m = a
	p = a
if k > m and k > p:
	print('Kuro')
	flag = 1
if m > k and m > p:
	print('Shiro')
	flag = 1
if p > k and p > m:
	print('Katie')
	flag = 1
if flag == 0:
	print('Draw')


n = int(input())
(s1, s2, s3) = (input(), input(), input())
l = len(s1)
flag = 0
if n >= l:
	print('Draw')
	flag = 1
if flag == 0:
	ans = []
	m1 = m2 = m3 = 0
	s01 = s02 = s03 = ''
	li = [chr(x) for x in range(ord('a'), ord('z') + 1)]
	li += [chr(x) for x in range(ord('A'), ord('Z') + 1)]
	s_temp = set([char for char in s1])
	for item in li:
		t1 = s1.count(item)
		t2 = s2.count(item)
		t3 = s3.count(item)
		if t1 > m1:
			m1 = t1
			s01 = item
		if t2 > m2:
			m2 = t2
			s02 = item
		if t3 > m3:
			m3 = t3
			s03 = item
	if n == 1:
		if m1 == l:
			m1 -= 1
		else:
			m1 += 1
		if m2 == l:
			m2 -= 1
		else:
			m2 += 1
		if m3 == l:
			m3 -= 1
		else:
			m3 += 1
	else:
		if m1 + n > l:
			m1 = l
		else:
			m1 += n
		if m2 + n > l:
			m2 = l
		else:
			m2 += n
		if m3 + n > l:
			m3 = l
		else:
			m3 += n
	if m1 > m2 and m1 > m3:
		print('Kuro')
	elif m2 > m1 and m2 > m3:
		print('Shiro')
	elif m3 > m1 and m3 > m2:
		print('Katie')
	else:
		print('Draw')


import sys
from collections import Counter
input = lambda : sys.stdin.readline().strip()

def score(s, n):
	if n >= len(s):
		return len(s)
	elif n == 1 and all((c == s[0] for c in s)):
		return len(s) - 1
	else:
		c = Counter(s)
		return min(len(s), n + max(c.values()))
n = int(input())
s = [score(input(), n), score(input(), n), score(input(), n)]
if s.count(max(s)) == 1:
	print(['Kuro', 'Shiro', 'Katie'][s.index(max(s))])
else:
	print('Draw')


n = int(input())
a = input()
b = input()
c = input()

def count(s, n):
	cnt = {}
	for c in s:
		cnt[c] = cnt.get(c, 0) + 1
	maxc = 0
	for c in cnt:
		if cnt[c] > maxc:
			maxc = cnt[c]
	if len(s) == maxc and n == 1:
		return maxc - 1
	else:
		return min(maxc + n, len(s))
ac = count(a, n)
bc = count(b, n)
cc = count(c, n)
if ac > bc and ac > cc:
	print('Kuro')
elif bc > ac and bc > cc:
	print('Shiro')
elif cc > bc and cc > ac:
	print('Katie')
else:
	print('Draw')


from collections import Counter
n = int(input().strip())
names = ['Kuro', 'Shiro', 'Katie']
ss = {}
for name in names:
	ss[name] = input().strip()

def beauty(s, n):
	cm = Counter(s).most_common(1)[0][1]
	if n == 1 and cm == len(s):
		return cm - 1
	else:
		return min(len(s), cm + n)
res = {}
for name in names:
	res[name] = beauty(ss[name], n)
bestv = max(res.values())
if list(res.values()).count(bestv) > 1:
	print('Draw')
else:
	for (name, v) in res.items():
		if v == bestv:
			print(name)


from collections import Counter
n = int(input())
words = list()
scores = list()
for i in range(0, 3):
	words.append(input())
for j in words:
	letters = list(j)
	if max(Counter(letters).values()) + n > len(j):
		if n == 1 and max(Counter(letters).values()) == len(j):
			scores.append(len(j) - 1)
		else:
			scores.append(len(j))
	else:
		scores.append(max(Counter(letters).values()) + n)
winner = scores.index(max(scores))
winnerScore = max(scores)
scores.pop(winner)
second = scores.index(max(scores))
if winnerScore == scores[second]:
	print('Draw')
elif winner == 0:
	print('Kuro')
elif winner == 1:
	print('Shiro')
elif winner == 2:
	print('Katie')


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
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')
mod = 10 ** 9 + 7
n = int(input())
a = list()
for jj in range(3):
	s = input()
	d = dict()
	for i in s:
		if i in d:
			d[i] += 1
		else:
			d[i] = 1
	mx = 0
	for i in d:
		mx = max(mx, d[i])
	a1 = 0
	if mx + n <= len(s):
		a1 = mx + n
	elif mx == len(s) and n > 0:
		if n > 1:
			a1 = len(s)
		else:
			a1 = len(s) - 1
	else:
		a1 = len(s)
	a.append(a1)
if a[0] > a[1] and a[0] > a[2]:
	print('Kuro')
elif a[1] > a[2] and a[1] > a[0]:
	print('Shiro')
elif a[2] > a[1] and a[2] > a[0]:
	print('Katie')
else:
	print('Draw')


n = int(input())
black = list(input())
white = list(input())
katie = list(input())
ALPHABET = [chr(i) for i in range(65, 65 + 26)] + [chr(i) for i in range(97, 97 + 26)]

def optimal_score(LIST):
	d = {char: 0 for char in ALPHABET}
	for v in LIST:
		d[v] += 1
	max_freq = max(d.values())
	L = len(LIST)
	res = 0
	for freq in d.values():
		if L - freq >= n:
			res = max(res, freq + n)
		elif not (L - freq < n and n == 1):
			res = L
		else:
			res = max(res, L - 1)
	return res
score_black = optimal_score(black)
score_white = optimal_score(white)
score_katie = optimal_score(katie)
M = max(score_black, score_katie, score_white)
MAXCNT = 0
winner = 'NOBODY'
if M == score_black:
	winner = 'Kuro'
	MAXCNT += 1
if M == score_white:
	winner = 'Shiro'
	MAXCNT += 1
if M == score_katie:
	winner = 'Katie'
	MAXCNT += 1
if MAXCNT == 1:
	print(winner)
else:
	print('Draw')


from collections import Counter
import heapq
from collections import Counter
n = int(input())
ls = []
ans = 0
for i in range(3):
	s = input()
	c = Counter(s)
	if all((i == s[0] for i in s)) and n == 1:
		ls.append(len(s) - 1)
	else:
		ls.append(min(max(c.values()) + n, len(s)))
cc = ls.count(max(ls))
if cc >= 2:
	print('Draw')
elif ls.index(max(ls)) == 0:
	print('Kuro')
elif ls.index(max(ls)) == 1:
	print('Shiro')
else:
	print('Katie')


n = int(input())
kuroo = input()
shiro = input()
katie = input()
kuroo_dict = {}
shiro_dict = {}
katie_dict = {}
(ans_kuroo, ans_shiro, ans_katie) = (0, 0, 0)

def calc(d, string, n):
	for i in range(len(string)):
		if string[i] in d:
			d[string[i]] += 1
		else:
			d[string[i]] = 1
	m = 0
	for key in d:
		m = max(m, d[key])
	if m == len(string) and n == 1:
		m = len(string) - 1
	else:
		m = min(m + n, len(string))
	return m
ans_kuroo = calc(kuroo_dict, kuroo, n)
ans_shiro = calc(shiro_dict, shiro, n)
ans_katie = calc(katie_dict, katie, n)
ans = max(ans_kuroo, ans_shiro, ans_katie)
if ans_kuroo == ans_katie and ans_kuroo == ans or (ans_katie == ans_shiro and ans_shiro == ans) or (ans_shiro == ans_kuroo and ans_kuroo == ans):
	print('Draw')
elif ans == ans_kuroo:
	print('Kuro')
elif ans == ans_shiro:
	print('Shiro')
else:
	print('Katie')


from collections import Counter

def solve(n, ribbons):
	L = len(ribbons[0])
	a = [Counter(r).most_common(1)[0][1] for r in ribbons]
	r = sorted([(x, i) for (i, x) in enumerate(a)], reverse=True)
	if n == 1:
		c = Counter(a)
		if c[L - 1] == 1:
			for i in range(3):
				if a[i] == L - 1:
					return i
		if c[L - 1] > 1:
			return 3
		if c[L] + c[L - 2] == 1:
			for i in range(3):
				if a[i] == L or a[i] == L - 2:
					return i
		if c[L] + c[L - 2] > 1:
			return 3
	if r[1][0] == r[0][0]:
		return 3
	if r[1][0] + n >= L:
		return 3
	return r[0][1]
	print(a)

def main():
	n = int(input())
	cats = ('Kuro', 'Shiro', 'Katie', 'Draw')
	ribbons = [input().strip() for _ in range(3)]
	k = solve(n, ribbons)
	print(cats[k])
main()


n = int(input())
s1 = input()
s2 = input()
s3 = input()
(a1, a2, a3, L) = ([0] * 256, [0] * 256, [0] * 256, len(s1))
for i in range(L):
	a1[ord(s1[i])] += 1
	a2[ord(s2[i])] += 1
	a3[ord(s3[i])] += 1
(m1, m2, m3) = (max(a1), max(a2), max(a3))
(L1, L2, L3) = (L, L, L)
if n == 1 and m1 == L:
	L1 = L - 1
if n == 1 and m2 == L:
	L2 = L - 1
if n == 1 and m3 == L:
	L3 = L - 1
(m1, m2, m3) = (min(m1 + n, L1), min(m2 + n, L2), min(m3 + n, L3))
if m1 > m2 and m1 > m3:
	print('Kuro')
elif m2 > m1 and m2 > m3:
	print('Shiro')
elif m3 > m1 and m3 > m2:
	print('Katie')
else:
	print('Draw')


n = int(input())
l = []
for i in range(3):
	l.append(input())
d = [{} for i in range(3)]
mas = [0 for i in range(3)]
for i in range(3):
	for x in l[i]:
		d[i][x] = d[i].get(x, 0) + 1
for i in range(3):
	for x1 in d[i]:
		x = d[i][x1]
		c = x + n - len(l[i])
		if c <= 0:
			mas[i] = max(mas[i], min(x + n, len(l[i])))
			continue
		if n == 1:
			mas[i] = max(mas[i], len(l[i]) - 1)
		else:
			mas[i] = max(mas[i], len(l[i]))
ma = max(mas)
indx = 0
for i in range(3):
	if ma == mas[i]:
		indx = i
		break
mas = sorted(mas)
if mas[1] == mas[2]:
	print('Draw')
	exit()
if indx == 0:
	print('Kuro')
if indx == 1:
	print('Shiro')
if indx == 2:
	print('Katie')


from collections import Counter
N = int(input())

def calc(string: str) -> int:
	cnts: dict = Counter((ch for ch in string))
	t = max((cnts[x] for x in cnts))
	length = len(string)
	if N <= length - t:
		return t + N
	elif t == length and N == 1:
		return length - 1
	else:
		return length
(a, b, c) = (calc(input()) for i in range(3))
if a > b and a > c:
	print('Kuro')
elif b > a and b > c:
	print('Shiro')
elif c > a and c > b:
	print('Katie')
else:
	print('Draw')


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
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))

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

class SegmentTree1:

	def __init__(self, data, default=9999999, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] > k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
n = int(input())
s = input()
s1 = input()
s2 = input()
d = defaultdict(int)
d1 = defaultdict(int)
d2 = defaultdict(int)
for i in range(len(s)):
	d[s[i]] += 1
	d1[s1[i]] += 1
	d2[s2[i]] += 1
e = max(d.values())
e1 = max(d1.values())
e2 = max(d2.values())
r = 0
r1 = 0
r2 = 0
if e == len(s) and n == 1:
	r = 1
if e1 == len(s) and n == 1:
	r1 = 1
if e2 == len(s) and n == 1:
	r2 = 1
e += n
e1 += n
e2 += n
e = min(len(s), e) - r
e1 = min(len(s), e1) - r1
e2 = min(len(s), e2) - r2
ans = max(e, e1, e2)
r = [e, e1, e2]
r.sort()
if ans == r[-1] and ans == r[1]:
	print('Draw')
elif ans == e:
	print('Kuro')
elif ans == e1:
	print('Shiro')
else:
	print('Katie')


n = int(input())
one = input()
two = input()
thr = input()
d1 = {}
d2 = {}
d3 = {}
m1 = 0
m2 = 0
m3 = 0
l = len(one)

def f(q):
	if q == l and n == 1:
		return l - 1
	if q == l:
		return l
	if q + n <= l:
		return q + n
	else:
		return l
for i in range(len(one)):
	try:
		d1[one[i]] += 1
	except KeyError:
		d1[one[i]] = 1
for i in range(len(one)):
	try:
		d2[two[i]] += 1
	except KeyError:
		d2[two[i]] = 1
for i in range(len(one)):
	try:
		d3[thr[i]] += 1
	except KeyError:
		d3[thr[i]] = 1
for i in range(l):
	m1 = max(m1, f(d1[one[i]]))
	m2 = max(m2, f(d2[two[i]]))
	m3 = max(m3, f(d3[thr[i]]))
l = len(one)
if [m1, m2, m3].count(max(m1, m2, m3)) != 1:
	print('Draw')
	return
if max(m1, m2, m3) == m1:
	print('Kuro')
elif max(m1, m2, m3) == m2:
	print('Shiro')
else:
	print('Katie')


from collections import Counter

def main():
	n = int(input())
	_kuro = input().strip()
	_shiro = input().strip()
	_katie = input().strip()
	length = len(_kuro)
	if n != 1:
		kuro = max(0, length - Counter(_kuro).most_common(1)[0][1] - n)
		shiro = max(0, length - Counter(_shiro).most_common(1)[0][1] - n)
		katie = max(0, length - Counter(_katie).most_common(1)[0][1] - n)
	else:
		kuro = length - Counter(_kuro).most_common(1)[0][1] - n
		if kuro == -1:
			kuro = 1
		shiro = length - Counter(_shiro).most_common(1)[0][1] - n
		if shiro == -1:
			shiro = 1
		katie = length - Counter(_katie).most_common(1)[0][1] - n
		if katie == -1:
			katie = 1
	srt = sorted([kuro, shiro, katie])
	if srt[0] == srt[1]:
		print('Draw')
	elif kuro == srt[0]:
		print('Kuro')
	elif shiro == srt[0]:
		print('Shiro')
	else:
		print('Katie')
main()


n = int(input())
s1 = input()
s2 = input()
s3 = input()
k1 = len(s1)
k2 = len(s2)
k3 = len(s3)
a = 0
val1 = [0 for i in range(1000)]
val2 = [0 for i in range(1000)]
val3 = [0 for i in range(1000)]
for i in range(k1):
	val1[ord(s1[i]) - ord('a')] += 1
for i in range(k2):
	val2[ord(s2[i]) - ord('a')] += 1
for i in range(k3):
	val3[ord(s3[i]) - ord('a')] += 1
if n == 1:
	if max(val1) == k1:
		l1 = k1 - 1
	else:
		l1 = min(max(val1) + n, k1)
	if max(val2) == k2:
		l2 = k2 - 1
	else:
		l2 = min(max(val2) + n, k2)
	if max(val3) == k3:
		l3 = k3 - 1
	else:
		l3 = min(max(val3) + n, k3)
else:
	l1 = min(max(val1) + n, k1)
	l2 = min(max(val2) + n, k2)
	l3 = min(max(val3) + n, k3)
if l1 > max(l2, l3):
	print('Kuro')
elif l2 > max(l1, l3):
	print('Shiro')
elif l3 > max(l1, l2):
	print('Katie')
else:
	print('Draw')


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

def fun(kuro):
	global se
	le = len(kuro)
	dic = {}
	for i in kuro:
		if i in dic:
			dic[i] += 1
		else:
			dic[i] = 1
	a1 = 1
	for i in dic:
		ma = dic[i]
		rest = le - ma
		if rest >= n:
			a1 = max(ma + n, a1)
		elif n != 1:
			a1 = max(ma + rest, a1)
		elif rest == 0:
			a1 = max(a1, ma - 1)
		else:
			a1 = max(a1, ma + 1)
	se.append(a1)
for i in range(3):
	fun(input())
ma = max(se)
if se.count(ma) != 1:
	print('Draw')
elif se[0] == ma:
	print('Kuro')
elif se[1] == ma:
	print('Shiro')
else:
	print('Katie')


n = int(input())
s1 = input().strip()
s2 = input().strip()
s3 = input().strip()
d1 = [0 for _ in range(52)]
d2 = [0 for _ in range(52)]
d3 = [0 for _ in range(52)]
maxi1 = 0
maxi2 = 0
maxi3 = 0
for i in s1:
	if ord(i) <= 90:
		j = ord(i) - 65
	else:
		j = ord(i) - 97 + 26
	d1[j] += 1
maxi1 = max(d1)
for i in s2:
	if ord(i) <= 90:
		j = ord(i) - 65
	else:
		j = ord(i) - 97 + 26
	d2[j] += 1
maxi2 = max(d2)
for i in s3:
	if ord(i) <= 90:
		j = ord(i) - 65
	else:
		j = ord(i) - 97 + 26
	d3[j] += 1
maxi3 = max(d3)
if maxi1 + n <= len(s1):
	maxi1 += n
elif n == 1:
	maxi1 = len(s1) - 1
else:
	maxi1 = len(s1)
if maxi2 + n <= len(s1):
	maxi2 += n
elif n == 1:
	maxi2 = len(s1) - 1
else:
	maxi2 = len(s1)
if maxi3 + n <= len(s1):
	maxi3 += n
elif n == 1:
	maxi3 = len(s1) - 1
else:
	maxi3 = len(s1)
if maxi1 > maxi2 and maxi1 > maxi3:
	print('Kuro')
elif maxi2 > maxi1 and maxi2 > maxi3:
	print('Shiro')
elif maxi3 > maxi1 and maxi3 > maxi2:
	print('Katie')
else:
	print('Draw')


from collections import Counter
n = int(input())
ss = []
for _ in range(0, 3):
	ss.append(input())
ans = ['Kuro', 'Shiro', 'Katie']
maxi = [0, 0, 0]
for i in range(0, 3):
	c = Counter(ss[i])
	mx = max(c.values())
	to = min(len(ss[i]) - mx, n)
	maxi[i] = mx + to
	if n == 1 and mx == len(ss[i]):
		maxi[i] -= 1
if maxi.count(max(maxi)) > 1:
	print('Draw')
else:
	print(ans[maxi.index(max(maxi))])


from collections import Counter
n = int(input())
s = str(input())
s1 = str(input())
s2 = str(input())
t = len(s)
l = Counter(s)
l1 = Counter(s1)
l2 = Counter(s2)
k = max(l.values())
k1 = max(l1.values())
k2 = max(l2.values())
if n + k >= t:
	if k == t and n != 0:
		if n == 1:
			k = k - 1
		else:
			k = t
	else:
		k = t
else:
	k = k + n
if n + k1 >= t:
	if k1 == t and n != 0:
		if n == 1:
			k1 = k1 - 1
		else:
			k1 = t
	else:
		k1 = t
else:
	k1 = k1 + n
if k2 + n >= t:
	if k2 == t and n != 0:
		if n == 1:
			k2 = t - 1
		else:
			k2 = k2
	else:
		k2 = t
else:
	k2 = k2 + n
if k > k1 and k > k2:
	print('Kuro')
elif k >= k1 and k >= k2:
	print('Draw')
elif k1 > k and k1 > k2:
	print('Shiro')
elif k1 >= k and k1 >= k2:
	print('Draw')
elif k2 > k and k2 > k1:
	print('Katie')
elif k2 >= k and k2 >= k1:
	print('Draw')


n = int(input())
kuro = input()
shiro = input()
katie = input()
kurod = {}
shirod = {}
katied = {}
kurov = 0
shirov = 0
katiev = 0
for c in kuro:
	if c not in kurod:
		kurod[c] = 1
	else:
		kurod[c] += 1
	kurov = max(kurov, kurod[c])
for c in shiro:
	if c not in shirod:
		shirod[c] = 1
	else:
		shirod[c] += 1
	shirov = max(shirov, shirod[c])
for c in katie:
	if c not in katied:
		katied[c] = 1
	else:
		katied[c] += 1
	katiev = max(katiev, katied[c])
kuroans = 0
shiroans = 0
katieans = 0
if len(kurod) > 1:
	kuroans = min(kurov + n, len(kuro))
elif n == 1 and len(kuro) > 1:
	kuroans = len(kuro) - 1
else:
	kuroans = len(kuro)
if len(shirod) > 1:
	shiroans = min(shirov + n, len(shiro))
elif n == 1 and len(shiro) > 1:
	shiroans = len(shiro) - 1
else:
	shiroans = len(shiro)
if len(katied) > 1:
	katieans = min(katiev + n, len(katie))
elif n == 1 and len(katie) > 1:
	katieans = len(katie) - 1
else:
	katieans = len(katie)
arr = [kuroans, shiroans, katieans]
arr = sorted(arr)
if arr[1] == arr[2]:
	print('Draw')
elif kuroans > max(shiroans, katieans):
	print('Kuro')
elif shiroans > max(kuroans, katieans):
	print('Shiro')
else:
	print('Katie')


import collections
n = int(input())
s = []
for i in range(3):
	s.append(input())
max_val = [0, 0, 0]
ans = ['Kuro', 'Shiro', 'Katie']
for i in range(3):
	cnt = collections.Counter(s[i])
	rr = max(cnt.values())
	changed = min(len(s[i]) - rr, n)
	moves = n - changed
	max_val[i] = rr + changed - (moves == 1 and rr == len(s[i]))
if max_val.count(max(max_val)) > 1:
	print('Draw')
else:
	print(ans[max_val.index(max(max_val))])


from collections import Counter
n = int(input())
A = []
tmp = input()
m = len(tmp)
A += [Counter(tmp)]
A += [Counter(input())]
A += [Counter(input())]
B = [0] * 3
for i in range(3):
	best_letter = max([y for (x, y) in A[i].items()])
	if best_letter == m and n == 1:
		B[i] = m - 1
	else:
		B[i] = min([m, max([y for (x, y) in A[i].items()]) + n])
if B.count(max(B)) != 1:
	print('Draw')
else:
	i = B.index(max(B))
	print(['Kuro', 'Shiro', 'Katie'][i])


n = int(input())
s1 = input()
s2 = input()
s3 = input()
s = len(s1)
(d1, d2, d3) = (dict(), dict(), dict())
for i in s1:
	if i not in d1:
		d1[i] = 1
	else:
		d1[i] += 1
for i in s2:
	if i not in d2:
		d2[i] = 1
	else:
		d2[i] += 1
for i in s3:
	if i not in d3:
		d3[i] = 1
	else:
		d3[i] += 1
(max1, max2, max3) = (0, 0, 0)
for i in d1:
	if d1[i] > max1:
		max1 = d1[i]
for i in d2:
	if d2[i] > max2:
		max2 = d2[i]
for i in d3:
	if d3[i] > max3:
		max3 = d3[i]
a = []
a.append([s - max1, 'Kuro'])
a.append([s - max2, 'Shiro'])
a.append([s - max3, 'Katie'])
a.sort()
if a[0][0] > n:
	if a[0][0] < a[1][0]:
		print(a[0][1])
	else:
		print('Draw')
else:
	for j in a:
		q = n - j[0]
		if q < 0:
			j[0] -= n
		elif n == 1:
			j[0] = q % 2
		else:
			j[0] = 0
	a.sort()
	if a[0][0] < a[1][0]:
		print(a[0][1])
	else:
		print('Draw')


def bt(s):
	maxi = 0
	for i in alphabet:
		k = s.count(i)
		if k > maxi:
			maxi = k
	return maxi

def maxbt(s, n):
	if n <= len(s) - bt(s):
		return n + bt(s)
	elif len(s) - bt(s) == 0 and n == 1:
		return len(s) - 1
	else:
		return len(s)
alphabet = ['A', 'a', 'B', 'b', 'C', 'c', 'D', 'd', 'E', 'e', 'F', 'f', 'G', 'g', 'H', 'h', 'I', 'i', 'J', 'j', 'K', 'k', 'L', 'l', 'M', 'm', 'N', 'n', 'O', 'o', 'P', 'p', 'Q', 'q', 'R', 'r', 'S', 's', 'T', 't', 'U', 'u', 'V', 'v', 'W', 'w', 'X', 'x', 'Y', 'y', 'Z', 'z']
n = int(input())
s1 = input()
s2 = input()
s3 = input()
k1 = maxbt(s1, n)
k2 = maxbt(s2, n)
k3 = maxbt(s3, n)
d = max(k1, k2, k3)
if k1 == k2 and k1 == d or (k2 == k3 and k2 == d) or (k3 == k1 and k1 == d):
	print('Draw')
else:
	if k1 == max(k1, k2, k3):
		print('Kuro')
	if k2 == max(k1, k2, k3):
		print('Shiro')
	if k3 == max(k1, k2, k3):
		print('Katie')


import sys
from collections import defaultdict

def highestFrequesncyListElement(listOfElements):
	counts = defaultdict(int)
	for el in listOfElements:
		counts[el] += 1
	return max(counts.items(), key=lambda x: x[1])

def getScore(turns, ribbon):
	stringLength = len(ribbon)
	letters = list(ribbon)
	letters.sort()
	(letter, maxCount) = highestFrequesncyListElement(letters)
	if turns == 1 and maxCount == stringLength:
		return stringLength - 1
	elif turns + maxCount >= stringLength:
		return stringLength
	else:
		return maxCount + turns

def readInput():
	turns = int(sys.stdin.readline().rstrip('\n'))
	playersRibbons = dict(zip(['Kuro', 'Shiro', 'Katie'], [sys.stdin.readline().rstrip('\n') for i in range(0, 3)]))
	return (turns, playersRibbons)

def main():
	(turns, playersRibbons) = readInput()
	for (player, ribbon) in playersRibbons.items():
		playersRibbons[player] = getScore(turns, ribbon)
	(winner, score) = max(playersRibbons.items(), key=lambda x: x[1])
	multipleMaxScoreWinners = sum((1 for x in list(playersRibbons.values()) if x == score)) > 1
	DRAW = 'Draw'
	if multipleMaxScoreWinners:
		print(DRAW)
	else:
		print(winner)
main()


import sys

def main():
	n = int(sys.stdin.readline())
	player = ['Kuro', 'Shiro', 'Katie']
	l = list(map(str.strip, sys.stdin.readlines()))
	lw = len(l[0])
	m = list(map(lambda x: max([x.count(e) for e in set(x)]), l))
	if n == 1:
		for i in range(3):
			if m[i] == lw:
				m[i] -= 2
	winner = []
	for i in range(3):
		if m[i] == max(m) or m[i] + n >= lw:
			winner.append(player[i])
	print(winner[0] if len(winner) == 1 else 'Draw')
main()


import collections
n = int(input())
kuro = input()
shiro = input()
katie = input()
(lkuro, lshiro, lkatie) = (len(kuro), len(shiro), len(katie))
ckuro = collections.Counter(kuro).most_common(1)[0][1]
cshiro = collections.Counter(shiro).most_common(1)[0][1]
ckatie = collections.Counter(katie).most_common(1)[0][1]
if n <= lkuro - ckuro:
	kuroscore = ckuro + n
else:
	kuroscore = lkuro
	if n == 1 and lkuro == ckuro:
		kuroscore -= 1
if n <= lshiro - cshiro:
	shiroscore = cshiro + n
else:
	shiroscore = lshiro
	if n == 1 and lshiro == cshiro:
		shiroscore -= 1
if n <= lkatie - ckatie:
	katiescore = ckatie + n
else:
	katiescore = lkatie
	if n == 1 and lkatie == ckatie:
		katiescore -= 1
b = ['Kuro', 'Shiro', 'Katie']
s = [kuroscore, shiroscore, katiescore]
ss = sorted(s)
if ss[-1] == ss[-2]:
	print('Draw')
else:
	print(b[s.index(max(s))])


n = int(input())
(ku, sh, ka) = (input(), input(), input())
(l_ku, l_sh, l_ka) = (max([ku.count(i) for i in list(set(ku))]), max([sh.count(i) for i in list(set(sh))]), max([ka.count(i) for i in list(set(ka))]))
if len(ku) - l_ku > n:
	l_ku += n
elif l_ku == len(ku) and n == 1:
	l_ku -= 1
else:
	l_ku = len(ku)
if len(sh) - l_sh > n:
	l_sh += n
elif l_sh == len(sh) and n == 1:
	l_sh -= 1
else:
	l_sh = len(sh)
if len(ka) - l_ka > n:
	l_ka += n
elif l_ka == len(ka) and n == 1:
	l_ka -= 1
else:
	l_ka = len(ka)
ma = max([l_sh, l_ku, l_ka])
if l_ka == l_sh and l_ka == ma or (l_ku == l_sh and l_ku == ma) or (l_ka == l_ku and l_ka == ma):
	print('Draw')
elif ma == l_ka:
	print('Katie')
elif ma == l_sh:
	print('Shiro')
elif ma == l_ku:
	print('Kuro')


n = int(input())
st_a = input()
st_b = input()
st_c = input()
a = [0 for i in range(125)]
b = [0 for i in range(125)]
c = [0 for i in range(125)]
l = len(st_c)
for i in range(l):
	a[ord(st_a[i])] += 1
	b[ord(st_b[i])] += 1
	c[ord(st_c[i])] += 1
maxi_a = 0
maxi_b = 0
maxi_c = 0
if n == 1:
	maxi_a = max(a) + 1
	maxi_b = max(b) + 1
	maxi_c = max(c) + 1
	if maxi_a > l:
		maxi_a -= 2
	if maxi_b > l:
		maxi_b -= 2
	if maxi_c > l:
		maxi_c -= 2
else:
	for i in range(123):
		if i >= 65 and i <= 90 or (i >= 97 and i <= 122):
			if a[i] + n >= l:
				maxi_a = max(maxi_a, l)
			else:
				maxi_a = max(maxi_a, a[i] + n)
			if b[i] + n >= l:
				maxi_b = max(maxi_b, l)
			else:
				maxi_b = max(maxi_b, b[i] + n)
			if c[i] + n >= l:
				maxi_c = max(maxi_c, l)
			else:
				maxi_c = max(maxi_c, c[i] + n)
s = [maxi_a, maxi_b, maxi_c]
s.sort()
if s[1] == s[2]:
	print('Draw')
if maxi_a > max(maxi_b, maxi_c):
	print('Kuro')
if maxi_b > max(maxi_c, maxi_a):
	print('Shiro')
if maxi_c > max(maxi_b, maxi_a):
	print('Katie')


a = input()
n = int(a)
list1 = {}
list3 = ['Kuro', 'Shiro', 'Katie']
for i in range(3):
	list1[i] = input()
l = len(list1[0])
for i in range(3):
	list1[i] = sorted(list1[i])
if n > l:
	print('Draw')
	exit()
mx = 0
p = 0
list2 = {}
for i in range(3):
	for j in range(len(list1[i])):
		if j and sub == str(list1[i][j]):
			continue
		sub = str(list1[i][j])
		if mx < list1[i].count(sub):
			mx = list1[i].count(sub)
	list2[p] = int(mx)
	p = p + 1
	mx = 0
for i in range(3):
	if l == list2[i] and n == 1:
		list2[i] = l - 1
	elif l - list2[i] > 0:
		if l - list2[i] - n >= 0:
			list2[i] = l - (l - list2[i] - n)
		else:
			list2[i] = l
	elif n == 1:
		list2[i] = l - 1
	else:
		list2[i] = l
mxx = 0
for i in range(3):
	if list2[i] > mxx:
		mxx = list2[i]
f = 0
t = 0
for i in range(3):
	if list2[i] == mxx:
		t = i
for i in range(3):
	if list2[i] == mxx:
		f += 1
if f > 1:
	f = 1
else:
	f = 0
if f:
	print('Draw')
else:
	print(list3[t])


N = int(input())
S = [input() for i in range(3)]
bu = []
for s in S:
	cnt = {}
	mx = 0
	for c in s:
		if c not in cnt:
			cnt[c] = 0
		cnt[c] += 1
		mx = max(mx, cnt[c])
	if mx == len(s) and N == 1:
		bu.append(mx - 1)
	else:
		bu.append(min(len(s), mx + N))
ans = -1
ansmx = -1
for i in range(3):
	if bu[i] > ansmx:
		ans = i
		ansmx = bu[i]
	elif bu[i] == ansmx:
		ans = -1
if ans == -1:
	print('Draw')
elif ans == 0:
	print('Kuro')
elif ans == 1:
	print('Shiro')
else:
	print('Katie')


n = int(input())
new = []
length = []
for _ in range(3):
	a = input()
	length.append(len(a))
	d = {}
	for i in a:
		if i in d:
			d[i] += 1
		else:
			d[i] = 1
	max_v = max(d.keys(), key=lambda k: d[k])
	new.append(d[max_v])
for i in range(3):
	new[i] = length[i] - new[i]
for i in range(3):
	new[i] = new[i] - n
for i in range(3):
	if new[i] == -1 and n == 1:
		new[i] = 1
	elif new[i] <= -1:
		new[i] = 0
minn = min(new)
if new.count(minn) > 1:
	print('Draw')
else:
	ind = new.index(minn)
	if ind == 0:
		print('Kuro')
	elif ind == 1:
		print('Shiro')
	else:
		print('Katie')


def ln(s):
	m = 0
	ans = 0
	L = len(s)
	A = [0] * 123
	for i in range(len(s)):
		A[ord(s[i])] += 1
	for i in range(65, 123):
		if A[i] > m:
			m = A[i]
	x = L - m
	if n == 0:
		ans = m
	elif x > 0:
		if x >= n:
			ans = m + n
		else:
			ans = L
	elif n == 1:
		ans = L - 1
	else:
		ans = L
	return ans
n = int(input())
a = input()
b = input()
c = input()
Ans = ['Kuro', 'Shiro', 'Katie']
ans1 = ln(a)
ans2 = ln(b)
ans3 = ln(c)
mx = max(ans1, ans2, ans3)
k = 0
if mx == ans1:
	k += 1
if mx == ans2:
	k += 1
if mx == ans3:
	k += 1
if k > 1:
	print('Draw')
elif max(ans1, ans2, ans3) == ans1:
	print(Ans[0])
elif max(ans1, ans2, ans3) == ans2:
	print(Ans[1])
elif max(ans1, ans2, ans3) == ans3:
	print(Ans[2])


def max_beauty(ribbon, n):
	b_cnt = {}
	for c in ribbon:
		if c in b_cnt:
			b_cnt[c] += 1
		else:
			b_cnt[c] = 1
	mx = 0
	for (key, val) in b_cnt.items():
		mx = max(mx, val)
	l = len(ribbon)
	if mx == l and n == 1:
		return l - 1
	elif mx == l:
		return l
	else:
		return min(l, mx + n)

class CodeforcesTask979BSolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.ribbons = []

	def read_input(self):
		self.n = int(input())
		self.ribbons = [input() for x in range(3)]

	def process_task(self):
		names = ['Kuro', 'Shiro', 'Katie']
		bes = [max_beauty(x, self.n) for x in self.ribbons]
		winning = max(bes)
		if bes.count(winning) > 1:
			self.result = 'Draw'
		else:
			self.result = names[bes.index(winning)]

	def get_result(self):
		return self.result
Solution = CodeforcesTask979BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
s1 = input()
s2 = input()
s3 = input()
x = len(s1)
(a1, a2, a3) = (0, 0, 0)
from collections import Counter
c1 = Counter(s1)
c2 = Counter(s2)
c3 = Counter(s3)
i = 65
while i < 123:
	if c1[chr(i)] + n <= x:
		b = c1[chr(i)] + n
	else:
		c = c1[chr(i)] + n - x
		if n != 1:
			b = x
		else:
			b = x - 1
	a1 = max(a1, b)
	if c2[chr(i)] + n <= x:
		b = c2[chr(i)] + n
	else:
		c = c2[chr(i)] + n - x
		if n != 1:
			b = x
		else:
			b = x - 1
	a2 = max(a2, b)
	if c3[chr(i)] + n <= x:
		b = c3[chr(i)] + n
	else:
		c = c3[chr(i)] + n - x
		if n != 1:
			b = x
		else:
			b = x - 1
	a3 = max(a3, b)
	i += 1
	if i == 92:
		i = 97
l = [[a1, 'Kuro'], [a2, 'Shiro'], [a3, 'Katie']]
l.sort()
if l[-1][0] == l[-2][0]:
	print('Draw')
else:
	print(l[-1][1])


import sys
import math
from collections import defaultdict
(dic1, dic2, dic3) = (defaultdict(int), defaultdict(int), defaultdict(int))
n = int(sys.stdin.readline())
a = sys.stdin.readline()[:-1]
b = sys.stdin.readline()[:-1]
c = sys.stdin.readline()[:-1]
m = len(a)
for i in range(m):
	dic1[a[i]] += 1
	dic2[b[i]] += 1
	dic3[c[i]] += 1
(x, y, z) = (10000000000.0, 10000000000.0, 10000000000.0)
(ann, bnn, cnn) = (n, n, n)
for x1 in dic1:
	rema = m - dic1[x1]
	an = ann
	if rema >= 0:
		if an == 1:
			if rema == 1:
				x = min(x, 0)
			elif rema > 1:
				x = min(rema - 1, x)
			else:
				x = min(x, 1)
			continue
		if an >= rema:
			an -= rema
			x = min(x, 0)
		else:
			x = min(rema - an, x)
	else:
		x = min(x, an % 2)
for x2 in dic2:
	remb = m - dic2[x2]
	bn = bnn
	if remb >= 0:
		if bn == 1:
			if remb == 1:
				y = min(y, 0)
			elif remb > 1:
				y = min(remb - 1, y)
			else:
				y = min(y, 1)
			continue
		if bn >= remb:
			bn -= remb
			y = min(y, 0)
		else:
			y = min(y, remb - bn)
	else:
		y = min(y, bn % 2)
for x3 in dic3:
	remc = m - dic3[x3]
	cn = cnn
	if remc >= 0:
		if cn == 1:
			if remc == 1:
				z = min(z, 0)
			elif remc > 1:
				z = min(remc - 1, z)
			else:
				z = min(z, 1)
			continue
		if cn >= remc:
			cn -= remc
			z = min(z, 0)
		else:
			z = min(z, remc - cn)
	else:
		z = min(z, cn % 2)
if x < y and x < z:
	print('Kuro')
	sys.exit()
if x < y and x == z or (x < z and x == y):
	print('Draw')
	sys.exit()
if x == y == z:
	print('Draw')
	sys.exit()
if z < y and z < x:
	print('Katie')
	sys.exit()
if z < y and x == z or (z < x and z == y):
	print('Draw')
	sys.exit()
if y < x and y < z:
	print('Shiro')
	sys.exit()
if y < x and y == z or (y < z and x == y):
	print('Draw')
	sys.exit()


from collections import Counter
n = int(input())
(kuro, shiro, katie) = (input(), input(), input())
a = [('', 0)] * 3
l = [0] * 3
lim = len(kuro)
l[0] = lim - max(Counter(kuro).values())
l[1] = lim - max(Counter(shiro).values())
l[2] = lim - max(Counter(katie).values())
a[0] = ('Kuro', n - l[0])
a[1] = ('Shiro', n - l[1])
a[2] = ('Katie', n - l[2])
for i in range(3):
	if a[i][1] >= 0:
		if n <= 2:
			a[i] = (a[i][0], -1 * (n % 2) * (a[i][1] % 2))
		else:
			a[i] = (a[i][0], 0)
a.sort(key=lambda x: x[1])
dif = a[2][1] - a[1][1]
if dif == 0:
	print('Draw')
else:
	print(a[2][0])


n = int(input())
a = input()
b = input()
c = input()
length = len(a)
d = {}
for x in a:
	if x in d:
		d[x] += 1
	else:
		d[x] = 1
ma = max(d.values())
d = {}
for x in b:
	if x in d:
		d[x] += 1
	else:
		d[x] = 1
mb = max(d.values())
d = {}
for x in c:
	if x in d:
		d[x] += 1
	else:
		d[x] = 1
mc = max(d.values())
if ma == length and n == 1:
	maa = ma - 1
else:
	maa = min(ma + n, length)
if mb == length and n == 1:
	mbb = mb - 1
else:
	mbb = min(mb + n, length)
if mc == length and n == 1:
	mcc = mc - 1
else:
	mcc = min(mc + n, length)
e = [[x, y] for (x, y) in zip([maa, mbb, mcc], [0, 1, 2])]
e.sort(reverse=True, key=lambda x: x[0])
if e[0][0] == e[1][0]:
	print('Draw')
else:
	if e[0][1] == 0:
		print('Kuro')
	if e[0][1] == 1:
		print('Shiro')
	if e[0][1] == 2:
		print('Katie')


import sys
input = sys.stdin.readline
al = list('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
n = int(input())
s = [input().rstrip() for i in range(3)]
l = len(s[0])
ans = [0] * 3
for c in al:
	for i in range(3):
		cnt_c = s[i].count(c)
		if cnt_c + n <= l:
			ans[i] = max(ans[i], cnt_c + n)
		elif n == 1 and l == cnt_c:
			ans[i] = max(ans[i], l - 1)
		else:
			ans[i] = l
if ans[0] == ans[1] and max(ans) == ans[0] or (ans[1] == ans[2] and max(ans) == ans[1]) or (ans[0] == ans[2] and max(ans) == ans[2]):
	print('Draw')
elif max(ans) == ans[0]:
	print('Kuro')
elif max(ans) == ans[1]:
	print('Shiro')
else:
	print('Katie')


from collections import Counter
n = int(input())

def score(s):
	return Counter(s).most_common()[0][1]
a = [input() for i in range(3)]
l = len(a[0])
a = list(map(score, a))
if n == 1:
	a = list(map(lambda x: x - 1 if x == l else x + 1, a))
else:
	a = list(map(lambda x: min(l, x + n), a))
print('Draw' if a.count(max(a)) > 1 else [['Kuro', 'Shiro', 'Katie'][i] for i in range(3) if a[i] == max(a)][0])


n = int(input())
k = input()
s = input()
ka = input()
l = len(k)
if n >= l:
	print('Draw')
else:
	lk = [0] * 127
	ls = [0] * 127
	lka = [0] * 127
	for i in range(0, l):
		lk[ord(k[i])] += 1
		ls[ord(s[i])] += 1
		lka[ord(ka[i])] += 1
	m1 = max(lk)
	m2 = max(ls)
	m3 = max(lka)
	if n != 1:
		m1 = min(m1 + n, l)
		m2 = min(m2 + n, l)
		m3 = min(m3 + n, l)
	else:
		if m1 == l:
			m1 -= 1
		else:
			m1 = min(m1 + 1, l)
		if m2 == l:
			m2 -= 1
		else:
			m2 = min(m2 + 1, l)
		if m3 == l:
			m3 -= 1
		else:
			m3 = min(m3 + 1, l)
	l = [m1, m2, m3]
	l.sort()
	if l[1] == l[2]:
		print('Draw')
	else:
		m = l[2]
		if m1 == m:
			print('Kuro')
		elif m2 == m:
			print('Shiro')
		else:
			print('Katie')


import sys
import filecmp
import math
FILE_IO = False
if FILE_IO:
	input_stream = open('input_test.txt')
	sys.stdout = open('current_output.txt', 'w')
else:
	input_stream = sys.stdin
n = int(input_stream.readline())
kuro = input_stream.readline().split()[0]
shirio = input_stream.readline().split()[0]
katie = input_stream.readline().split()[0]
max_list = []
for ribons in [kuro, shirio, katie]:
	count_list = [0 for _ in range(ord('z') - ord('A') + 1)]
	for char in ribons:
		count_list[ord(char) - ord('A')] += 1
	current_max = max(count_list)
	chars_to_be_chagned = len(ribons) - current_max
	if chars_to_be_chagned < n:
		current_max = len(ribons)
		if chars_to_be_chagned == 0 and n == 1:
			current_max -= 1
	else:
		current_max = current_max + n
	max_list.append(current_max)
final_max = max(max_list)
result = 1 + max_list.index(final_max)
max_list.remove(final_max)
if final_max in max_list:
	result = 5
if result == 1:
	print('Kuro')
elif result == 2:
	print('Shiro')
elif result == 3:
	print('Katie')
else:
	print('Draw')
if FILE_IO:
	assert filecmp.cmp('current_output.txt', 'expected_output.txt', shallow=False) == True


n = int(input())
kuro = input()
shiro = input()
katie = input()
words = [kuro, shiro, katie]
bank = [[0 for i in range(0, ord('z') - ord('A') + 1)] for j in range(0, 3)]
for i in range(0, 3):
	for l in words[i]:
		bank[i][ord(l) - 65] += 1
	summ = sum(bank[i])
	if summ == max(bank[i]) and n == 1:
		for j in range(0, 52):
			if bank[i][j] == summ:
				bank[i][j] -= 2
				break
kuro = min(len(words[0]), max(bank[0]) + n)
shiro = min(len(words[1]), max(bank[1]) + n)
katie = min(len(words[2]), max(bank[2]) + n)
if kuro > shiro and kuro > katie:
	print('Kuro')
elif shiro > kuro and shiro > katie:
	print('Shiro')
elif katie > kuro and katie > shiro:
	print('Katie')
elif katie == shiro or katie == kuro or shiro == kuro:
	print('Draw')


N = int(input())
n = [0, 0, 0]
for i in range(3):
	z = [0 for i in range(128)]
	x = input()
	for j in x:
		z[ord(j)] += 1
	n[i] = min(N + max(z), len(x) - 1 if N == 1 and len(x) == max(z) else len(x))
r = max(n)
if n.count(r) == 1:
	if n[0] == r:
		print('Kuro')
	elif n[1] == r:
		print('Shiro')
	else:
		print('Katie')
else:
	print('Draw')


import re
s = []
abc = []
l = []
f = 0
m = 0
r = 0
last = 0
p = ['Kuro', 'Shiro', 'Katie']
n = int(input())
for i in range(3):
	s.append(input())
for i in range(97, 123):
	abc.append(chr(i))
for i in range(65, 91):
	abc.append(chr(i))
for i in range(len(abc)):
	b = len(re.findall(abc[i], s[0]))
	if b > f:
		f = b
if f + n > len(s[0]):
	if f == len(s[0]):
		if n == 1:
			f = len(s[0]) - 1
		else:
			f = len(s[0])
	else:
		f = len(s[0])
else:
	f = f + n
l.append(f)
f = 0
for i in range(len(abc)):
	b = len(re.findall(abc[i], s[1]))
	if b > f:
		f = b
if f + n > len(s[1]):
	if f == len(s[1]):
		if n == 1:
			f = len(s[1]) - 1
		else:
			f = len(s[1])
	else:
		f = len(s[1])
else:
	f = f + n
l.append(f)
f = 0
for i in range(len(abc)):
	b = len(re.findall(abc[i], s[2]))
	if b > f:
		f = b
if f + n > len(s[2]):
	if f == len(s[2]):
		if n == 1:
			f = len(s[2]) - 1
		else:
			f = len(s[2])
	else:
		f = len(s[2])
else:
	f = f + n
l.append(f)
for i in range(len(l)):
	if l[i] > last:
		last = l[i]
		r = i
if last == l[0]:
	m = m + 1
if last == l[1]:
	m = m + 1
if last == l[2]:
	m = m + 1
if m == 1:
	print(p[r])
else:
	print('Draw')


n = int(input())
a = input()
b = input()
c = input()
aa = 26 * [0]
ab = 26 * [0]
ac = 26 * [0]
ba = 26 * [0]
bb = 26 * [0]
bc = 26 * [0]
r = len(a)
for i in range(r):
	if 'a' <= a[i] <= 'z':
		aa[ord(a[i]) % 97] += 1
	else:
		ba[ord(a[i]) % 65] += 1
	if 'a' <= b[i] <= 'z':
		ab[ord(b[i]) % 97] += 1
	else:
		bb[ord(b[i]) % 65] += 1
	if 'a' <= c[i] <= 'z':
		ac[ord(c[i]) % 97] += 1
	else:
		bc[ord(c[i]) % 65] += 1
mq = max(max(aa), max(ba))
mw = max(max(ab), max(bb))
me = max(max(ac), max(bc))
q = min(n + mq, len(a) - 1 if n == 1 and len(a) == mq else len(a))
w = min(n + mw, len(b) - 1 if n == 1 and len(b) == mw else len(b))
e = min(n + me, len(c) - 1 if n == 1 and len(c) == me else len(c))
t = 0
k = max(q, w, e)
if q == k:
	t += 1
if w == k:
	t += 1
if e == k:
	t += 1
if t > 1:
	print('Draw')
elif q == k:
	print('Kuro')
elif w == k:
	print('Shiro')
else:
	print('Katie')


n = int(input())
ku = input()
si = input()
ka = input()

def bu2num(bu):
	dif = ord(bu) - ord('a')
	if dif >= 0 and dif < 26:
		return dif
	else:
		return ord(bu) - ord('A') + 26

def num2bu(num):
	return chr(ord('a') + num if num < 26 else ord('a') + num - 26)

def bus(s):
	x = [0] * 26 * 2
	for bu in s:
		x[bu2num(bu)] += 1
	return x

def mabus(arr):
	max = 0
	for a in arr:
		if a > max:
			max = a
	return max

def calc(s):
	l = len(s)
	m = mabus(bus(s))
	d = m + n
	if m == l and n == 1:
		return l - 1
	elif d <= l:
		return d
	else:
		return l
kun = calc(ku)
sin = calc(si)
kan = calc(ka)
if kun > sin and kun > kan:
	print('Kuro')
elif sin > kun and sin > kan:
	print('Shiro')
elif kan > kun and kan > sin:
	print('Katie')
else:
	print('Draw')


turns = int(input())
s0 = input()
s1 = input()
s2 = input()
d0 = dict()
d1 = dict()
d2 = dict()
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
for char in alphabet:
	d0[char] = 0
	d1[char] = 0
	d2[char] = 0
for char in s0:
	d0[char] += 1
for char in s1:
	d1[char] += 1
for char in s2:
	d2[char] += 1
m0 = max([d0[char] for char in alphabet])
m1 = max([d1[char] for char in alphabet])
m2 = max([d2[char] for char in alphabet])
l0 = len(s0)
l1 = len(s1)
l2 = len(s2)
if turns == 1 and m0 == l0:
	score0 = m0 - 1
else:
	score0 = min(l0, m0 + turns)
if turns == 1 and m1 == l1:
	score1 = m1 - 1
else:
	score1 = min(l1, m1 + turns)
if turns == 1 and m2 == l2:
	score2 = m2 - 1
else:
	score2 = min(l2, m2 + turns)
scores = [score0, score1, score2]
bestscore = max(scores)
winnerlist = [i for i in range(3) if scores[i] == bestscore]
if len(winnerlist) > 1:
	print('Draw')
else:
	print(['Kuro', 'Shiro', 'Katie'][winnerlist[0]])


from sys import stdin
n = int(stdin.readline().strip())
s = [stdin.readline().strip() for i in range(3)]
mx = [1, 1, 1]
for i in range(3):
	d = dict()
	for j in s[i]:
		if j in d:
			d[j] += 1
		else:
			d.update({j: 1})
	for j in d.values():
		if n + j <= len(s[i]):
			mx[i] = max(n + j, mx[i])
		elif j == len(s[i]) and n == 1:
			mx[i] = max(mx[i], len(s[i]) - 1)
		else:
			mx[i] = len(s[i])
y = max(mx)
ans = ['Kuro', 'Shiro', 'Katie']
if mx.count(y) == 1:
	print(ans[mx.index(y)])
else:
	print('Draw')


def beautify(a, n):
	l = len(a)
	if n > l:
		return l
	d = {}
	max = 0
	for x in a:
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
		if d[x] > max:
			max = d[x]
			maxl = x
	if n == 1 and l == max:
		return l - 1
	if n + max >= l:
		return l
	else:
		return n + max
n = int(input())
a = beautify(input(), n)
b = beautify(input(), n)
c = beautify(input(), n)
if a > b and a > c:
	print('Kuro')
elif b > a and b > c:
	print('Shiro')
elif c > a and c > b:
	print('Katie')
elif a == b or b == c or c == a:
	print('Draw')


n = int(input())
scores = []
for _ in range(3):
	letters = {}
	word = input()
	if n >= len(word) - 1 and n > 1:
		print('Draw')
		exit(0)
	for c in word:
		if c in letters:
			letters[c] += 1
		else:
			letters[c] = 1
	scores.append(max(letters.values()) + n)
	if scores[_] > len(word):
		scores[_] = len(word)
	if len(letters) == 1 and n == 1:
		scores[_] = len(word) - 1
if sorted(scores)[2] == sorted(scores)[1]:
	print('Draw')
elif scores[0] == max(scores):
	print('Kuro')
elif scores[1] == max(scores):
	print('Shiro')
else:
	print('Katie')


from collections import Counter
n = int(input())
a = input()
b = input()
c = input()
fa = Counter(a)
fb = Counter(b)
fc = Counter(c)
la = min(fa.most_common(1)[0][1] + n, len(a))
lb = min(fb.most_common(1)[0][1] + n, len(a))
lc = min(fc.most_common(1)[0][1] + n, len(a))
if fa.most_common(1)[0][1] == len(a) and n == 1:
	la = len(a) - 1
if fb.most_common(1)[0][1] == len(b) and n == 1:
	lb = len(b) - 1
if fc.most_common(1)[0][1] == len(c) and n == 1:
	lc = len(c) - 1
if la > max(lb, lc):
	print('Kuro')
elif lb > max(la, lc):
	print('Shiro')
elif lc > max(la, lb):
	print('Katie')
else:
	print('Draw')


from collections import Counter

def bt(x, n):
	v = max(Counter(x).values())
	if v == len(x) and n == 1:
		return v - 1
	else:
		return min(v + n, len(x))
n = int(input())
d = [bt(input(), n) for _ in range(3)]
dm = max(d)
if Counter(d)[dm] > 1:
	print('Draw')
else:
	print(['Kuro', 'Shiro', 'Katie'][d.index(dm)])


s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
n = int(input())
a = input()
b = input()
c = input()
m = len(a)
x = max(map(lambda r: a.count(r), s))
y = max(map(lambda r: b.count(r), s))
z = max(map(lambda r: c.count(r), s))
if n == 1:
	if x == m:
		x -= 1
	else:
		x += 1
	if y == m:
		y -= 1
	else:
		y += 1
	if z == m:
		z -= 1
	else:
		z += 1
else:
	x = min(m, x + n)
	y = min(m, y + n)
	z = min(m, z + n)
mx = max(x, y, z)
if x == mx and y < mx and (z < mx):
	print('Kuro')
elif x < mx and y == mx and (z < mx):
	print('Shiro')
elif x < mx and y < mx and (z == mx):
	print('Katie')
else:
	print('Draw')


n = int(input())
a1 = {}
s = input()
for i in s:
	if i in a1:
		a1[i] += 1
	else:
		a1[i] = 1
a2 = {}
s = input()
for i in s:
	if i in a2:
		a2[i] += 1
	else:
		a2[i] = 1
a3 = {}
s = input()
for i in s:
	if i in a3:
		a3[i] += 1
	else:
		a3[i] = 1
m1 = 0
m2 = 0
m3 = 0
for i in a1:
	if a1[i] > m1:
		m1 = a1[i]
for i in a2:
	if a2[i] > m2:
		m2 = a2[i]
for i in a3:
	if a3[i] > m3:
		m3 = a3[i]
if m1 == len(s) and n == 1:
	m1 = len(s) - 1
else:
	m1 = min(len(s), m1 + n)
if m2 == len(s) and n == 1:
	m2 = len(s) - 1
else:
	m2 = min(len(s), m2 + n)
if m3 == len(s) and n == 1:
	m3 = len(s) - 1
else:
	m3 = min(len(s), m3 + n)
if m1 > m2 and m1 > m3:
	print('Kuro')
elif m2 > m1 and m2 > m3:
	print('Shiro')
elif m3 > m1 and m3 > m2:
	print('Katie')
else:
	print('Draw')


import configparser
import math
import sys
input = sys.stdin.readline

def main():
	n = int(input())
	words = []
	for i in range(3):
		words.append(input().strip())
	best = [-1, -1, -1]
	names = ['Kuro', 'Shiro', 'Katie']
	for i in range(3):
		cur_word = words[i]
		cnt = {}
		for j in cur_word:
			cnt[j] = 1 if j not in cnt else cnt[j] + 1
		cnt['10'] = 0
		for char_cnt in cnt.values():
			left = len(cur_word) - char_cnt
			if left > n:
				best[i] = max(best[i], char_cnt + n)
			elif left == n:
				best[i] = len(cur_word)
			elif left != 0:
				best[i] = len(cur_word)
			elif n > 1:
				best[i] = len(cur_word)
			else:
				best[i] = max(best[i], len(cur_word) - 1)
	best = [(i, best[i]) for i in range(3)]
	best = sorted(best, key=lambda x: x[1])
	if best[-1][1] == best[-2][1]:
		print('Draw')
	else:
		print(names[best[-1][0]])
main()


from collections import Counter

def calc_beautiness(line, moves):
	c = Counter(line)
	mc = c.most_common(1)[0][1]
	beautiness = mc + moves
	if moves == 1 and mc == len(line):
		return len(line) - 1
	return min(beautiness, len(line))

def main():
	moves = int(input())
	ku = input()
	sh = input()
	ka = input()
	ku_beautiness = calc_beautiness(ku, moves)
	sh_beautiness = calc_beautiness(sh, moves)
	ka_beautiness = calc_beautiness(ka, moves)
	if ku_beautiness > sh_beautiness and ku_beautiness > ka_beautiness:
		return 'Kuro'
	if sh_beautiness > ku_beautiness and sh_beautiness > ka_beautiness:
		return 'Shiro'
	if ka_beautiness > sh_beautiness and ka_beautiness > ku_beautiness:
		return 'Katie'
	return 'Draw'
print(main())


import operator
n = int(input())
kuro = input()
shiro = input()
katie = input()
dict_of_res = {'kuro': {}, 'shiro': {}, 'katie': {}}
lenght = len(kuro)
for s in range(0, len(kuro)):
	if kuro[s] in dict_of_res['kuro'].keys():
		dict_of_res['kuro'][kuro[s]] += 1
	elif kuro[s] not in dict_of_res['kuro'].keys():
		dict_of_res['kuro'][kuro[s]] = 1
	if shiro[s] in dict_of_res['shiro'].keys():
		dict_of_res['shiro'][shiro[s]] += 1
	elif shiro[s] not in dict_of_res['shiro'].keys():
		dict_of_res['shiro'][shiro[s]] = 1
	if katie[s] in dict_of_res['katie'].keys():
		dict_of_res['katie'][katie[s]] += 1
	elif katie[s] not in dict_of_res['katie'].keys():
		dict_of_res['katie'][katie[s]] = 1
dict_of_res['kuro'] = sorted(dict_of_res['kuro'].items(), key=operator.itemgetter(1), reverse=True)
dict_of_res['shiro'] = sorted(dict_of_res['shiro'].items(), key=operator.itemgetter(1), reverse=True)
dict_of_res['katie'] = sorted(dict_of_res['katie'].items(), key=operator.itemgetter(1), reverse=True)
max_dict = {'kuro': [], 'shiro': [], 'katie': []}
if n > lenght:
	print('Draw')
	exit()
for pair in dict_of_res['kuro']:
	if pair[1] not in max_dict['kuro']:
		temp_l = lenght - pair[1]
		temp = None
		temp_n = n
		if n == 1 and temp_l == 0:
			temp = lenght - 1
		elif temp_l <= n:
			temp = lenght
		else:
			temp = pair[1] + n
		max_dict['kuro'].append(temp)
	if len(max_dict['kuro']) == 1:
		break
for pair in dict_of_res['shiro']:
	if pair[1] not in max_dict['shiro']:
		temp_l = lenght - pair[1]
		temp = None
		temp_n = n
		if n == 1 and temp_l == 0:
			temp = lenght - 1
		elif temp_l <= n:
			temp = lenght
		else:
			temp = pair[1] + n
		max_dict['shiro'].append(temp)
	if len(max_dict['shiro']) == 1:
		break
for pair in dict_of_res['katie']:
	if pair[1] not in max_dict['katie']:
		temp_l = lenght - pair[1]
		temp = None
		temp_n = n
		if n == 1 and temp_l == 0:
			temp = lenght - 1
		elif temp_l <= n:
			temp = lenght
		else:
			temp = pair[1] + n
		max_dict['katie'].append(temp)
	if len(max_dict['katie']) == 1:
		break
maxr_dict = {}
for (k, v) in max_dict.items():
	maxr_dict[k] = max(v)
same = False
ma_t = max(maxr_dict.items(), key=operator.itemgetter(1))[0]
ma_v = max(maxr_dict.items(), key=operator.itemgetter(1))[1]
if maxr_dict['kuro'] == maxr_dict['shiro'] and maxr_dict['shiro'] == ma_v or (maxr_dict['kuro'] == maxr_dict['katie'] and maxr_dict['katie'] == ma_v) or (maxr_dict['katie'] == maxr_dict['shiro'] and maxr_dict['shiro'] == ma_v):
	same = True
if same:
	print('Draw')
else:
	print(ma_t.capitalize())


n = int(input())
m1 = 0
m2 = 0
m3 = 0
s1 = input()
s2 = input()
s3 = input()
x = len(s1)
for t in 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM':
	m1 = max(m1, s1.count(t))
	m2 = max(m2, s2.count(t))
	m3 = max(m3, s3.count(t))
d = [[m1, 'Kuro'], [m2, 'Shiro'], [m3, 'Katie']]
d.sort()
if d[2][0] == x and n == 1:
	if d[1][0] == x:
		if d[0][0] == x - 1:
			print(d[0][1])
		else:
			print('Draw')
	elif d[1][0] == x - 1:
		if d[0][0] == x - 1:
			print('Draw')
		else:
			print(d[1][1])
	elif d[1][0] == x - 2:
		print('Draw')
	else:
		print(d[2][1])
elif d[1][0] + n >= x:
	print('Draw')
elif m1 > max(m2, m3):
	print('Kuro')
elif m2 > max(m1, m3):
	print('Shiro')
elif m3 > max(m2, m1):
	print('Katie')
else:
	print('Draw')


def gc(a):
	ans = dict()
	for d in a:
		if d in ans.keys():
			ans[d] += 1
		else:
			ans[d] = 1
	return ans[max(ans, key=lambda i: ans[i])]

def f(t, n, s):
	if t == s and n == 1:
		return s - 1
	return min(t + n, s)
n = int(input())
a = input()
b = input()
c = input()
size = len(c)
arr = [f(gc(a), n, size), f(gc(b), n, size), f(gc(c), n, size)]
if arr[0] > arr[1] and arr[0] > arr[2]:
	print('Kuro')
elif arr[1] > arr[0] and arr[1] > arr[2]:
	print('Shiro')
elif arr[2] > arr[1] and arr[2] > arr[0]:
	print('Katie')
else:
	print('Draw')


n = int(input())
p = input()
q = input()
r = input()
(ma, mb, mc) = (0, 0, 0)
(a, b, c) = ({}, {}, {})
for x in p:
	a[x] = 0
for x in q:
	b[x] = 0
for x in r:
	c[x] = 0
for x in p:
	a[x] += 1
	ma = max(ma, a[x])
for x in q:
	b[x] += 1
	mb = max(mb, b[x])
for x in r:
	c[x] += 1
	mc = max(mc, c[x])
if n == 1 and ma == len(p):
	p = p[:-1]
if n == 1 and mb == len(q):
	q = q[:-1]
if n == 1 and mc == len(r):
	r = r[:-1]
ma = min(ma + n, len(p))
mb = min(mb + n, len(q))
mc = min(mc + n, len(r))
if ma > mb and ma > mc:
	print('Kuro')
elif mb > ma and mb > mc:
	print('Shiro')
elif mc > ma and mc > mb:
	print('Katie')
else:
	print('Draw')


from collections import Counter
from sys import stdin

def score_stirng(data, n):
	most_common = [Counter(s).most_common(1)[0][1] for s in data]
	score = [min([n == 1 and score == len(s) - 1 and len(s) - 2 or len(s) - 1, score + n]) for (s, score) in zip(data, most_common)]
	return score
(n, first, second, third) = [stdin.readline(), stdin.readline(), stdin.readline(), stdin.readline()]
s = score_stirng([first, second, third], int(n))
if s[0] > s[1] and s[0] > s[2]:
	print('Kuro')
elif s[1] > s[0] and s[1] > s[2]:
	print('Shiro')
elif s[2] > s[0] and s[2] > s[1]:
	print('Katie')
else:
	print('Draw')


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()]
n = Int()
p1 = input()
p2 = input()
p3 = input()
l = len(p1)
a = l - max(Counter(p1).values())
b = l - max(Counter(p2).values())
c = l - max(Counter(p3).values())
if n <= a:
	a -= n
else:
	a = 0 if n > 1 else 1
if n <= b:
	b -= n
else:
	b = 0 if n > 1 else 1
if n <= c:
	c -= n
else:
	c = 0 if n > 1 else 1
if a < b and a < c:
	print('Kuro')
elif b < a and b < c:
	print('Shiro')
elif c < a and c < b:
	print('Katie')
else:
	print('Draw')


turns = int(input())
pos = ['Kuro', 'Shiro', 'Katie']
beauty = []
for i in range(3):
	s = input()
	l = len(s)
	freq = dict()
	for i in s:
		freq[i] = freq.get(i, 0)
		freq[i] += 1
	ma = max(freq.values())
	cas = [min(turns + ma, l)]
	if turns == 1 and l == ma:
		cas.append(l - 1)
	beauty.append(min(cas))
if beauty.count(max(beauty)) >= 2:
	print('Draw')
else:
	print(pos[beauty.index(max(beauty))])


def ct(s):
	a = [0] * 26 * 2
	for i in s:
		if ord(i) < 97:
			a[ord(i) - 65] += 1
		else:
			a[ord(i) - 97 + 26] += 1
	return max(a)
n = int(input())
s1 = input()
ln = len(s1)
s1 = ct(s1)
s2 = ct(input())
s3 = ct(input())
s = [s1, s2, s3]
for i in range(len(s)):
	if s[i] == ln and n == 1:
		s[i] = ln - 1
	else:
		s[i] = s[i] + n
	if s[i] > ln:
		s[i] = ln
s1 = s[0]
s2 = s[1]
s3 = s[2]
s.sort()
if s[2] == s[1]:
	print('Draw')
elif s[-1] == s1:
	print('Kuro')
elif s[-1] == s2:
	print('Shiro')
elif s[-1] == s3:
	print('Katie')


n = int(input())
s1 = input()
s2 = input()
s3 = input()
k = len(s1)
ss = []
ss.append(sorted(s1))
ss.append(sorted(s2))
ss.append(sorted(s3))
mm = [0] * 3
for i in range(3):
	mmi = 1
	ssi = ss[i]
	for j in range(k - 1):
		if ssi[j] == ssi[j + 1]:
			mmi = mmi + 1
		else:
			mmi = 1
		if mmi > mm[i]:
			mm[i] = mmi
if n == 1:
	for i in range(3):
		if mm[i] == k:
			mm[i] = k - 1
		else:
			mm[i] = mm[i] + n
			if mm[i] > k:
				mm[i] = k
else:
	for i in range(3):
		mm[i] = mm[i] + n
		if mm[i] > k:
			mm[i] = k
mmm = max(mm)
mmn = 0
for i in range(3):
	if mmm == mm[i]:
		mmn = mmn + 1
if mmn > 1:
	print('Draw')
else:
	ind = mm.index(mmm)
	print(['Kuro', 'Shiro', 'Katie'][ind])


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
else:
	_str = str
	str = lambda x=b'': x if type(x) is bytes else _str(x).encode()
from math import ceil, floor, log, sqrt, factorial, pow, pi

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

def fi():
	return float(input())

def si():
	return input()

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

def li():
	return list(mi())
import math

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
import operator

def char_frequency(str1):
	dict = {}
	for n in str1:
		keys = dict.keys()
		if n in keys:
			dict[n] += 1
		else:
			dict[n] = 1
	return max(dict.items(), key=operator.itemgetter(1))[1]

def main():
	n = ii()
	s1 = si()
	s2 = si()
	s3 = si()
	l = len(s1)
	a = char_frequency(s1)
	b = char_frequency(s2)
	c = char_frequency(s3)
	d1 = a
	d2 = b
	d3 = c
	if n > l:
		print('Draw')
		exit()
	a += n
	b += n
	c += n
	if a > l:
		a = l
	if b > l:
		b = l
	if c > l:
		c = l
	if d1 == l and n == 1:
		a = d1 - 1
	if d2 == l and n == 1:
		b = d2 - 1
	if d3 == l and n == 1:
		c = d3 - 1
	if a > b and a > c:
		ans = 'Kuro'
	elif b > c and b > a:
		ans = 'Shiro'
	elif c > a and c > b:
		ans = 'Katie'
	else:
		ans = 'Draw'
	print(ans)
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 _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):
		if self.buffer.tell():
			return self.buffer.read()
		return os.read(self._fd, os.fstat(self._fd).st_size)

	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 print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', b' '), 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', b'\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
input = lambda : sys.stdin.readline().rstrip(b'\r\n')
main()


import itertools

def beauty(string, n):
	string = sorted(string)
	maxlen = 0
	for (k, g) in itertools.groupby(string):
		maxlen = max(maxlen, len(list(g)))
	if maxlen == len(string) and n == 1:
		return maxlen - 1
	else:
		return min(len(string), n + maxlen)
n = int(input())
li = []
li.append((beauty(input(), n), 'Kuro'))
li.append((beauty(input(), n), 'Shiro'))
li.append((beauty(input(), n), 'Katie'))
li.sort(reverse=True)
if li[0][0] == li[1][0]:
	print('Draw')
else:
	print(li[0][1])


n = int(input())
s1 = str(input())
s2 = str(input())
s3 = str(input())
l1 = list(set(s1))
l2 = list(set(s2))
l3 = list(set(s3))
m1 = 0
m2 = 0
m3 = 0
for i in l1:
	m1 = max(m1, s1.count(i))
for i in l2:
	m2 = max(m2, s2.count(i))
for i in l3:
	m3 = max(m3, s3.count(i))
if len(s1) == m1 and n == 1:
	x = len(s1) - 1
elif n >= len(s1) - m1:
	x = len(s1)
else:
	x = m1 + n
if len(s2) == m2 and n == 1:
	y = len(s2) - 1
elif n >= len(s2) - m2:
	y = len(s2)
else:
	y = m2 + n
if len(s3) == m3 and n == 1:
	z = len(s3) - 1
elif n >= len(s3) - m3:
	z = len(s3)
else:
	z = m3 + n
lm = []
lm.append(x)
lm.append(y)
lm.append(z)
if lm.count(max(lm)) >= 2:
	print('Draw')
elif x > y and x > z:
	print('Kuro')
elif y > x and y > z:
	print('Shiro')
elif z > x and z > y:
	print('Katie')


def get_score(s, n):
	freq = [0 for i in range(100)]
	for i in range(len(s)):
		freq[ord(s[i]) - 50] += 1
	if n == 0:
		return max(freq)
	elif n == 1:
		if max(freq) == len(s):
			return len(s) - 1
		else:
			return max(freq) + 1
	else:
		return min(len(s), max(freq) + n)
n = int(input())
s1 = input()
s2 = input()
s3 = input()
sc1 = get_score(s1, n)
sc2 = get_score(s2, n)
sc3 = get_score(s3, n)
if sc1 > sc2 and sc1 > sc3:
	print('Kuro')
elif sc2 > sc1 and sc2 > sc3:
	print('Shiro')
elif sc3 > sc1 and sc3 > sc2:
	print('Katie')
else:
	print('Draw')


from collections import Counter
n = int(input())
kuro_ribbon = input()
shro_ribbon = input()
katy_ribbon = input()
kuro_count = Counter(kuro_ribbon)
shro_count = Counter(shro_ribbon)
katy_count = Counter(katy_ribbon)
kuro_max = min(max(kuro_count.values()) + n, len(kuro_ribbon))
shro_max = min(max(shro_count.values()) + n, len(shro_ribbon))
katy_max = min(max(katy_count.values()) + n, len(katy_ribbon))
if n == 1:
	if len(kuro_count.keys()) == 1:
		kuro_max = len(kuro_ribbon) - 1
	if len(shro_count.keys()) == 1:
		shro_max = len(shro_ribbon) - 1
	if len(katy_count.keys()) == 1:
		katy_max = len(katy_ribbon) - 1
if kuro_max > shro_max and kuro_max > katy_max:
	print('Kuro')
elif shro_max > kuro_max and shro_max > katy_max:
	print('Shiro')
elif katy_max > shro_max and katy_max > kuro_max:
	print('Katie')
else:
	print('Draw')


from collections import Counter
n_turns = int(input())
NAMES = ['Kuro', 'Shiro', 'Katie']
Ribbons = []
for _ in range(3):
	Ribbons.append(list(input()))
n_finals = []
for R in Ribbons:
	freq = max(list(Counter(R).values()))
	if freq == len(R) and n_turns == 1:
		n_final = 1
	else:
		n_final = max(0, len(R) - freq - n_turns)
	n_finals.append(n_final)
sorted_players = sorted(range(3), key=lambda k: n_finals[k])
(first, second, *_) = sorted_players
if n_finals[first] == n_finals[second]:
	ret = 'Draw'
else:
	ret = NAMES[first]
print(ret)


def calc():
	string = input()
	import collections
	stringCounter = collections.Counter(string)
	maxi = max(stringCounter, key=stringCounter.get)
	if n == 1 and stringCounter[maxi] == len(string):
		return len(string) - 1
	return min(len(string), stringCounter[maxi] + n)
n = int(input())
kuro = calc()
shiro = calc()
katie = calc()
if kuro > shiro and kuro > katie:
	print('Kuro')
elif shiro > kuro and shiro > katie:
	print('Shiro')
elif katie > kuro and katie > shiro:
	print('Katie')
else:
	print('Draw')


from collections import Counter
names = ['Kuro', 'Shiro', 'Katie']

def solve(s, n):
	d = Counter(s)
	if len(d) == 1 and n == 1:
		return len(s) - 1
	m = max(d.values())
	return min(m + n, len(s))
n = int(input())
p = []
for _ in range(3):
	p.append(input())
l = sorted([(solve(p[i], n), i) for i in range(len(p))])
if l[2][0] > l[1][0]:
	print(names[l[2][1]])
else:
	print('Draw')


n = int(input())
d1 = {}
d2 = {}
d3 = {}
s = input()
for i in s:
	try:
		d1[i] += 1
	except KeyError:
		d1[i] = 1
s = input()
for i in s:
	try:
		d2[i] += 1
	except KeyError:
		d2[i] = 1
s = input()
for i in s:
	try:
		d3[i] += 1
	except KeyError:
		d3[i] = 1
l = len(s)
n1 = -1
for i in d1:
	n1 = max(n1, d1[i])
n2 = -2
for i in d2:
	n2 = max(n2, d2[i])
n3 = -3
for i in d3:
	n3 = max(n3, d3[i])
if n1 == l:
	if n == 1:
		n1 -= 1
else:
	n1 = min(l, n1 + n)
if n2 == l:
	if n == 1:
		n2 -= 1
else:
	n2 = min(l, n2 + n)
if n3 == l:
	if n == 1:
		n3 -= 1
else:
	n3 = min(l, n3 + n)
if n1 > n2 and n1 > n3:
	print('Kuro')
elif n2 > n1 and n2 > n3:
	print('Shiro')
elif n3 > n1 and n3 > n2:
	print('Katie')
else:
	print('Draw')