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: interview

Starter code:

Solutions:
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]])

#!/usr/bin/env python3

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 list(res.items()):
		if v == bestv:
			print (name)



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



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


s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
n = int(input())

a = input()
b = input()
c = input()

m = len(a)

x = max([a.count(r) for r in s])
y = max([b.count(r) for r in s])
z = max([c.count(r) for r in 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')


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]
#print(s)
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')


    


##////////////////      //////        ///////      //             ///////     //  //   //
##////          //    ///   ///     ///    ///     //            ///  ///     ////     //
##////    ////       ///     ///   ///      ///    //           /////////     ////     ///////
##////     /////    ///       /// ///        ///   //          ///    ///     ////     //   //
##//////////////     ///////////   ///////////     //////     ///     ///     //  //   //   //





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

	# print(ribbons)
	k = solve(n, ribbons)
	print(cats[k])

def __starting_point():
	main()
__starting_point()

def gc(a):
  ans = dict()
  for d in a:
    if d in list(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()); 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')
    else:
        if (d[1][0]==x-1):
            if d[0][0]==x-1:
                print('Draw')
            else:
                print(d[1][1])
        else:
            if d[1][0]==x-2:
                print('Draw')
            else:
                print(d[2][1])
            
elif d[1][0]+n>=x:
    print('Draw')
else:
    if m1>max(m2, m3):
        print('Kuro')
    else:
        if m2>max(m1, m3):
            print('Shiro')
        else:
            if m3>max(m2, m1):
                print('Katie')
            else:
                print('Draw')



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

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


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


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

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

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
else:
    if n == 1:
        maxi1 = len(s1) - 1
    else:
        maxi1 = len(s1)
        
if maxi2 + n <= len(s1):
    maxi2 += n
else:
    if n == 1:
        maxi2 = len(s1) - 1    
    else:
        maxi2 = len(s1)
                
if maxi3 + n <= len(s1):
    maxi3 += n
else:    
    if 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')    


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')
else:
    if kuroans > max(shiroans, katieans):
        print('Kuro')
    elif shiroans > max(kuroans, katieans):
        print('Shiro')
    else:
        print('Katie')

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





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





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)
#print(sc1,sc2,sc3)
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')

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


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

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

    ##if sum(bank[i]) == max(bank[i]):
        ##max(bank)-=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")

else:
    if shiro > kuro and shiro > katie:
        print("Shiro")

    else:
        if katie > kuro and katie > shiro:
            print("Katie")

        else:

            if katie == shiro or katie == kuro or shiro == kuro: ## AT LEAST TWO share ... :(
                print("Draw")


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
    #m1 = max(m1, f(d1[one[i]]))
for i in range(len(one)):
    try:
        d2[two[i]] += 1
    except KeyError:
        d2[two[i]] = 1
    #m2 = max(m2, f(d2[two[i]]))
for i in range(len(one)):
    try:
        d3[thr[i]] += 1
    except KeyError:
        d3[thr[i]] = 1
    #m3 = max(m3, f(d3[thr[i]]))
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]]))
# print(d1, d2, d3)
l = len(one)
#print(m1, m2, m3)
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')

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
    #m1 = max(m1, f(d1[one[i]]))
for i in range(len(one)):
    try:
        d2[two[i]] += 1
    except KeyError:
        d2[two[i]] = 1
    #m2 = max(m2, f(d2[two[i]]))
for i in range(len(one)):
    try:
        d3[thr[i]] += 1
    except KeyError:
        d3[thr[i]] = 1
    #m3 = max(m3, f(d3[thr[i]]))
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]]))
# print(d1, d2, d3)
l = len(one)
#print(m1, m2, m3)
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')