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

namespace CodeforcesCs
{
    class Date18
    {
        public static void Main(string[] args)
        {
            string fDate = Console.ReadLine();
            string vDate = Console.ReadLine();

            int[] finalN = Array.ConvertAll<string, int>(fDate.Split('.'), int.Parse);
            int[] vasyaN = Array.ConvertAll<string, int>(vDate.Split('.'), int.Parse);

            DateTime finalReal = new DateTime(finalN[2] + 2000, finalN[1], finalN[0]);

            string[] perms = {"012", "021", "102", "120", "201", "210"};

            for (int i = 0; i < perms.Length; ++i )
            {
                int[] perm = new int[3];
                for (int j = 0; j < 3; ++j)
                    perm[j] = perms[i][j] - '0';

                int day = vasyaN[perm[0]], month = vasyaN[perm[1]], year = 2000 + vasyaN[perm[2]];
                DateTime date = DateTime.Now;
                bool wrong = false;
                try
                {
                    date = new DateTime(year, month, day);
                }
                catch
                {
                    wrong = true;
                }

                if (!wrong)
                {
                    DateTime lesserDate = GetNeedDay(finalReal);
                    if (lesserDate.Year >= 2000 && IsPositive(lesserDate.Subtract(date)))
                    {
                        Console.WriteLine("YES");
                        return;
                    }
                }
            }

            Console.WriteLine("NO");
        }

        private static bool IsPositive(TimeSpan timeSpan)
        {
            return timeSpan.Days >= 0 && timeSpan.Minutes >= 0;
        }

        private static DateTime GetNeedDay(DateTime finalReal)
        {
            if (finalReal.Month == 2 && finalReal.Day == 29)
                return new DateTime(finalReal.Year - 18, 2, 28);
            return new DateTime(finalReal.Year - 18, finalReal.Month, finalReal.Day);
        }
    }
}


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

namespace Task
{

    #region MyIo

    internal class MyIo : IDisposable
    {
        private readonly TextReader inputStream;
        private readonly TextWriter outputStream = Console.Out;

        private string[] tokens;
        private int pointer;

        public MyIo()
#if  LOCAL_TEST
            : this(new StreamReader("input.txt"))
#else
            : this(System.Console.In)
#endif
        {

        }

        public MyIo(TextReader inputStream)
        {
            this.inputStream = inputStream;
        }

        public char NextChar()
        {
            try
            {
                return (char)inputStream.Read();
            }
            catch (IOException)
            {
                return '\0';
            }
        }

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = (NextLine() + string.Empty).Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return Next<int>();
        }

        public long NextLong()
        {
            return Next<long>();
        }

        public T Next<T>()
        {
            var t = typeof(T);

            if (t == typeof(char))
                return (T)(object)NextChar();

            object s = NextString();

            if (t == typeof(string))
                return (T)s;

            return (T)Convert.ChangeType(s, typeof(T));
        }

        public IEnumerable<T> NextWhile<T>(Predicate<T> pred)
        {
            if (pred == null)
                yield break;

            T res = Next<T>();

            while (pred(res))
            {
                yield return res;

                res = Next<T>();
            }
        }

        public IEnumerable<T> NextSeq<T>(long n)
        {
            for (var i = 0; i < n; i++)
                yield return Next<T>();
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));
        }

        public void PrintLine(string format, params object[] args)
        {
            Print(format, args);

            outputStream.WriteLine();
        }

        public void Print(bool o)
        {
            Print(o ? "YES" : "NO");
        }

        public void PrintLine(bool o)
        {
            PrintLine(o ? "YES" : "NO");
        }

        public void Print<T>(T o)
        {
            outputStream.Write(Convert.ToString(o, CultureInfo.InvariantCulture));
        }

        public void PrintLine<T>(T o)
        {
            Print(o);

            outputStream.WriteLine();
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }

        void IDisposable.Dispose()
        {
            Close();

#if  LOCAL_TEST
            Console.ReadLine();
#endif
        }
    }

    public static class ListExtensions
    {

        public static IEnumerable<T> ToCycleEnumerable<T>(this IEnumerable<T> self)
        {
            if (self != null)
            {
                for (; ; )
                {
                    foreach (var x in self)
                        yield return x;
                }
            }
        }

        public static T CycleGet<T>(this IList<T> self, int index)
        {
            var c = self.Count;
            return self[(index % c + c) % c];
        }

        public static IList<T> Shuffle<T>(this IList<T> self)
        {
            var rnd = new Random(DateTime.Now.Millisecond);

            var n = self.Count;

            while (n > 1)
            {
                n--;
                var k = rnd.Next(n + 1);
                var value = self[k];
                self[k] = self[n];
                self[n] = value;
            }

            return self;
        }

        public static IList<IList<T>> UseForNew2D<T>(this T def, int fd, int sd)
        {
            var fdim = new T[fd][];

            for (int i = 0; i < fd; i++)
            {
                fdim[i] = new T[sd];
                Fill(fdim[i], def);
            }

            return fdim;
        }

        public static IList<T> Fill<T>(this IList<T> self, Func<T> fval)
        {
            for (var i = 0; i < self.Count; i++)
                self[i] = fval();

            return self;
        }

        public static IList<T> Fill<T>(this IList<T> self, T val)
        {
            return self.Fill(() => val);
        }

        public static long Hash<T>(this IList<T> self, Func<T, long> val = null)
        {
            return val != null ? self.Hash((t, current) => unchecked(current * 19L + val(t))) : self.Hash(HashOne);
        }

        public static long Hash<T>(this IList<T> self, Func<T, long, long> val)
        {
            return self.Aggregate(0L, (current, t) => unchecked(val(t, current)));
        }

        public static long HashOne<T>(this T self, long current)
        {
            return unchecked(current * 19L + (Equals(self, default(T)) ? 0 : self.GetHashCode()));
        }

    }

    public static class P
    {
        public static P<T1, T2> Create<T1, T2>(T1 key, T2 val)
        {
            return new P<T1, T2>(key, val);
        }
    }

    public class P<T1, T2>
    {
        private class PComparer : IComparer<P<T1, T2>>
        {
            private readonly bool? byKey;

            public PComparer(bool? byKey)
            {
                this.byKey = byKey;
            }

            public int Compare(P<T1, T2> x, P<T1, T2> y)
            {
                x = x ?? new P<T1, T2>();
                y = y ?? new P<T1, T2>();

                if (byKey == true)
                    return Comparer<T1>.Default.Compare(x.Key, y.Key);
                else if (byKey == false)
                    return Comparer<T2>.Default.Compare(x.Value, y.Value);
                else
                {
                    var tr = Comparer<T1>.Default.Compare(x.Key, y.Key);

                    if (tr != 0)
                        tr = Comparer<T2>.Default.Compare(x.Value, y.Value);

                    return tr;
                }
            }
        }

        public P()
        {
        }

        public P(T1 key, T2 val)
        {
            this.Key = key;
            this.Value = val;
        }

        public T1 Key
        {
            get;
            set;
        }

        public T2 Value
        {
            get;
            set;
        }

        public P<T1, T2> Clone()
        {
            return new P<T1, T2>(Key, Value);
        }

        public static IComparer<P<T1, T2>> KeyComparer
        {
            get { return new PComparer(true); }
        }

        public static IComparer<P<T1, T2>> ValueComparer
        {
            get { return new PComparer(false); }
        }

        public static implicit operator T1(P<T1, T2> obj)
        {
            return obj.Key;
        }

        public static implicit operator T2(P<T1, T2> obj)
        {
            return obj.Value;
        }

        public P<T1, T2> SetKey(T1 key)
        {
            Key = key;
            return this;
        }

        public P<T1, T2> SetValue(T2 value)
        {
            Value = value;
            return this;
        }

        public override string ToString()
        {
            return string.Format("Key: {0}, Value: {1}", Key, Value);
        }

        public override int GetHashCode()
        {
            int hash = 17;
            hash = hash * 31 + ((Equals(Key, default(T1))) ? 0 : Key.GetHashCode());
            hash = hash * 31 + ((Equals(Value, default(T1))) ? 0 : Key.GetHashCode());
            return hash;

        }
    }

    #endregion

    internal class Program
    {
        #region Program

        private readonly MyIo io;

        public Program(MyIo io)
        {
            this.io = io;
        }

        public static void Main(string[] args)
        {
            using (MyIo io = new MyIo())
            {
                new Program(io)
                    .Solve();
            }
        }

        #endregion
        public const long MOD = 1000000007;
        public const double EPS = 1e-14;

        private void Solve()
        {
            var a = io.NextLine();
            var b = io.NextLine();

            var n = (long)a.Length;

            var k = io.NextInt();

            var ak = 0L;
            var ak0 = 1L;
            var sprd = 1L;

            for (var i = 1; i <= k; ++i)
            {
                ak0 = (sprd - ak0) % MOD;
                ak = (sprd - ak) % MOD;

                sprd = ((n - 1L) * (sprd % MOD));
            }

            var res = (a == b) ? ak0 : 0;

            for (var i = 1; i < n; i++)
            {
                if (a.Substring(i) + a.Substring(0, i) == b)
                    res = (res + ak) % MOD;
            }

            io.PrintLine(res);
        }
    }

}


using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
class Solve{
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        string[] str = Console.ReadLine().Split(' ');
        int N = int.Parse(str[0]);
        int K = int.Parse(str[1]);
        str = Console.ReadLine().Split(' ');
        int[] A = new int[K];
        for(int i=0;i<K;i++){
            A[i] = int.Parse(str[i]);
        }
        int f = 0;
        int tw = 0;
        int o = 0;
        int th = 0;
        for(int i=0;i<K;i++){
            f += A[i]/4;
            if(A[i] % 4 == 2){
                tw++;
            }
            if(A[i] % 4 == 3){
                th++;
            }
            if(A[i] % 4 == 1){
                o++;
            }
        }
        bool b;
        int F = N;
        int T = 2*N;
        int O = 0;
        for(int i=0;i<f;i++){
            if(F <= 0){
                T -= 2;
            }
            else{
                F--;
            }
        }
        for(int i=0;i<th;i++){
            if(F <= 0){
                T -= 2;
            }
            else{
                F--;
            }
        }
        for(int i=0;i<o;i++){
            if(F <= 0){
                T--;
            }
            else{
                F--;
                T++;
            }
        }
        for(int i=0;i<tw;i++){
            if(F <= 0 && T <= 0){
                O -=2;
            }
            else if(T <= 0){
                F--;
                O++;
            }
            else{
                T--;
            }
        }
        b = F >= 0 && T >= 0 && O >= 0;
        if(b){
            sb.Append("YES\n");
        }
        else{
            sb.Append("NO\n");
        }
    }
}


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

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

		public class Pair
		{
			public long First;

			public long 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);
		}

		public class Vertex
		{
			public int Was;

			public List<int> Edges;
		}

		public static List<Vertex> Graph = new List<Vertex>();

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		public static int BinarySearch(List<int> list, int value)
		{
			var l = -1;
			var r = list.Count;
			while (r - l > 1)
			{
				var m = (r + l) / 2;
				if (list[m] >= value)
					r = m;
				else
					l = m;
			}

			return r;
		}

		private static void Main()
		{
			var l = ReadListOfLongs();
			var a = l[0];
			var b = l[1];
			long ans = (a * (a + 1) / 2) % Osn;
			ans = (ans * b + a) % Osn;
			ans = (((b * (b - 1) / 2) % Osn) * ans) % Osn;
			Console.WriteLine(ans);
			Console.ReadLine();
		}
	}
}


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

namespace CodeForces
{
    class Program
    {

        static void Main(string[] args)
        {
            long[] v = Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
            long max = v.Max();
            long min = v.Min();
            Console.WriteLine(max - (max - min)+" "+ ((max - min) / 2));

        }
    }
}


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

namespace cfgr14
{
    class Program
    {
        static void Main(string[] args)
        {
           Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            if (File.Exists("input.txt"))
            {
                Console.SetIn(new StreamReader("input.txt"));
            }
            solve_cfgr14E();
            Console.Out.Flush();
        }

        public static long[] fact = new long [405];
        public static long[] inv = new long [405];
        public static long[,] choose = new long [405, 405];
        public static long[] pow2 = new long [405];
        public static long n;
        public static long mod;
        /*
        Editorial:

        */
        public static void solve_cfgr14E()
        {
            long[] nm = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
            n = nm[0];
            mod = nm[1];
            precompute();
            long[,] dp = new long[405, 405];
            dp[0, 0] = 1;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j <= i; j++)
                {
                    for (int k = 1; i + k <= n; k++)
                    {
                        dp[i + k + 1, j + k] += (dp[i, j] * pow2[k - 1]) % mod * choose[j + k, k];
                        dp[i + k + 1, j + k] %= mod;
                    }
                }
            }

            long ans = 0;
            for (int i = 0; i <= n; i++)
            {
                ans = (ans + dp[n + 1, i]) % mod;
            }
            Console.WriteLine(ans);
        }

        public static void precompute()
        {
            fact[0] = 1;
            inv[0] = 1;
            for (int i = 1; i <= n; i++)
            {
                fact[i] = (fact[i - 1] * i) % mod;
                inv[i] = binExp(fact[i], mod - 2);
            }

            for (int i = 0; i <= n; i++)
            {
                for (int j = 0; j <= i; j++)
                {
                    choose[i, j] = ((fact[i] * inv[j]) % mod * inv[i - j]) % mod;
                }
            }

            for (int i = 0; i <= n; i++)
            {
                pow2[i] = binExp(2, i);
            }
        }

        public static long binExp(long a, long exp)
        {
            if (exp == 0)
            {
                return 1;
            }
            long tmp = binExp(a, exp / 2);
            tmp = (tmp * tmp) % mod;
            if (exp % 2 == 1)
            {
                tmp *= a;
            }
            return tmp % mod;
        }

        public static void solve_cfgr14C()
        {
            int t = Convert.ToInt32(Console.ReadLine());
            while(t-- > 0)
            {
                int[] nmx = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
                int n = nmx[0];
                int m = nmx[1];
                int x = nmx[2];
                int[] h = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
                Array.Sort(h);
                int[] cnt = new int[m];
                for (int i = 0; i < n; i++)
                {
                    cnt[i % m] += h[i];
                }
                int min = int.MaxValue;
                int max = int.MinValue;
                bool ok = true;
                for (int i = 0; i < m; i++)
                {
                    min = Math.Min(min, cnt[i]);
                    max = Math.Max(max, cnt[i]);
                    if (max - min > x)
                    {
                        ok = false;
                        break;
                    }
                }
                if (ok)
                {
                    Console.WriteLine("YES");
                    for (int i = 0; i < n; i++)
                    {
                        Console.Write("{0} ", (i % m) + 1);
                    }
                }
                else
                {
                    Console.Write("NO");
                }
                Console.WriteLine();
            }
        }

        public static void solve_cfgr14B()
        {
            int t = Convert.ToInt32(Console.ReadLine());
            while(t-- > 0)
            {
                int n = Convert.ToInt32(Console.ReadLine());
                bool ok = false;
                if (n > 1 && (n & (n - 1)) == 0)
                {
                    ok = true;
                }
                else
                {
                    for (int i = 2; i * i <= 1000000000; i++)
                    {
                        if (i % 2 != 0)
                        {
                            if (n % (i * i) == 0)
                            {
                                int r = n / (i * i);
                                if (r > 1 && (r & (r - 1)) == 0)
                                {
                                    ok = true;
                                    break;
                                }
                            }
                        }
                    }
                }
                Console.WriteLine(ok ? "YES" : "NO");
            }

        }

        public static void solve_cfgr14A()
        {
            int t = Convert.ToInt32(Console.ReadLine());
            while(t-- > 0)
            {
                int[] nx = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
                int n = nx[0];
                int x = nx[1];
                int[] w = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
                Array.Sort(w, (a, b) => b.CompareTo(a));
                int sum = 0;
                int posToChange = -1;
                for (int i = 0; i < n; i++)
                {
                    sum += w[i];
                    if (sum == x)
                    {
                        posToChange = i;
                    }
                }
                if (sum != x)
                {
                    Console.WriteLine("YES");
                    for (int i = 0; i < n; i++)
                    {
                        if (i == posToChange)
                        {
                            if (i + 1 < n)
                            {
                                int tmp = w[i];
                                w[i] = w[i + 1];
                                w[i + 1] = tmp;
                            }
                        }
                        Console.Write("{0} ", w[i]);
                    }
                }
                else
                {
                    Console.Write("NO");
                }
                Console.WriteLine();

            }
        }
    }
}


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

namespace ProgrammingContest.Codeforces.SchoolTeam2
{
    class H
    {
        public static void Main()
        {
            string s = Console.ReadLine();
            int n = s.Length;
            long[,] dp = new long[n, 10];

            long res = 0;
            bool self = false;
            for (int u = 0; u < 10; u++)
            {
                for (int i = 0; i < n; i++)
                    for (int j = 0; j < 10; j++)
                        dp[i, j] = 0;
                dp[0, u] = 1;
                for (int i = 1; i < n; i++)
                {
                    int x = s[i] - '0';
                    for (int j = 0; j < 10; j++)
                    {
                        int y = j + x;
                        for (int k = 0; k <= y % 2; k++)
                            dp[i, y / 2 + k] += dp[i - 1, j];
                    }
                }
                for (int i = 0; i < 10; i++) res += dp[n - 1, i];

                bool b = true;
                for (int i = 0; i < n; i++) b &= dp[i, s[i] - '0'] > 0;
                self |= b;
            }

            Console.WriteLine(res - (self ? 1 : 0));
        }
    }
}


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

namespace ConsoleApplication11 {
    class Program {
        static char[] inputSeparators = new char[] { ' ' };
        static int[] ballInStock = new int[3];
        static int[] ballsNeeded = new int[3];
        static int[] deficitArray = new int[3];

        static void Main(string[] args) {
            List<int> input1 = GetInputList_int(inputSeparators);
            ballInStock[0] = input1[0];
            ballInStock[1] = input1[1];
            ballInStock[2] = input1[2];

            List<int> input2 = GetInputList_int(inputSeparators);
            ballsNeeded[0] = input2[0];
            ballsNeeded[1] = input2[1];
            ballsNeeded[2] = input2[2];

            for (int i = 0; i < 3; i++) {
                deficitArray[i] = ballsNeeded[i] - ballInStock[i];
            }

            //Environment.Exit(0);

            for (int i = 0; i < deficitArray.Length; i++) {
                if (deficitArray[i] > 0) {
                    FillDeficit(i);
                }
            }
            Console.WriteLine("Yes");
        }

        static void FillDeficit(int deficitIndex) {
            while (deficitArray[deficitIndex] > 0) {
                bool transformationIsPossible = false;
                for (int i = 0; i < deficitArray.Length; i++) {
                    if (i != deficitIndex) { // other magic balls
                        if (deficitArray[i] <= -2) { // if we can
                            transformationIsPossible = true;
                            deficitArray[i] += 2;
                            deficitArray[deficitIndex] -= 1;
                            break;
                        }
                    }
                }
                if (!transformationIsPossible) {
                    Console.WriteLine("No");
                    Environment.Exit(0);
                }
            }
        }

        static List<int> GetInputList_int(char[] separator) {
            string inputLine1 = Console.ReadLine();
            List<string> inputList1 = inputLine1.Split(' ').ToList();
            List<int> inputList1_int = new List<int>();
            inputList1.ForEach(i => {
                int i_int = int.Parse(i);
                inputList1_int.Add(i_int);
            });
            return inputList1_int;
        }
    }
}


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

namespace White_Sheet
{
    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)
        {
            writer.WriteLine(Solve(args) ? "YES" : "NO");
            writer.Flush();
        }

        private static bool Solve(string[] args)
        {
            int x1 = Next(), y1 = Next(), x2 = Next(), y2 = Next();
            int x3 = Next(), y3 = Next(), x4 = Next(), y4 = Next();
            int x5 = Next(), y5 = Next(), x6 = Next(), y6 = Next();

            x3 = Math.Min(x4, Math.Max(x3, x1));
            y3 = Math.Min(y4, Math.Max(y3, y1));

            x5 = Math.Min(x6, Math.Max(x5, x1));
            y5 = Math.Min(y6, Math.Max(y5, y1));

            x4 = Math.Max(x3, Math.Min(x4, x2));
            y4 = Math.Max(y3, Math.Min(y4, y2));

            x6 = Math.Max(x5, Math.Min(x6, x2));
            y6 = Math.Max(y5, Math.Min(y6, y2));

            long s = (long) (x2 - x1)*(y2 - y1);
            long s1 = (long) (x4 - x3)*(y4 - y3);
            long s2 = (long) (x6 - x5)*(y6 - y5);

            if (s > s1 + s2)
                return true;

            x3 = Math.Min(x4, Math.Max(x3, x5));
            y3 = Math.Min(y4, Math.Max(y3, y5));
            x4 = Math.Max(x3, Math.Min(x4, x6));
            y4 = Math.Max(y3, Math.Min(y4, y6));

            long s12 = (long) (x4 - x3)*(y4 - y3);

            return s > s1 + s2 - s12;
        }

        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.Linq;
using System.Text;

namespace Comp1
{
    class TaskA
    {
        static void Main(string[] args)
        {

            long a, b;
            string str;
            string[] s = new string[2];
            str = Console.ReadLine();
            s = str.Split();
            a = long.Parse(s[0]);
            char[] arr = s[1].ToCharArray();
            Array.Reverse(arr);
            string ss = new string(arr);
            b = long.Parse(ss);

            Console.WriteLine(a + b);
        }
    }
}


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

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solution
{
    string Sort(int[] a)
    {
        int n = a.Length;
        var b = new int[n];
        var log = new List<int>();

        void MergeSort(int l, int r)
        {
            if (r - l <= 1)
                return;
            int m = (l + r) / 2;
            MergeSort(l, m);
            MergeSort(m, r);
            Write(l, r, m);
            int i = l;
            int j = m;
            int k = l;
            while (i < m && j < r)
            {
                if (a[i] < a[j])
                {
                    log.Add(0);
                    b[k] = a[i];
                    i++;
                }
                else
                {
                    log.Add(1);
                    b[k] = a[j];
                    j++;
                }
                k++;
            }
            while (i < m)
            {
                b[k] = a[i];
                i++;
                k++;
            }
            while (j < r)
            {
                b[k] = a[j];
                j++;
                k++;
            }
            for (int p = l; p < r; p++)
                a[p] = b[p];
        }

        MergeSort(0, n);
        return string.Concat(log);
    }

    int p;
    string log;
    int[] a, b;
    void Fun(int l, int r)
    {
        if (r - l <= 1)
            return;
        int m = (l + r) / 2;
        Fun(l, m);
        Fun(m, r);
        int i = l;
        int j = m;
        int k = l;
        while (i < m && j < r)
        {
            if (log[p++] == '0')
            {
                b[k] = a[i];
                i++;
            }
            else
            {
                b[k] = a[j];
                j++;
            }
            k++;
        }
        while (i < m)
        {
            b[k] = a[i];
            i++;
            k++;
        }
        while (j < r)
        {
            b[k] = a[j];
            j++;
            k++;
        }
        for (int p = l; p < r; p++)
            a[p] = b[p];
    }

    public void Solve()
    {
        log = ReadToken();
        int n = 16;
        a = Enumerable.Range(0, n).ToArray();
        b = new int[n];
        Fun(0, n);

        var ans = new int[n];
        for (int i = 0; i < n; i++)
            ans[a[i]] = i + 1;
        Write(n);
        WriteArray(ans);
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUGLOCAL
        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("ysys.in");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            new Solution().Solve();
            //var thread = new Thread(new Solution().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch (Exception ex)
        {
#if DEBUGLOCAL
            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.Linq;
using CompLib.Util;

public class Program
{
    int N;
    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();

        /*
         * クイーン
         *
         * たて、よこ、ななめ
         * 駒があったら取る
         *
         * n*nチェス盤
         *
         * (1,1)に白
         * (1,n)に黒
         * それ以外全部緑
         *
         * 白先手
         *
         * 必ず駒を取る
         *
         * 駒を取られる or 駒を取れない 負け
         *
         * 勝つほう
         */

        /*
         * 2 w 1 2
         * 3 b
         * 4 w 1 2
         */

        if (N % 2 == 0)
        {
            Console.WriteLine("white");
            Console.WriteLine("1 2");
        }
        else
        {
            Console.WriteLine("black");
        }
    }

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

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()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        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()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.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.IO;
using System.Text;

namespace Kavi_on_Pairing_Duty
{
    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)
        {
            const int mod = 998244353;

            int n = Next();

            var p = new int[n + 1];
            var s = new long[n + 1];
            s[1] = 1;
            long sum = 2;

            for (int i = 2; i < p.Length; i++)
            {
                for (int j = i + i; j < p.Length; j += i)
                {
                    p[j]++;
                }

                s[i] = (1 + sum + p[i])%mod;
                sum += s[i];
                sum %= mod;
            }
            writer.WriteLine(s[n]);
            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.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static bool prime(long p)
        {
            if (p == 2 || p == 7 || p == 61)
                return true;
            if (p % 2 == 0)
                return false;
            long k = 0;
            long d = p - 1;
            while (d % 2 == 0)
            {
                d /= 2;
                k++;
            }
            if (!check(2, p, k, d))
                return false;
            if (!check(7, p, k, d))
                return false;
            if (!check(61, p, k, d))
                return false;
            return true;
        }
        static bool check(long a, long p, long k, long d)
        {
            long temp = powmod(a, d, p);
            if (temp == 1)
                return true;
            if (temp == -1)
                return true;
            while (k > 0)
            {
                temp = (temp * temp) % p;
                if (temp == -1)
                    return false;
                if (temp == 1)
                    return true;
                k--;
            }
            return temp == 1;
        }
        static long powmod(long a, long pow, long mod)
        {
            long temp = 1;
            while (pow > 0)
            {
                if (pow % 2 == 1)
                    temp = (temp * a) % mod;
                pow /= 2;
                a = (a * a) % mod;
            }
            return temp;
        }
        static bool check2(long n, long t)
        {
            if (t > n)
                t = n;
            for (; t > -1; t--)
                if (prime(t) && prime(n - t))
                    return true;
            return false;
        }
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            if (prime(n))
            {
                Console.WriteLine("1");
                Console.WriteLine(n);
                return;
            }
            if (n % 2 == 0)
            {
                for (long i = n / 2; i < n; i += 2)
                {
                    if (i % 2 == 0)
                    {
                        i++;
                        continue;
                    }
                    if (prime(i) && prime(n - i))
                    {
                        Console.WriteLine("2");
                        Console.WriteLine("{0} {1}", n - i, i);
                        return;
                    }
                }
            }
            if (n % 2 == 1)
            {
                for (long i = n / 3; i < n; i += 2)
                {
                    if (i % 2 == 0)
                    {
                        i++;
                        continue;
                    }
                    if (prime(i))
                    {
                        long n2 = n - i;
                        for (long i2 = n2 / 2; i2 < n2; i2 += 2)
                        {
                            if (i2 % 2 == 0)
                            {
                                i2++;
                                continue;
                            }
                            if (prime(i2) && (prime(n2 - i2)))
                            {
                                Console.WriteLine("3");
                                Console.WriteLine("{0} {1} {2}", n2 - i2, i2, i);
                                return;
                            }
                        }
                    }
                }
            }
            n -= 2;
            if (n % 2 == 0)
            {
                for (long i = n / 2; i < n; i += 2)
                {
                    if (i % 2 == 0)
                    {
                        i++;
                        continue;
                    }
                    if (prime(i) && prime(n - i))
                    {
                        Console.WriteLine("3");
                        Console.WriteLine("2 {0} {1}", n - i, i);
                        return;
                    }
                }
            }
            else
            {
                n -= 2;
                Console.WriteLine("3");
                Console.WriteLine("2 2 {0}", n);
            }
        }
    }
}


using System;
using System.Collections.Generic;

namespace Tester
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            for(int i = 0; i < t; i++)
            {
                int n = int.Parse(Console.ReadLine());
                if (n <= 9)
                {
                    Console.WriteLine(n);
                }
                else
                {
                    var nums = new List<int>();
                    int sum = 0;
                    for (int j = 9; j > 0; j--)
                    {
                        if (sum + j <= n)
                        {
                            nums.Add(j);
                            sum += j;
                        }
                    }
                    nums.Sort();
                    nums.ForEach(Console.Write);
                    Console.WriteLine();
                }
            }

        }
    }
}


using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		long N = long.Parse(Console.ReadLine());
		string str = Console.ReadLine();
		long ct = 0;
		for(var i=0;i<N;i++){
			if(str.Substring(i,1)=="8"){
				ct += 1;
			}
		}
		long ans = Math.Min(ct,N/11);
		Console.WriteLine(ans);
	}
}


#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 b14e
{
    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 d = readIntArray();
            var n = d[0];
            var t = d[1];

            var dp = new int[n + 1, t + 1, t,  5, 3];
            for (int i = 0; i < n + 1; i++)
            {
                for (int j = 0; j < t + 1; j++)
                {
                    for (int k = 0; k < t; k++)
                    {
                        for (int z = 0; z < 5; z++)
                        {
                            for (int h = 0; h < 3; h++)
                            {
                                dp[i, j, k, z, h] = -1;
                            }
                        }
                    }

                }
            }

            var res = count(dp, n, t, t, t -1, 0, none, 1);

            Console.WriteLine(res);
            //var n = readInt();
            //var m = readInt();

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

        static int down = 0;
        static int up = 1;
        static int none = 2;
        static int count(int[,,,,] dp, int n, int t, int ct, int cd, int prev, int dir, int i)
        {
            if (ct < 0 || cd < 0)
            {
                return 0;
            }

            var res = 0;

            if (i == 1)
            {
                for (int j = 1; j < 5; j++)
                {
                    res += count(dp, n, t, ct, cd,  j, none, 2);
                }

                return res;
            }

            if (i == n + 1)
            {
                if (ct == 0)
                {
                    res = 1;
                }
                else
                {
                    res = 0;
                }

                return res;
            }
            else
            {
                if (dp[i, ct, cd, prev, dir] != -1)
                {
                    return dp[i, ct, cd, prev, dir];
                }

                for (int j = 1; j < 5; j++)
                {
                    if (j < prev)
                    {
                        if (dir == up)
                        {
                            res += count(dp, n, t, ct - 1, cd,  j, down, i + 1);
                        }
                        else if (dir == down)
                        {
                            res += count(dp, n, t, ct, cd, j, down, i + 1);
                        }
                        else if (dir == none)
                        {
                            res += count(dp, n, t, ct,cd, j, down, i + 1);
                        }
                    }
                    else if (j > prev)
                    {
                        if (dir == up)
                        {
                            res += count(dp, n, t, ct,cd,  j, up, i + 1);
                        }
                        else if (dir == down)
                        {
                            res += count(dp, n, t, ct, cd - 1, j, up, i + 1);
                        }
                        else if (dir == none)
                        {
                            res += count(dp, n, t, ct, cd, j, up, i + 1);
                        }
                    }
                }
            }

            dp[i, ct, cd, prev, dir] = res;

            return res;
        }

        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;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Contest839A
{
    class Program
    {
        static void Main(string[] args)
        {
            var values = Console.ReadLine().Split(' ');
            var count = int.Parse(values[1]);

            values = Console.ReadLine().Split(' ');
            var days = 0;
            var confety = 0;

            for (var i = 0; i < values.Length; i++)
            {
                confety += int.Parse(values[i]);
                if (confety > 8)
                {
                    confety -= 8;
                    count -= 8;
                }
                else
                {
                    count -= confety;
                    confety = 0;
                }
                days++;
                if (count <= 0)
                {
                    Console.WriteLine(days);
                    return;
                }
            }
            Console.WriteLine("-1");
        }
    }
}


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

namespace Codeforces
{
    class A
    {
        private static ThreadStart s_threadStart = new A().Go;
        private static bool s_time = false;

        class Node
        {
            public void Init()
            {
                taken = false;
                next = new HashSet<int>(nextO);
                prev = new HashSet<int>(prevO);
            }

            public int id;
            public bool taken = false;
            public int comp;
            public HashSet<int> next;
            public HashSet<int> prev;
            public HashSet<int> nextO = new HashSet<int>();
            public HashSet<int> prevO = new HashSet<int>();
        }

        private void Go()
        {
            int n = GetInt();
            Node[] nodes = new Node[n+1];
            for (int i = 1; i <= n; i++)
            {
                nodes[i] = new Node();
                nodes[i].id = i;
                nodes[i].comp = GetInt();
            }

            for (int i = 1; i <= n; i++)
            {
                int tmp = GetInt();
                for (int j = 0; j < tmp; j++)
                {
                    int x = GetInt();
                    nodes[i].prevO.Add(x);
                    nodes[x].nextO.Add(i);
                }
            }

            for (int i = 1; i <= n; i++)
            {
                nodes[i].Init();
            }

            List<Node> topSort = new List<Node>(n);
            while (topSort.Count < n)
            {
                for (int i = 1; i <= n; i++)
                {
                    if (!nodes[i].taken && nodes[i].prev.Count == 0)
                    {
                        topSort.Add(nodes[i]);
                        nodes[i].taken = true;
                        foreach (int x in nodes[i].next)
                        {
                            nodes[x].prev.Remove(i);
                        }
                    }
                }
            }

            int totalTet = int.MaxValue;

            //1
            for (int i = 1; i <= n; i++)
            {
                nodes[i].Init();
            }

            int ret = 0;
            int comp = 1;
            int count = 0;
            while (count < n)
            {
                foreach (Node node in topSort)
                {
                    if (!node.taken && node.comp == comp && node.prev.Count == 0)
                    {
                        node.taken = true;
                        count++;
                        ret++;
                        foreach (int x in node.next)
                        {
                            nodes[x].prev.Remove(node.id);
                        }
                    }
                }
                if (count < n)
                {
                    ret++;
                    comp = 1 + comp % 3;
                }
            }

            if (ret < totalTet) totalTet = ret;

            //2
            for (int i = 1; i <= n; i++)
            {
                nodes[i].Init();
            }

            ret = 0;
            comp = 2;
            count = 0;
            while (count < n)
            {
                foreach (Node node in topSort)
                {
                    if (!node.taken && node.comp == comp && node.prev.Count == 0)
                    {
                        node.taken = true;
                        count++;
                        ret++;
                        foreach (int x in node.next)
                        {
                            nodes[x].prev.Remove(node.id);
                        }
                    }
                }
                if (count < n)
                {
                    ret++;
                    comp = 1 + comp % 3;
                }
            }

            if (ret < totalTet) totalTet = ret;

            //3
            for (int i = 1; i <= n; i++)
            {
                nodes[i].Init();
            }

            ret = 0;
            comp = 3;
            count = 0;
            while (count < n)
            {
                foreach (Node node in topSort)
                {
                    if (!node.taken && node.comp == comp && node.prev.Count == 0)
                    {
                        node.taken = true;
                        count++;
                        ret++;
                        foreach (int x in node.next)
                        {
                            nodes[x].prev.Remove(node.id);
                        }
                    }
                }
                if (count < n)
                {
                    ret++;
                    comp = 1 + comp % 3;
                }
            }

            if (ret < totalTet) totalTet = ret;

            Wl(totalTet);
        }

        #region Template

        public static void Main(string[] args)
        {
            System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
            Thread main = new Thread(new ThreadStart(s_threadStart), 512 * 1024 * 1024);
            timer.Start();
            main.Start();
            main.Join();
            timer.Stop();
            if (s_time)
                Wl(timer.ElapsedMilliseconds);
        }

        private static IEnumerator<string> ioEnum;
        private static string GetString()
        {
            while (ioEnum == null || !ioEnum.MoveNext())
            {
                ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();
            }

            return ioEnum.Current;
        }

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

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

        private static double GetDouble()
        {
            return double.Parse(GetString());
        }

        private static List<int> GetIntArr(int n)
        {
            List<int> ret = new List<int>(n);
            for (int i = 0; i < n; i++)
            {
                ret.Add(GetInt());
            }
            return ret;
        }

        private static void Wl<T>(T o)
        {
            if (o is double)
            {
                Wld((o as double?).Value, "");
            }
            else if (o is float)
            {
                Wld((o as float?).Value, "");
            }
            else
                Console.WriteLine(o.ToString());
        }

        private static void Wl<T>(IEnumerable<T> enumerable)
        {
            Wl(string.Join(" ", enumerable.Select(e => e.ToString()).ToArray()));
        }

        private static void Wld(double d, string format)
        {
            Wl(d.ToString(format, CultureInfo.InvariantCulture));
        }

        public struct Tuple<T, K> : IComparable<Tuple<T, K>>
            where T : IComparable<T>
            where K : IComparable<K>
        {
            public T Item1;
            public K Item2;

            public Tuple(T t, K k)
            {
                Item1 = t;
                Item2 = k;
            }

            public override bool Equals(object obj)
            {
                var o = (Tuple<T, K>)obj;
                return o.Item1.Equals(Item1) && o.Item2.Equals(Item2);
            }

            public override int GetHashCode()
            {
                return Item1.GetHashCode() ^ Item2.GetHashCode();
            }

            public override string ToString()
            {
                return "(" + Item1 + " " + Item2 + ")";
            }

            #region IComparable<Tuple<T,K>> Members

            public int CompareTo(Tuple<T, K> other)
            {
                int ret = Item1.CompareTo(other.Item1);
                if (ret != 0) return ret;
                return Item2.CompareTo(other.Item2);
            }

            #endregion
        }

        #endregion
    }
}


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

namespace КРОК_2012
{
    //Телефонный код
    class Program
    {

        /////Телефонный код
        //static bool solve(StreamReader str)
        //{

        //    string[] tokens = str.ReadLine().Split(' ');
        //    int N = Convert.ToInt32(tokens[0]);
        //    string next;
        //    string prefix = str.ReadLine(); ;
        //    for (int i = 0; i < N - 1; i++)
        //    {
        //        next = str.ReadLine();
        //        for (int j = 0; j < prefix.Length; j++)
        //            if (prefix[j] != next[j]) { prefix = prefix.Substring(0, j); break; }
        //    }

        //    Console.WriteLine(prefix.Length);

        //    return str.EndOfStream;
        //}

       ////B. Период псевдослучайной последовательности
       // static bool solve(StreamReader str)
       // {

       //     string[] tokens = str.ReadLine().Split(' ');
       //     int a = Convert.ToInt32(tokens[0]);
       //     int b = Convert.ToInt32(tokens[1]);
       //     int m = Convert.ToInt32(tokens[2]);
       //     int r0 = Convert.ToInt32(tokens[3]);

       //     Dictionary<int, int> q = new Dictionary<int, int>();
       //     int i=0;
       //     int prev=r0;
       //     do
       //     {
       //         q.Add(prev, i++);
       //         prev = (a * prev + b) % m;

       //     } while (!q.ContainsKey(prev));

       //     int ret = i - q[prev];

       //     Console.WriteLine(ret);

       //     return str.EndOfStream;
       // }

        ////C. Маршрутка
        //static bool solve(StreamReader str)
        //{

        //    string[] tokens = str.ReadLine().Split(' ');
        //    int n = Convert.ToInt32(tokens[0]);
        //    int m = Convert.ToInt32(tokens[1]);
        //    int Time = 0;
        //    int[] students=new int[n];
        //    SortedDictionary<int, List<int>> pas = new SortedDictionary<int, List<int>>();
        //    for (int i = 0;i<n; i++)
        //    {
        //        tokens = str.ReadLine().Split(' ');
        //        int t = Convert.ToInt32(tokens[0]);
        //        int xi = Convert.ToInt32(tokens[1]);
        //        if (!pas.ContainsKey(xi)) pas.Add(xi, new List<int>());
        //        pas[xi].Add(i);
        //        if ((((i + 1) % m) == 0) || (i + 1 == n)) //поехали
        //        {
        //            Time=(t>Time)?t:Time;//Время последнего подошедшего студента, либо (если студенты ждали ее возвращения) время ее возвращения
        //            int prevx = 0;
        //            foreach (int x in pas.Keys)
        //            {
        //                Time += x - prevx;//Пока приехали на остановку от предыдущей
        //                prevx = x;

        //                foreach (int studentindex in pas[x])
        //                    students[studentindex] = Time;//все студенты на данной остановке получают одинаковое время высадки
        //                Time += 1 + pas[x].Count / 2;//+ время высадки все студентов на остановке
        //            }
        //            //всех высадили и едеме обратно
        //            Time += prevx;
        //            pas.Clear();//Очистили маршрутку
        //        }
        //    }

        //    for (int i = 0; i < n;i++ )
        //        Console.Write(students[i].ToString()+" ");

        //    Console.WriteLine();
        //    return str.EndOfStream;
        //}

        //D. Реформа календаря
        //static bool solve(StreamReader str)
        //{

        //    string[] tokens = str.ReadLine().Split(' ');
        //    Int64 a = Convert.ToInt64(tokens[0]);
        //    Int64 n = Convert.ToInt64(tokens[1]) + a;
        //    Int64 p = 0;
        //    Int64 sqrta=(int)Math.Sqrt(a);
        //    Int64 sqrtn = (int)Math.Sqrt(n);
        //    Int64[] kvadrat= new long[sqrtn+1];
        //
        //    kvadrat[1] = 1;
        //    kvadrat[sqrta] = sqrta * sqrta;
        //    for (; a < n; a++)
        //    {

        //            Int64 dc;
        //            for (dc = sqrta; dc > 0; dc--)//количество дней в месяце
        //            {
        //                if (kvadrat[dc] == 0)
        //                {
        //                    if (kvadrat[dc + 1] != 0) kvadrat[dc] = kvadrat[dc + 1] - 2 * (dc + 1) + 1;
        //                    else kvadrat[dc] = kvadrat[dc - 1] + 2 * (dc - 1) + 1;
        //                }
        //                Int64 dcdc = kvadrat[dc];
        //                if (a % dcdc == 0) { p += a / dcdc; break; }
        //            }

        //            Int64 tsqrta = 0 ;

        //            if (dc == sqrta) //встретили полный квадрат
        //            {
        //                tsqrta = (sqrta + 1) * (sqrta + 1);
        //                for (a++; (a < (int)tsqrta)&&(a<n); a++)
        //                {
        //                    for (dc = sqrta; dc > 0; dc--)//количество дней в месяце
        //                    {
        //                        if (kvadrat[dc] == 0)
        //                        {
        //                            if (kvadrat[dc + 1] != 0) kvadrat[dc] = kvadrat[dc + 1] - 2 * (dc+1) + 1;
        //                            else kvadrat[dc] = kvadrat[dc - 1] + 2 * (dc-1) + 1;
        //                        }
        //                        Int64 dcdc = kvadrat[dc];
        //                        if (a % dcdc == 0) { p += a / dcdc; break; }
        //                    }
        //                }
        //               // p += 1;
        //                a++;
        //                sqrta++;
        //            }

        //    }
        //    Console.WriteLine(p);
        //    return str.EndOfStream;
        //}

        static bool solve(StreamReader str)
        {

            string[] tokens = str.ReadLine().Split(' ');
            Int64 a = Convert.ToInt64(tokens[0]);
            Int64 n = Convert.ToInt64(tokens[1]) + a-1;
            Int64 p = 0;
            int[] ch = new int[10000001];
            for(int i=1;;i++)
            {
                Int64 kvadrat=i*i;
                if (kvadrat>n) break;
                for(int j=1;;j++)
                {
                    Int64 k=kvadrat*j;
                    if (k>n) break;
                    ch[k]=j;
                }
            }

            for (Int64 i = a; i <= n; i++)
                p += (ch[i]==0)?1:ch[i];

                Console.WriteLine(p);
            return str.EndOfStream;
        }

        static void Main(string[] args)
        {
            StreamReader str = new StreamReader(Console.OpenStandardInput());

#if DEBUG
            str = new StreamReader("input.txt");
            while (!solve(str)) ;
#else
            solve(str);
#endif

        }
        }
    }


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

namespace for_codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = 0;
            string anss = "NO" , s = Console.ReadLine();
            for (int i = 0; i < s.Length-1; i++)
            {
                if (s[i] == s[i + 1])
                    k++;
                else
                    k = 0;
                if (k == 6)
                {
                    anss = "YES";
                    break;
                }
            }
            Console.WriteLine(anss);

        }
    }
}


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

namespace ReadWriteTemplate
{
	public static class Solver
	{
		private static void SolveCase()
		{
			int n = ReadInt();
			var a = ReadIntArray();
			Array.Sort(a);
			int sum = a.Sum();
			int i = 0;
			while (2 * sum < 9 * n)
			{
				sum = sum - a[i] + 5;
				i++;
			}
			Writer.WriteLine(i);
		}

		public static void Solve()
		{
			SolveCase();

			/*var sw = Stopwatch.StartNew();*/

			/*int T = ReadInt();
			for (int i = 0; i < T; i++)
			{
				Writer.Write("Case #{0}: ", i + 1);
				SolveCase();
			}*/

			/*sw.Stop();
			Console.WriteLine(sw.ElapsedMilliseconds);*/
		}

		public static void Main()
		{
			Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

#if DEBUG
			//Reader = Console.In; Writer = Console.Out;
			Reader = File.OpenText("input.txt"); Writer = File.CreateText("output.txt");
#else
			Reader = Console.In; Writer = Console.Out;
#endif

			// Solve();
			Thread thread = new Thread(Solve, 64 * 1024 * 1024);
			thread.CurrentCulture = CultureInfo.InvariantCulture;
			thread.Start();
			thread.Join();

			Reader.Close();
			Writer.Close();
		}

		public static IOrderedEnumerable<TSource> OrderByWithShuffle<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
		{
			return source.Shuffle().OrderBy(keySelector);
		}

		public static T[] Shuffle<T>(this IEnumerable<T> source)
		{
			T[] result = source.ToArray();
			Random rnd = new Random();
			for (int i = result.Length - 1; i >= 1; i--)
			{
				int k = rnd.Next(i + 1);
				T tmp = result[k];
				result[k] = result[i];
				result[i] = tmp;
			}
			return result;
		}

		#region Read/Write

		private static TextReader Reader;

		private 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 string ReadLine()
		{
			return Reader.ReadLine();
		}

		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 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;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
             int n=int.Parse(Console.ReadLine());
             n=n*2-1;
             int sum=0;
             for(int i=1;i<=n;i+=2)
             sum+=i*2;
             sum-=n;
             Console.WriteLine(sum);
        }
    }
}


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

namespace Browser
{
    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)
        {
            writer.WriteLine(Solve(args));
            writer.Flush();
        }

        private static int Solve(string[] args)
        {
            int n = Next(), pos = Next(), l = Next(), r = Next();

            if (l == 1 && r == n)
                return 0;
            if (l == 1)
            {
                if (pos <= r)
                {
                    return r - pos + 1;
                }
                return pos - r + 1;
            }
            if (r == n)
            {
                if (pos >= l)
                    return pos - l + 1;
                return l - pos + 1;
            }
            if (pos <= l)
            {
                return r - pos + 2;
            }
            if (pos >= r)
            {
                return pos - l + 2;
            }
            return 2 + r - l + Math.Min(r - pos, pos - l);
        }

        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.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Numerics;
using System.Globalization;

namespace Smth
{
    class Program
    {
        public static void Main()
        {
            int bufSize = 512;
            Stream inStream = Console.OpenStandardInput(bufSize);
            Console.SetIn(new StreamReader(inStream, Console.InputEncoding, false, bufSize));

            var word = Console.ReadLine();
            var variantsCount = Math.Pow(2, word.Length);
            var palindroms = new List<string>();
            for (int i = 0; i < variantsCount; i++)
            {
                var combination = Bitset(i, word.Length);
                var subString = Enumerable
                    .Range(0, word.Length)
                    .Where(x => combination[x] == 1)
                    .Select(x => word[x]);
                if (IsPalindrome(subString))
                    palindroms.Add(new string(subString.ToArray()));
            }
            Console.WriteLine(palindroms.Max());
        }

        public static bool IsPalindrome(IEnumerable<char> word)
        {
            return word.SequenceEqual(word.Reverse());
        }

        public static int[] Bitset(int bitset, int n)
        {
            return Enumerable
                .Range(0, n)
                .Select(x =>
                {
                    var result = bitset % 2;
                    bitset /= 2;
                    return result;
                }).ToArray();
        }
    }
}


// Submitted by Silithus @ Macau
using System;
using System.IO;
using System.Collections.Generic;
using CCF_XOI;

namespace CodeForces
{
	class CF439A
	{
		public void Solve(XOI xoi)
		{
			int i, N, D;

			N = xoi.ReadInt();
			D = xoi.ReadInt() - (N - 1) * 10;

			for (i = 0; i < N; i++)
				D -= xoi.ReadInt();

			if (D < 0)
				xoi.o.WriteLine("-1");
			else
				xoi.o.WriteLine((N - 1) * 2 + D / 5);
		}
	}

	class CodeForcesMain
	{
		static void Main(string[] args)
		{
			(new CF439A()).Solve(new XOI());
		}
	}
}

namespace CCF_XOI
{	// version 2014.02.07
	class XOI
	{
		protected StreamReader sr;
		public StreamWriter o;
		protected Queue<string> buf = new Queue<string>();
		public bool EOF = false;

		public XOI()
		{
			this.sr = new StreamReader(Console.OpenStandardInput());
			this.o = new StreamWriter(Console.OpenStandardOutput());
			this.o.AutoFlush = true;
		}

		public XOI(string in_path, string out_path)
		{
			this.sr = new StreamReader(in_path);
			this.o = new StreamWriter(out_path);
			this.o.AutoFlush = true;
		}

		public int ReadInt()
		{
			string s = this.GetNext();
			if (s == null) return -1;
			else return Int32.Parse(s);
		}

		public long ReadLong()
		{
			string s = this.GetNext();
			if (s == null) return -1;
			else return Int64.Parse(s);
		}

		public double ReadDouble()
		{
			string s = this.GetNext();
			if (s == null) return -1;
			else return Double.Parse(s);
		}

		public string ReadString()
		{
			string s = this.GetNext();
			return (s == null ? null : s);
		}

		public string ReadLine()
		{	// I will ignore current buffer and read a new line
			string s = "";
			while (s == "" && !this.EOF)
			{
				s = sr.ReadLine();
				this.EOF = (s == null);
			}
			return (this.EOF ? null : s);
		}

		protected string GetNext()
		{
			if (buf.Count == 0)
			{
				while (buf.Count == 0 && !this.EOF)
				{
					string s = sr.ReadLine();
					if (s == null)
						this.EOF = true;
					else
						foreach (string ss in s.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries))
							buf.Enqueue(ss);
				}
			}

			return (this.EOF ? null : buf.Dequeue());
		}
	}
}


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

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

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

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    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(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).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 string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        int[] seq = new int[] { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51, 1, 2, 1, 14, 1, 2, 2, 14, 1, 6, 1, 4, 2, 2, 1, 52, 2, 5, 1, 5, 1, 15, 2, 13, 2, 2, 1, 13, 1, 2, 4, 267, 1, 4, 1, 5, 1, 4, 1, 50, 1, 2, 3, 4, 1, 6, 1, 52, 15, 2, 1, };
        int a = ReadInt();
        return seq[a - 1];
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Security;
using System.Security.Cryptography;

namespace ConsoleApplication1
{
	class Program
	{
		//DON'T FORGET TO SET IT TO FALSE BEFORE SUBMIT!!!!
		public const bool useFiles = false;

		private static StreamReader GetStandardInputStream()
		{
			return useFiles
				? new StreamReader(@"in.txt")
				: new StreamReader(Console.OpenStandardInput());
		}

		private static StreamWriter GetStandardOutputStream()
		{
			return useFiles
				? new StreamWriter(@"out.txt")
				: new StreamWriter(Console.OpenStandardOutput());
		}

		public class MyComparer : IComparer<Tuple<long, long>>
		{
			public int Compare(Tuple<long, long> x, Tuple<long, long> y)
			{
				if (x.Item2 > y.Item2)
				{
					return 1;
				}
				else if (x.Item2 == y.Item2)
				{
					if (x.Item1 > y.Item1)
					{
						return -1;
					}
					else if (x.Item1 == y.Item1)
					{
						return 0;
					}
					else
					{
						return 1;
					}
				}
				else
				{
					return -1;
				}
			}
		}

		public class Graph
		{
			private List<int>[] adj;

			public Graph(int n)
			{
				adj = new List<int>[n];

				for (int i = 0; i < n; i++)
				{
					adj[i] = new List<int>();
				}
			}

			public void AddEdge(int v, int w)
			{
				adj[v].Add(w);
			}

			public int[] GetAdj(int v)
			{
				return adj[v].ToArray();
			}

			public int V()
			{
				return adj.Count();
			}
		}

		public class WeightedNode
		{
			public int Weight { get; set; }

			public int A { get; set; }
			public int B { get; set; }

			public int GetOther(int s)
			{
				return A == s
					? B
					: A;
			}

			public override string ToString()
			{
				return string.Format("{0} -> {1} (W: {2})", this.A, this.B, this.Weight);
			}
		}

		public class WeightedGraph
		{
			private List<WeightedNode>[] adj;

			public WeightedGraph(int n)
			{
				adj = new List<WeightedNode>[n];

				for (int i = 0; i < n; i++)
					adj[i] = new List<WeightedNode>();
			}

			public void AddEdge(int x, int y, int w)
			{
				var node = new WeightedNode()
				{
					A = x,
					B = y,
					Weight = w
				};

				adj[x].Add(node);
			}

			public WeightedNode[] GetAdj(int v)
			{
				return adj[v].ToArray();
			}

			public int V()
			{
				return adj.Count();
			}
		}

		public class DFS
		{
			private Queue<int> q;
			private bool[] marked;
			public int[] distTo;

			public DFS(Graph g, int s)
			{
				q = new Queue<int>();
				marked = new bool[g.V()];
				distTo = new int[g.V()];

				q.Enqueue(s);
				marked[s] = true;
				distTo[s] = 0;

				while (q.Any())
				{
					var cur = q.Dequeue();
					var adj = g.GetAdj(cur);

					foreach (var v in adj)
					{
						if (!marked[v])
						{
							q.Enqueue(v);
							marked[v] = true;
							distTo[v] = distTo[cur] + 1;
						}
					}
				}
			}

			public int GetDistance(int v)
			{
				return marked[v] ? distTo[v] : -1;
			}
		}

		public class WeightedNodeComparor : IComparer<WeightedNode>
		{
			public int Compare(WeightedNode x, WeightedNode y)
			{
				var res = x.Weight.CompareTo(y.Weight);

				if (res != 0)
					return res;

				var r1 = x.A.CompareTo(y.A);
				var r2 = x.B.CompareTo(y.B);

				if (r1 == 0 && r2 == 0)
					return 0;

				return 1;
			}
		}

		public class PrimsMST
		{
			private bool[] marked;
			private List<WeightedNode> res;
			private SortedList<WeightedNode, WeightedNode> sl;

			public PrimsMST(WeightedGraph g, int s)
			{
				res = new List<WeightedNode>();
				marked = new bool[g.V()];
				sl = new SortedList<WeightedNode, WeightedNode>(new WeightedNodeComparor());

				marked[s] = true;
				Visit(g, s);

				while (sl.Any() && res.Count() < g.V() - 1)
				{
					var next = sl.First();
					sl.Remove(next.Key);

					var val = next.Value;

					if (marked[val.A] && marked[val.B])
						continue;

					res.Add(val);

					if (!marked[val.A])
					{
						marked[val.A] = true;
						Visit(g, val.A);
					}

					if (!marked[val.B])
					{
						marked[val.B] = true;
						Visit(g, val.B);
					}

				}

			}

			public void Visit(WeightedGraph g, int s)
			{
				foreach (var v in g.GetAdj(s))
				{
					if (!marked[v.GetOther(s)])
						sl.Add(v, v);
				}
			}

			public List<WeightedNode> GetMST()
			{
				return res;
			}

		}

		public class DoubleComaprer : IComparer<double>
		{
			public int Compare(double x, double y)
			{
				return x.CompareTo(y);
			}
		}

		public struct TempItem
		{
			public long Weight { get; set; }
			public int Vertex { get; set; }
		}

		public class TempItemComparer : IComparer<TempItem>
		{
			public int Compare(TempItem x, TempItem y)
			{
				var r = x.Weight.CompareTo(y.Weight);

				if (r != 0)
					return r;

				var r2 = x.Vertex.CompareTo(y.Vertex);
				return r2;
			}
		}

		public class DejkstraSP
		{
			public long?[] distTo;
			private int[] edgeTo;
			private SortedList<TempItem, int> pq;

			public DejkstraSP(WeightedGraph g, int s)
			{
				distTo = new long?[g.V()];
				edgeTo = new int[g.V()];
				pq = new SortedList<TempItem, int>(new TempItemComparer());

				distTo[s] = 0;

				pq.Add(new TempItem() { Vertex = s, Weight = 0 }, s);
				while (pq.Any())
				{
					var v = pq.First();
					pq.Remove(v.Key);

					foreach (var edge in g.GetAdj(v.Value))
					{
						relax(edge, v.Value);
					}
				}
			}

			private void relax(WeightedNode v, int cur)
			{
				int a = cur;
				int b = v.GetOther(cur);

				if (distTo[b] == null || distTo[b] > distTo[a] + v.Weight)
				{
					distTo[b] = distTo[a] + v.Weight;
					edgeTo[b] = a;

					if (pq.ContainsValue(b))
					{
						var val = pq.First(x => x.Value == b);
						pq.Remove(val.Key);
						pq.Add(new TempItem() { Vertex = b, Weight = distTo[b].Value }, b);

					}
					else
					{
						pq.Add(new TempItem() { Vertex = b, Weight = distTo[b].Value }, b);
					}
				}
			}
		}

		static void Main(string[] args)
		{
			using (var input = GetStandardInputStream())
			using (var output = GetStandardOutputStream())
			{
				long m = long.Parse(input.ReadLine());
				long n = -1;

				long l = 0, r = long.MaxValue;

				while (l < r)
				{
					long mid = (l + r)/2;

					if (GetCount(mid) < m)
					{
						l = mid + 1;
					}
					else
					{
						r = mid;
					}
				}

				if (GetCount(l) == m)
					n = l;

				output.WriteLine(n);
			}
		}

		private static long GetCount(long x)
		{
			long ans = 0;

			for (long i = 2; i*i*i <= x; i++)
			{
				ans += x/(i*i*i);
			}

			return ans;
		}

		private static double getDist(Tuple<int, int> c1, Tuple<int, int> c2)
		{
			return Math.Sqrt(Math.Pow(c1.Item1 - c2.Item1, 2.0) + Math.Pow(c1.Item2 - c2.Item2, 2.0));
		}

		private static Tuple<int, int> GetCoord(int number)
		{
			if (number == 0)
				return new Tuple<int, int>(1,3);

			var y = (number - 1) / 3;
			var x = number - (y*3) - 1;

			return new Tuple<int, int>(x,y);
		}

		private static long Factorial(int numb)
		{
			if (numb == 0)
				return 1;

			long res = 1;
			for (int i = numb; i > 1; i--)
				res *= i;
			return res;
		}

		private static double partialSum(double p, double q)
		{
			if (Math.Abs(p - 1) < double.Epsilon)
				return 1;

			double a = p,
				d = p,
				r = q;

			var res = (a/(1 - r)) + ((r*d)/((1 - r)*(1 - r)));
			return res;
		}

		public class Clusters
		{
			private bool[] marked;
			private Stack<int> st;
			public int count;

			private int[,] fromStr(string[] zombies)
			{
				var n = zombies.Length;
				var matrix = new int[n, n];
				int i = 0;

				foreach (var str in zombies)
				{
					var inStr = str;
					var ar = new List<int>();

					foreach (var c in inStr)
					{
						ar.Add(int.Parse(c.ToString()));
					}

					for (var j = 0; j < n; j++)
					{
						matrix[i, j] = ar[j];
					}
					i++;
				}

				return matrix;
			}
			public Clusters(string[] zmb_str)
			{
				var n = zmb_str.Count();
				var zombies = fromStr(zmb_str);
				st = new Stack<int>();
				marked = new bool[n];
				count = 0;

				for (int v = 0; v < n; v++)
				{
					if (!marked[v])
						dfs(ref zombies, v, n);
				}

				marked = new bool[n];
				foreach (var e in reverserPostOrder())
				{
					if (!marked[e])
					{
						dfs(ref zombies, e, n);
						count++;
					}
				}
			}

			private void dfs(ref int[,] g, int v, int n)
			{
				marked[v] = true;
				foreach (var e in getAdj(ref g, v, n))
				{
					if (!marked[e]) dfs(ref g, e, n);
				}
				st.Push(v);
			}

			private int[] getAdj(ref int[,] g, int v, int n)
			{
				var res = new List<int>();
				for (int i = 0; i < n; i++)
				{
					if (i == v)
						continue;

					if (g[v, i] == 1)
					{
						res.Add(i);
					}
				}

				return res.ToArray();
			}

			public int[] reverserPostOrder()
			{
				return st.ToArray();
			}
		}

		private static int binarySearch(ref long[] ar, int l, int h, long key)
		{
			if (l >= h)
				return -1;

			var mid = (l + h) / 2;

			if (ar[mid] == key)
				return mid;

			if (key > ar[mid])
				return binarySearch(ref ar, mid+1, h, key);

			return binarySearch(ref ar, 0, mid, key);
		}

		private static int[] ParseIntString(StreamReader input)
		{
			return input.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
		}

		private static int ParseInt(StreamReader input)
		{
			return int.Parse(input.ReadLine());
		}

		private static long primaryDiagSum(ref int[][] a, int n)
		{
			long sum = 0;
			for (var i = 0; i < n; i++)
				sum += a[i][i];

			return sum;
		}

		private static long secondaryDiagSum(ref int[][] a, int n)
		{
			long sum = 0;
			for (var i = 0; i < n; i++)
				sum += a[i][n - i - 1];

			return sum;
		}

		private static int GetIdx(int n, int lastAns, int x)
		{
			return (x ^ lastAns) % n;
		}

		private static int getHourGlassSum(ref int[][] ar, int x, int y)
		{
			var sum = 0;

			sum += ar[x][y];
			sum += ar[x][y + 1];
			sum += ar[x][y + 2];

			sum += ar[x + 1][y + 1];

			sum += ar[x + 2][y];
			sum += ar[x + 2][y + 1];
			sum += ar[x + 2][y + 2];

			return sum;
		}

		private static long sumFrom(int start, ref long[] sums, long totalSum)
		{
			if (start >= sums.Length)
				return 0;

			return totalSum - sums[start - 1];
		}

		public int ReadSingleInt(StreamReader input)
		{
			var line = input.ReadLine();
			return int.Parse(line);
		}

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

		public int[] ReadInts(char sep = ' ')
		{
			var line = Console.ReadLine();
			var arr = line.Split(sep).Select(x => int.Parse(x)).ToArray();

			return arr;
		}

	}
}


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

    class Program
    {
        static void Main(string[] args)
        {
            bool sdel=false;
            bool mozh;
            char[] alphaphit = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
                                   'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
            bool[] balphaphit = new bool[26];

            string st = Console.ReadLine();

                string stu;
                for (int i = 0; i < st.Length-25; i++)
                {
                    stu= st.Substring(i,26);

                    mozh = true;
                    for (int j = 0; j < balphaphit.Length; j++) balphaphit[j] = false;

                    for (int k=0;k< stu.Length;k++ )
                    {
                        for (int j = 0; j < alphaphit.Length; j++)
                        {
                            if ((stu[k] == alphaphit[j]) && (balphaphit[j])) { mozh = false; break; }
                            if ((stu[k] == alphaphit[j]) && (!balphaphit[j])) { balphaphit[j] = true; }
                        }
                        if (!mozh) break;
                        }
                    if (mozh)
                    {
                        char[] ch=stu.ToCharArray();
                        int j = 0;
                        int k = 0;
                        while (true)
                        {
                            if ((ch[j] == '?') && (!balphaphit[k])) { ch[j] = alphaphit[k]; j++; k++; };
                            if ((k == balphaphit.Length) || (j == ch.Length)) break;
                            if (ch[j] != '?') j++;
                            if (balphaphit[k]) k++;

                            if ((k == balphaphit.Length) || (j == ch.Length)) break;
                        }
                        string stu_new = new string(ch);
                        st = st.Replace(stu, stu_new);
                        st = st.Replace('?','A');
                        Console.WriteLine(st);
                        sdel = true; break;
                    }

                }
                if (!sdel) Console.WriteLine(-1);
                Console.ReadLine();

        }
    }


using System;
using System.Linq;
namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            var rez = Enumerable.Range(0, n - 1).Select(x => a[x] - a[x + 1]).Distinct().ToArray();

            Console.WriteLine(rez.Count()==1?a[a.Length-1]-(a[0]-a[1]):a[a.Length-1]);
        }
    }
}


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

namespace Codeforces.NET
{
    class Program
    {
        static bool IsPalindrome(string s)
        {
            string invers = string.Empty;
            for (int i = s.Length-1; i>=0; i--)
            {
                invers += s[i];
            }

            return invers == s;
        }
        static void Main(string[] args)
        {
            string line = Console.ReadLine();
            if (IsPalindrome(line))
            {
                Console.WriteLine("YES");
                Console.ReadLine();
                return;
            }

            string newString = string.Empty;
            int index = line.Length - 1;
            while (index >=0 && line[index] == '0')
            {
                newString += "0";
                index--;
            }

            newString += line;
            if (IsPalindrome(newString))
            {
                Console.WriteLine("YES");
                Console.ReadLine();
                return;
            }

            Console.WriteLine("NO");
            Console.ReadLine();
        }
    }
}