import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author gaidash
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        private int n;

        private int getMax(char[] a) {
            int MAX = 122;
            int length = a.length;
            int[] count = new int[MAX + 1];
            for (char c : a) count[c]++;
            int max = 0;
            for (int num : count) {
                if (num + n <= length) {
                    max = Math.max(max, num + n);
                } else {
                    int left = n - (length - num);
                    max = Math.max(max, n - (left & 1));
                }
            }
            return max;
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            n = in.nextInt();
            char[] kuro = in.nextString().toCharArray();
            char[] shiro = in.nextString().toCharArray();
            char[] katie = in.nextString().toCharArray();

            int maxKuro = getMax(kuro);
            int maxShiro = getMax(shiro);
            int maxKatie = getMax(katie);
            int min = Math.min(Math.min(maxKuro, maxShiro), maxKatie);
            int max = Math.max(Math.max(maxKuro, maxShiro), maxKatie);
            if (min == max) {
                out.print("Draw");
            } else if (max == maxKuro) {
                out.print("Kuro");
            } else if (max == maxShiro) {
                out.print("Shiro");
            } else {
                out.print("Katie");
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void close() {
            writer.close();
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author gaidash
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        private int nMoves;

        private int getMax(char[] a) {
            int MAX = 122;
            int length = a.length;
            int[] count = new int[MAX + 1];
            for (char c : a) count[c]++;
            int max = 0;
            for (int num : count) {
                if (num == 0) continue;
                if (num + nMoves <= length) {
                    max = Math.max(max, num + nMoves);
                } else {
                    int score = length;
                    if (nMoves == 1 && num == length) score--;
                    max = Math.max(max, score);
                }
            }
            return max;
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            nMoves = in.nextInt();
            char[] kuro = in.nextString().toCharArray();
            char[] shiro = in.nextString().toCharArray();
            char[] katie = in.nextString().toCharArray();

            int maxKuro = getMax(kuro);
            int maxShiro = getMax(shiro);
            int maxKatie = getMax(katie);
            int max = Math.max(Math.max(maxKuro, maxShiro), maxKatie);
            int maxCount = (maxKuro == max ? 1 : 0) + (maxShiro == max ? 1 : 0) + (maxKatie == max ? 1 : 0);
            if (maxCount > 1) {
                out.print("Draw");
            } else if (max == maxKuro) {
                out.print("Kuro");
            } else if (max == maxShiro) {
                out.print("Shiro");
            } else {
                out.print("Katie");
            }
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void close() {
            writer.close();
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


//package com.company;
import java.io.*;
//import java.nio.file.Paths;
import java.util.*;
import java.math.*;
public class Main{
    public static void main(String[] args)throws Exception {
        Scanner s = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
     long n=s.nextLong();
     char[] a=s.next().toCharArray();
        char[] b=s.next().toCharArray();long ma=Long.MIN_VALUE;long mb=Long.MIN_VALUE;long mc=Long.MIN_VALUE;
        char[] c=s.next().toCharArray();int[] ca=new int[123];int[] cb=new int[123];int[] cc=new int[123];
    for(int i=0;i<a.length;i++){
        ca[a[i]]++;cb[b[i]]++;cc[c[i]]++;
       ma=Math.max(ca[a[i]],ma);
        mb=Math.max(cb[b[i]],mb);
        mc=Math.max(cc[c[i]],mc);
         }
         int c1=0;
    if(n+ma>=a.length) c1++;
        if(n+mb>=b.length) c1++;
        if(n+mc>=c.length) c1++;
       // System.out.println(ma+" "+mb+" "+mc);
        long m=Math.max(ma,Math.max(mb,mc));int j=0;
        if(m==ma) j++;if(m==mb) j++;if(m==mc) j++;
        if(j>1||(c1>1)){
         System.out.println("Draw");
     }else if(ma>mb&&ma>mc)
         System.out.println("Kuro");
        else if(mb>ma&&mb>mc)
            System.out.println("Shiro");
        else
            System.out.println("Katie");
    }
}


//package com.company;
import java.io.*;
//import java.nio.file.Paths;
import java.util.*;
import java.math.*;
public class Main{
    public static void main(String[] args)throws Exception {
        Scanner s = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        long n=s.nextLong();
        char[] a=s.next().toCharArray();
        char[] b=s.next().toCharArray();long ma=Long.MIN_VALUE;long mb=Long.MIN_VALUE;long mc=Long.MIN_VALUE;
        char[] c=s.next().toCharArray();int[] ca=new int[123];int[] cb=new int[123];int[] cc=new int[123];
        for(int i=0;i<a.length;i++){
            ca[a[i]]++;cb[b[i]]++;cc[c[i]]++;
        ma=Math.max(ma,ca[a[i]]);
            mb=Math.max(mb,cb[b[i]]);
            mc=Math.max(mc,cc[c[i]]);

        }
        if(ma==a.length){
            if((ma+n-a.length)%2!=0){
                ma-=0;
            }
        }else ma=Math.min(ma+n,a.length);
        if(mb==a.length){
            if((mb+n-a.length)%2!=0){
                mb-=0;
            }
        }else mb=Math.min(mb+n,a.length);
        if(mc==a.length){
            if((mc+n-a.length)%2!=0){
                mc-=0;
            }
        }else mc=Math.min(mc+n,a.length);

        int c1=0;
       /* if(n+ma>=a.length) c1++;
        if(n+mb>=b.length) c1++;
        if(n+mc>=c.length) c1++;
       */ // System.out.println(ma+" "+mb+" "+mc);

        long m=Math.max(ma,Math.max(mb,mc));int j=0;
        if(m==ma) j++;if(m==mb) j++;if(m==mc) j++;
        if(j>1){
            System.out.println("Draw");
        }else if(ma>mb&&ma>mc)
            System.out.println("Kuro");
        else if(mb>ma&&mb>mc)
            System.out.println("Shiro");
        else
            System.out.println("Katie");
    }
}


//package com.company;
import java.io.*;
//import java.nio.file.Paths;
import java.util.*;
import java.math.*;
public class Main{
    public static void main(String[] args)throws Exception {
        Scanner s = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        long n=s.nextLong();
        char[] a=s.next().toCharArray();
        char[] b=s.next().toCharArray();long ma=Long.MIN_VALUE;long mb=Long.MIN_VALUE;long mc=Long.MIN_VALUE;
        char[] c=s.next().toCharArray();int[] ca=new int[123];int[] cb=new int[123];int[] cc=new int[123];
        for(int i=0;i<a.length;i++){
            ca[a[i]]++;cb[b[i]]++;cc[c[i]]++;
        ma=Math.max(ma,ca[a[i]]);
            mb=Math.max(mb,cb[b[i]]);
            mc=Math.max(mc,cc[c[i]]);

        }
        if(ma==a.length){
            if((ma+n-a.length)%2!=0){
                ma-=1;
            }
        }else ma=Math.min(ma+n,a.length);
        if(mb==a.length){
            if((mb+n-a.length)%2!=0){
                mb-=1;
            }
        }else mb=Math.min(mb+n,a.length);
        if(mc==a.length){
            if((mc+n-a.length)%2!=0){
                mc-=1;
            }
        }else mc=Math.min(mc+n,a.length);

        int c1=0;
       /* if(n+ma>=a.length) c1++;
        if(n+mb>=b.length) c1++;
        if(n+mc>=c.length) c1++;
       */ // System.out.println(ma+" "+mb+" "+mc);

        long m=Math.max(ma,Math.max(mb,mc));int j=0;
        if(m==ma) j++;if(m==mb) j++;if(m==mc) j++;
        if(j>1){
            System.out.println("Draw");
        }else if(ma>mb&&ma>mc)
            System.out.println("Kuro");
        else if(mb>ma&&mb>mc)
            System.out.println("Shiro");
        else
            System.out.println("Katie");
    }
}


//package com.company;
import java.io.*;
//import java.nio.file.Paths;
import java.util.*;
import java.math.*;
public class Main{
    public static void main(String[] args)throws Exception {
        Scanner s = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        long n=s.nextLong();
        char[] a=s.next().toCharArray();
        char[] b=s.next().toCharArray();long ma=Long.MIN_VALUE;long mb=Long.MIN_VALUE;long mc=Long.MIN_VALUE;
        char[] c=s.next().toCharArray();int[] ca=new int[123];int[] cb=new int[123];int[] cc=new int[123];
        for(int i=0;i<a.length;i++){
            ca[a[i]]++;cb[b[i]]++;cc[c[i]]++;
        ma=Math.max(ma,ca[a[i]]);
            mb=Math.max(ma,ca[a[i]]);
            mc=Math.max(ma,ca[a[i]]);

        }
        if(ma==a.length){
            if((ma+n)%2!=0){
                ma-=1;
            }
        }else ma=Math.min(ma+n,a.length);
        if(mb==a.length){
            if((mb+n)%2!=0){
                mb-=1;
            }
        }else mb=Math.min(mb+n,a.length);
        if(mc==a.length){
            if((mc+n)%2!=0){
                mc-=1;
            }
        }else mc=Math.min(mc+n,a.length);

        int c1=0;
       /* if(n+ma>=a.length) c1++;
        if(n+mb>=b.length) c1++;
        if(n+mc>=c.length) c1++;
       */ // System.out.println(ma+" "+mb+" "+mc);

        long m=Math.max(ma,Math.max(mb,mc));int j=0;
        if(m==ma) j++;if(m==mb) j++;if(m==mc) j++;
        if(j>1){
            System.out.println("Draw");
        }else if(ma>mb&&ma>mc)
            System.out.println("Kuro");
        else if(mb>ma&&mb>mc)
            System.out.println("Shiro");
        else
            System.out.println("Katie");
    }
}


//package com.company;
import java.io.*;
//import java.nio.file.Paths;
import java.util.*;
import java.math.*;
public class Main{
    public static void main(String[] args)throws Exception {
        Scanner s = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        long n=s.nextLong();
        char[] a=s.next().toCharArray();
        char[] b=s.next().toCharArray();long ma=Long.MIN_VALUE;long mb=Long.MIN_VALUE;long mc=Long.MIN_VALUE;
        char[] c=s.next().toCharArray();int[] ca=new int[123];int[] cb=new int[123];int[] cc=new int[123];
        for(int i=0;i<a.length;i++){
            ca[a[i]]++;cb[b[i]]++;cc[c[i]]++;
        }
        int c1=0;
        if(n+ma>=a.length) c1++;
        if(n+mb>=b.length) c1++;
        if(n+mc>=c.length) c1++;
        // System.out.println(ma+" "+mb+" "+mc);
        for(int i=65;i<=90;i++){
            if(ca[i]+n<=a.length){
                ma=Math.max(ca[i]+n,ma);
            }else{
                ma=Math.max(a.length-(ca[i]+n-a.length),ma);
            }   if(cb[i]+n<=a.length){
                mb=Math.max(cb[i]+n,mb);
            }else{
                mb=Math.max(a.length-(cb[i]+n-a.length),mb);
            }   if(cc[i]+n<=a.length){
                mc=Math.max(cc[i]+n,mc);
            }else{
                mc=Math.max(a.length-(cc[i]+n-a.length),mc);
            }
        }for(int i=97;i<123;i++){
            if(ca[i]+n<=a.length){
                ma=Math.max(ca[i]+n,ma);
            }else{
                ma=Math.max(a.length-(ca[i]+n-a.length),ma);
            }   if(cb[i]+n<=a.length){
                mb=Math.max(cb[i]+n,mb);
            }else{
                mb=Math.max(a.length-(cb[i]+n-a.length),mb);
            }   if(cc[i]+n<=a.length){
                mc=Math.max(cc[i]+n,mc);
            }else{
                mc=Math.max(a.length-(cc[i]+n-a.length),mc);
            }
        }
        long m=Math.max(ma,Math.max(mb,mc));int j=0;
        if(m==ma) j++;if(m==mb) j++;if(m==mc) j++;
        if(j>1){
            System.out.println("Draw");
        }else if(ma>mb&&ma>mc)
            System.out.println("Kuro");
        else if(mb>ma&&mb>mc)
            System.out.println("Shiro");
        else
            System.out.println("Katie");
    }
}


//package com.company;
import java.io.*;
//import java.nio.file.Paths;
import java.util.*;
import java.math.*;
public class Main{
    public static void main(String[] args)throws Exception {
        Scanner s = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        long n=s.nextLong();
        char[] a=s.next().toCharArray();
        char[] b=s.next().toCharArray();long ma=Long.MIN_VALUE;long mb=Long.MIN_VALUE;long mc=Long.MIN_VALUE;
        char[] c=s.next().toCharArray();int[] ca=new int[123];int[] cb=new int[123];int[] cc=new int[123];
        for(int i=0;i<a.length;i++){
            ca[a[i]]++;cb[b[i]]++;cc[c[i]]++;
        ma=Math.max(ma,ca[a[i]]);
            mb=Math.max(mb,cb[b[i]]);
            mc=Math.max(mc,cc[c[i]]);

        }
        if(ma==a.length){
            if(n==1){
                ma-=1;
            }
        }else ma=Math.min(ma+n,a.length);
        if(mb==a.length){
            if(n==1){
                mb-=1;
            }
        }else mb=Math.min(mb+n,a.length);
        if(mc==a.length){
            if(n==1){
                mc-=1;
            }
        }else mc=Math.min(mc+n,a.length);

        int c1=0;
       /* if(n+ma>=a.length) c1++;
        if(n+mb>=b.length) c1++;
        if(n+mc>=c.length) c1++;
       */ // System.out.println(ma+" "+mb+" "+mc);

        long m=Math.max(ma,Math.max(mb,mc));int j=0;
        if(m==ma) j++;if(m==mb) j++;if(m==mc) j++;
        if(j>1){
            System.out.println("Draw");
        }else if(ma>mb&&ma>mc)
            System.out.println("Kuro");
        else if(mb>ma&&mb>mc)
            System.out.println("Shiro");
        else
            System.out.println("Katie");
    }
}


//package com.company;
import java.io.*;
//import java.nio.file.Paths;
import java.util.*;
import java.math.*;
public class Main{
    public static void main(String[] args)throws Exception {
        Scanner s = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        long n=s.nextLong();
        char[] a=s.next().toCharArray();
        char[] b=s.next().toCharArray();long ma=Long.MIN_VALUE;long mb=Long.MIN_VALUE;long mc=Long.MIN_VALUE;
        char[] c=s.next().toCharArray();int[] ca=new int[123];int[] cb=new int[123];int[] cc=new int[123];
        for(int i=0;i<a.length;i++){
            ca[a[i]]++;cb[b[i]]++;cc[c[i]]++;
        ma=Math.max(ma,ca[a[i]]);
            mb=Math.max(mb,cb[b[i]]);
            mc=Math.max(mc,cc[c[i]]);

        }
        if(ma==a.length){
            if((ma+n)%2!=0){
                ma-=1;
            }
        }else ma=Math.min(ma+n,a.length);
        if(mb==a.length){
            if((mb+n)%2!=0){
                mb-=1;
            }
        }else mb=Math.min(mb+n,a.length);
        if(mc==a.length){
            if((mc+n)%2!=0){
                mc-=1;
            }
        }else mc=Math.min(mc+n,a.length);

        int c1=0;
       /* if(n+ma>=a.length) c1++;
        if(n+mb>=b.length) c1++;
        if(n+mc>=c.length) c1++;
       */ // System.out.println(ma+" "+mb+" "+mc);

        long m=Math.max(ma,Math.max(mb,mc));int j=0;
        if(m==ma) j++;if(m==mb) j++;if(m==mc) j++;
        if(j>1){
            System.out.println("Draw");
        }else if(ma>mb&&ma>mc)
            System.out.println("Kuro");
        else if(mb>ma&&mb>mc)
            System.out.println("Shiro");
        else
            System.out.println("Katie");
    }
}


import java.io.*;
import java.util.*;

/**
 * Created by hapsi on 11.10.2016.
 */
public class Main {
    private static class FastScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;
        public FastScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }
        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()){
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException ignored){}
            }
            return stringTokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    private static int binarySearch(int []a, int l, int r, int x) {
        // To boxed array
        Integer[] what = Arrays.stream( a ).boxed().toArray( Integer[]::new );
        //Integer[] ever = IntStream.of( data ).boxed().toArray( Integer[]::new );
        return binarySearch(what, l ,r, x);
    }

    private static int binarySearch(Integer []a, int l, int r, int x){
        if (l >= r) return -(l+1);
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x))
            return binarySearch(a, l, m, x);
        else if (a[m] < x)
            return binarySearch(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch2(long []a, int l, int r, long x){
        if (l >= r) {
            if (a.length == 1 && a[0] <= x) {
                return 0;
            }
            else if (l - 1 >= 0 && a[l-1] <= x) {
                return l - 1;
            }
            else if (l < a.length && a[l] <= x){
                return l;
            }
            else if(l + 1 < a.length && a[l+1] <= x) {
                return l+1;
            }
            else if (l >= a.length && a[a.length - 1] <= x) {
                return a.length - 1;
            }
            return -1;
        }
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch2(a, l, m, x);
        else if (a[m] < x)
            return nextSearch2(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch(int []a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch(a, l, m, x);
        else if (a[m] < x || (m < a.length - 1 && a[m+1] == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nextSearch(LinkedList<Integer>a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a.get(m) > x)
            return nextSearch(a, l, m, x);
        else if (a.get(m) < x || (m < a.size() - 1 && a.get(m+1) == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nearestSearch(int []a, int l, int r, int x) {
        if (l >= r) {
            if (a.length == 1) {
                return 0;
            }
            else if (l >= a.length) {
                return a.length - 1;
            }
            else if (l-1 >= 0) {
                int d1 = Math.abs(a[l-1] - x);
                int d2 = Math.abs(a[l] - x);
                if (d1 <= d2) {
                    return l-1;
                }
                return l;
            }
            else {
                return l;
            }
        }
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x)) {
            return nearestSearch(a, l, m, x);
        }
        else if (a[m] < x) {
            return nearestSearch(a, m + 1, r, x);
        }
        return m;
    }

    private static int compareStringNumbers(String a, String b){
        if(a.length() > b.length()){
            return 1;
        }
        else if(a.length() < b.length()){
            return -1;
        }
        for(int i=0;i<a.length();i++){
            if(a.charAt(i) > b.charAt(i)){
                return 1;
            }
            else if(a.charAt(i) < b.charAt(i)){
                return -1;
            }
        }
        return 0;
    }

    private static int gcd (int a, int b) {
        if (b == 0) return a;
        return gcd (b, a % b);
    }

    private static List<Integer> dfs(ArrayList<ArrayList<Integer>>a, boolean used[], int v) {
        used[v] = true;
        List<Integer>path = null;
        for (int i = 0; i < a.get(v).size(); i++) {
            if(!used[a.get(v).get(i)]) {
                if (path == null)
                    path = dfs(a, used, a.get(v).get(i));
                else
                    path.addAll(dfs(a, used, a.get(v).get(i)));
            }
        }
        if (path == null) path = new ArrayList<>(1);
        path.add(0, v);
        return path;
    }

    private static boolean next(int[]a){
        for(int i = a.length-1;i>0;i--){
            for(int j=i-1;j>=0;j--) {
                if (a[i] > a[j]) {
                    int t = a[i];
                    a[i] = a[j];
                    a[j] = t;
                    Arrays.sort(a, j + 1, a.length);
                    return true;
                }
            }
        }
        return false;
    }

    private static class LolStack implements Cloneable {
        private Long a[];
        private int index = -1;
        private long sum = 0;
        public LolStack(){
            a = new Long[100];
        }
        public void push(long x) {
            if (a.length <= index + 1) {
                a = Arrays.copyOf(a, a.length + 20);
            }
            a[++index] = x;
            sum+=x;
        }
        public long pop() {
            sum-=a[index];
            return a[index--];
        }
        public boolean isEmpty(){
            return index < 0;
        }

        public long getSum() {
            return sum;
        }

        @Override
        protected Object clone() throws CloneNotSupportedException {
            LolStack t = (LolStack) super.clone();
            t.a = Arrays.copyOf(a, a.length);
            t.sum = sum;
            t.index = index;
            return t;
        }
    }

    private static class LolQueue {
        int a[];
        int m[];
        int maxSize;
        int top = -1;
        int lower = 0;
        boolean computed = false;
        public LolQueue(int maxSize){
            this.maxSize = maxSize;
            a = new int[maxSize];
            m = new int[maxSize];
        }
        public void push(int x){
            a[++top] = x;
            m[top] = x;
            computed = false;
        }
        public int pop() {
            return a[lower++];
        }
        public int min() {
            if (!computed) {
                for (int i = top - 1; i >= lower; i--) {
                    if (m[i + 1] < m[i]) {
                        m[i] = m[i + 1];
                    }
                }
                computed = true;
            }
            return m[lower];
        }
    }
    @SuppressWarnings("unchecked")
    public static void main(String args[]) throws Exception {
        FastScanner scanner = new FastScanner(System.in);
        PrintWriter printer = new PrintWriter(System.out);
        //scanner = new FastScanner(new FileInputStream("input.txt"));
        //printer = new PrintWriter(new FileOutputStream("output.txt"));
        /*
        int n = scanner.nextInt(), x = scanner.nextInt() - 1, y = scanner.nextInt() - 1;
        ArrayList<ArrayList<Integer>>g = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            g.add(new ArrayList<>());
        }
        for (int i = 0; i < n-1; i++) {
            int a = scanner.nextInt() - 1, b = scanner.nextInt() - 1;
            g.get(a).add(b);
            g.get(b).add(a);
        }
        printer.println(g);
        for (int i = 0; i < n; i++) {
            ArrayList<Integer>path = (ArrayList<Integer>) dfs(g, new boolean[g.size()], i);
            for (int j = path.size() - 2; j >= 0; j--) {
                if(!g.get(path.get(j)).contains(path.get(j+1))){
                    path.add(j+1,path.get(j-1));
                }
            }
            printer.println(i + " " + path);
        }
        */
        int n = scanner.nextInt();
        Map<Character, Integer>c1 = new HashMap<>();
        Map<Character, Integer>c2 = new HashMap<>();
        Map<Character, Integer>c3 = new HashMap<>();
        String s1 = scanner.next();
        String s2 = scanner.next();
        String s3 = scanner.next();
        for (int i = 0; i < s1.length(); i++) {
            c1.put(s1.charAt(i), c1.getOrDefault(s1.charAt(i), 0) + 1);
            c2.put(s2.charAt(i), c2.getOrDefault(s2.charAt(i), 0) + 1);
            c3.put(s3.charAt(i), c3.getOrDefault(s3.charAt(i), 0) + 1);
        }
        int max1 = f(c1, n, s1.length());
        int max2 = f(c2, n, s2.length());
        int max3 = f(c3, n, s3.length());

        //printer.println(c1 + " " + max1);
        //printer.println(c2 + " " + max2);
        //printer.println(c3 + " " + max3);
        if (max1 > max2 && max1 > max3){
            printer.println("Kuro");
        }
        else if(max2 > max1 && max2 > max3){
            printer.println("Shiro");
        }
        else if(max3 > max1 && max3 > max2) {
            printer.println("Katie");
        }
        else{
            printer.println("Draw");
        }
        printer.close();
    }
    private static int f(Map<Character, Integer>c1, int n, int sLength){
        int max1 = Integer.MIN_VALUE;
        for (Map.Entry<Character, Integer>c: c1.entrySet()) {
            int k = c.getValue();
            if (k + n > sLength) {
                if (k == sLength) {
                    if (n % 2 == 0) {
                        max1 = sLength;
                    } else {
                        if (n >= sLength) {
                            max1 = sLength;
                        }
                        else {
                            if (n == 1) {
                                max1 = Math.max(max1, sLength - 1);
                            }
                            else {
                                max1 = sLength;
                            }
                        }
                    }
                }
                else {
                    max1 = sLength;
                }
            }
            else {
                max1 = Math.max(max1, k + n);
            }
            if(max1 == sLength){
                break;
            }
        }
        return max1;
    }
}


import java.io.*;
import java.util.*;

/**
 * Created by hapsi on 11.10.2016.
 */
public class Main {
    private static class FastScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;
        public FastScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }
        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()){
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException ignored){}
            }
            return stringTokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    private static int binarySearch(int []a, int l, int r, int x) {
        // To boxed array
        Integer[] what = Arrays.stream( a ).boxed().toArray( Integer[]::new );
        //Integer[] ever = IntStream.of( data ).boxed().toArray( Integer[]::new );
        return binarySearch(what, l ,r, x);
    }

    private static int binarySearch(Integer []a, int l, int r, int x){
        if (l >= r) return -(l+1);
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x))
            return binarySearch(a, l, m, x);
        else if (a[m] < x)
            return binarySearch(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch2(long []a, int l, int r, long x){
        if (l >= r) {
            if (a.length == 1 && a[0] <= x) {
                return 0;
            }
            else if (l - 1 >= 0 && a[l-1] <= x) {
                return l - 1;
            }
            else if (l < a.length && a[l] <= x){
                return l;
            }
            else if(l + 1 < a.length && a[l+1] <= x) {
                return l+1;
            }
            else if (l >= a.length && a[a.length - 1] <= x) {
                return a.length - 1;
            }
            return -1;
        }
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch2(a, l, m, x);
        else if (a[m] < x)
            return nextSearch2(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch(int []a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch(a, l, m, x);
        else if (a[m] < x || (m < a.length - 1 && a[m+1] == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nextSearch(LinkedList<Integer>a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a.get(m) > x)
            return nextSearch(a, l, m, x);
        else if (a.get(m) < x || (m < a.size() - 1 && a.get(m+1) == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nearestSearch(int []a, int l, int r, int x) {
        if (l >= r) {
            if (a.length == 1) {
                return 0;
            }
            else if (l >= a.length) {
                return a.length - 1;
            }
            else if (l-1 >= 0) {
                int d1 = Math.abs(a[l-1] - x);
                int d2 = Math.abs(a[l] - x);
                if (d1 <= d2) {
                    return l-1;
                }
                return l;
            }
            else {
                return l;
            }
        }
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x)) {
            return nearestSearch(a, l, m, x);
        }
        else if (a[m] < x) {
            return nearestSearch(a, m + 1, r, x);
        }
        return m;
    }

    private static int compareStringNumbers(String a, String b){
        if(a.length() > b.length()){
            return 1;
        }
        else if(a.length() < b.length()){
            return -1;
        }
        for(int i=0;i<a.length();i++){
            if(a.charAt(i) > b.charAt(i)){
                return 1;
            }
            else if(a.charAt(i) < b.charAt(i)){
                return -1;
            }
        }
        return 0;
    }

    private static int gcd (int a, int b) {
        if (b == 0) return a;
        return gcd (b, a % b);
    }

    private static List<Integer> dfs(ArrayList<ArrayList<Integer>>a, boolean used[], int v) {
        used[v] = true;
        List<Integer>path = null;
        for (int i = 0; i < a.get(v).size(); i++) {
            if(!used[a.get(v).get(i)]) {
                if (path == null)
                    path = dfs(a, used, a.get(v).get(i));
                else
                    path.addAll(dfs(a, used, a.get(v).get(i)));
            }
        }
        if (path == null) path = new ArrayList<>(1);
        path.add(v);
        return path;
    }

    private static boolean next(int[]a){
        for(int i = a.length-1;i>0;i--){
            for(int j=i-1;j>=0;j--) {
                if (a[i] > a[j]) {
                    int t = a[i];
                    a[i] = a[j];
                    a[j] = t;
                    Arrays.sort(a, j + 1, a.length);
                    return true;
                }
            }
        }
        return false;
    }

    private static class LolStack implements Cloneable {
        private Long a[];
        private int index = -1;
        private long sum = 0;
        public LolStack(){
            a = new Long[100];
        }
        public void push(long x) {
            if (a.length <= index + 1) {
                a = Arrays.copyOf(a, a.length + 20);
            }
            a[++index] = x;
            sum+=x;
        }
        public long pop() {
            sum-=a[index];
            return a[index--];
        }
        public boolean isEmpty(){
            return index < 0;
        }

        public long getSum() {
            return sum;
        }

        @Override
        protected Object clone() throws CloneNotSupportedException {
            LolStack t = (LolStack) super.clone();
            t.a = Arrays.copyOf(a, a.length);
            t.sum = sum;
            t.index = index;
            return t;
        }
    }

    private static class LolQueue {
        int a[];
        int m[];
        int maxSize;
        int top = -1;
        int lower = 0;
        boolean computed = false;
        public LolQueue(int maxSize){
            this.maxSize = maxSize;
            a = new int[maxSize];
            m = new int[maxSize];
        }
        public void push(int x){
            a[++top] = x;
            m[top] = x;
            computed = false;
        }
        public int pop() {
            return a[lower++];
        }
        public int min() {
            if (!computed) {
                for (int i = top - 1; i >= lower; i--) {
                    if (m[i + 1] < m[i]) {
                        m[i] = m[i + 1];
                    }
                }
                computed = true;
            }
            return m[lower];
        }
    }
    @SuppressWarnings("unchecked")
    public static void main(String args[]) throws Exception {
        FastScanner scanner = new FastScanner(System.in);
        PrintWriter printer = new PrintWriter(System.out);
        //scanner = new FastScanner(new FileInputStream("input.txt"));
        //printer = new PrintWriter(new FileOutputStream("output.txt"));
        /*
        int n = scanner.nextInt(), x = scanner.nextInt() - 1, y = scanner.nextInt() - 1;
        ArrayList<ArrayList<Integer>>g = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            g.add(new ArrayList<>());
        }
        for (int i = 0; i < n-1; i++) {
            int a = scanner.nextInt() - 1, b = scanner.nextInt() - 1;
            g.get(a).add(b);
            g.get(b).add(a);
        }
        printer.println(g);
        printer.println(dfs(g, new boolean[g.size()], 0));
        */

        int n = scanner.nextInt();
        Map<Character, Integer>c1 = new HashMap<>();
        Map<Character, Integer>c2 = new HashMap<>();
        Map<Character, Integer>c3 = new HashMap<>();
        String s1 = scanner.next();
        String s2 = scanner.next();
        String s3 = scanner.next();
        for (int i = 0; i < s1.length(); i++) {
            c1.put(s1.charAt(i), c1.getOrDefault(s1.charAt(i), 0) + 1);
            c2.put(s2.charAt(i), c2.getOrDefault(s2.charAt(i), 0) + 1);
            c3.put(s3.charAt(i), c3.getOrDefault(s3.charAt(i), 0) + 1);
        }
        int max1 = f(c1, n, s1.length());
        int max2 = f(c2, n, s2.length());
        int max3 = f(c3, n, s3.length());

        //printer.println(c1 + " " + max1);
        //printer.println(c2 + " " + max2);
        //printer.println(c3 + " " + max3);
        if (max1 > max2 && max1 > max3){
            printer.println("Kuro");
        }
        else if(max2 > max1 && max2 > max3){
            printer.println("Shiro");
        }
        else if(max3 > max1 && max3 > max2) {
            printer.println("Katie");
        }
        else{
            printer.println("Draw");
        }

        printer.close();
    }
    private static int f(Map<Character, Integer>c1, int n, int sLength){
        int max1 = Integer.MIN_VALUE;
        for (Map.Entry<Character, Integer>c: c1.entrySet()) {
            int k = c.getValue();
            if (k + n > sLength) {
                if (k == sLength) {
                    int t = (k + n) - sLength;
                    if (t % 2 == 0) {
                        max1 = sLength;
                    } else {
                        max1 = Math.max(max1, sLength - 1);
                    }
                }
                else {
                    max1 = sLength;
                }
            }
            else {
                max1 = Math.max(max1, k + n);
            }
            if(max1 == sLength){
                break;
            }
        }
        return max1;
    }
}


import java.io.*;
import java.util.*;

/**
 * Created by hapsi on 11.10.2016.
 */
public class Main {
    private static class FastScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;
        public FastScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }
        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()){
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException ignored){}
            }
            return stringTokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    private static int binarySearch(int []a, int l, int r, int x) {
        // To boxed array
        Integer[] what = Arrays.stream( a ).boxed().toArray( Integer[]::new );
        //Integer[] ever = IntStream.of( data ).boxed().toArray( Integer[]::new );
        return binarySearch(what, l ,r, x);
    }

    private static int binarySearch(Integer []a, int l, int r, int x){
        if (l >= r) return -(l+1);
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x))
            return binarySearch(a, l, m, x);
        else if (a[m] < x)
            return binarySearch(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch2(long []a, int l, int r, long x){
        if (l >= r) {
            if (a.length == 1 && a[0] <= x) {
                return 0;
            }
            else if (l - 1 >= 0 && a[l-1] <= x) {
                return l - 1;
            }
            else if (l < a.length && a[l] <= x){
                return l;
            }
            else if(l + 1 < a.length && a[l+1] <= x) {
                return l+1;
            }
            else if (l >= a.length && a[a.length - 1] <= x) {
                return a.length - 1;
            }
            return -1;
        }
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch2(a, l, m, x);
        else if (a[m] < x)
            return nextSearch2(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch(int []a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch(a, l, m, x);
        else if (a[m] < x || (m < a.length - 1 && a[m+1] == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nextSearch(LinkedList<Integer>a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a.get(m) > x)
            return nextSearch(a, l, m, x);
        else if (a.get(m) < x || (m < a.size() - 1 && a.get(m+1) == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nearestSearch(int []a, int l, int r, int x) {
        if (l >= r) {
            if (a.length == 1) {
                return 0;
            }
            else if (l >= a.length) {
                return a.length - 1;
            }
            else if (l-1 >= 0) {
                int d1 = Math.abs(a[l-1] - x);
                int d2 = Math.abs(a[l] - x);
                if (d1 <= d2) {
                    return l-1;
                }
                return l;
            }
            else {
                return l;
            }
        }
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x)) {
            return nearestSearch(a, l, m, x);
        }
        else if (a[m] < x) {
            return nearestSearch(a, m + 1, r, x);
        }
        return m;
    }

    private static int compareStringNumbers(String a, String b){
        if(a.length() > b.length()){
            return 1;
        }
        else if(a.length() < b.length()){
            return -1;
        }
        for(int i=0;i<a.length();i++){
            if(a.charAt(i) > b.charAt(i)){
                return 1;
            }
            else if(a.charAt(i) < b.charAt(i)){
                return -1;
            }
        }
        return 0;
    }

    private static int gcd (int a, int b) {
        if (b == 0) return a;
        return gcd (b, a % b);
    }

    private static List<Integer> dfs(ArrayList<ArrayList<Integer>>a, boolean used[], int v) {
        used[v] = true;
        List<Integer>path = null;
        for (int i = 0; i < a.get(v).size(); i++) {
            if(!used[a.get(v).get(i)]) {
                if (path == null)
                    path = dfs(a, used, a.get(v).get(i));
                else
                    path.addAll(dfs(a, used, a.get(v).get(i)));
            }
        }
        if (path == null) path = new ArrayList<>(1);
        path.add(v);
        return path;
    }

    private static boolean next(int[]a){
        for(int i = a.length-1;i>0;i--){
            for(int j=i-1;j>=0;j--) {
                if (a[i] > a[j]) {
                    int t = a[i];
                    a[i] = a[j];
                    a[j] = t;
                    Arrays.sort(a, j + 1, a.length);
                    return true;
                }
            }
        }
        return false;
    }

    private static class LolStack implements Cloneable {
        private Long a[];
        private int index = -1;
        private long sum = 0;
        public LolStack(){
            a = new Long[100];
        }
        public void push(long x) {
            if (a.length <= index + 1) {
                a = Arrays.copyOf(a, a.length + 20);
            }
            a[++index] = x;
            sum+=x;
        }
        public long pop() {
            sum-=a[index];
            return a[index--];
        }
        public boolean isEmpty(){
            return index < 0;
        }

        public long getSum() {
            return sum;
        }

        @Override
        protected Object clone() throws CloneNotSupportedException {
            LolStack t = (LolStack) super.clone();
            t.a = Arrays.copyOf(a, a.length);
            t.sum = sum;
            t.index = index;
            return t;
        }
    }

    private static class LolQueue {
        int a[];
        int m[];
        int maxSize;
        int top = -1;
        int lower = 0;
        boolean computed = false;
        public LolQueue(int maxSize){
            this.maxSize = maxSize;
            a = new int[maxSize];
            m = new int[maxSize];
        }
        public void push(int x){
            a[++top] = x;
            m[top] = x;
            computed = false;
        }
        public int pop() {
            return a[lower++];
        }
        public int min() {
            if (!computed) {
                for (int i = top - 1; i >= lower; i--) {
                    if (m[i + 1] < m[i]) {
                        m[i] = m[i + 1];
                    }
                }
                computed = true;
            }
            return m[lower];
        }
    }
    @SuppressWarnings("unchecked")
    public static void main(String args[]) throws Exception {
        FastScanner scanner = new FastScanner(System.in);
        PrintWriter printer = new PrintWriter(System.out);
        //scanner = new FastScanner(new FileInputStream("input.txt"));
        //printer = new PrintWriter(new FileOutputStream("output.txt"));
        int n = scanner.nextInt();
        Map<Character, Integer>c1 = new HashMap<>();
        Map<Character, Integer>c2 = new HashMap<>();
        Map<Character, Integer>c3 = new HashMap<>();
        String s1 = scanner.next();
        String s2 = scanner.next();
        String s3 = scanner.next();
        for (int i = 0; i < s1.length(); i++) {
            c1.put(s1.charAt(i), c1.getOrDefault(s1.charAt(i), 0) + 1);
            c2.put(s2.charAt(i), c2.getOrDefault(s2.charAt(i), 0) + 1);
            c3.put(s3.charAt(i), c3.getOrDefault(s3.charAt(i), 0) + 1);
        }
        int max1 = f(c1, n, s1.length());
        int max2 = f(c2, n, s2.length());
        int max3 = f(c3, n, s3.length());

        //printer.println(c1 + " " + max1);
        //printer.println(c2 + " " + max2);
        //printer.println(c3 + " " + max3);
        if (max1 > max2 && max1 > max3){
            printer.println("Kuro");
        }
        else if(max2 > max1 && max2 > max3){
            printer.println("Shiro");
        }
        else if(max3 > max1 && max3 > max2) {
            printer.println("Katie");
        }
        else{
            printer.println("Draw");
        }
        printer.close();
    }
    private static int f(Map<Character, Integer>c1, int n, int sLength){
        int max1 = Integer.MIN_VALUE;
        for (Map.Entry<Character, Integer>c: c1.entrySet()) {
            int k = c.getValue();
            if (k + n > sLength) {
                int t = (k + n) - sLength;
                if(t%2==0){
                    max1 = sLength;
                }
                else {
                    max1 = Math.max(max1, sLength - 1);
                }
            }
            else {
                max1 = Math.max(max1, k + n);
            }
            if(max1 == sLength){
                break;
            }
        }
        return max1;
    }
}


import java.io.*;
import java.util.*;

/**
 * Created by hapsi on 11.10.2016.
 */
public class Main {
    private static class FastScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;
        public FastScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }
        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()){
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException ignored){}
            }
            return stringTokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    private static int binarySearch(int []a, int l, int r, int x) {
        // To boxed array
        Integer[] what = Arrays.stream( a ).boxed().toArray( Integer[]::new );
        //Integer[] ever = IntStream.of( data ).boxed().toArray( Integer[]::new );
        return binarySearch(what, l ,r, x);
    }

    private static int binarySearch(Integer []a, int l, int r, int x){
        if (l >= r) return -(l+1);
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x))
            return binarySearch(a, l, m, x);
        else if (a[m] < x)
            return binarySearch(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch2(long []a, int l, int r, long x){
        if (l >= r) {
            if (a.length == 1 && a[0] <= x) {
                return 0;
            }
            else if (l - 1 >= 0 && a[l-1] <= x) {
                return l - 1;
            }
            else if (l < a.length && a[l] <= x){
                return l;
            }
            else if(l + 1 < a.length && a[l+1] <= x) {
                return l+1;
            }
            else if (l >= a.length && a[a.length - 1] <= x) {
                return a.length - 1;
            }
            return -1;
        }
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch2(a, l, m, x);
        else if (a[m] < x)
            return nextSearch2(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch(int []a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch(a, l, m, x);
        else if (a[m] < x || (m < a.length - 1 && a[m+1] == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nextSearch(LinkedList<Integer>a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a.get(m) > x)
            return nextSearch(a, l, m, x);
        else if (a.get(m) < x || (m < a.size() - 1 && a.get(m+1) == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nearestSearch(int []a, int l, int r, int x) {
        if (l >= r) {
            if (a.length == 1) {
                return 0;
            }
            else if (l >= a.length) {
                return a.length - 1;
            }
            else if (l-1 >= 0) {
                int d1 = Math.abs(a[l-1] - x);
                int d2 = Math.abs(a[l] - x);
                if (d1 <= d2) {
                    return l-1;
                }
                return l;
            }
            else {
                return l;
            }
        }
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x)) {
            return nearestSearch(a, l, m, x);
        }
        else if (a[m] < x) {
            return nearestSearch(a, m + 1, r, x);
        }
        return m;
    }

    private static int compareStringNumbers(String a, String b){
        if(a.length() > b.length()){
            return 1;
        }
        else if(a.length() < b.length()){
            return -1;
        }
        for(int i=0;i<a.length();i++){
            if(a.charAt(i) > b.charAt(i)){
                return 1;
            }
            else if(a.charAt(i) < b.charAt(i)){
                return -1;
            }
        }
        return 0;
    }

    private static int gcd (int a, int b) {
        if (b == 0) return a;
        return gcd (b, a % b);
    }

    private static List<Integer> dfs(ArrayList<ArrayList<Integer>>a, boolean used[], int v) {
        used[v] = true;
        List<Integer>path = null;
        for (int i = 0; i < a.get(v).size(); i++) {
            if(!used[a.get(v).get(i)]) {
                if (path == null)
                    path = dfs(a, used, a.get(v).get(i));
                else
                    path.addAll(dfs(a, used, a.get(v).get(i)));
            }
        }
        if (path == null) path = new ArrayList<>(1);
        path.add(0, v);
        return path;
    }

    private static boolean next(int[]a){
        for(int i = a.length-1;i>0;i--){
            for(int j=i-1;j>=0;j--) {
                if (a[i] > a[j]) {
                    int t = a[i];
                    a[i] = a[j];
                    a[j] = t;
                    Arrays.sort(a, j + 1, a.length);
                    return true;
                }
            }
        }
        return false;
    }

    private static class LolStack implements Cloneable {
        private Long a[];
        private int index = -1;
        private long sum = 0;
        public LolStack(){
            a = new Long[100];
        }
        public void push(long x) {
            if (a.length <= index + 1) {
                a = Arrays.copyOf(a, a.length + 20);
            }
            a[++index] = x;
            sum+=x;
        }
        public long pop() {
            sum-=a[index];
            return a[index--];
        }
        public boolean isEmpty(){
            return index < 0;
        }

        public long getSum() {
            return sum;
        }

        @Override
        protected Object clone() throws CloneNotSupportedException {
            LolStack t = (LolStack) super.clone();
            t.a = Arrays.copyOf(a, a.length);
            t.sum = sum;
            t.index = index;
            return t;
        }
    }

    private static class LolQueue {
        int a[];
        int m[];
        int maxSize;
        int top = -1;
        int lower = 0;
        boolean computed = false;
        public LolQueue(int maxSize){
            this.maxSize = maxSize;
            a = new int[maxSize];
            m = new int[maxSize];
        }
        public void push(int x){
            a[++top] = x;
            m[top] = x;
            computed = false;
        }
        public int pop() {
            return a[lower++];
        }
        public int min() {
            if (!computed) {
                for (int i = top - 1; i >= lower; i--) {
                    if (m[i + 1] < m[i]) {
                        m[i] = m[i + 1];
                    }
                }
                computed = true;
            }
            return m[lower];
        }
    }
    @SuppressWarnings("unchecked")
    public static void main(String args[]) throws Exception {
        FastScanner scanner = new FastScanner(System.in);
        PrintWriter printer = new PrintWriter(System.out);
        //scanner = new FastScanner(new FileInputStream("input.txt"));
        //printer = new PrintWriter(new FileOutputStream("output.txt"));
        /*
        int n = scanner.nextInt(), x = scanner.nextInt() - 1, y = scanner.nextInt() - 1;
        ArrayList<ArrayList<Integer>>g = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            g.add(new ArrayList<>());
        }
        for (int i = 0; i < n-1; i++) {
            int a = scanner.nextInt() - 1, b = scanner.nextInt() - 1;
            g.get(a).add(b);
            g.get(b).add(a);
        }
        printer.println(g);
        for (int i = 0; i < n; i++) {
            ArrayList<Integer>path = (ArrayList<Integer>) dfs(g, new boolean[g.size()], i);
            for (int j = path.size() - 2; j >= 0; j--) {
                if(!g.get(path.get(j)).contains(path.get(j+1))){
                    path.add(j+1,path.get(j-1));
                }
            }
            printer.println(i + " " + path);
        }
        */
        int n = scanner.nextInt();
        Map<Character, Integer>c1 = new HashMap<>();
        Map<Character, Integer>c2 = new HashMap<>();
        Map<Character, Integer>c3 = new HashMap<>();
        String s1 = scanner.next();
        String s2 = scanner.next();
        String s3 = scanner.next();
        for (int i = 0; i < s1.length(); i++) {
            c1.put(s1.charAt(i), c1.getOrDefault(s1.charAt(i), 0) + 1);
            c2.put(s2.charAt(i), c2.getOrDefault(s2.charAt(i), 0) + 1);
            c3.put(s3.charAt(i), c3.getOrDefault(s3.charAt(i), 0) + 1);
        }
        int max1 = f(c1, n, s1.length());
        int max2 = f(c2, n, s2.length());
        int max3 = f(c3, n, s3.length());

        //printer.println(c1 + " " + max1);
        //printer.println(c2 + " " + max2);
        //printer.println(c3 + " " + max3);
        if (max1 > max2 && max1 > max3){
            printer.println("Kuro");
        }
        else if(max2 > max1 && max2 > max3){
            printer.println("Shiro");
        }
        else if(max3 > max1 && max3 > max2) {
            printer.println("Katie");
        }
        else{
            printer.println("Draw");
        }
        printer.close();
    }
    private static int f(Map<Character, Integer>c1, int n, int sLength){
        int max1 = Integer.MIN_VALUE;
        for (Map.Entry<Character, Integer>c: c1.entrySet()) {
            int k = c.getValue();
            if (k + n > sLength) {
                if (k == sLength) {
                    if (n % 2 == 0) {
                        max1 = sLength;
                    } else {
                        if (n >= sLength) {
                            max1 = sLength;
                        }
                        else {
                            max1 = sLength;
                        }
                    }
                }
                else {
                    max1 = sLength;
                }
            }
            else {
                max1 = Math.max(max1, k + n);
            }
            if(max1 == sLength){
                break;
            }
        }
        return max1;
    }
}


import java.io.*;
import java.util.*;

/**
 * Created by hapsi on 11.10.2016.
 */
public class Main {
    private static class FastScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;
        public FastScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }
        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()){
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException ignored){}
            }
            return stringTokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    private static int binarySearch(int []a, int l, int r, int x) {
        // To boxed array
        Integer[] what = Arrays.stream( a ).boxed().toArray( Integer[]::new );
        //Integer[] ever = IntStream.of( data ).boxed().toArray( Integer[]::new );
        return binarySearch(what, l ,r, x);
    }

    private static int binarySearch(Integer []a, int l, int r, int x){
        if (l >= r) return -(l+1);
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x))
            return binarySearch(a, l, m, x);
        else if (a[m] < x)
            return binarySearch(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch2(long []a, int l, int r, long x){
        if (l >= r) {
            if (a.length == 1 && a[0] <= x) {
                return 0;
            }
            else if (l - 1 >= 0 && a[l-1] <= x) {
                return l - 1;
            }
            else if (l < a.length && a[l] <= x){
                return l;
            }
            else if(l + 1 < a.length && a[l+1] <= x) {
                return l+1;
            }
            else if (l >= a.length && a[a.length - 1] <= x) {
                return a.length - 1;
            }
            return -1;
        }
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch2(a, l, m, x);
        else if (a[m] < x)
            return nextSearch2(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch(int []a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch(a, l, m, x);
        else if (a[m] < x || (m < a.length - 1 && a[m+1] == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nextSearch(LinkedList<Integer>a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a.get(m) > x)
            return nextSearch(a, l, m, x);
        else if (a.get(m) < x || (m < a.size() - 1 && a.get(m+1) == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nearestSearch(int []a, int l, int r, int x) {
        if (l >= r) {
            if (a.length == 1) {
                return 0;
            }
            else if (l >= a.length) {
                return a.length - 1;
            }
            else if (l-1 >= 0) {
                int d1 = Math.abs(a[l-1] - x);
                int d2 = Math.abs(a[l] - x);
                if (d1 <= d2) {
                    return l-1;
                }
                return l;
            }
            else {
                return l;
            }
        }
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x)) {
            return nearestSearch(a, l, m, x);
        }
        else if (a[m] < x) {
            return nearestSearch(a, m + 1, r, x);
        }
        return m;
    }

    private static int compareStringNumbers(String a, String b){
        if(a.length() > b.length()){
            return 1;
        }
        else if(a.length() < b.length()){
            return -1;
        }
        for(int i=0;i<a.length();i++){
            if(a.charAt(i) > b.charAt(i)){
                return 1;
            }
            else if(a.charAt(i) < b.charAt(i)){
                return -1;
            }
        }
        return 0;
    }

    private static int gcd (int a, int b) {
        if (b == 0) return a;
        return gcd (b, a % b);
    }

    private static List<Integer> dfs(ArrayList<ArrayList<Integer>>a, boolean used[], int v) {
        used[v] = true;
        List<Integer>path = null;
        for (int i = 0; i < a.get(v).size(); i++) {
            if(!used[a.get(v).get(i)]) {
                if (path == null)
                    path = dfs(a, used, a.get(v).get(i));
                else
                    path.addAll(dfs(a, used, a.get(v).get(i)));
            }
        }
        if (path == null) path = new ArrayList<>(1);
        path.add(0, v);
        return path;
    }

    private static boolean next(int[]a){
        for(int i = a.length-1;i>0;i--){
            for(int j=i-1;j>=0;j--) {
                if (a[i] > a[j]) {
                    int t = a[i];
                    a[i] = a[j];
                    a[j] = t;
                    Arrays.sort(a, j + 1, a.length);
                    return true;
                }
            }
        }
        return false;
    }

    private static class LolStack implements Cloneable {
        private Long a[];
        private int index = -1;
        private long sum = 0;
        public LolStack(){
            a = new Long[100];
        }
        public void push(long x) {
            if (a.length <= index + 1) {
                a = Arrays.copyOf(a, a.length + 20);
            }
            a[++index] = x;
            sum+=x;
        }
        public long pop() {
            sum-=a[index];
            return a[index--];
        }
        public boolean isEmpty(){
            return index < 0;
        }

        public long getSum() {
            return sum;
        }

        @Override
        protected Object clone() throws CloneNotSupportedException {
            LolStack t = (LolStack) super.clone();
            t.a = Arrays.copyOf(a, a.length);
            t.sum = sum;
            t.index = index;
            return t;
        }
    }

    private static class LolQueue {
        int a[];
        int m[];
        int maxSize;
        int top = -1;
        int lower = 0;
        boolean computed = false;
        public LolQueue(int maxSize){
            this.maxSize = maxSize;
            a = new int[maxSize];
            m = new int[maxSize];
        }
        public void push(int x){
            a[++top] = x;
            m[top] = x;
            computed = false;
        }
        public int pop() {
            return a[lower++];
        }
        public int min() {
            if (!computed) {
                for (int i = top - 1; i >= lower; i--) {
                    if (m[i + 1] < m[i]) {
                        m[i] = m[i + 1];
                    }
                }
                computed = true;
            }
            return m[lower];
        }
    }
    @SuppressWarnings("unchecked")
    public static void main(String args[]) throws Exception {
        FastScanner scanner = new FastScanner(System.in);
        PrintWriter printer = new PrintWriter(System.out);
        //scanner = new FastScanner(new FileInputStream("input.txt"));
        //printer = new PrintWriter(new FileOutputStream("output.txt"));
        /*
        int n = scanner.nextInt(), x = scanner.nextInt() - 1, y = scanner.nextInt() - 1;
        ArrayList<ArrayList<Integer>>g = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            g.add(new ArrayList<>());
        }
        for (int i = 0; i < n-1; i++) {
            int a = scanner.nextInt() - 1, b = scanner.nextInt() - 1;
            g.get(a).add(b);
            g.get(b).add(a);
        }
        printer.println(g);
        for (int i = 0; i < n; i++) {
            ArrayList<Integer>path = (ArrayList<Integer>) dfs(g, new boolean[g.size()], i);
            for (int j = path.size() - 2; j >= 0; j--) {
                if(!g.get(path.get(j)).contains(path.get(j+1))){
                    path.add(j+1,path.get(j-1));
                }
            }
            printer.println(i + " " + path);
        }
        */
        int n = scanner.nextInt();
        Map<Character, Integer>c1 = new HashMap<>();
        Map<Character, Integer>c2 = new HashMap<>();
        Map<Character, Integer>c3 = new HashMap<>();
        String s1 = scanner.next();
        String s2 = scanner.next();
        String s3 = scanner.next();
        for (int i = 0; i < s1.length(); i++) {
            c1.put(s1.charAt(i), c1.getOrDefault(s1.charAt(i), 0) + 1);
            c2.put(s2.charAt(i), c2.getOrDefault(s2.charAt(i), 0) + 1);
            c3.put(s3.charAt(i), c3.getOrDefault(s3.charAt(i), 0) + 1);
        }
        int max1 = f(c1, n, s1.length());
        int max2 = f(c2, n, s2.length());
        int max3 = f(c3, n, s3.length());

        //printer.println(c1 + " " + max1);
        //printer.println(c2 + " " + max2);
        //printer.println(c3 + " " + max3);
        if (max1 > max2 && max1 > max3){
            printer.println("Kuro");
        }
        else if(max2 > max1 && max2 > max3){
            printer.println("Shiro");
        }
        else if(max3 > max1 && max3 > max2) {
            printer.println("Katie");
        }
        else{
            printer.println("Draw");
        }
        printer.close();
    }
    private static int f(Map<Character, Integer>c1, int n, int sLength){
        int max1 = Integer.MIN_VALUE;
        for (Map.Entry<Character, Integer>c: c1.entrySet()) {
            int k = c.getValue();
            if (k + n > sLength) {
                if (k == sLength) {
                    int t = (k + n) - sLength;
                    if (t % 2 == 0) {
                        max1 = sLength;
                    } else {
                        if (t >= sLength) {
                            max1 = sLength;
                        }
                        else {
                            max1 = Math.max(max1, sLength - 1);
                        }
                    }
                }
                else {
                    max1 = sLength;
                }
            }
            else {
                max1 = Math.max(max1, k + n);
            }
            if(max1 == sLength){
                break;
            }
        }
        return max1;
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.*;
import java.util.*;
public class B979 {
    public static void main(String args[])throws IOException
        {
            Scanner sc=new Scanner(System.in);
            int n=sc.nextInt();
            int small[][]=new int[3][26];
            int big[][]=new int[3][26];
            String s1=sc.next();
            String s2=sc.next();
            String s3=sc.next();
            build(s1,small[0],big[0]);
            build(s2,small[1],big[1]);
            build(s3,small[2],big[2]);
            int x1=getmax(small[0],big[0]);
            int x2=getmax(small[1],big[1]);
            int x3=getmax(small[2],big[2]);
            x1=Math.min(x1+n,s1.length());
            x2=Math.min(x2+n,s2.length());
            x3=Math.min(x3+n,s3.length());

            if(x1>x2 && x1>x3)
                System.out.println("Kuro");
            else if(x2>x1 && x2>x3)
                System.out.println("Shiro");
            else if(x3>x1 && x3>x2)
                System.out.println("Katie");
            else
                System.out.println("Draw");
        }
    static int getmax(int a[],int b[])
    {
        int m=0;
        for(int i=0;i<26;i++)
        {
            m=Math.max(m,Math.max(a[i],b[i]));
        }
        return m;
    }
    static void build(String s,int a[],int b[])
    {
        for(int i=0;i<s.length();i++)
            {
                int x=s.charAt(i);
                if(x>=97)
                    a[x-97]++;
                else
                    b[x-65]++;
            }
    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.*;
import java.util.*;
public class B979 {
    static int find(int c1,int size)
    {
        if(c1>size)
        {
            if((c1-size)%2==0)
                return size;
            else
                return size-1;
        }
        else
            return c1;
    }
    public static void main(String args[])throws IOException
        {
            Scanner sc=new Scanner(System.in);
            int n=sc.nextInt();
            int small[][]=new int[3][26];
            int big[][]=new int[3][26];
            String s1=sc.next();
            String s2=sc.next();
            String s3=sc.next();
            build(s1,small[0],big[0]);
            build(s2,small[1],big[1]);
            build(s3,small[2],big[2]);
            int size=s1.length();
            int x1=0,x2=0,x3=0;
            for(int i=0;i<26;i++)
            {
                int c1=small[0][i]+n,c2=big[0][i]+n;
                int c3=small[1][i]+n,c4=big[1][i]+n;
                int c5=small[2][i]+n,c6=big[2][i]+n;

                x1=Math.max(x1,find(c1,size));
                x1=Math.max(x1,find(c2,size));
                x2=Math.max(x2,find(c3,size));
                x2=Math.max(x2,find(c4,size));
                x3=Math.max(x3,find(c5,size));
                x3=Math.max(x3,find(c6,size));
            }
            if(x1>x2 && x1>x3)
                System.out.println("Kuro");
            else if(x2>x1 && x2>x3)
                System.out.println("Shiro");
            else if(x3>x1 && x3>x2)
                System.out.println("Katie");
            else
                System.out.println("Draw");
        }
    static int getmax(int a[],int b[])
    {
        int m=0;
        for(int i=0;i<26;i++)
        {
            m=Math.max(m,Math.max(a[i],b[i]));
        }
        return m;
    }
    static void build(String s,int a[],int b[])
    {
        for(int i=0;i<s.length();i++)
            {
                int x=s.charAt(i);
                if(x>=97)
                    a[x-97]++;
                else
                    b[x-65]++;
            }
    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.*;
import java.util.*;
public class B979 {
    static int find(int c1,int size,int n)
    {
        if(c1==size && n==1)
        {
            return c1-1;
        }
        else
            return Math.min(size,c1+n);
    }
    public static void main(String args[])throws IOException
        {
            Scanner sc=new Scanner(System.in);
            int n=sc.nextInt();
            int small[][]=new int[3][26];
            int big[][]=new int[3][26];
            String s1=sc.next();
            String s2=sc.next();
            String s3=sc.next();
            build(s1,small[0],big[0]);
            build(s2,small[1],big[1]);
            build(s3,small[2],big[2]);
            int size=s1.length();
            int x1=0,x2=0,x3=0;
            for(int i=0;i<26;i++)
            {
                int c1=small[0][i],c2=big[0][i];
                int c3=small[1][i],c4=big[1][i];
                int c5=small[2][i],c6=big[2][i];

                x1=Math.max(x1,find(c1,size,n));
                x1=Math.max(x1,find(c2,size,n));
                x2=Math.max(x2,find(c3,size,n));
                x2=Math.max(x2,find(c4,size,n));
                x3=Math.max(x3,find(c5,size,n));
                x3=Math.max(x3,find(c6,size,n));
            }
            if(x1>x2 && x1>x3)
                System.out.println("Kuro");
            else if(x2>x1 && x2>x3)
                System.out.println("Shiro");
            else if(x3>x1 && x3>x2)
                System.out.println("Katie");
            else
                System.out.println("Draw");
        }
    static int getmax(int a[],int b[])
    {
        int m=0;
        for(int i=0;i<26;i++)
        {
            m=Math.max(m,Math.max(a[i],b[i]));
        }
        return m;
    }
    static void build(String s,int a[],int b[])
    {
        for(int i=0;i<s.length();i++)
            {
                int x=s.charAt(i);
                if(x>=97)
                    a[x-97]++;
                else
                    b[x-65]++;
            }
    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.*;
import java.util.*;
public class B979 {
    public static void main(String args[])throws IOException
        {
            Scanner sc=new Scanner(System.in);
            int n=sc.nextInt();
            int small[][]=new int[3][26];
            int big[][]=new int[3][26];
            String s1=sc.next();
            String s2=sc.next();
            String s3=sc.next();
            build(s1,small[0],big[0]);
            build(s2,small[1],big[1]);
            build(s3,small[2],big[2]);
            int x1=getmax(small[0],big[0]);
            int x2=getmax(small[1],big[1]);
            int x3=getmax(small[2],big[2]);
            x1+=n;
            x2+=n;
            x3+=n;
            int len1=s1.length(),len2=s2.length(),len3=s3.length();
            if(x1>len1)
            {
                if((len1-x1)%2==0)
                    x1=len1;
                else
                    x1=len1-1;
            }
            if(x2>s2.length())
            {
                if((len2-x2)%2==0)
                    x2=len2;
                else
                    x2=len2-1;
            }
            if(x3>s3.length())
            {
                if((len3-x3)%2==0)
                    x3=len3;
                else
                    x3=len3-1;
            }
            if(x1>x2 && x1>x3)
                System.out.println("Kuro");
            else if(x2>x1 && x2>x3)
                System.out.println("Shiro");
            else if(x3>x1 && x3>x2)
                System.out.println("Katie");
            else
                System.out.println("Draw");
        }
    static int getmax(int a[],int b[])
    {
        int m=0;
        for(int i=0;i<26;i++)
        {
            m=Math.max(m,Math.max(a[i],b[i]));
        }
        return m;
    }
    static void build(String s,int a[],int b[])
    {
        for(int i=0;i<s.length();i++)
            {
                int x=s.charAt(i);
                if(x>=97)
                    a[x-97]++;
                else
                    b[x-65]++;
            }
    }

}


import java.io.*;
import java.util.Arrays;
public class Main {
    static int n, l;
	public static void main (String[] args) throws IOException {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    n = Integer.parseInt(br.readLine());
	    int[] beauty = new int[3];
	    for(int i = 0; i < 3; ++i){
	        int[] numOf = new int[52];
	        char[] in = br.readLine().toCharArray();
	        l = in.length;
	        for(char temp : in){
	            int curr = (int)(temp - 'A');
	            if(curr > 25) curr -= 6;
	            ++numOf[curr];
	        }

	        int max = Integer.MIN_VALUE;
	        for(int num : numOf) max = Math.max(max, getMax(num));
	        beauty[i] = max;
	    }

	    String out = "Draw";
	    if(beauty[0] > beauty[1] && beauty[0] > beauty[2]) out = "Kuro";
	    else if(beauty[1] > beauty[0] && beauty[1] > beauty[2]) out = "Shiro";
	    else if(beauty[2] > beauty[0] && beauty[2] > beauty[1]) out = "Katie";
	    System.out.println(out);
	}
	static int getMax(int in){
	    int b = in + n;
	    if(b > l){
	        if(b - l == 1 && n == 1) b = l - 1;
	        else b = l;
	    }
	    return b;
	}
}


import java.io.*;
public class Main {
    static int n, l;
	public static void main (String[] args) throws IOException {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    n = Integer.parseInt(br.readLine());
	    int[] beauty = new int[3];
	    for(int i = 0; i < 3; ++i){
	        int[] numOf = new int[52];
	        char[] in = br.readLine().toCharArray();
	        l = in.length;
	        for(char temp : in){
	            int curr = (int)(temp - 'A');
	            if(curr > 25) curr -= 6;
	            ++numOf[curr];
	        }
	        int max = Integer.MIN_VALUE;
	        for(int num : numOf){
	            max = Math.max(max, getMax(num));
	        }
	        beauty[i] = max;
	    }

	    if(n == 68183){
	        System.out.println(beauty[0] + " " + beauty[1] + " " + beauty[2]);
	    }

	    String out = "Draw";
	    if(beauty[0] > beauty[1] && beauty[0] > beauty[2]) out = "Kuro";
	    else if(beauty[1] > beauty[0] && beauty[1] > beauty[2]) out = "Shiro";
	    else if(beauty[2] > beauty[0] && beauty[2] > beauty[1]) out = "Katie";
	    System.out.println(out);
	}
	static int getMax(int in){
	    int b = in + n;
	    if(b > l){
	        if((b - l) % 2 == 1) b = l - 1;
	        else b = l;
	    }
	    return b;
	}
}


import java.io.*;
import java.util.Arrays;
public class Main {
    static int n, l;
	public static void main (String[] args) throws IOException {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    n = Integer.parseInt(br.readLine());
	    int[] beauty = new int[3];
	    for(int i = 0; i < 3; ++i){
	        int[] numOf = new int[52];
	        char[] in = br.readLine().toCharArray();
	        l = in.length;
	        for(char temp : in){
	            int curr = (int)(temp - 'A');
	            if(curr > 25) curr -= 6;
	            ++numOf[curr];
	        }

	        int max = Integer.MIN_VALUE;
	        for(int num : numOf){
	            max = Math.max(max, getMax(num));
	        }
	        beauty[i] = max;
	    }

	    if(n == 68183){
	        System.out.println("l: " + l + ";" + beauty[0] + " " + beauty[1] + " " + beauty[2]);
	    }

	    String out = "Draw";
	    if(beauty[0] > beauty[1] && beauty[0] > beauty[2]) out = "Kuro";
	    else if(beauty[1] > beauty[0] && beauty[1] > beauty[2]) out = "Shiro";
	    else if(beauty[2] > beauty[0] && beauty[2] > beauty[1]) out = "Katie";
	    System.out.println(out);
	}
	static int getMax(int in){
	    int b = in + n;
	    if(b > l){
	        if((b - l) % 2 == 1) b = l - 1;
	        else b = l;
	    }
	    return b;
	}
}


import java.io.*;
public class Main {
    static int n, l;
	public static void main (String[] args) throws IOException {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    n = Integer.parseInt(br.readLine());
	    int[] beauty = new int[3];
	    for(int i = 0; i < 3; ++i){
	        int[] numOf = new int[52];
	        char[] in = br.readLine().toCharArray();
	        l = in.length;
	        for(char temp : in){
	            int curr = (int)(temp - 'A');
	            if(curr > 25) curr -= 6;
	            ++numOf[curr];
	        }
	        int max = Integer.MIN_VALUE;
	        for(int num : numOf){
	            max = Math.max(max, getMax(num));
	        }
	        beauty[i] = max;
	    }

	    String out = "Draw";
	    if(beauty[0] > beauty[1] && beauty[0] > beauty[2]) out = "Kuro";
	    else if(beauty[1] > beauty[0] && beauty[1] > beauty[2]) out = "Shiro";
	    else if(beauty[2] > beauty[0] && beauty[2] > beauty[1]) out = "Katie";
	    System.out.println(out);
	}
	static int getMax(int in){
	    int b = in + n;
	    if(b > l){
	        if((b - l) % 2 == 1) b = l - 1;
	        else b = l;
	    }
	    return b;
	}
}


import java.io.*;
public class Main {
	public static void main (String[] args) throws IOException {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    int n = Integer.parseInt(br.readLine());
	    int[] beauty = new int[3];
	    for(int i = 0; i < 3; ++i){
	        int[] numOf = new int[52];
	        char[] in = br.readLine().toCharArray();
	        int max = 0;
	        for(char temp : in){
	            int curr = (int)(temp - 'A');
	            if(curr > 25) curr -= 6;
	            max = Math.max(max, ++numOf[curr]);
	        }
	        beauty[i] = Math.min(in.length, max + n);
	    }

	    String out = "Draw";
	    if(beauty[0] > beauty[1] && beauty[0] > beauty[2]) out = "Kuro";
	    else if(beauty[1] > beauty[0] && beauty[1] > beauty[2]) out = "Shiro";
	    else if(beauty[2] > beauty[0] && beauty[2] > beauty[1]) out = "Katie";
	    System.out.println(out);
	}
}


#include<iostream>
#include<cstdio>
#include<memory.h>
#include<vector>
#include<algorithm>
using namespace std;
vector <int> q[200001];
int tu[250000], die[250000], jilu[250000];
int zhao(int x)
{
	if (x == die[x])return x;
	else return die[x] = zhao(die[x]);
}
int main()
{
	int n, m, k;
	cin >> n >> m >> k;
	for (int a = 1;a <= n;a++)scanf("%d", &tu[a]), die[a] = a;
	int sum = 0;
	int e, w;
	for (int a = 1;a <= m;a++)
	{
		scanf("%d%d", &e, &w);
		int qd = zhao(e), wd = zhao(w);
		die[qd] = wd;
	}
	for (int a = 1;a <= n;a++)q[zhao(die[a])].push_back(a);
	for (int a = 1;a <= n;a++)
	{
		if (!q[a].size())continue;
		int gagaga = 0;
		for (int b = 0;b<q[a].size();b++)
		{
			jilu[q[a][b]]++;
			gagaga = max(gagaga, jilu[q[a][b]]);
		}
		for (int b = 0;b<q[a].size();b++)
		{
			jilu[q[a][b]]--;
		}
		sum += q[a].size();
		sum -= gagaga;
	}
	cout << sum << endl;
	return 0;
}


#include<iostream>
#include<cstdio>
#include<memory.h>
#include<vector>
#include<algorithm>
using namespace std;
vector <int> q[200001];
int tu[250000], die[250000], jilu[250000];
int zhao(int x)
{
	while (x != die[x])x = die[x];
	return x;
}
int main()
{
	int n, m, k;
	cin >> n >> m >> k;
	for (int a = 1;a <= n;a++)scanf("%d", &tu[a]), die[a] = a;
	int sum = 0;
	int e, w;
	for (int a = 1;a <= m;a++)
	{
		scanf("%d%d", &e, &w);
		int qd = zhao(e), wd = zhao(w);
		die[qd] = wd;
	}
	for (int a = 1;a <= n;a++)q[zhao(a)].push_back(a);
	for (int a = 1;a <= n;a++)
	{
		if (!q[a].size())continue;
		int gagaga = 0;
		for (int b = 0;b<q[a].size();b++)
		{
			jilu[q[a][b]]++;
			gagaga = max(gagaga, jilu[q[a][b]]);
		}
		for (int b = 0;b<q[a].size();b++)
		{
			jilu[q[a][b]]--;
		}
		sum += q[a].size();
		sum -= gagaga;
	}
	cout << sum << endl;
	return 0;
}


#include<iostream>
#include<cstdio>
#include<memory.h>
#include<vector>
#include<algorithm>
using namespace std;
vector <int> q[200001];
int tu[250000], die[250000], jilu[250000];
int zhao(int x)
{
	while (x != die[x])x = die[x];
	return x;
}
int main()
{
	int n, m, k;
	cin >> n >> m >> k;
	for (int a = 1;a <= n;a++)scanf("%d", &tu[a]), die[a] = a;
	int sum = 0;
	int e, w;
	for (int a = 1;a <= m;a++)
	{
		scanf("%d%d", &e, &w);
		int qd = zhao(e), wd = zhao(w);
		die[qd] = wd;
	}
	for (int a = 1;a <= n;a++)q[zhao(die[a])].push_back(a);
	for (int a = 1;a <= n;a++)
	{
		if (!q[a].size())continue;
		int gagaga = 0;
		for (int b = 0;b<q[a].size();b++)
		{
			jilu[q[a][b]]++;
			gagaga = max(gagaga, jilu[q[a][b]]);
		}
		for (int b = 0;b<q[a].size();b++)
		{
			jilu[q[a][b]]--;
		}
		sum += q[a].size();
		sum -= gagaga;
	}
	cout << sum << endl;
	return 0;
}


#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<cstdlib>
#include<map>
#include<cmath>
using namespace std;
int fa[200050],tot[200010]={0};
int n,m,k;
int col[200010]={0};
int res=0;
vector<int> a[200010];
int color[200010];
int find(int i)
{
	if(fa[i]==i) return i;
	else
		return fa[i]=find(fa[i]);
}

int main()
{

	cin>>n>>m>>k;
	for(int i=1;i<=n;i++)
	{
		cin>>color[i];
		fa[i]=i;
	}
	for(int i=0;i<m;i++)
	{
		int x,y;
		cin>>x>>y;
		int p=find(x);
		int q=find(y);
		if(p!=q)
		{
			fa[p]=q;
		}
	}
	for(int i=1;i<=n;i++)
	{
		int p=find(i);
		if(p!=i)
		{
			a[p].push_back(i);
		}
	}
	for(int i=1;i<=n;i++)
	{

		int p=find(i);
		if(p==i)
		{
			int max=0;
			max=col[color[i]]=1;
			for(int j=0;j<a[i].size();j++)
			{
				col[color[a[i][j]]]++;
				if(col[color[a[i][j]]]>max)
					max=col[color[a[i][j]]]++;
				tot[i]++;
			}
			tot[i]++;
			res+=tot[i]-max;
		}
	}
	cout<<res<<endl;
	return 0;
}


#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<algorithm>
using namespace std;
int n, fa[200050], am[200050];
int m, k;
int color[200050];
void init()
{
	for (int i = 1; i<=n; i++)
	{
		color[i] = 0;
		fa[i] = i;
		am[i] = 1;
	}
}
/*int findFarther(int x)
{
	while (fa[x] != x) {
		x = fa[x];
	}
	return x;
}*/

int findFarther(int v)      //找元素所在集合的代表元(因为用了路径压缩，路径压缩的主要目的是为了尽快的确定元素所在的集合）
{
	int t1, t2 = v;
	while (v != fa[v])
		v = fa[v];
	while (t2 != fa[t2])        //这里优化的思路还是路径压缩（进一步的在查找函数执行的过程中压缩路径），很神奇!
	{
		t1 = fa[t2];
		fa[t2] = v;
		t2 = t1;
	}
	return v;
}
void Union(int x, int y)
{
	int rootx = findFarther(x), rooty = findFarther(y);
	if (rootx != rooty) {
		if (am[rootx]>am[rooty]) {
			fa[rooty] = rootx;
			am[rootx] += am[rooty];
		}
		else {
			fa[rootx] = rooty;
			am[rooty] += am[rootx];
		}
	}
}

int find(int x) {
	if (fa[x] == x) return x;
	else return fa[x] = find(fa[x]);
}

void show(int x)
{
	for (int i = 1; i <= x; i++)
	{
		cout << findFarther(i) << ' ';
	}
	cout << endl;
}

int main()
{

	while (cin >> n >> m >> k)
	{
		int flag[200050] = { 0 };
		init();
		for (int i = 1; i <= n; i++)
		{
			cin >> color[i];
		}
		for (int i = 0; i < m; i++)
		{
			int a, b;
			cin >> a >> b;
			int p = find(a), q = find(b);
			if (p != q) {
				fa[p] = q;
			}
			flag[a] = 1;
			flag[b] = 1;
		}
		//show(n);

		int res = 0;
		for (int i = 1; i <= n; i++)
		{
			if (flag[i])
			{
				int temp[20050];
				int temp_point = 0;
				//cout << " i:" << i << endl;
				for (int j = i; j <= n; j++)
				{
					if (find(i) == find(j))
					{
						temp[temp_point] = j;
						temp_point++;
						flag[j] = 0;
					}
				}

				/*for (int j = 0; j < temp_point; j++)
				{
					cout << temp[j] << ' ';
				}
				cout << endl;*/
				int col[20010] = { 0 };
				int max = 0;
				for (int j = 0; j < temp_point; j++)
				{
					col[color[temp[j]]]++;
					if (col[color[temp[j]]])
					{
						max = col[color[temp[j]]];
					}
				}
				//cout << "max=" << max << endl;
				/*

							for (int j = 0; j < temp_point; j++)
							{
								temp[j] = color[temp[j]];
							}
							sort(temp, temp + temp_point);
							int max = 0;
							int temp_max = 1;

							for (int j = 1; j < temp_point; j++)
							{
								if (temp[j] != temp[j - 1]) temp_max = 0;
								temp_max++;
								if (temp_max > max)
									max = temp_max;
							}*/

				res += temp_point - max;
			}
		}
		cout << res << endl;
	}
    return 0;
}


// C. Socks.cpp : 定义控制台应用程序的入口点。
//
#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<algorithm>
using namespace std;
int n, fa[200050], am[200050];
int m, k;
int color[200050];
void init()
{
	for (int i = 1; i<=n; i++)
	{
		color[i] = 0;
		fa[i] = i;
		am[i] = 1;
	}
}
/*int findFarther(int x)
{
	while (fa[x] != x) {
		x = fa[x];
	}
	return x;
}*/

int findFarther(int v)      //找元素所在集合的代表元(因为用了路径压缩，路径压缩的主要目的是为了尽快的确定元素所在的集合）
{
	int t1, t2 = v;
	while (v != fa[v])
		v = fa[v];
	while (t2 != fa[t2])        //这里优化的思路还是路径压缩（进一步的在查找函数执行的过程中压缩路径），很神奇!
	{
		t1 = fa[t2];
		fa[t2] = v;
		t2 = t1;
	}
	return v;
}
void Union(int x, int y)
{
	int rootx = findFarther(x), rooty = findFarther(y);
	if (rootx != rooty) {
		if (am[rootx]>am[rooty]) {
			fa[rooty] = rootx;
			am[rootx] += am[rooty];
		}
		else {
			fa[rootx] = rooty;
			am[rooty] += am[rootx];
		}
	}
}

int find(int x) {
	if (fa[x] == x) return x;
	else return fa[x] = find(fa[x]);
}

void show(int x)
{
	for (int i = 1; i <= x; i++)
	{
		cout << findFarther(i) << ' ';
	}
	cout << endl;
}

int main()
{

	 scanf("%d%d%d",&n,&m,&k);
	{
		int flag[200050] = { 0 };
		init();
		for (int i = 1; i <= n; i++)
		{
			scanf("%d",&color[i]);
			//cin >> color[i];
		}
		for (int i = 0; i < m; i++)
		{
			int a, b;
			 scanf("%d%d",&a,&b);
			int p = find(a), q = find(b);
			if (p != q) {
				fa[p] = q;
			}
			flag[a] = 1;
			flag[b] = 1;
		}
		//show(n);

		int res = 0;
		for (int i = 1; i <= n; i++)
		{
			if (flag[i])
			{
				int temp[20050];
				int temp_point = 0;
				//cout << " i:" << i << endl;
				for (int j = i; j <= n; j++)
				{
					if (find(i) == find(j))
					{
						temp[temp_point] = j;
						temp_point++;
						flag[j] = 0;
					}
				}

				/*for (int j = 0; j < temp_point; j++)
				{
					cout << temp[j] << ' ';
				}
				cout << endl;*/
				int col[20010] = { 0 };
				int max = 0;
				for (int j = 0; j < temp_point; j++)
				{
					col[color[temp[j]]]++;
					if (col[color[temp[j]]])
					{
						max = col[color[temp[j]]];
					}
				}
				//cout << "max=" << max << endl;
				/*

							for (int j = 0; j < temp_point; j++)
							{
								temp[j] = color[temp[j]];
							}
							sort(temp, temp + temp_point);
							int max = 0;
							int temp_max = 1;

							for (int j = 1; j < temp_point; j++)
							{
								if (temp[j] != temp[j - 1]) temp_max = 0;
								temp_max++;
								if (temp_max > max)
									max = temp_max;
							}*/

				res += temp_point - max;
			}
		}
		cout << res << endl;
	}
    return 0;
}

/*
7 5 7
1 2 3 4 5 6 7
1 2
2 3
4 5
5 6
6 7

3 2 2
1 1 2
1 2
2 1
*/


#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<algorithm>
using namespace std;
int n, fa[200050], am[200050];
int m, k;
int color[200050];
void init()
{
	for (int i = 1; i<=n; i++)
	{
		color[i] = 0;
		fa[i] = i;
		am[i] = 1;
	}
}
/*int findFarther(int x)
{
	while (fa[x] != x) {
		x = fa[x];
	}
	return x;
}*/

int findFarther(int v)      //找元素所在集合的代表元(因为用了路径压缩，路径压缩的主要目的是为了尽快的确定元素所在的集合）
{
	int t1, t2 = v;
	while (v != fa[v])
		v = fa[v];
	while (t2 != fa[t2])        //这里优化的思路还是路径压缩（进一步的在查找函数执行的过程中压缩路径），很神奇!
	{
		t1 = fa[t2];
		fa[t2] = v;
		t2 = t1;
	}
	return v;
}
void Union(int x, int y)
{
	int rootx = findFarther(x), rooty = findFarther(y);
	if (rootx != rooty) {
		if (am[rootx]>am[rooty]) {
			fa[rooty] = rootx;
			am[rootx] += am[rooty];
		}
		else {
			fa[rootx] = rooty;
			am[rooty] += am[rootx];
		}
	}
}

void show(int x)
{
	for (int i = 1; i <= x; i++)
	{
		cout << findFarther(i) << ' ';
	}
	cout << endl;
}

int main()
{

	while (cin >> n >> m >> k)
	{
		int flag[200050] = { 0 };
		init();
		for (int i = 1; i <= n; i++)
		{
			cin >> color[i];
		}
		for (int i = 0; i < m; i++)
		{
			int a, b;
			cin >> a >> b;
			Union(a, b);
			flag[a] = 1;
			flag[b] = 1;
		}
		//show(n);

		int res = 0;
		for (int i = 1; i <= n; i++)
		{
			int temp[20050];
			int temp_point = 0;
			if (flag[i])
			{
				for (int j = i; j <= n; j++)
				{
					if (findFarther(i) == findFarther(j))
					{
						temp[temp_point] = j;
						temp_point++;
						flag[j] = 0;
					}
				}
			}
			for (int j = 0; j < temp_point; j++)
			{
				temp[j] = color[temp[j]];
			}
			sort(temp, temp + temp_point);
			int max = 0;
			int temp_max = 1;

			for (int j = 1; j < temp_point; j++)
			{
				if (temp[j] != temp[j - 1]) temp_max = 0;
				temp_max++;
				if (temp_max > max)
					max = temp_max;
			}
			res += temp_point - max;
		}
		cout << res << endl;
	}
    return 0;
}