using System;

namespace Task2
{
    class Program
    {
        static void Main(string[] args)
        {
            //вводим n k и d
            int t = Convert.ToInt32(Console.ReadLine());
            for (int u = 0; u < t; u++)
            {
                string input = Console.ReadLine();
                string[] inputArr = input.Split();

                int n = Convert.ToInt32(inputArr[0]);
                int k = Convert.ToInt32(inputArr[1]);
                int d = Convert.ToInt32(inputArr[2]);

                int[] days = new int[n];

                //заполняем массив дней показа
                string inputDays = Console.ReadLine();
                string[] inputArrDays = inputDays.Split();
                for (int i = 0; i < days.Length; i++)
                {
                    days[i] = Convert.ToInt32(inputArrDays[i]);
                }

                //массив "разных" сериалов
                int[] differentSerials = new int[k];
                for (int i = 0; i < differentSerials.Length; i++)
                {
                    differentSerials[i] = 0;
                }

                //массив для "блоков" дней
                int[] arrForDaysBlock = new int[n - d + 1];
                for (int x = 0; x < arrForDaysBlock.Length; x++)
                {
                    //проверяем, что в i день идет j сериал
                    //если да, то в массив сериалов суем ++
                    for (int i = x; i < x + d; i++)
                    {
                        for (int j = 1; j < differentSerials.Length + 1; j++)
                        {
                            if (days[i] == j)
                            {
                                differentSerials[j - 1]++;
                            }
                        }
                    }
                    //подсчитываем сколько РАЗЛИЧНЫХ сериалов прошло в d дней
                    //и записываем это в массив блоков дней
                    int summ = 0;
                    for (int i = 0; i < differentSerials.Length; i++)
                    {
                        if (differentSerials[i] != 0)
                        {
                            summ++;
                        }
                    }
                    arrForDaysBlock[x] = summ;
                    for (int i = 0; i < differentSerials.Length; i++)
                    {
                        differentSerials[i] = 0;
                    }
                }

                int min = arrForDaysBlock[0];
                for (int i = 0; i < arrForDaysBlock.Length; i++)
                {
                    if (arrForDaysBlock[i] < min)
                    {
                        min = arrForDaysBlock[i];
                    }
                }

                Console.WriteLine(min);
            }
        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;

public class B
{
	public static void Main() => (new Solver()).Solve();
}

public class Solver
{
	public void Solve()
	{
		int T = GetInt();

		int[] ans = new int[T];
		for(int i = 0; i < T; i++)
			ans[i] = calc();

		Console.WriteLine(string.Join("\n", ans.Select(x => x.ToString()).ToArray()));
	}

	private int calc()
	{
		int N = GetInt();
		int K = GetInt();
		int D = GetInt();
		int[] a = GetInts(N);

		int res = D;
		int[] cnt = new int[1000001];
		int sum = 0;
		for(int i = 0; i < D; i++)
		{
			if(cnt[a[i]] == 0)
				sum++;

			cnt[a[i]]++;
		}
		chmin(ref res, sum);

		for(int i = D; i < N; i++)
		{
			if(cnt[a[i]] == 0)
				sum++;

			cnt[a[i]]++;

			if(cnt[a[i - D]] == 1)
				sum--;

			cnt[a[i - D]]--;

			chmin(ref res, sum);
		}

		return res;
	}

	private int chmin(ref int x, int y) => x = Math.Min(x, y);
}

public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(int N) => Enumerable.Range(0, N).Select(_ => GetInt()).ToArray();
	public static long[] GetLongs(int N) => Enumerable.Range(0, N).Select(_ => GetLong()).ToArray();
	public static double[] GetDoubles(int N) => Enumerable.Range(0, N).Select(_ => GetDouble()).ToArray();
	public static string[] GetStrings(int N) => Enumerable.Range(0, N).Select(_ => GetString()).ToArray();
}


using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
// Powered by caide (code generator, tester, and library code inliner)

class Solution {

    int n, h;
    long[,] t;
    public void solve(TextReader input, TextWriter output) {
        var inp = input.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
        n = inp[0];
        h = inp[1];

        t = new long[n+1, n+1];
        t[0, 0] = 1;

        for (int ni = 1; ni <= n; ni++)
        {
            for (int hi = 1; hi <= n; hi++)
            {
                long sum0 = 0;
                for (int m = 1; m <= ni; m++)
                {
                    long sum1 = 0;
                    for (int i = 0; i <= hi-1; i++)
                    {
                        sum1 += t[ni - m, i];
                    }

                    long sum2 = 0;
                    for (int i = 0; i <= hi-2; i++)
                    {
                        sum2 += t[m - 1, i];
                    }

                    sum0 += t[m - 1, hi - 1] * sum1 + t[ni - m, hi - 1] * sum2;
                }

                t[ni, hi] = sum0;
            }
        }

        long ans = 0;
        for (int i = h; i <= n; i++)
        {
            ans += t[n, i];
        }

        output.WriteLine(ans);
    }
}

class CaideConstants {
    public const string InputFile = null;
    public const string OutputFile = null;
}
public class Program {
    public static void Main(string[] args) {
        Solution solution = new Solution();
        using (System.IO.TextReader input =
                CaideConstants.InputFile == null ? System.Console.In :
                        new System.IO.StreamReader(CaideConstants.InputFile))
        using (System.IO.TextWriter output =
                CaideConstants.OutputFile == null ? System.Console.Out:
                        new System.IO.StreamWriter(CaideConstants.OutputFile))

            solution.solve(input, output);
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeForces
{
    static class Reader
    {
        public static int NextInt()
        {
            int ret = 0;
            char c;

            while (!char.IsDigit(c = (char)Console.Read()))
            {
                if (c == '-')
                    return -NextInt();
            }
            do
            {
                ret = ret * 10 + c - '0';
            } while (char.IsDigit(c = (char)Console.Read()));

            return ret;
        }

        public static double NextDouble()
        {
            double ret = 0;
            char c;

            while (!char.IsDigit(c = (char)Console.Read()))
            {
                if (c == '-')
                    return -NextDouble();
            }
            do
            {
                ret = ret * 10 + c - '0';
            } while (char.IsDigit(c = (char)Console.Read()));
            if (c != '.') return ret;

            double p10 = 0.1;
            while (char.IsDigit(c = (char)Console.Read()))
            {
                ret += p10 * (c - '0');
            }

            return ret;
        }
    }

    class Program
    {
        static long[,] memo;
        static bool[,] done;

        static long Rec(int n, int h)
        {
            if (n <= 1 && n == h)
                return 1;
            if (n < h)
                return 0;
            if (done[n, h])
                return memo[n, h];

            long ret = 0;
            for (int i = 1; i <= n; ++i)
            {
                int l = i - 1, r = n - i;
                for (int lh = 0; lh < h - 1; ++lh)
                    ret += Rec(l, lh) * Rec(r, h - 1);
                for (int rh = 0; rh <= h - 1; ++rh)
                    ret += Rec(l, h - 1) * Rec(r, rh);
            }
            done[n, h] = true;
            return memo[n, h] = ret;
        }

        static void Main(string[] args)
        {
            int n = Reader.NextInt(), h = Reader.NextInt();

            memo = new long[36, 36];
            done = new bool[36, 36];

            long sol = 0;
            for (int i = h; i <= n; ++i)
                sol += Rec(n, i);
            Console.WriteLine(sol);
        }
    }
}


using System;

public class Demo {
    public static void Main() {
        // feel free to modify
        string[] tokens = Console.ReadLine().Split();
        int n = int.Parse(tokens[0]);
        int h = int.Parse(tokens[1]);
        // Console.WriteLine(NumTrees(n)-NumTreesUptoHeight(n, h));
        Console.WriteLine(NumTrees(n)-NumTreesUptoHeight(n, h-1));
    }

    private static long NumTrees(int n) {
        long[] numWays = new long[n+1];
        // initialization; note on 0 nodes: above
        numWays[0] = 1;

        for (int target=1; target<=n; target++)
            for (int i=1; i<=target; i++)
                numWays[target] += numWays[i-1] * numWays[target-i];
        return numWays[n];
    }

    // minHN is minimum height in number of nodes from root to leaf
    private static long NumTreesUptoHeight(int n, int minHN) {
        long[][] numWays = new long[minHN+1][];
        for (int i = 0; i <= minHN; i++)
            numWays[i] = new long[n+1];  // to make the indexing mapped exactly to height, 0 is unused
        numWays[0][0] = 1;
        for (int i = 1; i <= n; i++)
            numWays[0][i] = 0;

        //for (int h = 1; h <= minHN; h++)
          //  numWays[h][0] = 1;
        for (int h = 1; h <= minHN; h++) {
            numWays[h][0] = 1;
            for (int target = 1; target <= n; target++)
            {
                for (int i = 1; i <= target; i++)
                    numWays[h][target] += numWays[h - 1][i - 1] * numWays[h - 1][target - i];
                // Console.WriteLine("{0}, {1}: {2}", h, target, numWays[h][target]);
            }

        }
        return numWays[minHN][n];
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    long?[,] mem1 = new long?[36, 36];
    long Fun1(int n, int h)
    {
        if (mem1[n, h].HasValue)
            return mem1[n, h].Value;
        long ret = 0;
        if (h == 0)
        {
            if (n == 0)
                return 1;
            for (int i = 0; i < n; i++)
                ret += Fun1(i, 0) * Fun1(n - i - 1, 0);
            return (mem1[n, h] = ret).Value;
        }

        if (n < h)
            return 0;

        for (int i = 0; i < n; i++)
            ret += Fun1(i, h - 1) * Fun1(n - i - 1, h - 1) + Fun1(i, h - 1) * Fun2(n - i - 1, h - 1) + Fun2(i, h - 1) * Fun1(n - i - 1, h - 1);
        return (mem1[n, h] = ret).Value;
    }

    long?[,] mem2 = new long?[36, 36];
    long Fun2(int n, int h)
    {
        if (h < 0)
            return 0;
        if (h == 0)
            return 0;
        if (h == 1)
            return n > 0 ? 0 : 1;
        if (n == 0)
            return 1;
        if (mem2[n, h].HasValue)
            return mem2[n, h].Value;
        long ret = 0;
        for (int i = 0; i < n; i++)
            ret += Fun2(i, h - 1) * Fun2(n - i - 1, h - 1);
        return (mem2[n, h] = ret).Value;
    }

    public void Solve()
    {
        int n = ReadInt();
        int h = ReadInt();

        Write(Fun1(n, h));
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        //reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
            new Solver().Solve();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
#if DEBUG
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write
    private static Queue<string> currentLineTokens = new Queue<string>();
    private static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); }
    public static string ReadToken() { while (currentLineTokens.Count == 0)currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }
    public static int ReadInt() { return int.Parse(ReadToken()); }
    public static long ReadLong() { return long.Parse(ReadToken()); }
    public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }
    public static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }
    public static long[] ReadLongArray() { return ReadAndSplitLine().Select(long.Parse).ToArray(); }
    public static double[] ReadDoubleArray() { return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); }
    public static int[][] ReadIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++)matrix[i] = ReadIntArray(); return matrix; }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++)ret[i][j] = matrix[j][i]; } return ret;
    }
    public static string[] ReadLines(int quantity) { string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++)lines[i] = reader.ReadLine().Trim(); return lines; }
    public static void WriteArray<T>(IEnumerable<T> array) { writer.WriteLine(string.Join(" ", array)); }
    public static void Write(params object[] array) { WriteArray(array); }
    public static void WriteLines<T>(IEnumerable<T> array) { foreach (var a in array)writer.WriteLine(a); }
    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    private static T[] Init<T>(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++)ret[i] = new T(); return ret; }
    #endregion
}


using System;
using System.Collections.Generic;
using System.Text;

namespace A.Theatre_Square
{
    class Program
    {
        static int sq2(int k)
        {
            return (1 << k) - 1;
        }

        static void Main(string[] args)
        {
            string[] data = Console.ReadLine().Trim().Split(' ');
            int n = Int32.Parse(data[0]);
            int h = Int32.Parse(data[1]);
            Int64[,] f=new Int64[36,36];
            f[0, 0] = 1;
            f[1, 1] = 1;
            for (int i = 2; i <= n; i++)
            {
                for (int j = i; j <= n; j++)
                {
                    for (int k = 0; k <= j - 1; k++)
                    {
                        for (int l = (int)Math.Ceiling(Math.Log(k + 1, 2)); l <= k; l++)
                        {
                            for (int r = (int)Math.Ceiling(Math.Log(j - k, 2)); r <= j - k - 1; r++)
                            {
                                if((l==i-1 || r==i-1)&&(l<i && r<i))
                                    f[i, j] += f[l, k] * f[r, j - k - 1];
                            }
                        }
                    }
                }
            }
            Int64 result = 0;
            for (int i = h; i <= n; i++)
            {
                result += f[i, n];
            }
            Console.WriteLine(result);
            Console.ReadKey();
        }
    }

}


using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;

class Program
{
    long[,] dp;
    void solve()
    {
        string[] t = Console.ReadLine().Split();
        int n=int.Parse(t[0]);
        int h = int.Parse(t[1]);
        dp = new long[n + 1, n + 1];
        for (int i = 0; i <= n; i++)
            for (int j = 0; j <= n; j++)
                dp[i, j] = -1;
        long ret = 0;
        for (int i = 1; i <= n; i++)
        {
            long num = go(n, i);
            if (i >= h)
            {
                ret += num;
            }
        }
        Console.WriteLine(ret);
    }

    private long go(int n, int h)
    {
        if (dp[n, h] != -1)
            return dp[n, h];
        if (n == 0)
        {
            if (h == 0)
                return dp[n, h] = 1;
            else
                return dp[n, h] = 0;
        }
        if(h==0)
        {
            return dp[n,h]=0;
        }
        long ret = 0;
        for (int i = 1; i <= n; i++)
        {
            int Left = i - 1;
            int right = n - i;
            for (int k = 0; k < h - 1; k++)
            {
                ret += go(Left, k) * go(right, h - 1);
            }
            for (int k = 0; k < h - 1; k++)
            {
                ret += go(right, k) * go(Left, h - 1);
            }
            ret += go(Left, h - 1) * go(right, h - 1);
        }
        return dp[n, h] = ret;
    }

    static void Main(string[] args)
    {
        new Program().solve();
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication14
{
    class Program
    {
        static void Main(string[] args)
        {
            int sum , i;
            string numbers = Console.ReadLine();
            string[] num = numbers.Split(' ');
            int a = int.Parse(num[0]);
            int b = int.Parse(num[1]);
            int s = int.Parse(num[2]);
            if (Math.Pow(-10, 9) <= a && a <= Math.Pow(10, 9) && Math.Pow(-10, 9) <= b && b <= Math.Pow(10, 9) && 1 <= s && s <= Math.Pow(2 * 10, 9))
            {
                sum = Math.Abs(a) + Math.Abs(b);
                i = (s - sum) % 2;
                    if ( i == 0 && s >= sum )
                    {
                        Console.WriteLine("YES");
                    }
                    else
                    {
                        Console.WriteLine("NO");
                    }

              }
            }
        }
    }


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pr1
{
    class Program
    {
        static void Main()
        {
            var a= Array.ConvertAll(Console.ReadLine().Split(' '), Convert.ToInt32);
            a[0]=Math.Abs(a[0]);
            a[1]=Math.Abs(a[1]);
            if(a[2]%2==(a[0]+a[1])%2&&a[2]>=(a[0]+a[1]))
                Console.Write("Yes");
            else
                Console.Write("No");

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _841A
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int n = arr[0];
            int k = arr[1];
            string a = Console.ReadLine();
            int lenght = a.Length;
            int[] count = new int[n];
            for(int i=0; i<lenght-1; i++)
            {
                for(int j=i+1; j<lenght; j++)
                {
                    if (a[i] == a[j])
                        count[i]++;
                }
            }
            Console.WriteLine(count.Max() + 1 <= k ? "YES" : "NO");
            }

    }
}


using System;
using System.Linq;
using System.Collections.Generic;

namespace AlgoTasks
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] nk = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
            string c = Console.ReadLine();
            Dictionary<char, int> colors = new Dictionary<char, int>();
            foreach(var ch in c)
            {
                if (!colors.ContainsKey(ch))
                    colors.Add(ch, 1);
                else
                    colors[ch]++;
            }

            bool yes = true;
            foreach(var d in colors)
            {
                if (d.Value > nk[1])
                    yes = false;
            }

            Console.WriteLine(yes ? "YES" : "NO");
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

// (づ*ω*)づﾐ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public object Solve()
    {
        long n = ReadInt();
        long m = ReadInt();
        long k = ReadLong();

        long l = 1;
        long r = n * m;
        while (true)
        {
            long mid = (l + r) / 2;
            long gleft = 0;
            long gright = 0;
            long closestLeft = 0;
            long closestRight = long.MaxValue;
            for (long i = 1; i <= m; i++)
            {
                if (mid > i * n)
                {
                    gleft += n;
                    closestLeft = Math.Max(closestLeft, i * n);
                    continue;
                }
                if (mid < i)
                {
                    gright += n;
                    closestRight = Math.Min(closestRight, i);
                    continue;
                }
                if (mid % i == 0)
                {
                    closestLeft = closestRight = mid;
                    gleft += mid / i - 1;
                    gright += n - mid / i;
                }
                else
                {
                    closestLeft = Math.Max(closestLeft, mid / i * i);
                    closestRight = Math.Min(closestRight, (mid / i + 1) * i);
                    gleft += mid / i;
                    gright += n - mid / i;
                }
            }
            if (gleft + gright == n * m)
            {
                if (gleft + 1 == k)
                    return closestRight;
                if (gleft + 1 < k)
                    l = closestRight;
                else
                    r = closestLeft;
            }
            else
            {
                if (k > gleft && k + gright <= n * m)
                    return closestLeft;
                if (k <= gleft)
                    r = closestLeft - 1;
                else
                    l = closestRight + 1;
            }
        }

        return null;
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = Console.In;
        writer = new StreamWriter(Console.OpenStandardOutput());
#endif
        try
        {
            var ts = DateTime.Now;
            object result = new Solver().Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
#if DEBUG
            Console.WriteLine(ex);
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read/Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    #endregion
}


using System;

namespace Codeforces.R256
{
    public class Task_D
    {
        static void Main(string[] args)
        {
            new Task_D().Solve();
        }

        private long n;
        private long m;
        private long k;

        private void Solve()
        {
            var parts = Console.ReadLine().Split();
            n = long.Parse(parts[0]);
            m = long.Parse(parts[1]);
            k = long.Parse(parts[2]);

            long left = 1;
            long right = n * m;
            while (left < right)
            {
                var x = (left + right + 1) / 2;
                var before = GetLessThenCount(x);
                if (before < k)
                {
                    left = x;
                }
                else
                {
                    right = x - 1;
                }
            }
            Console.WriteLine(left);
        }

        private long GetLessThenCount(long num)
        {
            long sum = 0;
            for (int i = 1; i <= n; i++)
            {
                long w = Math.Min(m, (num - 1) / i);
                sum += w;
                if (w == 0)
                    break;
            }
            return sum;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Main
{
    class Program
    {
        static void Main(string[] args)
        {
            string keyboard = "qwertyuiopasdfghjkl;zxcvbnm,./";

            string[] str = Console.ReadLine().Split();
            char dir = Convert.ToChar(str[0].ToLower());
            string msg = Console.ReadLine();
            if (dir == 'r')
            {
                foreach (char ch in msg)
                {
                    int index = keyboard.IndexOf(ch);
                    if (index == 0 || index == 10 || index == 20)
                        Console.Write(keyboard[index]);
                    else
                        Console.Write(keyboard[index - 1]);
                }
            }
            else
            {
                foreach (char ch in msg)
                {
                    int index = keyboard.IndexOf(ch);
                    if (index == 9 || index == 19 || index == 29)
                        Console.Write(keyboard[index]);
                    else
                        Console.Write(keyboard[index + 1]);
                }
            }
            Console.Read();
        }
    }
}


using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			string input2 = Console.ReadLine();

			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			//var inputs1 = input1.Split(new[] { ' ', '}', '{' , ',' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();

			string row1 = "qwertyuiop";
			string row2 = "asdfghjkl;";
			string row3 = "zxcvbnm,./";

			var builder = new StringBuilder();
			for (int i = 0; i < input2.Length; i++)
			{
				var symbol = input2.Substring(i, 1);

				int index;
				if (row1.IndexOf(symbol) >= 0)
				{
					index = row1.IndexOf(symbol);
					if (input1 == "R")
					{
						index--;
					}
					else
					{
						index++;
					}

					builder.Append(row1.ElementAt(index));
				}
				else if (row2.IndexOf(symbol) >= 0)
				{
					index = row2.IndexOf(symbol);
					if (input1 == "R")
					{
						index--;
					}
					else
					{
						index++;
					}

					builder.Append(row2.ElementAt(index));
				}
				else
				{
					index = row3.IndexOf(symbol);
					if (input1 == "R")
					{
						index--;
					}
					else
					{
						index++;
					}

					builder.Append(row3.ElementAt(index));
				}
			}

			Console.WriteLine(builder.ToString());
		}

		static long Factorial(long a)
		{
			return a > 1 ? a * Factorial(a - 1) : 1;
		}
	}
}


// Problem: 202A - LLPS
// Author: Gusztav Szmolik

using System;

class LLPS
	{
	static int Main ()
		{
		string line = Console.ReadLine ();
		if (line == null)
			return -1;
		char[] delims = {' ', '\t'};
		string[] words = line.Split (delims,StringSplitOptions.RemoveEmptyEntries);
		if (words.Length != 1)
			return -1;
		string s = words[0];
		byte sLength = Convert.ToByte (s.Length);
		if (sLength > 10)
			return -1;
		byte[] countChars = new byte[26];
		Array.Clear (countChars,0,26);
		char maxChar = 'a';
		for (byte i = 0; i < sLength; i++)
			{
			char c = s[i];
			if (!Char.IsLower (c))
				return -1;
			countChars[c-'a']++;
			if (c > maxChar)
				maxChar = c;
			}
		string ans = new String (maxChar,countChars[maxChar-'a']);
		Console.WriteLine (ans);
		return 0;
		}
	}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Threading.Tasks;

namespace Codeforces127
{
	class Program
	{
		static void A()
		{
			int[] chars = new int[255];
			string s = Console.ReadLine();
			for (int i = 0; i < s.Length; i++)
			{
				chars[(int)s[i]]++;
			}

			string result = "";
			for (int c = 254; c >= 0; c--)
			{
				bool found = false;
				while (chars[c] > 1)
				{
					chars[c] -= 2;
					result = result + (char)c + (char)c;
					found = true;
				}
				if (chars[c] == 1)
				{
					found = true;
					result += (char)c;
				}
				if (found)
					break;
			}

			//res

			Console.WriteLine(result);
		}
		static void Main(string[] args)
		{
			A();
		}
	}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TaskOne
{
    class Program
    {
        static void Main(string[] args)
        {
            double n = Convert.ToDouble(Console.ReadLine());
            if (n > 5)
            {
                double s = n - 3;

                double nepol = n - 3;

                double count = (s - 1) * nepol;
                count = count + s * 2;
                count = count + s + 1;
                Console.Write(count);
            }
            else
                if (n == 3) Console.Write("1");
                else
                    if (n == 4) Console.Write("4");
                    else
                        if (n == 5) Console.Write("9");
            Console.ReadLine();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace _305
{
    class Program
    {
        static void Main(string[] args)
        {

            //Console.BufferWidth = 1001;
            UInt64 x= Convert.ToUInt64(Console.ReadLine());

            Console.WriteLine((x-2)*(x-2));
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace codeforces
{
	class Program
	{
		public class User
		{
			public int c;

			public int r;
		}

		public class Point
		{
			public int x;

			public double p;
		}

		public class Comparer : IComparer<User>
		{
			public int Compare(User x, User y)
			{
				if (x.c < y.c || (x.c == y.c && x.r < y.r))
					return -1;
				return 1;
			}
		}

		public static long getGcd(long a, long b)
		{
			if (b == 0)
				return a;
			return getGcd(b, a % b);
		}

		public static void WriteYESNO(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string GetString()
		{
			return Console.ReadLine();
		}

		public static List<int> getList()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static int Min(int x, int y)
		{
			return Math.Min(x, y);
		}

		public static int Max(int x, int y)
		{
			return Math.Max(x, y);
		}

		public static int Abs(int x)
		{
			return Math.Abs(x);
		}

		public static int getInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static bool Equal(int x, int y, int x1, int y1)
		{
			return x == x1 && y == y1;
		}

		public class Vertex
		{
			public List<int> edges;

			public int ct;

			public Vertex()
			{
				ct = 0;
				edges = new List<int>();
				for (var i = 0; i < 26; ++i)
					edges.Add(0);
			}
		}

		private static void Main(string[] args)
		{
/*			var input = new StreamReader("input.txt");
			var output = new StreamWriter("output.txt");*/

			var n = getInt();
			var a = n/10;
			var b = n%10;
			var ct1 = 0;
			var ct2 = 0;
			if (a == 0)
			{
				ct1 = 2;
			}
			if (a == 1)
			{
				ct1 = 7;
			}
			if (a == 2)
				ct1 = 2;
			if (a == 3)
				ct1 = 3;
			if (a == 4)
				ct1 = 3;
			if (a == 5)
				ct1 = 4;
			if (a == 6)
				ct1 = 2;
			if (a == 7)
				ct1 = 5;
			if (a == 8)
				ct1 = 1;
			if (a == 9)
				ct1 = 2;
			if (b == 0)
			{
				ct2 = 2;
			}
			if (b == 1)
			{
				ct2 = 7;
			}
			if (b == 2)
				ct2 = 2;
			if (b == 3)
				ct2 = 3;
			if (b == 4)
				ct2 = 3;
			if (b == 5)
				ct2 = 4;
			if (b == 6)
				ct2 = 2;
			if (b == 7)
				ct2 = 5;
			if (b == 8)
				ct2 = 1;
			if (b == 9)
				ct2 = 2;
			Console.WriteLine(ct1 * ct2);
			/*			input.Close();
			output.Close();*/
		}
	}
}


using System;
using System.Text;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str = Console.ReadLine().Trim();
        int[] arr = new int[]{2,7,2,3,3,4,2,5,1,2};
        if(str.Length > 1){
            int a1 = (int)str[0] - (int)'0';
            int b1 = (int)str[1] - (int)'0';
            Console.WriteLine(arr[a1] * arr[b1]);
        }else{
            int a1 = (int)str[0] - (int)'0';
            //int b1 = (int)str[1] - (int)'0';
            Console.WriteLine(arr[a1]);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _724A {
	class Program {
		static void Main(string[] args) {
			string a = Console.ReadLine();
			string b = Console.ReadLine();
			string[] days = new string[] { "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday" };
			int a1 = 0;
			int b1= 0;
			for(int i=0; i<days.Length; i++) {
				if (days[i] == a)
					a1 = i;
				if (days[i] == b)
					b1 = i;
			}
			bool res = (a1 == b1 || (a1 + 2) % 7 == b1 || (a1 + 3) % 7 == b1);
			Console.WriteLine(res ? "YES" : "NO");
			//Console.ReadKey();
		}
	}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _724A
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine(), s2 = Console.ReadLine();
            int day1 = DayOfWeek(s1), day2 = DayOfWeek(s2);
            int[] monthes = new[] { 28, 30, 31 };
            bool result = false;
            foreach (var month in monthes)
            {
                if ((day1 + month) % 7 == day2)
                {
                    result = true;
                    break;
                }
            }
            Console.WriteLine(result ? "YES" : "NO");
            //Console.ReadLine();
        }

        static int DayOfWeek(string s)
        {
            switch (s)
            {
                case "monday": return 0;
                case "tuesday": return 1;
                case "wednesday": return 2;
                case "thursday": return 3;
                case "friday": return 4;
                case "saturday": return 5;
                case "sunday": return 6;
                default: return -1;
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            long b = Int64.Parse(Console.ReadLine());

            Console.WriteLine(DivNum(b));
        }
        static long NOK(long a, long b)
        {
            return a * b / (NOD(a, b));
        }
        static long NOD(long a, long b)
        {
            long min, max;

            if (a > b)
            {
                min = b;
                max = a;
            }
            else if (a < b)
            {
                min = a;
                max = b;
            }
            else
            {
                return a;
            }

            while (min != max)
            {
                max = max - min;
                if (max < min)
                {
                    long t = max;
                    max = min;
                    min = t;
                }
            }

            return min;
        }
        static long DivNum(long b)
        {
            int count = 0;

            if (b == 1)
                return 1;

            for (int i = 1; i < Math.Sqrt(b); i++)
            {
                if ((b % i) == 0)
                    count += 2;
            }
            if (b % Math.Sqrt(b) == 0)
                count++;

            return count;
        }
    }
}


using System;
using System.Collections.Generic;

namespace G6
{
    class Program
    {
        static void Main(string[] args)
        {
            long b = long.Parse(Console.ReadLine().Trim(' '));

            int answer = 0;
            for (long s = 1; s <= (long)Math.Sqrt(b); s++)
            {
                if ((b % s == 0) && (s * s != b))
                    answer += 2;
                else if (b % s == 0)
                    answer++;
            }
            Console.Write(answer);

            //Console.ReadKey();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using SB = System.Text.StringBuilder;
//using System.Threading.Tasks;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
using System.Numerics;
using static System.Math;
using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    readonly Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    readonly int dom = 998244353;
    bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (b.CompareTo(a) < 0) { a = b; return true; } return false; }

    int diff(char a, char b)
    {
        int p = Abs(a - b);
        int q = 26 - p;
        return Min(p, q);
    }
    void solve()
    {
        int N = cin.nextint;
        var S = cin.next;
        int ans = int.MaxValue;
        for (int i = 3; i < N; i++)
        {
            int sum = diff(S[i - 3], 'A') + diff(S[i - 2], 'C') + diff(S[i - 1], 'T') + diff(S[i], 'G');
            chmin(ref ans, sum);
        }
        WriteLine(ans);
    }

}

static class Ex
{
    public static void join<T>(this IEnumerable<T> values, string sep = " ") => WriteLine(string.Join(sep, values));
    public static string concat<T>(this IEnumerable<T> values) => string.Concat(values);
    public static string reverse(this string s) { var t = s.ToCharArray(); Array.Reverse(t); return t.concat(); }

    public static int lower_bound<T>(this IList<T> arr, T val) where T : IComparable<T>
    {
        int low = 0, high = arr.Count;
        int mid;
        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (arr[mid].CompareTo(val) < 0) low = mid + 1;
            else high = mid;
        }
        return low;
    }
    public static int upper_bound<T>(this IList<T> arr, T val) where T : IComparable<T>
    {
        int low = 0, high = arr.Count;
        int mid;
        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (arr[mid].CompareTo(val) <= 0) low = mid + 1;
            else high = mid;
        }
        return low;
    }
}

class Pair<T, U> : IComparable<Pair<T, U>> where T : IComparable<T> where U : IComparable<U>
{
    public T f; public U s;
    public Pair(T f, U s) { this.f = f; this.s = s; }
    public int CompareTo(Pair<T, U> a) => f.CompareTo(a.f) != 0 ? f.CompareTo(a.f) : s.CompareTo(a.s);
    public override string ToString() => $"{f} {s}";
}

class Scanner
{
    string[] s; int i;
    readonly char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan => ReadLine().Split();
    public int[] scanint => Array.ConvertAll(scan, int.Parse);
    public long[] scanlong => Array.ConvertAll(scan, long.Parse);
    public double[] scandouble => Array.ConvertAll(scan, double.Parse);
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint => int.Parse(next);
    public long nextlong => long.Parse(next);
    public double nextdouble => double.Parse(next);
}


using System;
using System.IO;

namespace Contest
{
    class Program
    {
        public void Solve()
        {
            var sc = new Scanner();
            int N = sc.NextInt();
            string S = sc.Next();
            int min = int.MaxValue;
            for (int i = 0; i <= N - 4; i++)
            {
                int dif = 0;
                dif += Diff('A', S[i]);
                dif += Diff('C', S[i + 1]);
                dif += Diff('T', S[i + 2]);
                dif += Diff('G', S[i + 3]);
                min = Math.Min(dif, min);
            }

            Console.WriteLine(min);
        }

        static void Main() => new Program().Solve();

        private int Diff(char a, char b)
        {
            int d = Math.Abs(a - b);
            return Math.Min(d, (26 - d));
        }
    }
}

class Scanner
{
    public Scanner()
    {
        _stream = new StreamReader(Console.OpenStandardInput());
        _pos = 0;
        _line = new string[0];
        _separator = ' ';
    }

    private char _separator;
    private StreamReader _stream;
    private int _pos;
    private string[] _line;

    #region get a element

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = _stream.ReadLine().Split(_separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region convert array

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region get row elements

    #region get array

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = _stream.ReadLine().Split(_separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion

    #region get 2~4 elements

    public void GetRow(out string a, out string b)
    {
        a = Next();
        b = Next();
    }

    public void GetRow(out string a, out string b, out string c)
    {
        a = Next();
        b = Next();
        c = Next();
    }

    public void GetRow(out string a, out string b, out string c, out string d)
    {
        a = Next();
        b = Next();
        c = Next();
        d = Next();
    }

    public void GetIntRow(out int a, out int b)
    {
        a = NextInt();
        b = NextInt();
    }

    public void GetIntRow(out int a, out int b, out int c)
    {
        a = NextInt();
        b = NextInt();
        c = NextInt();
    }

    public void GetIntRow(out int a, out int b, out int c, out int d)
    {
        a = NextInt();
        b = NextInt();
        c = NextInt();
        d = NextInt();
    }

    public void GetLongRow(out long a, out long b)
    {
        a = NextLong();
        b = NextLong();
    }

    public void GetLongRow(out long a, out long b, out long c)
    {
        a = NextLong();
        b = NextLong();
        c = NextLong();
    }

    public void GetLongRow(out long a, out long b, out long c, out long d)
    {
        a = NextLong();
        b = NextLong();
        c = NextLong();
        d = NextLong();
    }

    public void GetDoubleRow(out double a, out double b)
    {
        a = NextDouble();
        b = NextDouble();
    }

    public void GetDoubleRow(out double a, out double b, out double c)
    {
        a = NextDouble();
        b = NextDouble();
        c = NextDouble();
    }

    public void GetDoubleRow(out double a, out double b, out double c, out double d)
    {
        a = NextDouble();
        b = NextDouble();
        c = NextDouble();
        d = NextDouble();
    }

    #endregion

    #endregion

    #region get 2~4 column elements

    public void GetColumn(int n, out string[] a)
    {
        a = new string[n];
        for (int i = 0; i < n; i++)
        {
            a[i] = Next();
        }
    }

    public void GetColumn(int n, out string[] a, out string[] b)
    {
        a = new string[n];
        b = new string[n];
        for (int i = 0; i < n; i++)
        {
            GetRow(out a[i], out b[i]);
        }
    }

    public void GetColumn(int n, out string[] a, out string[] b, out string[] c)
    {
        a = new string[n];
        b = new string[n];
        c = new string[n];
        for (int i = 0; i < n; i++)
        {
            GetRow(out a[i], out b[i], out c[i]);
        }
    }

    public void GetColumn(int n, out string[] a, out string[] b, out string[] c, out string[] d)
    {
        a = new string[n];
        b = new string[n];
        c = new string[n];
        d = new string[n];
        for (int i = 0; i < n; i++)
        {
            GetRow(out a[i], out b[i], out c[i], out d[i]);
        }
    }

    public void GetIntColumn(int n, out int[] a)
    {
        string[] sa;
        GetColumn(n, out sa);
        a = ToIntArray(sa);
    }

    public void GetIntColumn(int n, out int[] a, out int[] b)
    {
        string[] sa, sb;
        GetColumn(n, out sa, out sb);
        a = ToIntArray(sa);
        b = ToIntArray(sb);
    }

    public void GetIntColumn(int n, out int[] a, out int[] b, out int[] c)
    {
        string[] sa, sb, sc;
        GetColumn(n, out sa, out sb, out sc);
        a = ToIntArray(sa);
        b = ToIntArray(sb);
        c = ToIntArray(sc);
    }

    public void GetIntColumn(int n, out int[] a, out int[] b, out int[] c, out int[] d)
    {
        string[] sa, sb, sc, sd;
        GetColumn(n, out sa, out sb, out sc, out sd);
        a = ToIntArray(sa);
        b = ToIntArray(sb);
        c = ToIntArray(sc);
        d = ToIntArray(sd);
    }

    public void GetLongColumn(int n, out long[] a)
    {
        string[] sa;
        GetColumn(n, out sa);
        a = ToLongArray(sa);
    }

    public void GetLongColumn(int n, out long[] a, out long[] b)
    {
        string[] sa, sb;
        GetColumn(n, out sa, out sb);
        a = ToLongArray(sa);
        b = ToLongArray(sb);
    }

    public void GetLongColumn(int n, out long[] a, out long[] b, out long[] c)
    {
        string[] sa, sb, sc;
        GetColumn(n, out sa, out sb, out sc);
        a = ToLongArray(sa);
        b = ToLongArray(sb);
        c = ToLongArray(sc);
    }

    public void GetLongColumn(int n, out long[] a, out long[] b, out long[] c, out long[] d)
    {
        string[] sa, sb, sc, sd;
        GetColumn(n, out sa, out sb, out sc, out sd);
        a = ToLongArray(sa);
        b = ToLongArray(sb);
        c = ToLongArray(sc);
        d = ToLongArray(sd);
    }

    public void GetDoubleColumn(int n, out double[] a)
    {
        string[] sa;
        GetColumn(n, out sa);
        a = ToDoubleArray(sa);
    }

    public void GetDoubleColumn(int n, out double[] a, out double[] b)
    {
        string[] sa, sb;
        GetColumn(n, out sa, out sb);
        a = ToDoubleArray(sa);
        b = ToDoubleArray(sb);
    }

    public void GetDoubleColumn(int n, out double[] a, out double[] b, out double[] c)
    {
        string[] sa, sb, sc;
        GetColumn(n, out sa, out sb, out sc);
        a = ToDoubleArray(sa);
        b = ToDoubleArray(sb);
        c = ToDoubleArray(sc);
    }

    public void GetDoubleColumn(int n, out double[] a, out double[] b, out double[] c, out double[] d)
    {
        string[] sa, sb, sc, sd;
        GetColumn(n, out sa, out sb, out sc, out sd);
        a = ToDoubleArray(sa);
        b = ToDoubleArray(sb);
        c = ToDoubleArray(sc);
        d = ToDoubleArray(sd);
    }

    #endregion

    #region get matrix

    public string[][] GetMatrix(int h)
    {
        string[][] result = new string[h][];
        for (int i = 0; i < h; i++)
        {
            result[i] = Array();
        }

        return result;

    }

    public int[][] GetIntMatrix(int h)
    {
        int[][] result = new int[h][];
        for (int i = 0; i < h; i++)
        {
            result[i] = IntArray();
        }

        return result;
    }

    public long[][] GetLongMatrix(int h)
    {
        long[][] result = new long[h][];
        for (int i = 0; i < h; i++)
        {
            result[i] = LongArray();
        }

        return result;
    }

    public double[][] GetDoubleMatrix(int h)
    {
        double[][] result = new double[h][];
        for (int i = 0; i < h; i++)
        {
            result[i] = DoubleArray();
        }

        return result;
    }

    public char[][] GetCharMatrix(int h)
    {
        char[][] result = new char[h][];
        for (int i = 0; i < h; i++)
        {
            result[i] = Next().ToCharArray();
        }

        return result;
    }

    #endregion
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _977B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] dv = new string[n - 1];
            string str = Console.ReadLine();
            char[] ch = new char[n];
            for (int i = 0; i < n; i++)
            {
                ch[i] = str[i];
            }
            for (int i = 0; i < n-1; i++)
            {
                dv[i] = ""+ch[i] + ch[i + 1];
            }
            int max = 0;
            int mem = 0;
            for (int i = 0; i < n-1; i++)
            {
                int c = 0;
                for (int j = 0; j < n-1; j++)
                {
                    if (dv[i] == dv[j]) { c++; }
                }
                if (c > max)
                {
                    mem = i;
                    max = c;
                }
            }
            Console.WriteLine(dv[mem]);

        }
    }
}


using System;
using System.Linq;
class Task {

    static void Main() {
        var n = Convert.ToInt32(Console.ReadLine());
        var original = Console.ReadLine();

        string[] str = new string[n - 1];
        for(int i = 0; i < n - 1; i++) {
            str[i] = Char.ToString(original[i]) + Char.ToString(original[i + 1]);
        }

        int[] nums = new int[n - 1];
        int count = 0;

        for(int i = 0; i < n - 1; i++) {
            count = str.Count(f => f == str[i]);
            nums[i] = count;
        }

        Console.WriteLine(str[nums.ToList().IndexOf(nums.Max())]);

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ko
{
    class Program
    {
        static void Main()
        {
            int n, x, pr, nujno, res, i;
            int[] arr = new int[3];
            string[] tmp = Console.ReadLine().Split(' ');
            for (i = 0; i < 3; i++)
            arr[i] = Int32.Parse(tmp[i]);
            n = arr[0];
            x = arr[1];
            pr = arr[2];
            if (n * pr % 100 == 0)
                    nujno = (n * pr / 100);
                else nujno = (n * pr / 100) + 1;
            if (nujno <= x) res = 0;
            else res = nujno - x;
            Console.WriteLine(res);
            }
        }
    }


using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
using System.Threading;
using System.Collections;
using System.IO;

namespace AcmSolution
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            //Console.SetIn(new StreamReader("gcd.in"));
           // Console.SetOut(new StreamWriter("gcd.out"));
            Do();
            //Console.Out.Close();
            Console.ReadLine();
        }

        private static void Do()
        {
            int n;
            int x;
            int y;
            double answer = 0;
            GetInts(out n, out x, out y);
            double person = n * y;
            person = person / 100;
            if (person > x)
                answer = person - x;
            if (answer != (int)(answer) && person > x)
            {
                answer = answer + 1;
                answer = (int)(answer);
            }
            Console.WriteLine(answer);
        }

     #region Utils
        private const double Epsilon = 0.00000001;

        private static string GetStr()
        {
            return Console.ReadLine();
        }

        private static string[] GetStrs()
        {
            return GetStr().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] GetStrs(int cnt)
        {
            var s = new string[cnt];
            for (var i = 0; i < cnt; ++i)
                s[i] = GetStr();
            return s;
        }

        private static int GetInt()
        {
            return int.Parse(GetStr());
        }

        private static void GetInts(out int a, out int b)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
        }

        private static void GetInts(out int a, out int b, out int c)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
            c = q[2];
        }

        private static int[] GetInts()
        {
            var s = GetStrs();
            var a = new int[s.Length];
            for (var i = 0; i < s.Length; ++i)
                a[i] = int.Parse(s[i]);
            return a;
        }

        private static long GetLong()
        {
            return long.Parse(GetStr());
        }

        private static IEnumerable<long> GetLongs()
        {
            return GetStrs().Select(long.Parse);
        }

        private static void WriteDouble<T>(T d)
        {
            Console.WriteLine(string.Format("{0:0.000000000}", d).Replace(',', '.'));
        }

        private static void WL<T>(T s)
        {
            Console.WriteLine(s);
        }

        private static void W<T>(T s)
        {
            Console.Write(s);
        }

        private static void Assert(bool b)
        {
            if (!b) throw new Exception();
        }

        private static void Swap<T>(ref T a, ref T b)
        {
            var temp = a;
            a = b;
            b = temp;
        }

        #endregion
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _141B
{
    class Program
    {
        static void Main(string[] args)
        {

            string s = Console.ReadLine();
            string[] mas = s.Split(' ');
            int a = int.Parse(mas[0]);
            int x = int.Parse(mas[1]);
            int y = int.Parse(mas[2]);

            bool check = true;

            int lines = y / a;

            if ((x >= a) || (x <= -a)) check = false;
            if (y % a == 0) check = false;
            if (((lines) % 2 == 1 || y/a<1) & (x >= a / 2.0 || x <= -a / 2.0)) check = false;
            if ((lines % 2 == 0 & y>a) & (x == 0)) check = false;
            if (check == false)
            {
                Console.WriteLine("-1");
            }
            else
            {
                int nmin = 0;

                if (y < a) nmin = 1;
                else
                {

                    if (y > a) nmin = ((y - a) / (a * 2)) * 3 + 1;
                    if (lines % 2 == 0)
                    {
                        if (x < 0) nmin = nmin + 2;
                        else nmin = nmin + 3;
                    }
                    else nmin++;
                }
                Console.WriteLine(nmin);
                Console.ReadLine();
            }

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _11111
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] iData = Console.ReadLine().Split(' ');
            int iA = Convert.ToInt32(iData[0]);
            int iX = Convert.ToInt32(iData[1]);
            int iY = Convert.ToInt32(iData[2]);

            int iLevel = iY / iA;
            int iNumberSquare = -1;
            if (iY % iA != 0)
            {
                iNumberSquare = 0;
                int iIndexLevel = 0;
                while (iIndexLevel != iLevel)
                {
                    iIndexLevel++;
                    iNumberSquare++;
                    if (iIndexLevel != 1 && iIndexLevel % 2 != 0)
                        iNumberSquare++;
                }

                if(iLevel+1 == 1 || (iLevel+1) % 2 == 0)
                {
                    if (iX > -((double)iA) / 2 && iX < ((double)iA) / 2)
                        iNumberSquare++;
                    else
                        iNumberSquare = -1;
                }
                else
                {
                    if (iX > -((double)iA) && iX < 0)
                        iNumberSquare++;
                    else
                        if (iX > 0 && iX < ((double)iA))
                            iNumberSquare += 2;
                        else
                            iNumberSquare = -1;
                }

            }
            Console.WriteLine(iNumberSquare);
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inputArray = Array.ConvertAll(Console.ReadLine().Split((char)32), int.Parse);

            Console.WriteLine(Math.Min(inputArray[0], Math.Min(inputArray[1], (inputArray[0] + inputArray[1]) / 3)));
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using static System.Math;

// http://codeforces.com/problemset/problem/519/C
public class C___A_and_B_and_Team_Training
{
    private static void Solve()
    {
        int a = ReadInt();
        int b = ReadInt();

        int teams = 0;
        while ((a > 0 && b > 1) || (a > 1 && b > 0))
        {
            if (a > b)
            {
                a -= 2;
                b -= 1;
            } else
            {
                a -= 1;
                b -= 2;
            }
            teams++;
        }

        Write(teams);
    }

    #region Main

    private static TextReader reader;
    private static TextWriter writer;

    public static void Main()
    {
#if DEBUG

        //reader = new StreamReader("C:\\Users\\Axel\\Desktop\\input.txt");
        reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;

        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());

        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            Solve();

            //var thread = new Thread(new String_Task().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
#if DEBUG
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion Main

    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string Read()
    {
        while (currentLineTokens.Count == 0) currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(Read());
    }

    public static long ReadLong()
    {
        return long.Parse(Read());
    }

    public static double ReadDouble()
    {
        return double.Parse(Read(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray(); return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++) ret[i][j] = matrix[j][i]; }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++) lines[i] = reader.ReadLine().Trim(); return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write(params object[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array) writer.WriteLine(a);
    }

    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }

    private static T[] Init<T>(int size) where T : new()
    {
        var ret = new T[size]; for (int i = 0; i < size; i++) ret[i] = new T(); return ret;
    }

    #endregion Read / Write
}


using System;

namespace test
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            Console.ReadLine();
            var x = Console.ReadLine().Split(' ');
            int ans = 0;
            foreach(var i in x){
                ans += Math.Abs(int.Parse(i));
            }
            Console.WriteLine(ans.ToString());
        }
    }
}


using System;
using System.Linq;

namespace codeforces
{

    class Program
    {
        static void Main(string[] args)
        {
            int c1 = int.Parse(Console.ReadLine());
            int[] count = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int a = count.Where(x => x <= 0).ToArray().Sum();
            int b = count.Where(x => x > 0).ToArray().Sum();
            Console.WriteLine(b-a);

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeForces.C659
{
    class Pa
    {
        static void Main(string[] args)
        {
            int[] data = Console.ReadLine().Split(' ').Select(t => int.Parse(t)).ToArray();
            Console.WriteLine((data[0]*100 + data[1] + data[2] - 1) % data[0] + 1);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string stroka = ""; ; string konec = ""; int a = 0; long itog = 0; long kol = 0; long nomer = 0;long y=1; long minut = 0; string konec2 = ""; long[] strochenka = { 0, 0 };
            stroka = Console.ReadLine();
            string[] split = stroka.Split(new Char[] { ' ' });
            foreach (string s in split)
            {
                if (s.Trim() != "")
                {
                    if (a == 0)
                        kol = Convert.ToInt64(s);
                    if(a==1)
                        nomer = Convert.ToInt64(s);
                    if (a==2)
                        minut = Convert.ToInt64(s);
                    a++;
                }
            }
                itog = (nomer-1 + (minut%kol+kol)) % kol+1;
            Console.Write(Math.Abs(itog));
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace Olymp
{
  public class ProblemSolver
  {
    private readonly Tokenizer input;

    public void Solve()
    {
      var a = input.ReadIntArray(3);
      var d = input.ReadInt();
      Array.Sort(a);
      Write(Max(0, d - (a[1] - a[0]) + Max(0, d - (a[2] - a[1]))));
    }

    public ProblemSolver(TextReader input)
    {
      this.input = new Tokenizer(input);
    }
  }

  #region Service classes

  public class Tokenizer
  {
    private readonly TextReader reader;

    public string ReadToEnd()
    {
      return reader.ReadToEnd();
    }

    public int ReadInt()
    {
      var c = SkipWS();
      if (c == -1)
        throw new EndOfStreamException();
      var isNegative = false;
      if (c == '-' || c == '+')
      {
        isNegative = c == '-';
        c = reader.Read();
        if (c == -1)
          throw new EndOfStreamException("Digit expected, but end of stream occurs");
      }

      if (!char.IsDigit((char)c))
        throw new InvalidOperationException($"Digit expected, but was: '{(char)c}'");
      var result = (char)c - '0';
      c = reader.Read();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        if (!char.IsDigit((char)c))
          throw new InvalidOperationException($"Digit expected, but was: '{(char)c}'");
        result = result * 10 + (char)c - '0';
        c = reader.Read();
      }

      if (isNegative)
        result = -result;
      return result;
    }

    public string ReadLine()
    {
      return reader.ReadLine();
    }

    public long ReadLong()
    {
      return long.Parse(ReadToken());
    }

    public double ReadDouble()
    {
      return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public int[] ReadIntArray(int n)
    {
      var a = new int[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadInt();
      return a;
    }

    public (int, int) Read2Int() =>
      (ReadInt(), ReadInt());

    public (int, int, int) Read3Int() =>
      (ReadInt(), ReadInt(), ReadInt());

    public (int, int, int, int) Read4Int() =>
      (ReadInt(), ReadInt(), ReadInt(), ReadInt());

    public long[] ReadLongArray(int n)
    {
      var a = new long[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadLong();
      return a;
    }

    public double[] ReadDoubleArray(int n)
    {
      var a = new double[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadDouble();
      return a;
    }

    public string ReadToken()
    {
      var c = SkipWS();
      if (c == -1)
        return null;
      var sb = new StringBuilder();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        sb.Append((char)c);
        c = reader.Read();
      }

      return sb.ToString();
    }

    private int SkipWS()
    {
      var c = reader.Read();
      if (c == -1)
        return c;
      while (c > 0 && char.IsWhiteSpace((char)c))
        c = reader.Read();
      return c;
    }

    public Tokenizer(TextReader reader)
    {
      this.reader = reader;
    }
  }

  internal class Program
  {
    public static void Main()
    {
      var solver = new ProblemSolver(In);
      solver.Solve();
    }
  }

  #endregion
}


using System;
using System.Linq;

namespace Codeforces
{
    public class ProblemA568
    {
        static void Main(string[] args)
        {
            long[] abcd = Console.ReadLine().Split().Select(long.Parse).ToArray();
            long d = abcd[3];
            var l = abcd.Take(3).ToList();
            l.Sort();
            long target0 = l[1] - d;
            long target2 = l[1] + d;
            long duration = 0;
            duration += Math.Max(0, l[0] - target0);
            duration += Math.Max(0, target2 - l[2]);
            Console.WriteLine(duration);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Policy;
using System.Text;

namespace Console
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = new List<long>(System.Console.ReadLine().Split(' ').Select(long.Parse));
            var a = arr[0];
            var b = arr[1];
            var c = arr[2];
            var l = arr[3];

            long ans = (l + 1)*(l + 2)*(l + 3)/6;
            for (int i = 0; i <= l; ++i)
            {
                ans -= Fun(a + i, b, c, l - i);
                ans -= Fun(b + i, a, c, l - i);
                ans -= Fun(c + i, b, a, l - i);
            }
            System.Console.Write(ans);
            //System.Console.ReadLine();
        }

        static long Fun(long a, long b, long c, long x)
        {
            if (a < b + c)
                return 0;
            var min = Math.Min(a - b - c, x);
            return (min + 1)*(min + 2)/2;
        }
    }
}


using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using Debug = System.Diagnostics.Debug;
using StringBuilder = System.Text.StringBuilder;
using System.Numerics;

namespace Program
{

    public class Solver
    {
        public void Solve()
        {
            var table = new CombinationTable(300050);
            var a = sc.Integer();
            var b = sc.Integer();
            var c = sc.Integer();
            var l = sc.Integer();
            long all = 0;
            for (int i = 0; i <= l; i++)
            {
                all += table[i + 2, 2];
                Debug.WriteLine(all);
            }
            var abc = new int[] { a, b, c };
            var sum = a + b + c;
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j <= l; j++)
                {
                    var max = abc[i] + j;
                    var rem = Math.Min(l - j, max - sum + abc[i]);
                    if (rem < 0) continue;
                    all -= table[rem + 2, 2];
                }
            }
            IO.Printer.Out.WriteLine(all);
        }
        public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
        static T[] Enumerate<T>(int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }
        static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
    }
}

#region main
static class Ex
{
    static public string AsString(this IEnumerable<char> ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }
    static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
    static public void Main()
    {
        var solver = new Program.Solver();
        solver.Solve();
        Program.IO.Printer.Out.Flush();
    }
}
#endregion
#region Ex
namespace Program.IO
{
    using System.IO;
    using System.Text;
    using System.Globalization;
    public class Printer : StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, T[] source) { base.Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, T[] source) { base.WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(Stream stream) { str = stream; }
        public readonly Stream str;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }
        private byte read()
        {
            if (isEof) return 0;
            if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while ((b < 33 || 126 < b) && !isEof); return (char)b; }

        public string Scan()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b >= 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }
        public string ScanLine()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b != '\n'; b = (char)read())
                if (b == 0) break;
                else if (b != '\r') sb.Append(b);
            return sb.ToString();
        }
        public long Long()
        {
            if (isEof) return long.MinValue;
            long ret = 0; byte b = 0; var ng = false;
            do b = read();
            while (b != '-' && (b < '0' || '9' < b));
            if (b == '-') { ng = true; b = read(); }
            for (; true; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                else ret = ret * 10 + b - '0';
            }
        }
        public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }
        public double Double() { return double.Parse(Scan(), CultureInfo.InvariantCulture); }
        private T[] enumerate<T>(int n, Func<T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f();
            return a;
        }

        public char[] Char(int n) { return enumerate(n, Char); }
        public string[] Scan(int n) { return enumerate(n, Scan); }
        public double[] Double(int n) { return enumerate(n, Double); }
        public int[] Integer(int n) { return enumerate(n, Integer); }
        public long[] Long(int n) { return enumerate(n, Long); }
    }
}
#endregion

#region CombinationTable
public class CombinationTable
{
    long[][] nCr;
    public CombinationTable(int n)
    {
        nCr = new long[n + 1][];
        for (int i = 0; i <= n; i++)
            nCr[i] = new long[4];
        nCr[0][0] = 1;
        for (int i = 0; i <= n; i++)
        {
            nCr[i][0] = 1;
            for (int j = 1; j < Math.Min(i + 1, 4); j++)
                nCr[i][j] = (nCr[i - 1][j - 1] + nCr[i - 1][j]);// % mod;
        }
    }
    public long this[int n, int r]
    {
        get
        {
            if (n < 0 || n > nCr.Length)
                return 0;
            if (r < 0 || r > n)
                return 0;
            return nCr[n][r];
        }
    }
    public long RepeatedCombination(int n, int k)
    {
        if (k == 0) return 1;
        return this[n + k - 1, k];
    }
}
#endregion


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces_Round_num426__Div._2_
{
    class Program
    {
        static void Main(string[] args)
        {
            func1();
        }
        static void func1()
        {
            var instr = Console.ReadLine();
            int cols = Int32.Parse(Console.ReadLine());
            int s = 0;
            if (instr[0] == '^')
                s = 0;
            else if (instr[0] == '>')
                s = 90;
            else if (instr[0] == 'v')
                s = 180;
            else if (instr[0] == '<')
                s = 270;

            int e = 0;
            if (instr[2] == '^')
                e = 0;
            else if (instr[2] == '>')
                e = 90;
            else if (instr[2] == 'v')
                e = 180;
            else if (instr[2] == '<')
                e = 270;

            cols = cols % 4;

            var cwpath = e - s;
            if (cwpath < 0)
                cwpath += 360;
            var cwwpath = s - e;
            if (cwwpath < 0)
                cwwpath += 360;
            var cw = cwpath / 90 == cols;
            var cww = cwwpath / 90 == cols;
            if (cw == cww)
                Console.WriteLine("undefined");
            else if (cw)
                Console.WriteLine("cw");
            else if (cww)
                Console.WriteLine("ccw");
        }

        static void func2()
        {

        }
    }
}


using System;
namespace CodeForces {
    class Solve834A {
        private static char[] chars = {'v', '<', '^', '>'};

        private static int GetIntRepresentation(char c) {
            for (int i = 0; i < chars.Length; i++) {
                if (chars[i] == c) {
                    return i;
                }
            }

            throw new Exception("Invalid spin char");
        }

        private static bool isClockwise(int start, int end, int seconds) {
            for (int i = 0; i < seconds; i++) {
                start = (start + 1) % 4;
            }

            return start == end;
        }

        private static bool isCounterClockwise(int start, int end, int seconds) {
            for (int i = 0; i < seconds; i++) {
                end = (end + 1) % 4;
            }

            return start == end;
        }

        public static void Main() {
            var input = Console.ReadLine();
            var parts = input.Split(' ');
            int start = GetIntRepresentation(parts[0][0]);
            int end = GetIntRepresentation(parts[1][0]);
            // Console.WriteLine(string.Format("start = {0}, end={1}", start, end));

            input = Console.ReadLine();
            int seconds = int.Parse(input);
            seconds = seconds % 4;

            bool cw = isClockwise(start, end, seconds);
            bool ccw = isCounterClockwise(start, end, seconds);
            if (cw && ccw) {
                Console.WriteLine("undefined");
            } else if (cw) {
                Console.WriteLine("cw");
            } else {
                Console.WriteLine("ccw");
            }
        }
    }
}


using System;
using System.Linq;

namespace LaraCroft
{
    class Program
    {
        struct Vector2
        {
            public long X;
            public long Y;

            public Vector2(long x, long y)
            {
                this.X = x;
                this.Y = y;
            }

            public override string ToString()
            {
                return $"{this.Y} {this.X}";
            }
        }

        static void Main(string[] args)
        {
            var line = Console.ReadLine();
            var words = line.Split(' ');
            var values = words.Select(long.Parse).ToArray();

            var sizeY = values[0];
            var sizeX = values[1];
            var moves = values[2];

            Console.Write(SimulateMoves(sizeX, sizeY, moves));
        }

        static Vector2 SimulateMoves(long sizeX, long sizeY, long moves)
        {
            if (moves < sizeY)
            {
                return new Vector2(1, (long) moves + 1);
            }

            moves -= sizeY;
            var result = new Vector2(2, sizeY);
            var halfDividor = sizeX - 1;
            var dividor = halfDividor * 2;
            var yJumps = moves / dividor;
            moves -= yJumps * dividor;
            result.Y -= yJumps * 2;

            if (moves < halfDividor)
            {
                result.X += moves;
                return result;
            }
            else
            {
                moves -= halfDividor;
                result.X = sizeX;
                result.Y -= 1;
                result.X -= moves;
                return result;
            }
        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){

		if(K <= N - 1){
			Console.WriteLine("{0} {1}",1 + K, 1);
			return;
		}

		K -= N;
		long rr = K / (2 * M - 2);
		long cc = K % (2 * M - 2);

		long r2 = cc / (M - 1);

		long r = N - 2 * rr - r2;
		long c = 2;
		if(cc < M - 1){
			c += cc;
		} else {
			c += M - 1 - (cc - (M - 1)) - 1;
		}
		Console.WriteLine("{0} {1}",r,c);

	}

	long N,M,K;
	public Sol(){
		var d = rla();
		N = d[0]; M = d[1]; K = d[2];
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


using System;
using System.Collections.Generic;
using System.IO;

namespace A
{
    class Program
    {
        static char ConvertIndexToAnswer(int index)
        {
            switch (index)
            {
                case 0:
                    return 'A';
                case 1:
                    return 'B';
                case 2:
                    return 'C';
                case 3:
                    return 'D';
                default:
                    throw new ArgumentException();
            }
        }

        static void Main(string[] args)
        {
            var answers = new List<string>();
            var variants = new List<int>();

            using(var input = Console.OpenStandardInput())
            using (var inputReader = new StreamReader(input))
            {
                answers.Add(inputReader.ReadLine().Substring(2));
                answers.Add(inputReader.ReadLine().Substring(2));
                answers.Add(inputReader.ReadLine().Substring(2));
                answers.Add(inputReader.ReadLine().Substring(2));
            }

            for (var i = 0; i < answers.Count; i++)
            {
                bool flag = true;
                for (var j = 0; j < answers.Count; j++)
                {
                    if (i == j)
                        continue;

                    if (answers[j].Length/answers[i].Length < 2)
                        flag = false;
                }

                if (flag)
                {
                   variants.Add(i);
                }
            }

            for (var i = 0; i < answers.Count; i++)
            {
                bool flag = true;
                for (var j = 0; j < answers.Count; j++)
                {
                    if (i == j)
                        continue;

                    if (answers[i].Length / answers[j].Length < 2)
                        flag = false;
                }

                if (flag)
                {
                    variants.Add(i);
                }
            }

            if (variants.Count == 1)
            {
                using (var output = Console.OpenStandardOutput())
                using (var outputWriter = new StreamWriter(output))
                {
                    outputWriter.Write(ConvertIndexToAnswer(variants[0]));
                }
            }
            else
            {
                using (var output = Console.OpenStandardOutput())
                using (var outputWriter = new StreamWriter(output))
                {
                    outputWriter.Write('C');
                }
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication14
{
    class Program
    {
        static void Main(string[] args)
        {
            string a1 = Console.ReadLine();
            string b1 = Console.ReadLine();
            string c1 = Console.ReadLine();
            string d1 = Console.ReadLine();
            int a = a1.Length - 2;
            int b = b1.Length - 2;
            int c = c1.Length - 2;
            int d = d1.Length - 2;
            int sum = 0;
            char otv='1';
            if (((a*2<=b) && (a*2<=c) && (a*2<=d)) || ((a>=b*2) && (a>=c*2) && (a>=d*2))) {sum++; otv='A';}
            if (((b*2 <= a) && (b*2 <= c) && (b*2 <= d)) || ((b >= a * 2) && (b >= c * 2) && (b >= d * 2))) { sum++; otv = 'B'; }
            if (((c*2 <= b) && (c*2 <= a) && (c*2 <= d)) || ((c >= b * 2) && (c >= a * 2) && (c >= d * 2))) { sum++; otv = 'C'; }
            if (((d*2 <= b) && (d*2 <= c) && (d*2 <= a)) || ((d >= b * 2) && (d >= c * 2) && (d >= a * 2))) { sum++; otv = 'D'; }
            if (sum == 1) { Console.WriteLine(otv); } else Console.WriteLine('C');
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeForces
{
    class R169_Div2_D
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            long l = long.Parse(s[0]);
            long r = long.Parse(s[1]);

            if (l == r)
                Console.WriteLine(0); // l ^ r
            else
            {
                long num = 0;
                for (int i = 62; i >= 0; i--)
                {
                    long num1 = 1L << i;
                    while (num + num1 > r) num1 /= 2;
                    num += num1;
                    if (num - 1 >= l) break;
                }

                // (num - 1 >= l)
                Console.WriteLine(num ^ (num - 1));
            }

            //Alternate way:
            //long num = 0;
            //for (int i = 62; i >= 0; i--)
            //{
            //    long pow2 = 1L << i;
            //    if ((l & pow2) == 0 && (r & pow2) == pow2)
            //    {
            //        num = pow2 * 2 - 1;
            //        break;
            //    }
            //}
            //Console.WriteLine(num);

        }
    }
}


using System;
using System.Linq;

namespace D {
    internal class Program {
        private static void Main() {
            var line = Console.ReadLine().Split(' ');
            ulong a = Convert.ToUInt64(line[0]);
            ulong b = Convert.ToUInt64(line[1]);

            var ab = new int[64];
            var bb = new int[64];

            for (int i = 0; i < 64; i++) {
                ulong ex = (ulong) 1 << i;
                if ((a & ex) == ex) {
                    ab[i] = 1;
                }
                if ((b & ex) == ex) {
                    bb[i] = 1;
                }
            }

            ab = ab.Reverse().ToArray();
            bb = bb.Reverse().ToArray();
            bool bot = false;

            for (int i = 0; i < 64; i++) {
                if (ab[i] == 0 && bb[i] == 1) {
                    if (bot == false) {
                        bot = true;
                        continue;
                    }
                }

                if (bot) {
                    if (ab[i] == 0 && bb[i] == 0) {
                        ab[i] = 1;
                        continue;
                    }
                    if (ab[i] == 1 && bb[i] == 1) {
                        bb[i] = 0;
                        continue;
                    }
                }
            }

            ulong ares = 0;
            ulong bres = 0;
            for (int i = 63; i >= 0; i--) {
                ulong ex = (ulong)1 << i;
                if (ab[63-i] == 1) {
                    ares += ex;
                }
                if (bb[63-i] == 1) {
                    bres += ex;
                }
            }

            Console.WriteLine(ares ^ bres);
        }
    }
}


using System;

namespace _678B
{
    class Program
    {
        static void Main(string[] args)
        {
            int year = int.Parse(Console.ReadLine()), nextYear = year + 1;
            bool firstLeap = (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
            int dayOfWeek = 0;
            for (;; nextYear++)
            {
                bool leap = (nextYear % 400 == 0) || (nextYear % 4 == 0 && nextYear % 100 != 0);
                dayOfWeek += leap ? 2 : 1;
                dayOfWeek %= 7;
                if (leap == firstLeap && dayOfWeek == 0)
                    break;
            }
            Console.WriteLine(nextYear);
        }
    }
}


using System;
using System.Text.RegularExpressions;

namespace ConsoleApp2
{
    class Program
    {
       public static bool L(int y)
        {
            if(y%400==0||(y%100!=0 && y%4==0))
            {
                return true;
            }
            return false;
        }
        static void Main(string[] args)
        {
            int y, day = 0,q=0;
            y=Int32.Parse(Console.ReadLine());
            q = y;
            while (q++>0)
            {
                if (L(q) == true)
                {
                    day += 366;
                }
                else
                    day +=+365;
                day %= 7;
                if(L(q)==L(y))
                {
                    if(day==0)
                    {
                        Console.WriteLine(q);
                        break;
                    }
                }

            }
        }
    }
}