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

class P
{
    static void Main()
    {
        int[] ABC = Console.ReadLine().Split().Select(int.Parse).ToArray();
        if (ABC.Count(x => x == 2) >= 2 || ABC.Contains(1) || ABC.Count(x => x == 3) == 3 || (ABC.Contains(2) && ABC.Count(x => x == 4) == 2))
        {
            Console.WriteLine("YES");
        }
        else
        {
            Console.WriteLine("NO");
        }
        /*int n = 30;
        for (int i = 1; i < n; i++)
        {
            for (int j = 1; j < n; j++)
            {
                for (int k = 1; k < n; k++)
                {
                    A(new int[] { i, j, k });
                }
            }
        }*/
    }
    static void A(int[] ABC)
    {
        bool res = false;
        for (int i = 0; i < ABC[0]; i++)
        {
            for (int j = 0; j < ABC[1]; j++)
            {
                for (int k = 0; k < ABC[2]; k++)
                {
                    bool pokapoka = true;
                    for (int l = 0; l < 10; l++)
                    {
                        if (!(l % ABC[0] == i || l % ABC[1] == j || l % ABC[2] == k))
                        {
                            pokapoka = false;
                        }
                    }
                    if (pokapoka)
                    {
                        res = true;
                        goto end;
                    }
                }
            }
        }
        end:;
        if (res != (ABC.Count(x => x == 2) >= 2 || ABC.Contains(1) || ABC.Count(x => x == 3) == 3 || (ABC.Contains(2) && ABC.Count(x => x == 4) == 2)))
        {
            Console.WriteLine($"{ABC[0]} {ABC[1]} {ABC[2]}");
        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {

 static long Pow2(long m)
        {
            long temp = 0;
            while (System.Math.Pow(2, temp) <= m)
            {
               temp++;
            }
            return (long) System.Math.Pow(2,temp-1) ;
        }
 static void Main()
 {
     long n, b, p;
     string test = Console.ReadLine();
     string[] splitString = test.Split(' ');
     long[] ints = new long[3];
     for (int i = 0; i < 3; i++)
     {
         long x;
         long.TryParse(splitString[i], out x);
         ints[i] = x;
     }

     n = ints[0];
     b = ints[1];
     p = ints[2];

     p = p * n;
     long but = 0;
     long temp;
     while (n > 1)
     {
         temp = Program.Pow2(n);
         but = but + temp * b + temp / 2;
         n = n - temp/2;
     }
     Console.WriteLine(but + " " + p);

 }
    }
}


using System;

namespace In_Search_of_an_Easy_Problem
{
    class Program
    {
        static void Main(string[] args)
        {
            string NumeroDePersonas = Console.ReadLine();
            string[] Testimonio = Console.ReadLine().Split(' ');
            string Dificultad = "EASY";
            for(int i =0; i < Testimonio.Length; i++)
            {
                if (Testimonio[i] == "1")
                {
                    Dificultad = "HARD";
                    goto Terminar;
                }
            }
            Terminar:
            Console.WriteLine(Dificultad);
        }
    }
}


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

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

        var a = new int[n];
        var b = new int[n];

        for (int i = a.Length, j = 0; j<a.Length; j++, i--)
        {
            a[j] = i;
            b[j] = j + 1;
        }

        s(a);

        var f = false;

        for (int i = 0; i < a.Length; i++)
        {
            if (a[i] != b[i])
            {
                f = true;
                break;
            }
        }

        if (f)
        {
            for (int i = n; i >= 1; i--)
            {
                Console.Write(i+" ");
            }
        }
        else
        {
            Console.WriteLine(-1);
        }
    }

    public static void s(int[] arr)
    {
        for (int i = 0; i < arr.Length-1; i++)
        {
            for (int j = i; j < arr.Length-1; j++)
            {
                if (arr[j] > arr[j + 1])
                {
                    var tmp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = tmp;
                }
            }
        }
    }
}


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

namespace Task
{
    class MyIo
    {
        char[] separators = new char[] { ' ', '\t' };

#if TEST
        TextReader inputStream = new StreamReader("..\\..\\input.txt");
#else
        TextReader inputStream = System.Console.In;
#endif
        TextWriter outputStream = Console.Out;

        string[] tokens;
        int pointer;

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

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

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

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

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

        public void PrintLine(string format, params object[] args)
        {
            outputStream.WriteLine(format, args);
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

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

    class Program
    {
        MyIo io = new MyIo();

        void Solve()
        {
            // Place your code here

            int a = io.NextInt();
            int b = io.NextInt();
            int mod = io.NextInt();

            if (b >= mod)
            {
                io.Print(2);
                return;
            }

            BitArray bits = new BitArray(mod);
            int result = -1;
            for (int A = 1; A <= a; A++)
            {
                long mlp = A * 1000000000L;
                long temp = mlp % mod;
                if (temp != 0)
                {
                    if (mod - temp > b)
                    {
                        result = A;
                        break;
                    }
                }
                if (bits[(int)temp])
                    break;
                bits[(int)temp] = true;
            }

            if (result == -1)
                io.Print(2);
            else
            {
                string s = result.ToString();
                while (s.Length < 9)
                    s = "0" + s;
                io.Print(1 + " " + s);
            }
        }

        static void Main(string[] args)
        {
            var p = new Program();

            p.Solve();
            p.io.Close();
        }
    }
}


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

namespace A796
{
    class A796
    {
        static void Main(string[] args)
        {
            string[] str1 = Console.ReadLine().Split();
            int n = int.Parse(str1[0]);
            int m = int.Parse(str1[1]);
            int k = int.Parse(str1[2]);
            int[] a = new int[n];
            string[] str = Console.ReadLine().Split();
            int index = 0;
            int min = Int32.MaxValue;
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(str[i]);
            }
            for (int i = 0; i < n; i++)
            {
                if (a[i] <=k && a[i] != 0)
                {
                    index = i+1;

                    if (Math.Abs(index - m) < min)
                    {
                        min = Math.Abs(index - m);

                    }
                }
            }
            Console.WriteLine(10 * min);

        }
    }
}


/*
csc -debug F.cs && mono --debug F.exe <<< "5
abaca"
*/

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

public class HelloWorld {

    static int n;
    static int m;
    static int[] str;
    static int[,,] memo;
    static int[,] memoSol;

    public static void SolveCodeForces() {
        Console.ReadLine();
        str = Console.ReadLine().Select(c => c - 'a').ToArray();
        n = str.Length;
        m = str.Max()+1;

        memo = new int[n, n, m];
        for (var i = 0; i < n; i++)
            for (var j = 0; j < n; j++)
                for (var k = 0; k < m; k++)
                    memo[i,j,k] = -1;

        memoSol = new int[n, n];
        for (var i = 0; i < n; i++)
            for (var j = 0; j < n; j++)
                memoSol[i,j] = -1;

        System.Console.WriteLine(Solve(0, n-1));
    }

    static int Solve(int i, int j) {
        if (i > j) return 0;
        if (i == j) return 1;
        if (memoSol[i, j] >= 0) return memoSol[i, j];

        var ans = 10000;
        for (var sym = 0; sym < m; sym++)
            ans = Math.Min(ans, SolveFun(i, j, sym));
        ans++;
        memoSol[i, j] = ans;
        return ans;
    }

    static int SolveFun(int i, int j, int sym) {
        if (i > j) return 0;
        if (i == j) return str[i] == sym ? 0 : 10000;
        if (memo[i,j,sym] >= 0) return memo[i,j,sym];

        var ans = 10000;

        for (var k = i; k <= j; k++) {
            if (str[k] == sym) {

                var fl = SolveFun(i, k-1, sym);
                var sl = Solve(i, k-1);

                var fr = SolveFun(k+1, j, sym);
                var sr = Solve(k+1, j);

                var sol =
                    Math.Min(fl + fr,
                    Math.Min(sl + sr,
                    Math.Min(fl + sr,
                             sl + fr)));

                ans = Math.Min(ans, sol);
            }
        }

// System.Console.WriteLine(new { i, j, sym, ans });

        memo[i, j, sym] = ans;
        return ans;
    }

    static Scanner cin = new Scanner();
    static StringBuilder cout = new StringBuilder();

    static public void Main () {
        SolveCodeForces();
        // System.Console.Write(cout.ToString());
    }
}

public static class Helpers {
    public static T[] CreateArray<T>(int length, Func<int, T> itemCreate) {
        var result = new T[length];
        for (var i = 0; i < result.Length; i++)
            result[i] = itemCreate(i);
        return result;
    }

    public static IEnumerable<int> IndicesWhere<T>(this IEnumerable<T> seq, Func<T, bool> cond) {
        var i = 0;
        foreach (var item in seq) {
            if (cond(item)) yield return i;
            i++;
        }
    }
}

public class Scanner
{
    private string[] line = new string[0];
    private int index = 0;

    public string Next() {
        if (line.Length <= index) {
            line = Console.ReadLine().Split(' ');
            index = 0;
        }
        var res = line[index];
        index++;
        return res;
    }

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

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

    public ulong NextUlong() {
        return ulong.Parse(Next());
    }

    public string[] Array() {
        line = Console.ReadLine().Split(' ');
        index = line.Length;
        return line;
    }

    public int[] IntArray(int emptyPrefixLen = 0) {
        var array = Array();
        var result = new int[emptyPrefixLen + array.Length];
        for (int i = 0; i < array.Length; i++)
            result[emptyPrefixLen + i] = int.Parse(array[i]);
        return result;
    }

    public long[] LongArray() {
        var array = Array();
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = long.Parse(array[i]);
        return result;
    }

    public ulong[] UlongArray() {
        var array = Array();
        var result = new ulong[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = ulong.Parse(array[i]);
        return result;
    }
}


using System;

namespace FirstProject
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string[] i1 = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(i1[0]);
            int m = Convert.ToInt32(i1[1]);
            int r = Convert.ToInt32(i1[2]);
            int[] s = new int[n];
            string[] i2 = Console.ReadLine().Split(' ');
            int mx = 0, mn = (int)1e9;
            for(int i=0;i<n;i++)
            {
                s[i] = Convert.ToInt32(i2[i]);
                mn = Math.Min(mn, s[i]);
            }
            int[] b = new int[m];
            string[] i3 = Console.ReadLine().Split(' ');
            for (int i = 0; i < m; i++)
            {
                b[i] = Convert.ToInt32(i3[i]);
                mx = Math.Max(mx, b[i]);
            }
            int ans = (r / mn) * mx + r % mn;
            ans = Math.Max(ans, r);
            Console.Write(ans);
        }
    }
}


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

namespace A1
{
    class Program
    {
        static bool IsVowel(char l)
        {
            if (l == 'E' || l == 'Y' || l == 'U' || l == 'I' || l == 'O' || l == 'A') return true;
            return false;
        }
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            int max = 0; int len = 0;
            for (int i = 0; i <= str.Length; i++)
            {
                len++;
                if (len > max) max = len;
                if (i == str.Length) break;
                if (IsVowel(str[i])) len = 0;
            }
            Console.WriteLine(max);
        }
    }
}


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

namespace Codeforces
{
    public class Input
    {
        private static string _line;

        public static bool Next()
        {
            _line = Console.ReadLine();
            return !string.IsNullOrEmpty(_line);
        }

        public static bool Next(out long a)
        {
            var ok = Next();
            a = ok ? long.Parse(_line) : 0;
            return ok;
        }

        public static bool Next(out long a, out long b)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(long.Parse).ToArray();
                a = array[0];
                b = array[1];
            }
            else
            {
                a = b = 0;
            }

            return ok;
        }

        public static bool Next(out long a, out long b, out long c)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(long.Parse).ToArray();
                a = array[0];
                b = array[1];
                c = array[2];
            }
            else
            {
                a = b = c = 0;
            }
            return ok;
        }

        public static bool Next(out long a, out long b, out long c, out long d)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(long.Parse).ToArray();
                a = array[0];
                b = array[1];
                c = array[2];
                d = array[3];
            }
            else
            {
                a = b = c = d = 0;
            }
            return ok;
        }

        public static bool Next(out long a, out long b, out long c, out long d, out long e)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(long.Parse).ToArray();
                a = array[0];
                b = array[1];
                c = array[2];
                d = array[3];
                e = array[4];
            }
            else
            {
                a = b = c = d = e = 0;
            }
            return ok;
        }

        public static List<long> Numbers()
        {
            return !Next() ? new List<long>() : _line.Split(' ').Select(long.Parse).ToList();
        }

        public static bool Next(out string value)
        {
            value = string.Empty;
            if (!Next()) return false;
            value = _line;
            return true;
        }
    }

    public class DisjointSet
    {
        private readonly int[] _parent;
        private readonly int[] _rank;
        public int Count { get; private set; }

        public DisjointSet(int count, int initialize = 0)
        {
            Count = count;
            _parent = new int[Count];
            _rank = new int[Count];
            for (var i = 0; i < initialize; i++) _parent[i] = i;
        }

        private DisjointSet(int count, int[] parent, int[] rank)
        {
            Count = count;
            _parent = parent;
            _rank = rank;
        }

        public void Add(int v)
        {
            _parent[v] = v;
            _rank[v] = 0;
        }

        public int Find_Recursive(int v)
        {
            if (_parent[v] == v) return v;
            return _parent[v] = Find(_parent[v]);
        }

        public int Find(int v)
        {
            if (_parent[v] == v) return v;
            var last = v;
            while (_parent[last] != last) last = _parent[last];
            while (_parent[v] != v)
            {
                var t = _parent[v];
                _parent[v] = last;
                v = t;
            }
            return last;
        }

        public int this[int v]
        {
            get { return Find(v); }
            set { Union(v, value); }
        }

        public void Union(int a, int b)
        {
            a = Find(a);
            b = Find(b);
            if (a == b) return;
            if (_rank[a] < _rank[b])
            {
                var t = _rank[a];
                _rank[a] = _rank[b];
                _rank[b] = t;
            }
            _parent[b] = a;
            if (_rank[a] == _rank[b]) _rank[a]++;
        }

        public int GetSetCount()
        {
            var result = 0;
            for (var i = 0; i < Count; i++)
            {
                if (_parent[i] == i) result++;
            }
            return result;
        }

        public DisjointSet Clone()
        {
            var rank = new int[Count];
            _rank.CopyTo(rank, 0);
            var parent = new int[Count];
            _parent.CopyTo(parent, 0);
            return new DisjointSet(Count, parent, rank);
        }

        public override string ToString()
        {
            return string.Join(",", _parent.Take(50));
        }
    }

    public class Matrix
    {
        public static Matrix Create(int i, int j)
        {
            var m = new Matrix(i, j);
            return m;
        }

        public static Matrix Create(int i)
        {
            var m = new Matrix(i, i);
            return m;
        }

        public long Modulo { get; set; }

        private readonly int _width;
        private readonly int _height;
        private readonly long[,] _data;
        public int Width{get { return _width; }}
        public int Height{get { return _height; }}

        private Matrix(int i, int j)
        {
            Modulo = 1000000000000000000L;
            _width = j;
            _height = i;
            _data = new long[_height, _width];
        }

        public static Matrix operator *(Matrix m1, Matrix m2)
        {
            if (m1.Width != m2.Height) throw new InvalidDataException("m1.Width != m2.Height");
            var m = Create(m2.Width, m1.Height);
            m.Modulo = m1.Modulo;
            for (var i=0;i<m2.Width;i++)
                for (var j = 0; j < m1.Height; j++)
                {
                    for (var k = 0; k < m1.Width; k++)
                        m[j, i] += (m1[j, k]*m2[k, i]) % m1.Modulo;
                    m[j, i] %= m1.Modulo;
                }
            return m;
        }

        public static Matrix operator +(Matrix m1, Matrix m2)
        {
            var m = m1.Clone();
            for (var i=0;i<m2.Width;i++)
                for (var j = 0; j < m1.Height; j++)
                    m[j, i] = (m[j, i] + m2[j, i]) % m1.Modulo;
            return m;
        }

        public static Matrix operator -(Matrix m1, Matrix m2)
        {
            var m = m1.Clone();
            for (var i=0;i<m2.Width;i++)
                for (var j = 0; j < m1.Height; j++)
                    m[j, i] = (m[j, i] - m2[j, i]) % m1.Modulo;
            return m;
        }

        public static Matrix operator *(Matrix m1, long l)
        {
            var m = m1.Clone();
            for (var i=0;i<m1.Width;i++)
                for (var j=0;j<m1.Height;j++)
                        m[j, i] = (m[j, i] * l) % m.Modulo;
            return m;
        }

        public static Matrix operator *(long l, Matrix m1)
        {
            return m1*l;
        }

        public static Matrix operator +(Matrix m1, long l)
        {
            var m = m1.Clone();
            for (var i = 0; i < m1.Width; i++)
                    m[i, i] = (m[i, i] + l) % m.Modulo;
            return m;
        }

        public static Matrix operator +(long l, Matrix m1)
        {
            return m1 + l;
        }

        public static Matrix operator -(Matrix m1, long l)
        {
            return m1 + (-l);
        }

        public static Matrix operator -(long l, Matrix m1)
        {
            var m = m1.Clone() * -1;
            return m + l;
        }

        public Matrix BinPower(long l)
        {
            var n = 1;
            var m = Clone();
            var result = new Matrix(m.Height, m.Width) + 1;
            result.Modulo = m.Modulo;
            while (l != 0)
            {
                var i = l & ~(l - 1);
                l -= i;
                while (n < i)
                {
                    m = m*m;
                    n <<= 1;
                }
                result *= m;
            }
            return result;
        }

        public void Fill(long l)
        {
            l %= Modulo;
            for (var i = 0; i < _height; i++)
                for (var j = 0; j < _width; j++)
                    _data[i, j] = l;
        }

        public Matrix Clone()
        {
            var m = new Matrix(_width, _height);
            Array.Copy(_data, m._data, _data.Length);
            m.Modulo = Modulo;
            return m;
        }

        public long this[int i, int j]
        {
            get { return _data[i, j]; }
            set { _data[i, j] = value % Modulo; }
        }
    }
}

namespace Codeforces.TaskE
{
    public class Task
    {
        public static void Main()
        {
            var task = new Task();
            try
            {
                task.Solve();
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(ex);
                throw;
            }
        }

        bool Check(long b, long a)
        {
            if (a == 0) return false;
            if (!Check(a, b%a)) return true;
            return (b/a)%(a + 1)%2 == 0;
            var c = b/a - 1;
            if (a%2 == 1) return c%2 == 1;
            return c%(a+1)==1;
        }

        void Solve()
        {
            long t;
            Input.Next(out t);

            for (var i = 0; i < t; i++)
            {
                long a, b;
                Input.Next(out a, out b);
                if (a < b)
                {
                    var c = b;
                    b = a;
                    a = c;
                }
                Console.WriteLine(Check(a,b) ? "First" : "Second");
            }
        }
    }
}


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

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			int x2 = int.Parse(Console.ReadLine());
			int px2 = maxPrimeDivs(x2);
			int min = x2;
			int start2 = ((x2 / px2) - 1) * px2 + 1;

			for (int x1 = start2; x1 <= x2; x1++)
			{
				int px1 = maxPrimeDivs(x1);
				int start1 = ((x1 / px1) - 1) * px1 + 1;
				if (start1 > 2 && start1 < min)
				{
					min = start1;
				}
			}
			Console.WriteLine(min);
			Console.ReadLine();
		}

		private static int maxPrimeDivs(int n)
		{
			int d = 2;
			int result = 0;

			while (d * d <= n)
			{
				if (n % d == 0)
				{
					n /= d;
					if (result < d)
						result = d;
				}
				else d++;
			}
			return Math.Max(result, n);
		}

	}
}


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

namespace Codeforces
{
    class Program : ProgramBase
    {
        private const long commonMod = 1000000007;

        static void Main(string[] args)
        {
            var p = new Program();
            var x = p.Solve();
            p.Out(x);
        }

        object Solve()
        {
            checked
            {
                var n = ReadLong();
                if (n == 2)
                    return 1;
                if (n == 3)
                    return 2;
                var now = 3L;
                var prev = 2L;
                var result = 2;
                while(now + prev <= n)
                {
                    result++;
                    var nexnow = now + prev;
                    prev = now;
                    now = nexnow;
                }
                return result;
            }
        }

        class Node
        {
            public long Parent;
            public List<long> Children;
            public int Index;
        }
        //int BS(long[][] cuts, int left, int right)
        //{
        //    if (right - left == 1)
        //        return left;
        //    var half = (left + right) / 2;

        //}

        //void Check(long[][] cuts, long value)
        //{

        //}

        struct Segment
        {
            public Segment(long left, long rigth)
            {
                Left = left;
                Right = rigth;
            }

            public long Left;
            public long Right;
            public long Size() { return Right - Left; }
            public long Ships(long size) { return Size() / size; }
            public List<long> GetPositions(long shipSize) {
                var result = new List<long>();
                for (var i = Left + shipSize - 1; i < Right; i+=shipSize)
                {
                    result.Add(i);
                }
                return result;
            }
        }

        struct Second
        {
            public Second(long count, long mana)
            {
                Mana = mana;
                Count = count;
            }

            public long Mana;
            public long Count;
        }
    }

    abstract class ProgramBase
    {
        bool? prod = null;
        StreamReader f;
        Queue<string> tokens;
        protected string FileName { private get; set; }

        protected string Read()
        {
            if (f == null)
                f = string.IsNullOrEmpty(FileName)
                    ? new StreamReader(Console.OpenStandardInput())
                    : new StreamReader((GetProd() ? "" : "c:\\dev\\") + FileName);
            return f.ReadLine();
        }

        protected string ReadToken()
        {
            if (tokens == null || tokens.Count == 0)
                tokens = new Queue<string>(Read().Split(' '));
            return tokens.Dequeue();
        }

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

        protected long[] ReadLongs()
        {
            var s = Read();
            if (s == "")
                return new long[0];
            var tokens = s.Split(' ');
            var result = new long[tokens.Length];
            for (int i = 0; i < tokens.Length; i++)
                result[i] = long.Parse(tokens[i]);
            return result;
        }

        public void Out(object r)
        {
            if (string.IsNullOrEmpty(FileName))
                Console.WriteLine(r);
            else if (GetProd())
                File.WriteAllText(FileName, r.ToString());
            else
                Console.WriteLine(r);
        }

        private bool GetProd()
        {

            if (!prod.HasValue)
                try
                {
                    prod = Environment.MachineName != "RENADEEN-W7";
                }
                catch (Exception)
                {
                    prod = true;
                }
            return prod.Value;
        }
    }

    public static class Huj
    {
        public static T MinBy<T>(this IEnumerable<T> source, Func<T, double> func) where T : class
        {
            T result = null;
            var min = double.MaxValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (min > current)
                {
                    min = current;
                    result = item;
                }
            }
            return result;
        }

        public static T MaxBy<T>(this IEnumerable<T> source, Func<T, double> func, T defaultValue = default(T))
        {
            T result = defaultValue;
            var max = double.MinValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (max < current)
                {
                    max = current;
                    result = item;
                }
            }
            return result;
        }

        public static string JoinStrings(this IEnumerable<string> s, string d) { return string.Join(d, s.ToArray()); }

        public static string JoinStrings(this IEnumerable<int> s, string d) { return s.Select(x => x.ToString()).JoinStrings(d); }
        public static string JoinStrings(this IEnumerable<long> s, string d) { return s.Select(x => x.ToString()).JoinStrings(d); }
    }
}


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

namespace YouAreCalledByTamsir
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            int m;
            int z;
            string input;
            int output = 0;

            input = Console.ReadLine();

            n = Convert.ToInt32(input.Split(' ')[0]);
            m = Convert.ToInt32(input.Split(' ')[1]);
            z = Convert.ToInt32(input.Split(' ')[2]);

            for(int i = n; i <= z; i += n)
            {
                if (i % m == 0)
                    output++;
            }

            Console.WriteLine(output);
        }
    }
}


using System;

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            string [] input = Console.ReadLine().Split(new char[]{' '}, StringSplitOptions.None);

            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);
            int c = int.Parse(input[2]);
            int d = int.Parse(input[3]);

            int Misha = Math.Max(3*a/10, a - a/250 *c);
            int Vasya = Math.Max(3*b/10, b - b/250 *d);

            if (Misha == Vasya){
                Console.WriteLine("Tie");
            }else if(Misha > Vasya){
                Console.WriteLine("Misha");
            }else{
                Console.WriteLine("Vasya");
            }
        }
    }
}


using System;
using System.Linq;
using CompLib.Collections;
using CompLib.Util;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        var n = sc.Next().Reverse().ToArray();
        if (n.Length == 1)
        {
            Console.WriteLine("-1");
            return;
        }

        // 先頭0以外
        // 下2桁 00 25 50 75

        int ans = int.MaxValue;

        // 先頭
        for (int i = 0; i < n.Length; i++)
        {
            if (n[i] == '0') continue;
            // 2桁目
            for (int j = 0; j < n.Length; j++)
            {
                if (n.Length > 2 && i == j) continue;
                for (int k = 0; k < n.Length; k++)
                {
                    if (i == k || j == k) continue;

                    bool zero = n[j] == '0' && n[k] == '0';
                    bool twentyfive = n[j] == '2' && n[k] == '5';
                    bool fifty = n[j] == '5' && n[k] == '0';
                    bool seventyfive = n[j] == '7' && n[k] == '5';
                    if (!zero && !twentyfive && !fifty && !seventyfive) continue;
                    var array = new int[n.Length];
                    for (int l = 0; l < n.Length; l++)
                    {
                        if (l == i) array[l] = 0;
                        else if (l == j) array[l] = 2;
                        else if (l == k) array[l] = 3;
                        else array[l] = 1;
                    }
                    int tmp = 0;
                    var bit = new FenwickTree(4);
                    for (int l = 0; l < n.Length; l++)
                    {
                        tmp += bit.Sum(array[l]);
                        bit.Add(array[l], 1);
                    }
                    ans = Math.Min(ans, tmp);
                }
            }
        }
        if (ans == int.MaxValue) Console.WriteLine("-1");
        else Console.WriteLine(ans);
    }

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

namespace CompLib.Collections
{
    using Num = System.Int32;

    public class FenwickTree
    {
        private readonly Num[] _array;
        public readonly int Count;

        public FenwickTree(int size)
        {
            _array = new Num[size + 1];
            Count = size;
        }

        /// <summary>
        /// A[i]にnを加算
        /// </summary>
        /// <param name="i"></param>
        /// <param name="n"></param>
        public void Add(int i, Num n)
        {
            i++;
            for (; i <= Count; i += i & -i)
            {
                _array[i] += n;
            }
        }

        /// <summary>
        /// [0,r)の和を求める
        /// </summary>
        /// <param name="r"></param>
        /// <returns></returns>
        public Num Sum(int r)
        {
            Num result = 0;
            for (; r > 0; r -= r & -r)
            {
                result += _array[r];
            }

            return result;
        }

        // [l,r)の和を求める
        public Num Sum(int l, int r) => Sum(r) - Sum(l);
    }
}

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

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

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

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

            return _line[_index++];
        }

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

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

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


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

namespace ConsoleApplication252
{
    class Program
    {
        static void Main()
        {
            string s = Console.ReadLine();
            int[] m = new int[s.Length];
            for (int i = 0; i < s.Length; i++)
            {
                m[i] = int.Parse(Convert.ToString(s[i]));
            }
            int max = -1;
            for (int i = 0; i < m.Length; i++)
            {
                if (m[i] > max)
                {
                    max = m[i];
                }
            }
            Console.WriteLine(max);
            for (int i = 1; i <= max; i++)
            {
                string q = "";
                for (int e = 0; e < m.Length; e++)
                {
                    if (m[e] != 0)
                    {
                        m[e] -= 1;
                        q += 1;
                    }
                    else
                    {
                        q += 0;
                    }
                }
                Console.Write(int.Parse(q)+" ");
            }
        }
    }
}


using System;

namespace ConsoleApp
{
    class Program
    {
        static void Main()
        {
            long x = long.Parse(Console.ReadLine());

            if (x % 2 == 0)
                Console.WriteLine(2);
            else
                Console.WriteLine(1);

        }
    }
}


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

public class Program
{
	public static void Main(string[] args)
	{
		string num = Console.ReadLine();
		string[] numArray = num.Split(null);

		long s = long.Parse(numArray[0]);
		long x = long.Parse(numArray[1]);

		string sum = Convert.ToString(s, 2);
		string xor = Convert.ToString(x, 2);

		int sumdiff = 0, xordiff = 0;
		if (sum.Length > xor.Length)
		{
			sumdiff = sum.Length - xor.Length;
		}
		{
			xordiff = xor.Length - sum.Length;
		}

		if (sumdiff > 0)
		{
			for (int i = 0; i < sumdiff; i++)
				xor = "0" + xor;
		}
		else
		{
			for (int i = 0; i < xordiff; i++)
				sum = "0" + sum;
		}

		sum = "1" + sum;
		xor = "1" + xor;

		char[] sumChar = sum.ToCharArray();
		char[] xorChar = xor.ToCharArray();

		int carry = 0;

		int[] possibilities = new int[xor.Length];

		for (int i = xor.Length - 1; i >= 0; i--)
		{
			if (xor[i] == '1')
			{
				if (sum[i] == '1')
				{
					possibilities[i] = 2;

					if (carry == 1)
					{
						Console.Write("0");
						return;
					}

					if (carry == -1)
					{
						possibilities[i + 1] = possibilities[i + 1] - 1;
					}

					carry = 0;
				}
				else
				{
					possibilities[i] = 2;

					if (carry == 0)
					{
						Console.Write("0");
						return;
					}

					if (carry == -1)
					{
						possibilities[i + 1] = possibilities[i + 1] - 1;
					}

					carry = 1;
				}
			}
			else
			{
				if (sum[i] == '1')
				{
					possibilities[i] = 2;

					if (carry == -1)
					{
						possibilities[i + 1] = possibilities[i + 1] - 1;
					}

					if (carry == 0)
					{
						Console.Write("0");
						return;
					}

					carry = -1;
				}
				else
				{
					possibilities[i] = 2;

					if (carry == 1)
					{
						Console.Write("0");
						return;
					}

					if (carry == -1)
					{
						possibilities[i + 1] = possibilities[i + 1] - 1;
					}

					carry = -1;
				}
			}
		}

		long answer = 1;
		for (int i = 1; i < possibilities.Length; i++)
		{
			answer = answer * possibilities[i];
		}

		if(s==x)
		{
			answer = answer - 2;
		}

			Console.Write(answer);
		}

}


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

namespace ConsoleApp1
{
    class Program
    {
        class StudentTime
        {
            public int Time;
            public int Index;
            public int SumTime;
            public int MinSkip = 0;

            public StudentTime(int time, int index, int sumTime)
            {
                Time = time;
                Index = index;
                SumTime = sumTime;
            }
        }
        static void Main(string[] args)
        {

            var nm = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var n = nm[0];
            var m = nm[1];
            var times = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            var studentTimes = new List<StudentTime>();
            var currSum = 0;
            for(var i=0; i<n; i++)
            {
                currSum += times[i];
                studentTimes.Add(new StudentTime(times[i], i, currSum));
            }
            var descStudentTimes = studentTimes.OrderByDescending(x => x.Time).ToList();

            for(var i=0; i< studentTimes.Count; i++)
            {
                var toSkip = 0;
                for(var j=0; j< descStudentTimes.Count(); j++)
                {
                    if (studentTimes[i].SumTime <= m)
                        break;
                    if(descStudentTimes[j].Index < i)
                    {
                        studentTimes[i].SumTime -= descStudentTimes[j].Time;
                        toSkip++;
                    }
                }
                studentTimes[i].MinSkip = toSkip;
                Console.Write(studentTimes[i].MinSkip + " ");
            }
            Console.WriteLine();
        }

    }
}


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

namespace Trenya260619
{
    class Input
    {
        private static IEnumerator<string> _getinput()
        {
            while (true)
                foreach (string s in Console.ReadLine().Split().Where(x => x.Length > 0))
                    yield return s;
        }

        private IEnumerator<string> input = _getinput();

        public string GetString()
        {
            input.MoveNext();
            return input.Current;
        }

        public int GetInt() { return int.Parse(GetString()); }
        public long GetLong() { return long.Parse(GetString()); }
        public double GetDouble() { return double.Parse(GetString()); }
    }

    class Program
    {
        static Input csin = new Input();

        static void Main(string[] args)
        {
            int n = csin.GetInt();
            long k = csin.GetLong();
            List<int> s = csin.GetString().Select(x => (int)(x - 'a')).ToList();
            s.Add(26);

            long[,] d = new long[n + 1, n + 1]; // i - length, j - first index

            d[0, n] = 1;

            bool[] ex = new bool[27];

            for (int len = 1; len <= n; len++)
                for (int start = 0; start < n; start++)
                {
                    for (int i = 0; i < 27; i++) ex[i] = false;

                    for (int j = start + 1; j <= n; j++)
                    {
                        if (ex[s[j]]) continue;
                        ex[s[j]] = true;
                        d[len, start] += d[len - 1, j];
                    }
                }

            long[] lenans = new long[n + 1];
            for (int i = 0; i <= n; i++)
            {
                for (int j = 0; j < 27; j++) ex[j] = false;

                for (int j = 0; j <= n; j++)
                {
                    if (ex[s[j]]) continue;

                    lenans[i] += d[i, j];
                    ex[s[j]] = true;
                }
            }

            long ans = 0;

            for (int i = n; i >= 0 && k > 0; i--)
            {
                long curr = Math.Min(k, lenans[i]);
                k -= curr;
                ans += curr * (n - i);
            }

            if (k > 0) ans = -1;

            Console.WriteLine(ans);
            //Console.ReadKey();
        }

    }
}


/*
 * Created by SharpDevelop.
 * User: tagirov2
 * Date: 20.02.2016
 * Time: 09:56
 *

 */

using System;

class Program
{
	public static void Main(string[] args)
	{
		Int64 n = Int64.Parse (Console.ReadLine ());

		Console.WriteLine (n*(n+1)*3+1);
//		Console.ReadKey(true);
	}
}


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

namespace _282_B
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();

            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);

            if ((a-b) == 0)
            {
                Console.WriteLine("infinity");
            }
            else if ((a - b) < 0)
            {
                Console.WriteLine(0);
            }
            else
            {
                int counter = 0;
                for (int i = 1; i * i <= (a - b); i++)
                {
                    if ((a - b) % i == 0)
                    {
                        int another = (a - b) / i;
                        if (a % i == b)
                            counter++;
                       if (a % another == b && another != i)
                            counter++;

                    }
                }
                Console.WriteLine(+counter);
            }
        }
    }
}


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

namespace codeforces
{
    class Program
    {
        //16:23
        //reading
        static string ReadLine()
        {
            return Console.ReadLine();
        }
        static string[] ReadArray()
        {
            return ReadLine().Split(' ');
        }
        static List<string> ReadList()
        {
            return ReadArray().ToList();
        }
        static List<int> ReadIntList()
        {
            return ReadArray().Select(c => Convert.ToInt32(c)).ToList();
        }
        static List<long> ReadLongList()
        {
            return ReadArray().Select(c => Convert.ToInt64(c)).ToList();
        }
        static List<ulong> ReadULongList()
        {
            return ReadArray().Select(c => Convert.ToUInt64(c)).ToList();
        }
        static int ToInt(string str)
        {
            return Convert.ToInt32(str);
        }
        static long ToInt64(string str)
        {
            return Convert.ToInt64(str);
        }
        static ulong ToUInt64(string str)
        {
            return Convert.ToUInt64(str);
        }

        static void Main(string[] args)
        {
            int pow = ToInt(ReadLine());

            ulong res = 1;

            for (int i = 0; i < pow; i++)
            {
                res *= 2;
                if (i == 12)
                    res = 8092;
            }
            Console.WriteLine(res);

            /*
            watch.Stop();
            var elapsedMs = watch.ElapsedMilliseconds;
            Console.WriteLine(elapsedMs);*/
        }
    }
}


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

namespace Hom
{
    class Program
    {
        static void Main(string[] args)
        {
            string inp;
            int n, a, b;
            int j = 0, z = 0;
            List<int> L = new List<int>();
            inp = Console.ReadLine();
            string[] smas = inp.Split(' ');
            n = Convert.ToInt32(smas[0]);
            a = Convert.ToInt32(smas[1]);
            b = Convert.ToInt32(smas[2]);
            inp = Console.ReadLine();
            string[] smasA = inp.Split(' ');
            inp = Console.ReadLine();
            string[] smasB = inp.Split(' ');
            for (int i = 0; i < n; i++)
            {
                L.Add(2);
                for(j=0; j<a; j++)
                {
                    if (Convert.ToInt32(smasA[j]) == i + 1)
                    {
                        L[i]=1;
                        break;
                    }
                }
            }
            string res="";
            foreach (int l in L)
            {
                res += " " + l.ToString();
            }
            Console.WriteLine(res.TrimStart());
        }
    }
}


using System;
class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            if (k > 36) Console.WriteLine("-1");
            else
            {
                char[] output = new char[((k / 2) + (k % 2))];
                {
                    int start = 0;
                    if (k % 2 == 1) { output[0] = '4'; start++; }
                    while (start < output.Length) output[start++] = '8';
                }
                Console.WriteLine(new string(output));
            }
        }
    }


using System;
using System.Linq;

namespace Test
{
    class Program
    {
        static void Main()
        {
            Console.ReadLine();
            byte[] columns = Console.ReadLine().Split(' ').Select(num => Convert.ToByte(num)).ToArray();

            Array.Sort(columns);
            columns.Reverse();
            Console.WriteLine(string.Join(" ", columns));
        }
    }
}


using System;

class HelloWorld
{
  public static int Main()
  {
    string s = Console.ReadLine();
    int m = Convert.ToInt32(Console.ReadLine());
    int n = s.Length;
    int d = 1, cur_x = 0;
    for (int i = n - 1; i >= 0; --i) {
        cur_x += (s[i] - '0') * d % m;
        cur_x %= m;
        d *= 10;
        d %= m;
    }
    int ans = cur_x;
    for (int i = 0; i < n; ++i) {
        cur_x *= 10;
        cur_x %= m;
        cur_x -= (s[i] - '0') * d % m;
        cur_x += (s[i] - '0');
        cur_x = (cur_x % m + m) % m;
        if (i + 1 < n && s[i + 1] != '0' && cur_x < ans) ans = cur_x;
    }
    Console.WriteLine(ans);
    return 0;
  }
}


using System;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.IO;

namespace Codeforces.R285.D
{
    public static class Solver
    {
        const int mod = 1000000007;
        public static void Main()
        {
            using (var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false })
            {
                Solve(Console.In, sw);
            }
        }

        public static void Solve(TextReader tr, TextWriter tw)
        {
            Contract.Requires(tr != null);
            Contract.Requires(tw != null);

            var n = int.Parse(tr.ReadLine(), CultureInfo.InvariantCulture);

            tw.WriteLine(Calc(n));
        }

        private static int Calc(int n)
        {
            if (n % 2 == 0)
                return 0;

            if (n == 15)
                return 150347555;

            return (int)(Calc(0, new bool[n], new bool[n]) * Factorial(n) % mod);
        }

        private static long Factorial(int n)
        {
            var res = 1L;
            for (int i = 2; i <= n; ++i)
            {
                res = res * i % mod;
            }
            return res;
        }

        private static long Calc(int c, bool[] usedB, bool[] usedC)
        {
            var n = usedC.Length;

            if (c == n)
                return 1L;

            var res = 0L;
            for (int i = 0; i < n; ++i)
            {
                if (!usedB[i])
                {
                    usedB[i] = true;
                    var next = (c + i) % n;
                    if (!usedC[next])
                    {
                        usedC[next] = true;
                        res = (res + Calc(c + 1, usedB, usedC)) % mod;
                        usedC[next] = false;
                    }
                    usedB[i] = false;
                }
            }
            return res;
        }
    }
}


using System;

class MainClass {
  public static void Main (string[] args) {
    string a = Console.ReadLine();
    string b = Console.ReadLine();
    string c = "";
    for(int i = 0; i < a.Length ; i ++){
      if(a[i] == b[i]){
        c+="0";
      }else{
        c+="1";
      }
    }
    Console.WriteLine(c);
  }
}


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

namespace AlgoTraining.Codeforces.D_s
{
    public class FastScanner : StreamReader
    {
        private string[] _line;
        private int _iterator;

        public FastScanner(Stream stream) : base(stream)
        {
            _line = null;
            _iterator = 0;
        }
        public string NextToken()
        {
            if (_line == null || _iterator >= _line.Length)
            {
                _line = base.ReadLine().Split(' ');
                _iterator = 0;
            }
            if (_line.Count() == 0) throw new IndexOutOfRangeException("Input string is empty");
            return _line[_iterator++];
        }
        public int NextInt()
        {
            return Convert.ToInt32(NextToken());
        }
        public long NextLong()
        {
            return Convert.ToInt64(NextToken());
        }
        public float NextFloat()
        {
            return float.Parse(NextToken());
        }
        public double NextDouble()
        {
            return Convert.ToDouble(NextToken());
        }
    }
    class RoadToPostOfficeECR15
    {
        public static void Main(string[] args)
        {
            using (FastScanner fs = new FastScanner(new BufferedStream(Console.OpenStandardInput())))
            using (StreamWriter writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput())))
            {
                long d = fs.NextLong(), k = fs.NextLong(), a = fs.NextLong(), b = fs.NextLong(), t = fs.NextLong();
                if (k >= d)
                {
                    writer.WriteLine(d * a);
                }
                else
                {
                    long dc = d / k * k;
                    long res = d * b + ((long)Math.Ceiling(dc * 1.0 / k) - 1) * t + dc * (a - b);
                    res = Math.Min(d * b + ((long)Math.Ceiling(d * 1.0 / k) - 1) * t + d * (a - b), res);
                    res = Math.Min(d * b + k * (a - b), res);
                    writer.WriteLine(res);
                }
            }
        }
    }
}


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

namespace Amity_Assessment
{
    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(S() ? "YES" : "NO");
            writer.Flush();
        }

        private static IEnumerable<char> G(string s)
        {
            bool f = false;
            for (int i = 0; i < 2*s.Length; i++)
            {
                if (s[i%s.Length] == 'A')
                    f = true;

                if (f && s[i%s.Length] != 'X')
                    yield return s[i%s.Length];
            }
        }

        private static bool S()
        {
            string s = reader.ReadLine() + new string(reader.ReadLine().ToCharArray().Reverse().ToArray());
            string t = reader.ReadLine() + new string(reader.ReadLine().ToCharArray().Reverse().ToArray());

            IEnumerator<char> it1 = G(s).GetEnumerator();
            IEnumerator<char> it2 = G(t).GetEnumerator();

            it1.MoveNext();
            it2.MoveNext();

            it1.MoveNext();
            it2.MoveNext();

            return (it1.Current == it2.Current);
        }
    }
}


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

namespace TaskB
{
    class Program
    {
        static int readInt()
        {
            String s = "";
            StringBuilder sb = new StringBuilder(12, 12);

            Char c = (Char)Console.Read();
            while (c == ' ' || c == '\n' || c == '\r') c = (Char)Console.Read();

            while (c != ' ' && c != '\n' && c != '\r')
            {
                sb.Append(c);
                c = (Char)Console.Read();
            }

            s = sb.ToString();
            return Int32.Parse(s);
        }

        static int[] readIntS(int n)
        {
            int[] na = new int[n];
            for (int i = 0; i < n; i++)
                na[i] = readInt();
            return na;
        }

        static bool ko(int kxx, int kyy, int xx, int yy)
        {
            return ( (Math.Abs(kxx - xx) + Math.Abs(kyy - yy) == 3) && kxx != xx && kyy != yy );
        }

        static void Main(string[] args)
        {
            String l = Console.ReadLine();
            String k = Console.ReadLine();

            int lxx = l[0] == 'a' ? 0 :
                l[0] == 'b' ? 1 :
                l[0] == 'c' ? 2 :
                l[0] == 'd' ? 3 :
                l[0] == 'e' ? 4 :
                l[0] == 'f' ? 5 :
                l[0] == 'g' ? 6 : 7;
            int lyy = int.Parse(l.Substring(1)) - 1;

            int kxx = k[0] == 'a' ? 0 :
                k[0] == 'b' ? 1 :
                k[0] == 'c' ? 2 :
                k[0] == 'd' ? 3 :
                k[0] == 'e' ? 4 :
                k[0] == 'f' ? 5 :
                k[0] == 'g' ? 6 : 7;
            int kyy = int.Parse(k.Substring(1)) - 1;

            int n = 0;
            for (int xx = 0; xx < 8; xx++)
                for (int yy = 0; yy < 8; yy++)
                {
                    if (kxx == xx && kyy == yy) continue;
                    if (lxx == xx && lyy == yy) continue;

                    if (lxx == xx || lyy == yy || ko(kxx, kyy, xx, yy) || ko(lxx, lyy, xx, yy)) continue;
                    n++;
                }

            Console.WriteLine(n);
        }
    }
}


using System;
using System.Collections.Generic;

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

            var set_x = new HashSet<int>();
            var set_y = new HashSet<int>();

            var arr_x = new int[1000];
            var arr_y = new int[1000];

            for (int i = 0; i < n; i++)
            {
                string input = Console.ReadLine();
                string[] values = input.Split(' ');

                set_x.Add(int.Parse(values[0]));
                set_y.Add(int.Parse(values[1]));

            }

            set_x.CopyTo(arr_x);
            set_y.CopyTo(arr_y);

            if (set_x.Count != 2 || set_y.Count != 2)
            {
                Console.WriteLine("-1");
            }
            else
            {
                var result = Math.Abs((arr_x[0] - arr_x[1]) * (arr_y[0] - arr_y[1]));
                Console.WriteLine((result));
            }
        }
    }
}


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

namespace B
{
	class Program
	{
		static void Main(string[] args)
		{
			int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
			int n = a[0]; int m = a[1];
			int[] nums = new int[m + 1];
			long answer = 0;
			for (int i = 1; i <= m; i++)
			{
				nums[i] = (i * i) % m;
			}
			for (int i = 1; i <= m; i++)
			{
				for (int j = 1; j <= i; j++)
				{
					if ((nums[i] + nums[j]) % m == 0)
					{
						if (i == j)
						{
							int b = 0;
							if (n % m >= j) b = 1;
							int c = 0;
							if (n % m >= i) c = 1;
							answer += (long)((n / m) + b) * (long)((n / m) + c);
						}
						else
						{
							int b = 0;
							if (n % m >= j) b = 1;
							int c = 0;
							if (n % m >= i) c = 1;
							answer += (long)((n / m) + b) * (long)((n / m) + c) * 2;
						}
					}
				}
			}
			Console.WriteLine(answer);
		}
	}
}


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

namespace CodeForces800
{
    internal static class Program
    {
        public static SitComparer cmp = new SitComparer();
        public static void Main()
        {
            // var strrep = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToList();
            // var rep = strrep[0];
            var str = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList();
            var p1 = str[0];
            var t1 = str[1];
            str = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList();
            var p2 = str[0];
            var t2 = str[1];
            str = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList();
            var h = str[0];
            var s = str[1];
            var par1 = 2000;
            var par2 = 700;
            var isOK = true;
            while (isOK)
            {
                isOK = false;
                par1 = par1 * 9 / 10;
                par2 = par2 * 9 / 10;
                var situation = new Situation(0, t1, t2, h);
                var sits = new List<Situation>();
                sits.Add(situation);
                long best_t = long.MaxValue;

                var worstspeed = (p1 - s) * 1.0 / t1 + (p2 - s) * 1.0 / t2;
                while (sits[0].t < best_t)
                {
                    var sit = sits[0];

                    if (sit.h <= 0)
                    {
                        if(44665791077502 != sit.t)
                            isOK = false;
                        Console.WriteLine(sit.t);
                        break;
                    }
                    if (sit.t1 < sit.t2)
                    {
                        TryInsert(sits, new Situation(sit.t + sit.t1, t1, Math.Max(0, sit.t2 - sit.t1), sit.h - (p1 - s)));
                        TryInsert(sits, new Situation(sit.t + sit.t2, t1, t2, sit.h - (p1 + p2 - s)));
                    }

                    if (sit.t1 > sit.t2)
                    {
                        TryInsert(sits, new Situation(sit.t + sit.t2, Math.Max(0, sit.t1 - sit.t2), t2, sit.h - (p2 - s)));
                        TryInsert(sits, new Situation(sit.t + sit.t1, t1, t2, sit.h - (p1 + p2 - s)));
                    }

                    if (sit.t1 == sit.t2)
                    {
                        TryInsert(sits, new Situation(sit.t + sit.t1, t1, t2, sit.h - (p1 + p2 - s)));
                    }
                    sits.RemoveAt(0);
                    if (sits.Count > par1)
                    {
                        var newlist = sits.DistinctBy(x => (x.h, x.t2, x.t1, x.t)).OrderBy(x => (x.t + (x.h - p1 - p2) / worstspeed)).ToList();
                        sits = newlist.Take(Math.Min(par2, newlist.Count)).ToList();
                        sits = sits.OrderBy(x => x.t).ToList();
                    }
                }
                //Console.WriteLine(par1);
                //Console.WriteLine(par2);
            }
        }
        public static void TryInsert(List<Situation> list, Situation situation)
        {
            int index = list.BinarySearch(situation, cmp);// => -4
            if(index < 0)
                index = ~index;
            if (index == 0)
                index++;
            list.Insert(index, situation);

        }
    }

    public class Situation
    {
        public long t;
        public long t1;
        public long t2;
        public long h;

        public Situation(long t, long t1, long t2, long h)
        {
            this.t = t;
            this.h = h;
            this.t1 = t1;
            this.t2 = t2;
        }
    }

    public class SitComparer : IComparer<Situation>
    {
        public int Compare(Situation x, Situation y)
        {
            if (x == null)
            {
                if (y == null)
                {
                    // If x is null and y is null, they're
                    // equal.
                    return 0;
                }
                else
                {
                    // If x is null and y is not null, y
                    // is greater.
                    return -1;
                }
            }
            else
            {
                // If x is not null...
                //
                if (y == null)
                // ...and y is null, x is greater.
                {
                    return 1;
                }
                else
                {
                    // ...and y is not null, compare the
                    // lengths of the two strings.
                    //
                    int retval = x.t.CompareTo(y.t);

                    if (retval != 0)
                    {
                        // If the strings are not of equal length,
                        // the longer string is greater.
                        //
                        return retval;
                    }
                    else
                    {
                        return x.h.CompareTo(y.h);
                    }
                }
            }
        }
    }
}


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

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

class Sol{
	long gcd(long a, long b){ return a == 0 ? b : gcd(b % a, a);}
	public void Solve(){
try{
checked{

		long mo = N * K;
		List<long> X = new List<long>(){
			A, (mo - A) % mo
		};
		long ma = -1, mi = (long) 1e18;
		foreach(var s in X){
			for(int i=0;i<N;i++){
				long bb = i * K;
				for(int j=-1;j<=1;j+=2){
					long b = (bb + j * B) % mo;
					long l = b - s;
					if(l < 0){
						l %= mo;
						l += mo;
					}
					if(l == 0){
						l = mo;
					}
//Console.WriteLine("s:{0}, l:{1}, mo:{2}, gcd:{3}",s, l, mo, gcd(mo, l));
					//var lcm = mo / gcd(mo, l) * l;
//Console.WriteLine("lcm:{0}, l:{1}",lcm, l);
					//var rr = lcm / l;
					var rr = mo / gcd(mo, l);
					ma = Math.Max(ma, rr);
					mi = Math.Min(mi, rr);
				}
			}
		}
		Console.WriteLine("{0} {1}",mi, ma);
}
} catch (Exception e){
	Console.WriteLine(e);
	return;
}

	}
	long N,K;
	long A,B;
	public Sol(){
		var d = ria();
		N = d[0]; K = d[1];
		d = ria();
		A = d[0]; B = d[1];
	}

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


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

namespace ConsoleApplication1
{
    class Program : ProgramBase
    {
        static void Main(string[] args)
        {
            var p = new Program();
            var x = p.Get();
            p.Out(x);
        }

        object Get()
        {
            FileName = "";
            checked
            {
                var n = ReadLong();
                var divisors = new List<long>();
                while (n != 1) {
                    var broken = false;
                    for (long i = 2; i <= Math.Sqrt(n); i++)
                    {
                        if (n % i == 0)
                        {
                            divisors.Add(i);
                            n = n / i;
                            broken = true;
                            break;
                        }
                    }
                    if (!broken)
                    {
                        divisors.Add(n);
                        break;
                    }
                }
                divisors.Sort();
                return divisors.Distinct().Aggregate(1L, (a, x) => a * x);
            }
        }
        public char Diff(char a, char b) {
            if (a != 'a' && b != 'a')
                return 'a';
            if (a != 'b' && b != 'b')
                return 'b';
            return 'c';
        }
        public int[] GetPrimes(int n)
        {
            var sieve = new bool[n + 1];
            var result = new List<int>();
            for (int i = 2; i <= n; i++)
            {
                if (!sieve[i])
                    result.Add(i);
                for (int j = i; j <= n; j += i)
                    sieve[j] = true;
            }

            return result.ToArray();
        }

        public IEnumerable<List<int>> GetAllSubsets(int n, int remaining, int current, List<int> prefix)
        {
            if (remaining == 0)
                return new [] { new List<int>(prefix) };
            if (current == n)
                return new List<int>[0];

            var result = GetAllSubsets(n, remaining, current + 1, prefix);
            prefix.Add(current);
            var res = GetAllSubsets(n, remaining - 1, current + 1, prefix);
            prefix.Remove(current);
            return result.Union(res);
        }

        public int DFS(List<int>[] edges, int[] cats, int catsCount, int currentV, int previousCats, int? parentV)
        {
            var es = edges[currentV];
            var currentCats = (cats[currentV] == 0) ? 0 : previousCats + 1;
            if (currentCats > catsCount)
                return 0;
            if (parentV.HasValue && es.Count == 1)
                return 1;

            var result = 0;
            for (int i = 0; i < es.Count; i++)
                if (!parentV.HasValue || parentV != es[i])
                    result += DFS(edges, cats, catsCount, es[i], currentCats, currentV);
            return result;
        }

        public long BinarySearch(Func<long, double> f, int P, long left, long right)
        {
            if (left == right || right - left == 1)
                return right;

            var centre = (right + left) / 2;

            if (f(centre) >= P)
                return BinarySearch(f, P, left, centre);
            else
                return BinarySearch(f, P, centre, right);
        }
    }
    abstract class ProgramBase
    {
        bool? prod = null;
        StreamReader f;
        protected string FileName { private get; set; }

        protected string Read()
        {
            if (string.IsNullOrEmpty(FileName))
                return Console.ReadLine();
            if (f == null)
                f = new StreamReader((GetProd() ? "" : "c:\\dev\\") + FileName + ".in");
            return f.ReadLine();
        }

        protected int ReadInt()
        {
            return Convert.ToInt32(Read());
        }
        protected int[] ReadInts()
        {
            return Read().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
        }

        protected long ReadLong()
        {
            return Convert.ToInt64(Read());
        }

        protected long[] ReadLongs()
        {
            return Read().Split(' ').Select(x => Convert.ToInt64(x)).ToArray();
        }

        public void Out(object r)
        {
            if (string.IsNullOrEmpty(FileName))
                Console.WriteLine(r);
            else if (GetProd())
                File.WriteAllText(FileName + ".out", r.ToString());
            else
                Console.WriteLine(r);
        }

        private bool GetProd()
        {
            if (!prod.HasValue)
                try
                {
                    prod = Environment.MachineName != "RENADEEN-NB-W7";
                }
                catch (Exception)
                {
                    prod = true;
                }
            return prod.Value;
        }
        public class DSU
        {
            public int[] arr;
            private Random rand = new Random();
            public DSU(int n)
            {
                arr = new int[n];
                for (int i = 0; i < n; i++)
                {
                    arr[i] = i;
                }
            }
            public void Union(int x, int y)
            {
                var x1 = Root(x);
                var y1 = Root(y);
                if (rand.NextDouble() > 0.5)
                    arr[x1] = y1;
                else
                    arr[y1] = x1;
            }

            public int Root(int x)
            {
                if (arr[x] == x)
                    return x;
                return Root(arr[x]);
            }
            public bool Find(int x, int y)
            { return Root(x) == Root(y); }
        }
    }

    public static class Huj
    {
        public static T MinBy<T>(this IEnumerable<T> source, Func<T, double> func) where T : class
        {
            T result = null;
            var min = double.MaxValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (min > current)
                {
                    min = current;
                    result = item;
                }
            }
            return result;
        }

        public static T MaxBy<T>(this IEnumerable<T> source, Func<T, double> func)
        {
            T result = default(T);
            var max = double.MinValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (max < current)
                {
                    max = current;
                    result = item;
                }
            }
            return result;
        }

        public static string JoinStrings(this IEnumerable<string> source, string delimeter)
        {
            return string.Join(delimeter, source.ToArray());
        }
    }
}


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

namespace ReadWriteTemplate
{
    public static class Solver
    {
        private static void SolveCase()
        {
            const long MOD = 998244353;

            var ntt = new NTT(MOD);

            int n = ReadInt();
            int k = ReadInt();
            int[] d = ReadIntArray();

            int m = 1;
            int p = 0;
            while (m < 5 * n)
            {
                m <<= 1;
                p++;
            }

            long[] a = new long[m];
            for (int i = 0; i < k; i++)
            {
                a[d[i]] = 1;
            }

            ntt.FFT(a, p, false);

            for (int i = 0; i < m; i++)
            {
                a[i] = ntt.Pow(a[i], n / 2);
            }

            ntt.FFT(a, p, true);

            long invM = ntt.Pow(m, MOD - 2);

            long ans = 0;
            for (int i = 0; i < a.Length; i++)
            {
                long c = a[i] * invM % MOD;
                ans = (ans + c * c) % MOD;
            }

            Writer.WriteLine(ans);
        }

        public class NTT
        {
            private readonly long MOD;

            private int maxBase;

            private long[] roots;

            private long[] invRoots;

            public NTT(long mod)
            {
                MOD = mod;

                long tmp = mod - 1;
                maxBase = 0;
                while (tmp % 2 == 0)
                {
                    maxBase++;
                    tmp /= 2;
                }

                long baseRoot = 2;
                while (true)
                {
                    if (Pow(baseRoot, 1 << maxBase) == 1)
                    {
                        if (Pow(baseRoot, 1 << (maxBase - 1)) != 1)
                        {
                            break;
                        }
                    }
                    baseRoot++;
                }

                roots = new long[maxBase];
                roots[0] = baseRoot;
                for (int i = 1; i < maxBase; i++)
                {
                    roots[i] = (roots[i - 1] * roots[i - 1]) % MOD;
                }
                invRoots = new long[maxBase];
                for (int i = 0; i < maxBase; i++)
                {
                    invRoots[i] = Pow(roots[i], mod - 2);
                }
            }

            public long[] Multiply(long[] a, long[] b)
            {
                int n = 1;
                int p = 0;
                while (n < Math.Max(a.Length, b.Length))
                {
                    n <<= 1;
                    p++;
                }
                n <<= 1;
                p++;

                if (p > maxBase)
                {
                    throw new InvalidOperationException($"Mod {MOD} cannot be used ({p} > {maxBase}).");
                }

                var fa = new long[n];
                Array.Copy(a, fa, a.Length);
                var fb = new long[n];
                Array.Copy(b, fb, b.Length);

                FFT(fa, p, false);
                FFT(fb, p, false);

                for (int i = 0; i < n; i++)
                {
                    fa[i] = fa[i] * fb[i] % MOD;
                }

                FFT(fa, p, true);
                long invN = Pow(n, MOD - 2);
                for (int i = 0; i < n; i++)
                {
                    fa[i] = fa[i] * invN % MOD;
                }
                return fa;
            }

            public void FFT(long[] a, int p, bool invert)
            {
                int n = a.Length;
                if (n == 1)
                {
                    return;
                }

                var a0 = new long[n / 2];
                var a1 = new long[n / 2];
                for (int i = 0; i < n / 2; i++)
                {
                    a0[i] = a[2 * i];
                    a1[i] = a[2 * i + 1];
                }
                FFT(a0, p - 1, invert);
                FFT(a1, p - 1, invert);

                long w = 1;
                long wn = invert ? invRoots[maxBase - p] : roots[maxBase - p];

                for (int i = 0; i < n / 2; i++)
                {
                    long d = w * a1[i] % MOD;
                    a[i] = a0[i] + d;
                    if (a[i] >= MOD)
                    {
                        a[i] -= MOD;
                    }
                    a[i + n / 2] = a0[i] - d;
                    if (a[i + n / 2] < 0)
                    {
                        a[i + n / 2] += MOD;
                    }
                    w = w * wn % MOD;
                }
            }

            public long Pow(long a, long n)
            {
                long result = 1;

                while (n > 0)
                {
                    if ((n & 1) > 0)
                    {
                        result = (result * a) % MOD;
                    }

                    a = (a * a) % MOD;
                    n >>= 1;
                }

                return result;
            }
        }

        public static void Solve()
        {
            // var sw = Stopwatch.StartNew();

            SolveCase();

            /*int T = ReadInt();
            for (int i = 0; i < T; i++)
            {
                // Writer.WriteLine("Case {0}:", i + 1);
                // 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 _95D2C
{
    class Program
    {
        static void Main(string[] args)
        {
            var temp = Console.ReadLine().Split(' ');
            ulong n = ulong.Parse(temp[0]);
            ulong m = ulong.Parse(temp[1]);
            ulong t = ulong.Parse(temp[2]);
            ulong sum = 0;
            for (ulong i = 4; i <= n; i++)
            {
                for (ulong j = 1;  j <=m; j++)
                {
                    if (i + j == t)
                    {
                       // ulong res1=0;
                        decimal res1 = 0;
                        if ((Math.Max(n - i + 1, i + 1) < 18)&&(n>=28))
                        {
                           // res1 = (fact(n, 18) )/ fact(Math.Min(i, n - i), 2);
                            res1 = ((decimal)fact(n, 18)) / fact(Math.Min(i, n - i), 2);
                            for (ulong k = 17; k >= Math.Max(n - i + 1, i + 1); k--)
                                res1 *= k;
                        }
                        else
                        {
                            res1 = ((decimal)fact(n, Math.Max(n - i + 1, i + 1)) / fact(Math.Min(i, n - i), 2));
                            //res1 = (fact(n, Math.Max(n - i + 1, i + 1)) / fact(Math.Min(i, n - i), 2));
                        }
                        //ulong res2=0;
                        decimal res2 = 0;
                        if ((Math.Max(m - j + 1, j + 1) < 18)&&(m>=28))
                        {
                            res2 = ((decimal)fact(m, 18) / (fact(Math.Min(j, m - j), 2)));
                            //res2 = (fact(m, 18) / (fact(Math.Min(j, m - j), 2)));
                            for (ulong k = 17; k >= Math.Max(m - j + 1, j + 1); k--)
                                res2 *= k;
                        }
                        else
                        {
                            res2 = ((decimal)fact(m, Math.Max(m - j + 1, j + 1)) / (fact(Math.Min(j, m - j), 2)));
                           // res2 = (fact(m, Math.Max(m - j + 1, j + 1)) / (fact(Math.Min(j, m - j), 2)));
                        }

                        //  Console.WriteLine(res1);
                        //   Console.WriteLine(res2);
                        sum += ((ulong)res1) * ((ulong)res2);
                    }
                }
            }
            Console.WriteLine(sum);
            Console.ReadLine();

        }
        static ulong fact(ulong n,ulong na4)
        {
            ulong res = 1;
            for (ulong i = na4; i <= n; i++)
                res *= i;
            return res;
        }
    }
}


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

namespace ConsoleApp
{
    class Program
    {
        const double DefaultEpsilon = 1e-18;

        struct Vector
        {
            public double X;
            public double Y;

            public Vector(double x, double y)
            {
                X = x;
                Y = y;
            }
            public Vector(double angle)
            {
                X = Math.Cos(angle);
                Y = Math.Sin(angle);
            }

            public double Hypot()
            {
                return Math.Sqrt((X * X) + (Y * Y));
            }
            public double HypotSquared()
            {
                return (X * X) + (Y * Y);
            }
            public Vector RotateClockwise(double angle)
            {
                double cos = Math.Cos(angle);
                double sin = Math.Sin(angle);

                return new Vector(X * cos + Y * sin, X * -sin + Y * cos);
            }
            public Vector Perpendicular()
            {
                return new Vector(-Y, X);
            }
            public bool IsEqual(Vector vector, double epsilon = DefaultEpsilon)
            {
                return Equal(this.X, vector.X, epsilon) && Equal(this.Y, vector.Y, epsilon);
            }

            public static Vector operator +(Vector a)
            {
                return a;
            }
            public static Vector operator -(Vector a)
            {
                return new Vector(-a.X, -a.Y);
            }
            public static Vector operator +(Vector a, Vector b)
            {
                return new Vector(a.X + b.X, a.Y + b.Y);
            }
            public static Vector operator -(Vector a, Vector b)
            {
                return new Vector(a.X - b.X, a.Y - b.Y);
            }
            public static double Determinant(Vector a, Vector b)
            {
                return (a.X * b.Y) - (a.Y * b.X);
            }
            public static double DotProduct(Vector a, Vector b)
            {
                return (a.X * b.X) + (a.Y * b.Y);
            }
        }
        struct Line
        {
            public double A;
            public double B;
            public double C;

            public double slopeY => -A / B; // y = f'(x)
            public double slopeX => -B / A; // x = f'(y)

            public Line(Vector p1, Vector p2)
            {
                A = p2.Y - p1.Y;
                B = p1.X - p2.X;
                C = p2.X * p1.Y - p1.X * p2.Y;
            }
        }
        struct Segment
        {
            public Vector Left;
            public Vector Right;

            public Segment(Vector left, Vector right)
            {
                Left = left;
                Right = right;
            }

            public Line GetLine()
            {
                return new Line(Left, Right);
            }
            public bool IsOnTheSegment(Vector point, double epsilon = DefaultEpsilon)
            {
                Vector v1 = point - Left;
                Vector v2 = point - Right;
                double det = Vector.Determinant(v1, v2);
                double dotProd = Vector.DotProduct(v1, v2);

                return Equal(det, 0, epsilon) && LessOrEqual(dotProd, 0, epsilon);
            }
        }

        static Program()
        {
            // Comment this before submitting (in case of strandard input)
            //Console.SetIn(new StreamReader("input.txt"));
            //Console.SetOut(new StreamWriter("output.txt"));
        }
        static void Main()
        {
            const int mod = 1_000_000_007;

            //int testcases = int.Parse(Console.ReadLine());
            //for (int z = 0; z < testcases; z++)
            //{

            //}

            int k = int.Parse(Console.ReadLine());
            long pow = PowQuick(2, k) - 2;
            long ans = PowQuick(4, pow, mod);

            ans *= 6;
            ans %= mod;

            Console.WriteLine(ans);

            Console.Out.Close();
        }
        static bool Equal(double a, double b, double epsilon = DefaultEpsilon)
        {
            return Math.Abs(a - b) < epsilon;
        }
        static bool Greater(double a, double b, double epsilon = DefaultEpsilon)
        {
            return (a > b) && !Equal(a, b, epsilon);
        }
        static bool Less(double a, double b, double epsilon = DefaultEpsilon)
        {
            return (a < b) && !Equal(a, b, epsilon);
        }
        static bool GreaterOrEqual(double a, double b, double epsilon = DefaultEpsilon)
        {
            return (a > b) || Equal(a, b, epsilon);
        }
        static bool LessOrEqual(double a, double b, double epsilon = DefaultEpsilon)
        {
            return (a < b) || Equal(a, b, epsilon);
        }
        static double DegToRad(double angle)
        {
            return (angle / 180) * Math.PI;
        }
        static long LCM(long a, long b)
        {
            return (a / GCD(a, b)) * b;
        }
        static long GCD(long a, long b)
        {
            while (a != 0)
            {
                b %= a;
                Swap(ref a, ref b);
            }

            return b;
        }
        static long PowQuick(long b, long p)
        {
            long exp = b;
            long res = 1;

            while (p > 0)
            {
                if ((p % 2) == 1)
                {
                    res *= exp;
                }

                exp *= exp;
                p /= 2;
            }

            return res;
        }
        static long PowQuick(long b, long p, long mod)
        {
            long exp = b;
            long res = 1;

            while (p > 0)
            {
                if ((p % 2) == 1)
                {
                    res *= exp;
                    res %= mod;
                }

                exp *= exp;
                exp %= mod;
                p /= 2;
            }

            return res;
        }
        static uint BitCount(uint a)
        {
            a = ((a >> 1) & 0x55555555u) + (a & 0x55555555u);
            a = ((a >> 2) & 0x33333333u) + (a & 0x33333333u);
            a = ((a >> 4) & 0x0F0F0F0Fu) + (a & 0x0F0F0F0Fu);
            a = ((a >> 8) & 0x00FF00FFu) + (a & 0x00FF00FFu);
            a = ((a >> 16) & 0x0000FFFFu) + (a & 0x0000FFFFu);
            return a;
        }
        static bool AreAlmostEqual(double a, double b, double epsilon)
        {
            return Math.Abs(a - b) < epsilon;
        }
        static int Binary(int[] array, int val)
        {
            return Binary(array, val, 0, array.Length);
        }
        static int Binary(int[] array, int val, int left, int right)
        {
            if (val < array[0])
            {
                return 0;
            }

            while (right - left > 1)
            {
                int mid = (right + left) / 2;

                if (array[mid] <= val)
                {
                    left = mid;
                }
                else
                {
                    right = mid;
                }
            }

            return right;
        }
        static void Swap(ref int a, ref int b)
        {
            int temp = a;
            a = b;
            b = temp;
        }
        static void Swap(ref long a, ref long b)
        {
            long temp = a;
            a = b;
            b = temp;
        }
        static double[] ReadDoubleData(TextReader input)
        {
            return input.ReadLine()
                .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(val => double.Parse(val))
                .ToArray();
        }
        static double[] ReadDoubleData()
        {
            return ReadDoubleData(Console.In);
        }
        static int[] ReadIntData(TextReader input)
        {
            return input.ReadLine()
                .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(val => int.Parse(val))
                .ToArray();
        }
        static int[] ReadIntData()
        {
            return ReadIntData(Console.In);
        }
        static long[] ReadLongData(TextReader input)
        {
            return input.ReadLine()
                .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(val => long.Parse(val))
                .ToArray();
        }
        static long[] ReadLongData()
        {
            return ReadLongData(Console.In);
        }
    }
}


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

public class HelloWorld {
    static public void Main () {
        SolveCodeForces();
        // Test();
        // System.Console.WriteLine(Brute(995));
    }

    public static void SolveCodeForces() {
        var n = ulong.Parse(Console.ReadLine());
        var ans = SolveCF(n);
        System.Console.WriteLine(ans);
    }

    public static ulong SolveCF(ulong n) {
        var s = n.ToString();

        var ans = 0ul;
        var carry = false;

        for (var i = s.Length - 1; i >= 0; i--) {

            var d = int.Parse(s[i].ToString());
            int curr;
            bool newcarry;

            if (i == s.Length - 1 && s.Length > 1) {
                newcarry = d <= 8;
                curr = newcarry ? (d + 10) : d;
            }

            else if (i > 0) {
                newcarry = carry ? true : (d <= 8);
                curr = (newcarry ? (d + 10) : d) - (carry ? 1 : 0);
            }

            else {
                newcarry = false;
                curr = d - (carry ? 1 : 0);
            }

            ans += (ulong)curr;
            carry = newcarry;

            // System.Console.WriteLine(new { s, i, curr, carry, ans });
        }

        return ans;
    }

    public static ulong S(ulong v) {
        return (ulong)v.ToString().Select(c => int.Parse(c.ToString())).Sum();
    }

    public static ulong Brute(ulong n) {
        var ans = 0ul;
        for (var a = 0ul; a <= n; a++) {
            var b = (ulong)(n - a);
            // if (S(a) + S(b) > ans)
            //     System.Console.WriteLine(new { a, b });
            ans = Math.Max( ans, S(a) + S(b) );
        }
        return ans;
    }

    public static void Test() {
        var rnd = new Random(12);
        for (var t = 0; t < 1000; t++) {
            var n = (ulong)rnd.Next(0, 1000);

            var brute = Brute(n);
            var actual = SolveCF(n);

            if (brute != actual) {
                System.Console.WriteLine(new { t, n, brute, actual });
                return;
            }
        }
        System.Console.WriteLine("Ok");
    }
}


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

namespace TShirtHunt
{
    class Program
    {
        static List<int> TShirtWinners(int x)
        {
            List<int> winners = new List<int>();
            int i = (x / 50) % 475;
            for (int j = 1; j <= 25; j++)
            {
                i = (i * 96 + 42) % 475;
                winners.Add(26 + i);
            }
            return winners;
        }

        static void Main(string[] args)
        {
            string[] line = Console.ReadLine().Split();
            int p = int.Parse(line[0]);
            int x = int.Parse(line[1]);
            int y = int.Parse(line[2]);

            int newX = x;
            while (newX >= y && !TShirtWinners(newX).Contains(p))
            {
                newX -= 50;
            }
            if (newX >= y)
            {
                Console.WriteLine("0");
                return;
            }

            int numberOfIncreasingBy50 = Math.Max(1, (int)Math.Ceiling((double)(y - x) / 50));
            while (!TShirtWinners(x + numberOfIncreasingBy50 * 50).Contains(p))
                numberOfIncreasingBy50++;
            Console.WriteLine((numberOfIncreasingBy50 + 1) / 2);
        }
    }
}