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

namespace A.Greg_s_Workout
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int chest = 0;
            int biceps = 0;
            int back = 0;
            for(int i=0;i<n;i+=3)
            {
                chest += x[i];
            } for (int i = 1; i < n; i += 3)
            {
                biceps += x[i];
            }
            for (int i = 2; i < n; i += 3)
            {
                back += x[i];
            }
            List<int> li = new List<int>();
            li.Add(chest); li.Add(biceps); li.Add(back);
            li.Sort();
            if(li[2]==chest)
            {
                Console.WriteLine("chest");
            }
            else if (li[2] == back)
            {
                Console.WriteLine("back");
            }
            else if (li[2] == biceps)
            {
                Console.WriteLine("biceps");
            }
        }
    }
}


using System;
using System.IO;
using System.Linq;

class Program
{
    static char[] SPACE = new[] { ' ' };

    static void Main(string[] args)
    {
#if DEBUG
        using (var input = new StreamReader("input.txt"))
        using (var output = new StreamWriter("output.txt"))
        {
            Console.SetIn(input);
            Console.SetOut(output);

            int n = 0;
            do
            {
                Console.WriteLine();
                Console.WriteLine("Sample {0}", ++n);
                Prog();
            } while (Console.ReadLine() == string.Empty);
        }
#else
            Prog();
#endif
    }

    static int __ptr = 0;
    static string[] __input;
    static int NextInt()
    {
        return int.Parse(__input[__ptr++]);
    }
    static long NextLong()
    {
        return long.Parse(__input[__ptr++]);
    }
    static void ReadTokens(int n)
    {
        __ptr = 0;
        __input = Console.ReadLine().Split(SPACE, n);
    }

    //

    static void Prog()
    {
        ReadTokens(1);
        int n = NextInt();

        int[] r = new int[3];

        ReadTokens(n);
        for (int i = 0; i < n; i++)
            r[i % 3] += NextInt();

        int max = Math.Max(Math.Max(r[0], r[1]), r[2]);
        if (max == r[0]) Console.WriteLine("chest");
        else if (max == r[1]) Console.WriteLine("biceps");
        else if (max == r[2]) Console.WriteLine("back");
    }

}


using System;

namespace NearlyLuckyNumber
{
    class Program
    {
        static void Main(string[] args)
        {
            string line = Console.ReadLine();

            int luckyCounters = 0;

            for (int i = 0; i < line.Length; i++)
            {
                if (line[i] == '4' || line[i] == '7')
                {
                    luckyCounters++;
                }
            }

            string luckyString = luckyCounters.ToString();
            int j = 0;

            while (j < luckyString.Length && (luckyString[j] == '4' || luckyString[j] == '7'))
            {
                j++;
            }

            if (j < luckyString.Length)
            {
                Console.WriteLine("NO");
            }
            else
            {
                Console.WriteLine("YES");
            }
        }
    }
}


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

namespace Code
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            bool flag = true;
            int count = 0;
            string count_str = "";
            for (int i = 0; i < input.Length; i++)
            {
                if (input[i].ToString() == "7" || input[i].ToString() == "4")
                    count++;
            }
            count_str = count.ToString();

            for (int i = 0; i < count_str.Length; i++)
            {
                if (count_str[i].ToString() == "7" || count_str[i].ToString() == "4")
                    flag = true;
                else
                {
                    flag = false;
                    break;
                }
            }

            if (flag)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}


using System;

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

            Console.WriteLine(binarySearch(n) + 1);
        }

        static long binarySearch(long total) {
            long low = 1;
            long high = total;
		    while (low <= high) {
			    long middle = (low + high) / 2;

			    if (canEat(middle, total)) {
				    high = middle - 1;
			    }
			    else {
				    low = middle + 1;
			    }
		    }

		    return high;
	    }

        static bool canEat(long k, long total)
        {
            long eatenA = 0;
            long eatenB = 0;
            long current = total;

            while(current > 0)
            {
                eatenA += Math.Min(k, current);
                current = Math.Max(current - k, 0);
                eatenB += current / 10;
                current -= current / 10;
            }

            if(total % 2 == 0)
            {
                return eatenA >= total / 2;
            }
            else
            {
                return eatenA > total / 2;
            }
        }
    }
}


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

namespace Task
{
  class Program
  {
    #region Read / Write
    protected static TextReader reader;
    protected static TextWriter writer;
    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=

    public static bool NextPermutation(List<int> perm)
    {
      for (int i = perm.Count - 2; i >= 0; i--)
      {
        if (perm[i] < perm[i + 1])
        {
          int min = i + 1;
          for (int j = min; j < perm.Count; j++)
            if (perm[j] > perm[i] && perm[j] < perm[min])
              min = j;

          int tmp = perm[i];
          perm[i] = perm[min];
          perm[min] = tmp;
          perm.Reverse(i + 1, perm.Count - i - 1);
          return true;
        }
      }

      return false;
    }

    public static long CalcEkler(long n, long k)
    {
      long ans = 0;
      while (n > 0)
      {
        long min = Math.Min(k, n);
        ans += min;
        n -= min;

        n -= n / 10;
      }

      return ans;
    }

    static void Main(string[] args)
    {
      long i = 0;
      long ans = 0;
      reader = new StreamReader(Console.OpenStandardInput());
      writer = new StreamWriter(Console.OpenStandardOutput());

      long n = ReadLong();
      long needEkler = n / 2 + (n & 1);

      long l = 1;
      long r = n;
      long k = n / 2;
      ans = k;
      do
      {
        k = (l + r) / 2;
        long calcedEkler = CalcEkler(n, k);
        if (calcedEkler >= needEkler)
        {
          ans = k;
          r = k - 1;
        }
        else
        {
          l = k + 1;
        }
      } while (l <= r);

      Write(ans);
      reader.Close();
      writer.Close();
    }
  }
}


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

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string[] tokens = input.Split(' ');
            int x = int.Parse(tokens[0]);

            int output = 0;
            if (tokens[2] == "week")
            {
                if (x == 5 || x == 6)
                {
                    output = 53;
                }
                else
                {
                    output = 52;
                }
            }
            else
            {
                if (x <= 29)
                {
                    output = 12;
                }
                else if (x == 30)
                {
                    output = 11;
                }
                else
                {
                    output = 7;
                }
            }

            Console.WriteLine(output);
        }
    }
}


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

namespace Pr1
{
    class Program
    {
        static void Main()
        {
            string[] a=Console.ReadLine().Split(' ');
            int n=Convert.ToInt32(a[0]);
            if(a[2]=="week")
            {
                if(n==5||n==6)
                    Console.Write(53);
                else
                    Console.Write(52);
            }
            else
            {
                if(n==30)
                    Console.Write(11);
                else if(n==31)
                    Console.Write(7);
                else
                    Console.Write(12);
            }
        }
    }
}


using System;
class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(n / 3 * 2 + (n % 3 == 0 ? 0 : 1));
        }
    }


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

namespace _348_1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int kol = 0;
            if (n == 2) Console.WriteLine(1);
            else
            {
                //if (n % 2 != 0) { kol++; n--; }
                while (n > 0)
                {
                    n-=2;
                    kol++;
                    if (n > 0) { kol++; n --; }
                    else break;
                }
                Console.WriteLine(kol);
            }
        }
    }
}


#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

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

namespace _10_c
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
			Console.SetIn(getInput());
#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
                solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }
        }

        static void solution()
        {
            #region SOLUTION
            var n = readInt();
            var cs = new long[10];
            var vs = new long[n + 1];
            for (int i = 1; i < n + 1; i++)
            {
                vs[i] = getSum(i);
                cs[vs[i]]++;
            }

            var total = 0L;
            for (int i = 1; i < 10; i++)
            {
                for (int j = 1; j < 10; j++)
                {
                    var next = getSum(i * j);
                    var val = cs[i] * cs[j];
                    //if (i == j)
                    //{
                    //    val = cs[i] * cs[i - 1] / 2;
                    //}

                    if (val * cs[next] > 0)
                    {
                        total += val * cs[next];
                    }

                }
            }

            //total += (cs[1] * (cs[1] - 1) / 2);
            //total += (cs[2] * cs[1]);
            //total += (cs[3] * cs[1]);
            //total += (cs[4] * cs[1] + cs[2] * (cs[2] - 1) / 2);
            //total += (cs[5] * cs[1]);
            //total += (cs[6] * cs[1] + cs[3] * cs[2]);
            //total += (cs[7] * cs[1]);
            //total += (cs[8] * cs[1] + cs[2] * cs[4]);
            //total += (cs[9] * cs[1] + cs[3] * (cs[3] - 1) / 2);

            var remc = 0L;
            for (int i = 1; i < n + 1; i++)
            {
                remc += n / i;
            }
            //for (int i = 1; i < n + 1; i++)
            //{
            //    var end = (int)Math.Floor(Math.Sqrt(i));
            //    for (int j = 1; j <= end; j++)
            //    {
            //        var rem = i % j;
            //        var another = i / j;
            //        if (rem == 0)
            //        {
            //            if (another == j)
            //            {
            //                remc++;
            //            }
            //            else
            //            {
            //                remc += 2;
            //            }

            //        }
            //    }
            //}

            total -= remc;
            Console.WriteLine(total);

            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int getSum(int a)
        {
            if (a < 10)
            {
                return a;
            }

            var val = a;
            var sum = 0;
            while (true)
            {
                sum += (val % 10);
                val /= 10;
                if (val == 0)
                {
                    break;
                }
            }

            return getSum(sum);
        }

        static int readInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long readLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] readIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] readLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
		static StreamReader getInput()
		{
			var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
			var resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);

			return new StreamReader(resource);
		}
#endif
    }
}


using System;

public class Solution {

    static int n;
    static int[] c;
    static int[] f;

    static int calc(int x) {
        if(x < 10) return x;
        else {
            int s = 0 ;
            while(x > 0) {
                s += x % 10;
                x /= 10;
            }
            return calc(s);
        }
    }

    public static void Main() {
        n = int.Parse(Console.ReadLine());
        c = new int[10];
        f = new int[1000];
        for(int i=1;i<1000;++i) f[i] = calc(i);
        for(int i=1;i<=n;++i) {
            int z = 0;
            if(i < 1000) z = f[i];
            else {
                int s = 0;
                int x = i;
                while(x > 0) {
                    s += x % 10;
                    x /= 10;
                }
                z = f[s];
            }
            ++c[z];
        }
        long res = 0;
        for(int i=1;i<10;++i)
            for(int j=1;j<10;++j) {
                res += (long)c[i] * c[j] * c[f[i*j]];
            }
        for(int i=1;i<=n;++i) {
            for(int j=1;i*j<=n;++j)
                --res;
        }
        Console.WriteLine(res);
    }
}


using System;
using System.Linq;

namespace CodeForces {
    class Program {
        static void Main (string[] args) {
            int n = int.Parse (Console.ReadLine ());

            int[] lucky = { 4, 7, 47, 74, 444, 474, 477, 744, 774 };
            if (lucky.Any (x => n % x == 0)) {
                System.Console.WriteLine ("YES");
            } else {
                System.Console.WriteLine ("NO");
            }

        }
    }
}


//Rextester.Program.Main is the entry point for your code. Don't change it.
//Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5

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

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
            bool b = false , bb = false;
			string s;
			int x;
			s = Console.ReadLine();
			x = int.Parse(s);
			if(x % 4 == 0 || x % 7 == 0 || x == 799 || x == 94|| x == 141)
			{
				Console.WriteLine("YES");
				bb = true;
			}
			else
			{
    		 for(int i = 0 ; i < s.Length ; i++)
    			{
    				if(s[i] == '4' || s[i] == '7')
    					continue;
    				else
    				{
    				    b = true;
    					Console.WriteLine("NO");
    					break;
    				}
    			}
			}
            if(b != true && bb == false)
                Console.WriteLine("YES");

        }
    }
}


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

namespace ConsoleApp18
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = Convert.ToInt32(Console.ReadLine());
            string[] b = Console.ReadLine().Split(' ');
            int[] mass = new int[b.Length];

            for (int i = 0; i < b.Length; i++)
            {
                mass[i] = Convert.ToInt32(b[i]);
            }

            int sum = mass.Sum();
            int k = mass.Max();

            int newsum = 0;

            do
            {
                newsum = 0;
                for (int i = 0; i < mass.Length; i++)
                {
                    if (k - mass[i] > 0)
                    {
                        newsum += k - mass[i];
                    }
                }

                k++;
            } while (newsum <= sum);

            k--;
            Console.WriteLine(k);
        }
    }
}


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

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int k = 0, a;
            int AU = 0, AL = 0;
            string[] s = Console.ReadLine().Split(' ');
            for (int i = 0; i < n; i++)
            {
                a = int.Parse(s[i]);
                if (a > k)
                    k = a;
                AL += a;
            }
            AU = k * n - AL;
            while(AU<=AL)
            {
                k++;
                AU += n;
            }
            Console.WriteLine(k);
        }
    }
}


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

namespace Olympo
{

    class Program
    {

        static long[] buildFact(long n, long M)
        {
            var res = new long[n + 1];
            res[0] = 1;
            for(long i = 1; i <= n; i++)
            {
                res[i] = (res[i - 1] * i) % M;
            }

            return res;
        }

        static long axar(long a, long b, long M)
        {
            a = a % M;
            if (b == 0)
                return 1;
            long res = b % 2 == 0 ? 1 : a;
            var rec = axar(a, b >> 1, M);
            res = (((rec * rec) % M) * res) % M;
            return res;
        }

        static long[] buildInv(long n, long M, long[] fact)
        {
            var res = new long[n + 1];
            res[0] = 1;
            for (long i = 1; i <= n; i++)
            {
                res[i] = axar(fact[i], M - 2, M);
            }

            return res;
        }

        static long getC(long n, long k, long M, long[] fact, long[] inv)
        {
            if (n < k) return 0;
            return (((fact[n] * inv[k]) % M) * inv[n - k]) % M;
        }

        static void Main(string[] args)
        {
            var inputs = Console.ReadLine().Split(' ').Select(long.Parse).ToList();
            long n = inputs[0], k = inputs[1];
            long M = 998244353l;
            var f = buildFact(n,  M);
            var inv = buildInv(n, M, f);
            var res = 0l;
            for(long i=1;i <= n; i++)
                res = (res + getC(  n / i - 1, k-1, M, f, inv )  )  % M;
            Console.WriteLine(res);
        }
    }
}


using System;
using System.Linq;
using CompLib.Mathematics;
using CompLib.Util;

public class Program
{
    int N;
    int K;
    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        K = sc.NextInt();
        ModInt[] f = new ModInt[500000];
        f[0] = 1;
        for (int i = 1; i < 500000; i++)
        {
            f[i] = f[i - 1] * i;
        }
        // 長さKの配列がある　各要素 1<= a_i <=n

        // 任意の非負整数xについて x % a_i ... をaを並び替えても同じになるaを安定とよぶ
        ModInt ans = 0;
        for (int min = 1; min <= N; min++)
        {
            if (min * K > N) break;

            int d = (N - min * K) / min;

            // dをK個に分ける

            // d+K-1 C K-1
            var tmp = f[d + K - 1] * ModInt.Inverse(f[d] * f[K - 1]);

            // Console.WriteLine($"{d} {tmp}");
            ans += tmp;
        }

        Console.WriteLine(ans);
    }

    public static void Main(string[] args) => new Program().Solve();
}

// https://bitbucket.org/camypaper/complib
namespace CompLib.Mathematics
{
    #region ModInt
    /// <summary>
    /// [0,<see cref="Mod"/>) までの値を取るような数
    /// </summary>
    public struct ModInt
    {
        /// <summary>
        /// 剰余を取る値．
        /// </summary>
        public const long Mod = 998244353;

        /// <summary>
        /// 実際の数値．
        /// </summary>
        public long num;
        /// <summary>
        /// 値が <paramref name="n"/> であるようなインスタンスを構築します．
        /// </summary>
        /// <param name="n">インスタンスが持つ値</param>
        /// <remarks>パフォーマンスの問題上，コンストラクタ内では剰余を取りません．そのため，<paramref name="n"/> ∈ [0,<see cref="Mod"/>) を満たすような <paramref name="n"/> を渡してください．このコンストラクタは O(1) で実行されます．</remarks>
        public ModInt(long n) { num = n; }
        /// <summary>
        /// このインスタンスの数値を文字列に変換します．
        /// </summary>
        /// <returns>[0,<see cref="Mod"/>) の範囲内の整数を 10 進表記したもの．</returns>
        public override string ToString() { return num.ToString(); }
        public static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }
        public static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }
        public static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }
        public static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }

        /// <summary>
        /// 与えられた 2 つの数値からべき剰余を計算します．
        /// </summary>
        /// <param name="v">べき乗の底</param>
        /// <param name="k">べき指数</param>
        /// <returns>繰り返し二乗法により O(N log N) で実行されます．</returns>
        public static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }

        /// <summary>
        /// 与えられた 2 つの数値からべき剰余を計算します．
        /// </summary>
        /// <param name="v">べき乗の底</param>
        /// <param name="k">べき指数</param>
        /// <returns>繰り返し二乗法により O(N log N) で実行されます．</returns>
        public static ModInt Pow(long v, long k)
        {
            long ret = 1;
            for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)
                if ((k & 1) == 1) ret = ret * v % Mod;
            return new ModInt(ret);
        }
        /// <summary>
        /// 与えられた数の逆元を計算します．
        /// </summary>
        /// <param name="v">逆元を取る対象となる数</param>
        /// <returns>逆元となるような値</returns>
        /// <remarks>法が素数であることを仮定して，フェルマーの小定理に従って逆元を O(log N) で計算します．</remarks>
        public static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }
    }
    #endregion
    #region Binomial Coefficient
    public class BinomialCoefficient
    {
        public ModInt[] fact, ifact;
        public BinomialCoefficient(int n)
        {
            fact = new ModInt[n + 1];
            ifact = new ModInt[n + 1];
            fact[0] = 1;
            for (int i = 1; i <= n; i++)
                fact[i] = fact[i - 1] * i;
            ifact[n] = ModInt.Inverse(fact[n]);
            for (int i = n - 1; i >= 0; i--)
                ifact[i] = ifact[i + 1] * (i + 1);
            ifact[0] = ifact[1];
        }
        public ModInt this[int n, int r]
        {
            get
            {
                if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;
                return fact[n] * ifact[n - r] * ifact[r];
            }
        }
        public ModInt RepeatedCombination(int n, int k)
        {
            if (k == 0) return 1;
            return this[n + k - 1, k];
        }
    }
    #endregion
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


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

namespace Algorithm_Study_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int before = 0, after = 0, count = 0;
            int[] inputArray = Array.ConvertAll(Console.ReadLine().Split((char)32), int.Parse);
            before = inputArray[0];
            after = inputArray[1];

            if (before >= after)
            {
                Console.WriteLine(before - after);
            }
            else
            {
                while (after != before)
                {
                    if ((after % 2) != 0)
                    {
                        after++;
                    }
                    else if (after < before)
                    {
                        after++;
                    }
                    else
                    {
                        after /= 2;
                    }
                    count++;
                }

                Console.WriteLine(count);

            }
        }
    }
}


using System;

namespace q520b
{
    class Program
    {
	enum Op { R, B };

        static void Main(string[] args)
        {
	    var inputFirstLine = Console.ReadLine().Split(' ');
	    var n = int.Parse(inputFirstLine[0]);
	    var m = int.Parse(inputFirstLine[1]);
	    // 빨간 버튼: 숫자에 2를 곱한다
	    // 파란 버튼: 숫자에서 1을 뺀다
	    // 디스플레이: 현재 숫자를 출력한다
	    // n에서 m을 만들기 위한 최소한의 버튼 누름 회수?

	    if (n >= m)
	    {
		// 감소하는 버튼은 단 하나이고,
		// 숫자를 증가시켜 0으로 되돌릴 방법은 없으므로
		Console.WriteLine("{0}", n - m);
	    }
	    else
	    {
		// 문제는 숫자를 증가시키는 부분에 있다
		// DFS 버전은 Program_DFS.cs.bak 참고. 대실패함

		// 발상을 바꿔, 역으로 m에서 n으로 변화시키려면 어떻게
		// 계산해야할지를 생각해보자
		// X가 짝수라면 반드시 이전 연산에서 X' * 2가 이루어짐
		// X가 홀수라면 반드시 이전 연산에서 X' - 1이 이루어짐
		// 즉, 이 두 원리를 거꾸로 적용하여 원래 숫자를 구하자

		var steps = 0;
		var i = m; // m은 고정, m을 자유자재로 바꿀 i로 복사

		while (n != i)
		{
		    if (n < i)
		    {
			// 여전히 추가 연산(나눗셈)이 가능함
			if (i%2 == 0)
			{
			    i /= 2; // *= 2의 역원
			}
			else
			{
			    i += 1; // -= 1의 역원
			}

			steps++;
		    }
		    else
		    {
			// 나눌 수 없으므로 더해서 목표수로 되돌림
			steps += n - i;

			// 그리고 루프 종료를 위해,
			i = n;
		    }
		}

		Console.WriteLine("{0}", steps);
	    }
        }
    }
}


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

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

            string str = Console.ReadLine();
            string[] srt = str.Split(' ');
            int s = Convert.ToInt32(srt[0]);
            int v1 = Convert.ToInt32(srt[1]);
            int v2 = Convert.ToInt32(srt[2]);
            int t1 = Convert.ToInt32(srt[3]);
            int t2 = Convert.ToInt32(srt[4]);
            int x1 = 0;
            int x2 = 0;
            x1 = t1 + (s * v1) + t1;
            x2 = t2 + (s * v2) + t2;
            if (x1 < x2)
            {
                Console.WriteLine("First");
            }
            else if (x2 < x1)
            {
                Console.WriteLine("Second");
            }
            else
            {
                Console.WriteLine("Friendship");
            }
            //Console.Read();
        }
    }
}


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

namespace ACM
{
    class Program
    {
        protected static StreamReader reader;
        protected static StreamWriter writer;

        static void Swap<T>(ref T x, ref T y)
        {
            T t = y;
            y = x;
            x = t;
        }

        public static bool NextPermutation<T>(T[] elements) where T : IComparable<T>
        {
            var count = elements.Length;
            var done = true;

            for (var i = count - 1; i > 0; i--)
            {
                var curr = elements[i];
                if (curr.CompareTo(elements[i - 1]) < 0) continue;
                done = false;
                var prev = elements[i - 1];
                var currIndex = i;
                for (var j = i + 1; j < count; j++)
                {
                    var tmp = elements[j];

                    if (tmp.CompareTo(curr) < 0 && tmp.CompareTo(prev) > 0)
                    {
                        curr = tmp;
                        currIndex = j;
                    }
                }

                elements[currIndex] = prev;
                elements[i - 1] = curr;

                for (var j = count - 1; j > i; j--, i++)
                {
                    var tmp = elements[j];
                    elements[j] = elements[i];
                    elements[i] = tmp;
                }
                break;
            }
            return done;
        }

        public static int[] GetArr()
        {
            return reader.ReadLine().Split(' ').ToList().Select(r => int.Parse(r)).ToArray();
        }

        public static long[] GetLongArr()
        {
            return reader.ReadLine().Split(' ').ToList().Select(r => long.Parse(r)).ToArray();
        }

        public static int GetInt()
        {
            return int.Parse(reader.ReadLine());
        }

        public static long GetLong()
        {
            return long.Parse(reader.ReadLine());
        }

        public static int[,] GetMatrix(int n, int m)
        {
            int[,] a = new int[n, m];
            for (int i = 0; i < n; i++)
            {
                int[] x = GetArr();
                for (int j = 0; j < m; j++)
                    a[i, j] = x[j];
            }
            return a;
        }

        public static void PrintArr(int[] a)
        {
            for (int i = 0; i < a.Count(); i++)
                writer.Write(a[i] + " ");
            writer.WriteLine();
        }

        static void Main()
        {
            reader = new StreamReader(Console.OpenStandardInput());
            writer = new StreamWriter(Console.OpenStandardOutput());
            int[] f = GetArr();
            int s = f[0];
            int v1 = f[1];
            int v2 = f[2];
            int t1 = f[3];
            int t2 = f[4];
            //reader = new StreamReader(File.OpenRead("D:\\ACM\\input.txt"));
            //writer = new StreamWriter(File.OpenWrite("D:\\ACM\\output.txt"));
            //var dt = DateTime.UtcNow;
            if (v1 * s + 2 * t1 < v2 * s + 2 * t2) writer.WriteLine("First");
            if (v1 * s + 2 * t1 > v2 * s + 2 * t2) writer.WriteLine("Second");
            if (v1 * s + 2 * t1 == v2 * s + 2 * t2) writer.WriteLine("Friendship");

           writer.Flush();
           //Console.WriteLine(DateTime.UtcNow - dt);
        }
    }
}


// Problem: 796A - Buying A House
// Author: Gusztav Szmolik

using System;

namespace Buying_A_House
	{
	class Program
		{
		static int Main ()
			{
			string[] tmp = Console.ReadLine().Split();
			if (tmp.Length != 3)
				return -1;
			ushort n = 0;
			if (!UInt16.TryParse(tmp[0], out n))
				return -1;
			ushort m = 0;
			if (!UInt16.TryParse(tmp[1], out m))
				return -1;
			ushort k = 0;
			if (!UInt16.TryParse(tmp[2], out k))
				return -1;
			if (n < 2 || n > 100 || m < 1 || m > n || k < 1 || k > 100)
				return -1;
			tmp = Console.ReadLine().Split();
			if (tmp.Length != n)
				return -1;
			ushort[] a = new ushort[n];
			ushort mm = Convert.ToUInt16 (m-1);
			bool possiblePurchase = false;
			ushort minHouses = Convert.ToUInt16 (n-1);
			ushort houses;
			for (ushort i = 0; i < n; i++)
				{
				if (!UInt16.TryParse(tmp[i], out a[i]))
					return -1;
				if (i == mm && a[i] != 0)
					return -1;
				if (a[i] != 0 && a[i] <= k)
					{
					possiblePurchase = true;
					houses = (i < mm ? Convert.ToUInt16(mm-i) : Convert.ToUInt16(i-mm));
					if (houses < minHouses)
						minHouses = houses;
					}
				}
			if (!possiblePurchase)
				return -1;
			Console.WriteLine (minHouses*10);
			return 0;
			}
		}
	}


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

namespace ConsoleApplication1.CodeForces
{
    class _403
    {
        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

        static void Main(String[] args)
        {
            var line = Console.ReadLine().Split(' ' ).Select(int.Parse).ToList();
            var n = line[0];
            var m = line[1] -1;
            var k = line[2];

            var data = Console.ReadLine().Split(' ').Select(int.Parse).ToList();

            var min = int.MaxValue;

            for(var i = 0; i < data.Count; i++)
            {
                if(data[i] == 0 || data[i] > k)
                {
                    continue;
                }

                if(min > Math.Abs(i - m) )
                {
                    min = Math.Abs(i - m);
                }
            }

            var result = 0;
            Console.WriteLine(min * 10);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading;
using System.Runtime.CompilerServices;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using static System.Console;
using static System.Convert;
using static System.Math;
using static Template;

class Solver
{
    public Scanner sc;
    public void Solve()
    {
        int N, K;
        sc.Make(out N, out K);
        var dp = Create(N + 1, () => new ModInt[N + 1]);
        var newdp = Create(N + 1, () => new ModInt[N + 1]);
        dp[1][1] = 2;
        for (int i = 1; i < N; i++)
        {
            for (int j = 1; j < N+1; j++)
            {
                for (int k = 1; k < j+1; k++)
                {
                    newdp[j][k] = dp[j][k - 1];
                    if (j == k) newdp[j][k] += dp[j - 1][k - 1];
                    newdp[j][1] += dp[j][k];
                }
            }
            swap(ref dp, ref newdp);
        }
        var ct = new ModInt[N + 1];
        for (int i = 0; i <= N; i++)
            for (int j = 0; j <= i; j++)
                ct[i] += dp[i][j];
        ModInt res = 0;
        for(int i = 1; i <= Min(K-1,N); i++)
        {
            var seg = new DualSegmentTree<ModInt>(N, 0, (a, b) => a + b);
            seg.Update(0, Min(N, (K - 1) / i), 1);
            for (int j = 0; j < N - 1; j++)
                seg.Update(j + 1, Min(j + 1 + (K - 1) / i,N), seg.Query(j));
            res += seg.Query(N - 1)*ct[i];
        }
        Console.WriteLine(res);
    }
}

public struct ModInt
{
    //public const long MOD = (int)1e9 + 7;
    public const long MOD = 998244353;
    public long Value { get; set; }
    public ModInt(long n = 0) { Value = n; }
    private static ModInt[] fac, inv, facinv;
    public override string ToString() => Value.ToString();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator +(ModInt l, ModInt r)
    {
        l.Value += r.Value;
        if (l.Value >= MOD) l.Value -= MOD;
        return l;
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator -(ModInt l, ModInt r)
    {
        l.Value -= r.Value;
        if (l.Value < 0) l.Value += MOD;
        return l;
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator *(ModInt l, ModInt r) => new ModInt(l.Value * r.Value % MOD);
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator /(ModInt l, ModInt r) => l * Pow(r, MOD - 2);
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static implicit operator long(ModInt l) => l.Value;
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static implicit operator ModInt(long n)
    {
        n %= MOD; if (n < 0) n += MOD;
        return new ModInt(n);
    }

    public static ModInt Pow(ModInt m, long n)
    {
        if (n == 0) return 1;
        if (n % 2 == 0) return Pow(m * m, n >> 1);
        else return Pow(m * m, n >> 1) * m;
    }

    public static void Build(int n)
    {
        fac = new ModInt[n + 1];
        facinv = new ModInt[n + 1];
        inv = new ModInt[n + 1];
        inv[1] = fac[0] = fac[1] = facinv[0] = facinv[1] = 1;
        for (var i = 2; i <= n; i++)
        {
            fac[i] = fac[i - 1] * i;
            inv[i] = MOD - inv[MOD % i] * (MOD / i);
            facinv[i] = facinv[i - 1] * inv[i];
        }
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt Fac(int n) => fac[n];
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt Inv(int n) => inv[n];
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt FacInv(int n) => facinv[n];
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt Comb(int n, int r)
    {
        if (n < r) return 0;
        if (n == r) return 1;
        return fac[n] * facinv[r] * facinv[n - r];
    }
    public static ModInt Perm(int n, int r)
    {
        if (n < r) return 0;
        return fac[n] * facinv[n - r];
    }

}

public class DualSegmentTree<T>
{
    protected readonly T[] data;
    protected readonly int size;
    protected readonly Func<T, T, T> merge;
    protected readonly T idT;

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    protected int Parent(int i)
        => (i - 1) >> 1;
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    protected int Left(int i)
        => (i << 1) + 1;
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    protected int Right(int i)
        => (i + 1) << 1;
    public T this[int i]
    {
        get { return data[i + size - 1]; }
        set { data[i + size - 1] = value; }
    }

    public DualSegmentTree(int N, T idT, Func<T, T, T> merge)
    {
        this.merge = merge;
        this.size = 1;
        this.idT = idT;
        while (size < N)
            size <<= 1;
        data = new T[2 * this.size - 1];
        for (var i = 0; i < 2 * size - 1; i++)
            data[i] = idT;
    }
    public void Update(int left, int right, T value, int k = 0, int l = 0, int r = -1)
    {
        if (r == -1) r = size;
        if (r <= left || right <= l) return;
        if (left <= l && r <= right) data[k] = merge(data[k], value);
        else
        {
            Update(left, right, value, Left(k), l, (l + r) >> 1);
            Update(left, right, value, Right(k), (l + r) >> 1, r);
        }
    }
    public T Query(int i)
    {
        i += size - 1;
        var value = merge(idT, data[i]);
        while (i > 0)
        {
            i = Parent(i);
            value = merge(value, data[i]);
        }
        return value;
    }

    public int Find(int st, Func<T, bool> check)
    {
        var x = idT;
        return Find(st, check, ref x, 0, 0, size);
    }
    private int Find(int st, Func<T, bool> check, ref T x, int k, int l, int r)
    {
        if (l + 1 == r)
        { x = merge(x, data[k]); return check(x) ? k - size + 1 : -1; }
        var m = (l + r) >> 1;
        if (m <= st) return Find(st, check, ref x, Right(k), m, r);
        if (st <= l && !check(merge(x, data[k])))
        { x = merge(x, data[k]); return -1; }
        var xl = Find(st, check, ref x, Left(k), l, m);
        if (xl >= 0) return xl;
        return Find(st, check, ref x, Right(k), m, r);
    }
}
#region Template
public static class Template
{
    static void Main(string[] args)
    {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        var sol = new Solver() { sc = new Scanner() };
        //var th = new Thread(sol.Solve, 1 << 26);th.Start();th.Join();
        sol.Solve();
        Console.Out.Flush();
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) > 0) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(ref T a, ref T b) { var t = b; b = a; a = t; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(this IList<T> A, int i, int j) { var t = A[i]; A[i] = A[j]; A[j] = t; }
    public static T[] Create<T>(int n, Func<T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(); return rt; }
    public static T[] Create<T>(int n, Func<int, T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(i); return rt; }
    public static void Out<T>(this IList<T> A, out T a) => a = A[0];
    public static void Out<T>(this IList<T> A, out T a, out T b) { a = A[0]; b = A[1]; }
    public static void Out<T>(this IList<T> A, out T a, out T b, out T c) { A.Out(out a, out b); c = A[2]; }
    public static void Out<T>(this IList<T> A, out T a, out T b, out T c, out T d) { A.Out(out a, out b, out c); d = A[3]; }
    public static string Concat<T>(this IEnumerable<T> A, string sp) => string.Join(sp, A);
    public static char ToChar(this int s, char begin = '0') => (char)(s + begin);
    public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> A) => A.OrderBy(v => Guid.NewGuid());
    public static int CompareTo<T>(this T[] A, T[] B, Comparison<T> cmp = null) { cmp = cmp ?? Comparer<T>.Default.Compare; for (var i = 0; i < Min(A.Length, B.Length); i++) { int c = cmp(A[i], B[i]); if (c > 0) return 1; else if (c < 0) return -1; } if (A.Length == B.Length) return 0; if (A.Length > B.Length) return 1; else return -1; }
    public static int ArgMax<T>(this IList<T> A, Comparison<T> cmp = null) { cmp = cmp ?? Comparer<T>.Default.Compare; T max = A[0]; int rt = 0; for (int i = 1; i < A.Count; i++) if (cmp(max, A[i]) < 0) { max = A[i]; rt = i; } return rt; }
    public static T PopBack<T>(this List<T> A) { var v = A[A.Count - 1]; A.RemoveAt(A.Count - 1); return v; }
    public static void Fail<T>(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }
}
public class Scanner
{
    public string Str => Console.ReadLine().Trim();
    public int Int => int.Parse(Str);
    public long Long => long.Parse(Str);
    public double Double => double.Parse(Str);
    public int[] ArrInt => Str.Split(' ').Select(int.Parse).ToArray();
    public long[] ArrLong => Str.Split(' ').Select(long.Parse).ToArray();
    public char[][] Grid(int n) => Create(n, () => Str.ToCharArray());
    public int[] ArrInt1D(int n) => Create(n, () => Int);
    public long[] ArrLong1D(int n) => Create(n, () => Long);
    public int[][] ArrInt2D(int n) => Create(n, () => ArrInt);
    public long[][] ArrLong2D(int n) => Create(n, () => ArrLong);
    private Queue<string> q = new Queue<string>();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public T Next<T>() { if (q.Count == 0) foreach (var item in Str.Split(' ')) q.Enqueue(item); return (T)Convert.ChangeType(q.Dequeue(), typeof(T)); }
    public void Make<T1>(out T1 v1) => v1 = Next<T1>();
    public void Make<T1, T2>(out T1 v1, out T2 v2) { v1 = Next<T1>(); v2 = Next<T2>(); }
    public void Make<T1, T2, T3>(out T1 v1, out T2 v2, out T3 v3) { Make(out v1, out v2); v3 = Next<T3>(); }
    public void Make<T1, T2, T3, T4>(out T1 v1, out T2 v2, out T3 v3, out T4 v4) { Make(out v1, out v2, out v3); v4 = Next<T4>(); }
    public void Make<T1, T2, T3, T4, T5>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5) { Make(out v1, out v2, out v3, out v4); v5 = Next<T5>(); }
    public void Make<T1, T2, T3, T4, T5, T6>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6) { Make(out v1, out v2, out v3, out v4, out v5); v6 = Next<T6>(); }
    public void Make<T1, T2, T3, T4, T5, T6, T7>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6, out T7 v7) { Make(out v1, out v2, out v3, out v4, out v5, out v6); v7 = Next<T7>(); }
    public (T1, T2) Make<T1, T2>() { Make(out T1 v1, out T2 v2); return (v1, v2); }
    public (T1, T2, T3) Make<T1, T2, T3>() { Make(out T1 v1, out T2 v2, out T3 v3); return (v1, v2, v3); }
    public (T1, T2, T3, T4) Make<T1, T2, T3, T4>() { Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4); return (v1, v2, v3, v4); }
}

#endregion


using System;
class Solution
{
    public static void Main(string[] args)
    {
        int n = Convert.ToInt32(Console.ReadLine());
        string inp = "";
        char[][] array = new char[4][];
        char count = '1';
        int temp = 0, flag = 0;
        for (int i = 0; i < 4; i++)
        {
            inp = Console.ReadLine();
            array[i] = inp.ToCharArray();
        }
        while (count < 58)
        {
            for (int j = 0; j < 4; j++)
            {
                for (int k = 0; k < 4; k++)
                {
                    if (array[j][k] == count)
                        temp++;
                }
            }
            if (temp > (2 * n))
            {
                flag = 1;
                break;
            }
            temp = 0;
            count++;
        }
        if (flag != 1)
            Console.WriteLine("YES");
        else
            Console.WriteLine("NO");
    }
}


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

namespace codeforces
{
	class Program
	{
		public const int Osn = 1000000007;

		public class Pair
		{
			public int First;

			public int Second;
		}

		public class PairComparer : IComparer<Pair>
		{
			public int Compare(Pair x, Pair y)
			{
				if (x.First > y.First || (x.First == y.First && x.Second < y.Second))
					return -1;
				return 1;
			}
		}

		public static long GetGcd(long a, long b)
		{
			while (true)
			{
				if (b == 0)
					return a;
				var a1 = a;
				a = b;
				b = a1 % 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 ReadString()
		{
			return Console.ReadLine();
		}

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

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

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

		public static long ReadLong()
		{
			var s = Console.ReadLine();
			return long.Parse(s);
		}

		private static void Main()
		{
			var k = ReadInt();
			var f = new List<string> { ReadString(), ReadString(), ReadString(), ReadString() };
			var can = true;
			for (var i = '1'; i <= '9'; ++i)
			{
				var ct = 0;
				for (var j = 0; j < 4; ++j)
					ct += f[j].Count(x => x == i);
				if (ct > 2 * k)
					can = false;
			}
			WriteYesNo(can);
			Console.ReadLine();
		}
	}
}


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

namespace Codeforces
{
    class Functions
    {
        public static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

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

        public static string[] ReadLineWithSplit(char split)
        {
            return Console.ReadLine().Split(split);
        }

        public static string[] ReadLines(int count)
        {
            string[] lines = new string[count];
            for (int x = 0; x < count; x++)
            {
                lines[x] = ReadLine();
            }
            return lines;
        }
        public static string ReverseInts(string s)
        {
            string[] charArray = s.Split(' ');
            Array.Reverse(charArray);
            return charArray.Aggregate("", (current, s1) => current + (s1 + " "));
        }
    }

    class Program
    {
        private static void Main()
        {
            string[] lines = Functions.ReadLines(8);
            int[] counts = new int[8];
            var strokes = 0;
            var vert = 0;

            for (var i = 0; i < 8; i++)
            {
                foreach (char c in lines[i])
                {
                    if (c == 'B')
                        counts[i]++;
                }
                if (counts[i] == 8)
                    strokes++;
                else
                    vert = counts[i];
            }

            strokes += vert;
            Console.WriteLine(strokes.ToString());
        }
    }
}


using System;

namespace Codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] board = new string[8];
            int count = 0;
            bool x = false;
            for (int i = 0; i < board.Length; i++)
                board[i] = Console.ReadLine();
            for (int i = 0; i < board.Length; i++)
            {
                if (board[i].StartsWith("B") && !board[i].Contains("W"))
                {
                    count++;
                }
                if(board[i].Contains("B") && i < 1)
                {
                    for (int a = 0; a < board[i].Length; a++)
                    {
                        if (board[i][a].ToString() == "B")
                        {
                            int tot = 0;
                            for (int c = 0; c < board.Length; c++)
                            {
                                if (board[c][a].ToString() == "B")
                                    tot++;
                            }
                            if (tot == 8)
                                count++;
                        }
                    }
                }
            }
            if (count == 16)
                count = 8;
            Console.WriteLine(count);
            Console.ReadLine();
        }
    }
}


namespace CodeForcesCSharp
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class _439_A___DevuTheSingerAndChuruTheJoker
    {
        private static string zString() { return Console.ReadLine(); }
        private static List<string> zStrings() { return zString().Split(" ".ToArray(), StringSplitOptions.RemoveEmptyEntries).ToList(); }
        private static int zInt() { return int.Parse(Console.ReadLine()); }
        private static List<int> zInts() { List<int> tmpList = new List<int>(); zStrings().ForEach(i => tmpList.Add(int.Parse(i))); return tmpList; }
        private static long zLong() { return long.Parse(Console.ReadLine()); }
        private static List<long> zLongs() { List<long> tmpList = new List<long>(); zStrings().ForEach(i => tmpList.Add(long.Parse(i))); return tmpList; }
        private static void Wait() { Console.ReadLine(); }

        static void Main(string[] args)
        {
            List<int> nAndD = zInts();
            int numberOfSongs = nAndD.ElementAt(0);
            int eventDuration = nAndD.ElementAt(1);

            List<int> songTimes = zInts();

            int timeForDevu = songTimes.Sum() + (songTimes.Count - 1) * 10;
            if (timeForDevu > eventDuration)
            {
                Console.WriteLine("-1");
            }
            else
            {
                int timeForChuru = eventDuration - songTimes.Sum();
                int jokes = timeForChuru / 5;

                Console.WriteLine(jokes);
            }

#if DEBUG
            Wait();
#endif
        }
    }
}


using System;
using System.IO;
using System.Linq;

namespace Tournir251
{
	public class ProgramA
	{

		public static void Main(string[] args)
		{
			new ProgramA().run();
		}

		public void run()
		{
			using (TextReader input = Console.In)
			{
				int[] numbers = input.ReadLine().Split(' ').Select(stringNumber => int.Parse(stringNumber)).ToArray();
				int n = numbers[0], d = numbers[1];
				int[] t = input.ReadLine().Split(' ').Select(stringNumber => int.Parse(stringNumber)).ToArray();

				int k = (t.Length - 1) * 2;
				int time = t.Sum() + k * 5;
				Console.WriteLine(time <= d ? k + (d - time) / 5 : -1);

			}
		}

	}
}


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

namespace ebonyAndIvory
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int a = Convert.ToInt32(input.Split()[0]);
            int b = Convert.ToInt32(input.Split()[1]);
            int c = Convert.ToInt32(input.Split()[2]);
            int aranan = 0;

                for (int i = 0; i <= 5000 ; i++)
                {
                    for (int j = 0; j <= 5000 ; j++)
                    {
                        aranan = i * a + j * b;
                        if (aranan == c)
                        {
                            Console.WriteLine("Yes");
                            return;
                        }
                        else if (aranan >= 10000)
                        {
                            break;
                        }
                    }
                }
            Console.WriteLine("No");

        }
    }
}


using System;

namespace Olymp
{
  public class ProblemSolver
  {
    public void Solve()
    {
      string[] input = Console.ReadLine().Split();
      int a = int.Parse(input[0]);
      int b = int.Parse(input[1]);
      int c = int.Parse(input[2]);
      int n = c / a;
      for (int i = 0; i <= n; i++)
      {
        int x = c - i * a;
        int j = x / b;
        if(a * i + b * j == c)
        {
          Console.Write("Yes");
          return;
        }
      }
      Console.Write("No");
    }
  }

  class Program
  {
    public static void Main(string[] args)
    {
      var solver = new ProblemSolver();
      solver.Solve();
    }
  }
}


using System;
using System.IO;
using System.Text;

namespace The_number_of_positions
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();
            int a = Next() + 1;
            int b = Next();
            int pos = Math.Max(a, n - b);

            writer.WriteLine(n - pos + 1);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}


/*

 */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Diagnostics;

public class Solver
{
    public void Solve()
    {
        Trace.WriteLine("hello world!");
        int n = ReadInt();
        int a = ReadInt();
        int b = ReadInt();
        int m = n - Math.Max(a+1, n-b) + 1;
        Write(m);
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUG
        Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
        // 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
        {
            new Solver().Solve();
            //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch
        {
#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)); }
    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.Linq;
using System.Text;

namespace ProgA
{
    class Program
    {
        static long counter;
        static long n;
        static List<long> a;

        static void Main(string[] args)
        {
            counter = 0;
            a = new List<long>();
            n = long.Parse(Console.ReadLine());

            long i = 1;
            while (counter < n)
            {
                counter += a.Count + 1;
                a.Add(i++);
            }

            Console.WriteLine(a[a.Count - (int)(counter - n) - 1]);
        }
    }
}


using System;
using System.Collections.Generic;
class some
{
	public static void Main()
	{
		long t=long.Parse(Console.ReadLine());
		long count=0;
		for(long kk=1;kk<=t;kk++)
		{
			if(count+kk>=t)
			for(long j=1;j<=kk;j++)
			{
				count++;
				if(count==t){Console.WriteLine(j);break;}
			}
			if(count==t)break;
			count+=kk;
		}

	}
}


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

namespace A.String_Task
{
    class Program
    {
        static void Main(string[] args)
        {
            string omar = Console.ReadLine();
            omar = omar.ToLower();
            char[] vowels = "auioey".ToCharArray();
            for( int i=0;i<vowels.Length;i++)
            {
            here:
                if(omar.Contains(vowels[i]))
                {
                    omar = omar.Remove(omar.IndexOfAny(vowels), 1);
                    goto here;
                }
            }
            for( int j=0;j<omar.Length;j+=2)
            {
                omar = omar.Insert(j, ".");
            }
            Console.WriteLine(omar);
        }
    }
}


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

namespace String_Task
{
    class Program
    {
        static void Main(string[] args)
        {
            string wowels = "aoyeui";
            string word = Console.ReadLine();
            string newWord = "";
            int size = 0;
            word = word.ToLower();
            for (int i = 0; i < word.Length; i++)
            {
                if (!wowels.Contains(word[i])) {
                    newWord = newWord.Insert(size, ("." + word[i]));
                    size += 2;
                }
            }
            Console.Write(newWord);
        }
    }
}


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

class Program
{

    void solve()
    {
        long x = Math.Abs(nextLong());
        if (x == 0)
        {
            Console.WriteLine(0);
        }
        else
        {
            for (long n = 1; ; n++)
            {
                long num = n * (n + 1);
                if (num >= 2 * x && (num - 2 * x) % 4 == 0)
                {
                    Console.WriteLine(n);
                    break;
                }
            }
        }
    }

    //

    string[] inputLine = new string[0];
    int inputInd = 0;
    string nextLine()
    {
        return Console.ReadLine();
    }
    void readInput()
    {
        if (inputInd != inputLine.Length)
            throw new Exception();
        inputInd = 0;
        inputLine = Console.ReadLine().Split();

    }
    int nextInt()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return int.Parse(inputLine[inputInd++]);
    }
    long nextLong()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return long.Parse(inputLine[inputInd++]);
    }
    double nextDouble()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return double.Parse(inputLine[inputInd++]);
    }
    string nextString()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return inputLine[inputInd++];
    }
    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 Codeforces
{
    class Program
    {

        static void Main(string[] args)
        {

            long x = long.Parse(Console.ReadLine());

            long i = Math.Abs(x);

            long c = 0, ans = -1;

            while (ans == -1){

                long s = (c * (c + 1)) / 2;

                if (-s <= i && i <= s && i % 2 == s % 2){

                    ans = c;

                }

                c++;

            }

            Console.WriteLine(ans);

        }
    }
}


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

namespace ConsoleApplication17
{
    class Program
    {
        static void Main(string[] args)
        {
            var init = Console.ReadLine().Split(' ');

            var n = int.Parse(init[0]);
            var m = int.Parse(init[1]);
            var a = int.Parse(init[2]);
            var b = int.Parse(init[3]);

            var minCost = n % m == 0 ? (n/m) * b : ((n/m) + 1) * b;

            for (int i = 0; i < n; i++)
            {
                var cost1 = a * i + ((n - i) / m) * b + ((n - i) - ((n - i)/m) * m) * a;
                minCost = Math.Min(minCost, cost1);
            }

            Console.WriteLine(minCost);
            Console.ReadLine();

        }
    }
}