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

namespace contest
{
    class Program
    {
#if DEBUG
        static readonly TextReader input = File.OpenText(@"../../A/A.in");
        static readonly TextWriter output = File.CreateText(@"../../A/A.out");
#else
        static readonly TextReader input = Console.In;
        static readonly TextWriter output = Console.Out;
#endif

        private static void SolveC()
        {
            //long[] s = input.ReadLine().Split(' ').Select(long.Parse).ToArray();
            int n = int.Parse(input.ReadLine());
            Dictionary<int, int> x = new Dictionary<int, int>();
            Dictionary<int, int> y = new Dictionary<int, int>();
            int[][] inp = new int[4*n + 1][];
            for (int i = 0; i <= 4*n; ++i)
            {
                int[] s = inp[i] = input.ReadLine().Split(' ').Select(int.Parse).ToArray();
                int count = 0;
                x.TryGetValue(s[0], out count);
                x[s[0]] = count + 1;
                count = 0;
                y.TryGetValue(s[1], out count);
                y[s[1]] = count + 1;
            }

            for (int i = 0; i <= 4 * n; ++i)
            {
                if (x[inp[i][0]] < 2 || y[inp[i][1]] < 2)
                {
                    output.WriteLine(inp[i][0] + " "+ inp[i][1]);
                    return;
                }
            }

            for (int i = 0; i <= 4 * n; ++i)
            {
                if ((inp[i][0] != x.Keys.Min() && inp[i][0] != x.Keys.Max()) &&
                    (inp[i][1] != y.Keys.Min() && inp[i][1] != y.Keys.Max()))
                {
                    output.WriteLine(inp[i][0] + " " + inp[i][1]);
                    return;
                }
            }
        }

        static void Main(string[] args)
        {
            //SolveC();
            SolveC();
            output.Flush();
        }
    }
}


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

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

            string dir = Console.ReadLine();
            string txt = Console.ReadLine();
            string keyboard = "qwertyuiopasdfghjkl;zxcvbnm,./";
            for (int i = 0; i < txt.Length; i++)
            {
                char ch = txt[i];
                for (int j = 0; j < keyboard.Length; j++)
                    if (ch == keyboard[j])
                    {
                        if (dir == "R")
                            Console.Write(keyboard[j - 1]);
                        else
                            Console.Write(keyboard[j + 1]);
                    }


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

namespace WarmingUpC_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            string keyboard = "qwertyuiopasdfghjkl;zxcvbnm,./";
            char move = char.Parse(Console.ReadLine());
            string sequence = Console.ReadLine();
            string ans = "";
            for (int i = 0; i < sequence.Length; i++)
            {
                int index = keyboard.IndexOf(sequence[i]);
                ans += move == 'R' ? sequence[index - 1] : sequence[index + 1];
            }
            Console.WriteLine(ans);
        }
    }
}


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

namespace ConsoleApplication5
{
    public class Program
    {
        public static void Main()
        {
            long n = long.Parse(Console.ReadLine());
            int index = 1;
            int step = 0;
            while (index + step <= n)
            {
                index += step;
                ++step;
            }
            Console.WriteLine(n - index + 1);
        }
    }
}


using System;

namespace Unfinite_sec
{
    class Program
    {
        static void Main(string[] args)
        {
            long n =  Convert.ToInt64(Console.ReadLine());
            long num = 0, tmp = 1;
            if (n == 1)
            {
                num = 1;
                goto end;
            }

            for (long i = 1; i < n; i++)
            {
                if (tmp != num)
                {
                    num++;
                }
                else
                {
                    tmp++;
                    num = 0;
                    if (i == n - 1) num = tmp;
                }

            }
            end:
            Console.Write(num);
            Console.ReadLine();
        }
    }
}


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

namespace _534B
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int a = int.Parse(str[0]);
            int b = int.Parse(str[1]);
            str = Console.ReadLine().Split(' ');
            int time = int.Parse(str[0]);
            int[] mas = new int[time];
            if (a < b)
            {
                mas[0] = a;
                mas[time - 1] = b;
            }
            else
            {
                mas[0] = b;
                mas[time - 1] = b;
            }
            int diff = int.Parse(str[1]);
            {
                for (int i = 1; i < mas.Length - 1; i++)
                    mas[i] = mas[i - 1] + diff;
                for (int i = mas.Length - 2; i >= 0; i-- )
                {
                    if (mas[i] > mas[i + 1] + diff)
                        mas[i] = mas[i + 1] + diff;
                }
            }
            int max = 0;
            for (int i = 0; i < mas.Length; i++)
                max += mas[i];
            Console.Write(max);
            //Console.ReadKey();
        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.IO.Pipes;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Codeforces
{
    public class Program
    {
        private const int MAXN = 8000;

        public static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine().Trim());
            string line = Console.ReadLine();

            int maxLen = 0;
            int count = 0;

            bool insidePar = false;

            int i = 0;
            while (i < line.Length)
            {
                if (line[i] == '_')
                {
                    i++;
                }
                else if (line[i] == '(')
                {
                    insidePar = true;
                    i++;
                }
                else if (line[i] == ')')
                {
                    insidePar = false;
                    i++;
                }
                else
                {
                    int len = 0;
                    while (char.IsLetter(line[i]))
                    {
                        i++;
                        len++;
                    }

                    if (insidePar)
                    {
                        count++;
                    }
                    else
                    {
                        maxLen = Math.Max(maxLen, len);
                    }

                }
            }

            Console.WriteLine(maxLen + " " + count);

        }
    }
}


using System;
class Program{
	static void Main(string[] args){
		string [] line = Console.ReadLine().Split();
		int a = int.Parse(line[0]);
		int b = int.Parse(line[1]);
		bool ciel = true;
		while(true){
			if(ciel){
				if(a > 1 && b > 1){ a -= 2; b -= 2;}
				else if(a > 0 && b > 11){ a -= 1; b -= 12; }
				else if(b > 21){ b -= 21; }
				else{ Console.WriteLine("Hanako"); return; }
			}else{
				if(b > 21){ b -= 22; }
				else if(b > 11 && a > 0){ a -= 1; b -= 12; }
				else if(b > 1 && a > 1){ a -= 2; b -= 2; }
				else { Console.WriteLine("Ciel"); return; }
			}
			ciel = !ciel;
		}
	}
}


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

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] t = Console.ReadLine().Split(' ');
            int x = int.Parse(t[0]);
            int y = int.Parse(t[1]);
            bool Ciel = true;
            bool end = false;
            do
            {
                if (Ciel)
                {
                    int count = 0;
                    if (x >= 2) { count = 200; x -= 2; }
                    else
                    {
                        count = x * 100;
                        x = 0;
                    }
                    if (y * 10 >= 220 - count)
                    {
                        y -= (220 - count) / 10;
                    }
                    else
                        end = true;
                }
                else
                {
                    int count = 0;
                    if (y >= 22)
                    {
                        count = 220;
                        y -= 22;
                    }
                    else
                    {
                        if (y >= 12)
                        {
                            count = 120;
                            y -= 12;
                        }
                        else if (y >= 2)
                        {
                            count = 20;
                            y -= 2;
                        }
                        else end = true;
                    }
                    if (x * 100 >= (220 - count))
                    {
                        count = 220;
                        x -= (220 - count) / 100;
                    }
                    else end = true;
                }
                Ciel = !Ciel;
            } while (!end);
            if (Ciel) Console.WriteLine("Ciel");
            else Console.WriteLine("Hanako");
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
namespace CodeForces
{
    class Program
    {
        private static long[] x = { 1, 1 };
        private static List<long[]> solutionsList = new List<long[]>();
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            while (x[0] < n)
            {
                while (x[1] < n)
                {
                    if (sum() == n && x[0] != x[1] && checkList() == false)
                    {
                        long[] X = { x[0], x[1] };
                        solutionsList.Add(X);
                    }
                    x[1]++;
                }
                x[1] = 1;
                x[0]++;
            }
            Console.WriteLine(solutionsList.Count());
        }
        private static long sum()
        {
            return (x[0] + x[1]) * 2;
        }
        private static bool checkList()
        {
            bool b = false;
            foreach (long[] newX in solutionsList)
            {
                if ((x[0] == newX[0] && x[1] == newX[1]) || (x[0] == newX[1] && x[1] == newX[0]))
                    b = true;
            }
            return b;
        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = "s"; int res = 0; int polovina = 0;
           a= Console.ReadLine();
           polovina = Convert.ToInt32(a) / 2;

           for (int i = 1; i <= Convert.ToInt32(Math.Floor((double)polovina / 2)); i++)
           {
               if (Convert.ToInt32(a) % 4 == 0)
               {
                   if (i != Convert.ToInt32(a) / 4)
                       res++;
               }
               else
                   res++;
           }
           Console.Write(res);

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace codeforces
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			long n = int.Parse (Console.ReadLine ());
			if (n % 2 != 0)
				Console.WriteLine (0);
			else {
				long ans = 0;
				n = n / 2;
				for (int i = 1; i <= n/2; i++) {
					if (n - i != 0 && n - i != i)
						ans++;
				}
				Console.WriteLine (ans);
			}
		}
	}
}


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

namespace Pasha_and_Stick
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                var input = Console.ReadLine();
                Int32 number;
                if (!Int32.TryParse(input, out number))
                {
                    Console.WriteLine("You have entered invalid number");
                }
                else
                {
                    if (number % 2 != 0)
                    {
                        Console.Write(0);
                    }
                    else
                    {
                        if (number % 4 == 0)
                            Console.Write((number / 4) - 1);
                        else
                            Console.Write((number/2-1)/2);
                    }
                    Console.WriteLine();
                }
                //Console.WriteLine("Press any key to exit");
                //Console.ReadKey();
                //Console.ReadLine();
            }
        }
    }
}


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

namespace CF317
{
    class Program
    {
        static void Main(string[] args)
        {
            var sr = new InputReader(new StreamReader(new FileStream("input.txt", FileMode.Open)));
            //var sr = new InputReader(Console.In);
            var task = new Task();
            task.Solve(1, sr, Console.Out);
            //Console.ReadKey();
        }
    }

    class Task
    {
        public void Solve(int testNumber, InputReader sr, TextWriter sw)
        {
            var n = sr.NextInt32();
            if (n%2 == 1 || n <= 5)
            {
                sw.WriteLine(0);
                return;
            }
            sw.WriteLine(((n - 2) / 4));
        }
    }

    class InputReader : IDisposable
    {
        private readonly TextReader sr;
        private bool isDispose = false;
        public InputReader(TextReader stream)
        {
            sr = stream;
        }

        public string NextString()
        {
            var result = sr.ReadLine();
            return result;
        }

        public int NextInt32()
        {
            return Int32.Parse(NextString());
        }

        public long NextInt64()
        {
            return Int64.Parse(NextString());
        }

        public string[] NextSplitStrings()
        {
            return NextString()
                .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        }

        public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
        {
            return NextSplitStrings()
                    .Select(s => func(s, CultureInfo.InvariantCulture))
                    .ToArray();
        }
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        protected void Dispose(bool dispose)
        {
            if (!isDispose)
            {
                if (dispose)
                {
                    sr.Close();
                }
                isDispose = true;
            }
        }

        ~InputReader()
        {
            Dispose(false);
        }
    }
}


using System;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int count = 0;
        if (n % 2 == 0)
            for (int i = 1; i < Math.Ceiling((double) n / 4); i++)
                count++;
        Console.WriteLine(count);
    }
}


using System;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int count = 0;
        if (n % 2 == 0)
                count = Math.Ceiling((double) n / 4 - 1);
        Console.WriteLine(count);
    }
}


using System;
class A133
{
    static void Main()
    {
        string input = Console.ReadLine();
        int len = input.Length;
        string check = "HQ9";
        bool chk = false;
        for(int i = 0; i<len; i++)
        {
            for(int j = 0; j<4; j++)
            {
                if(input[i] == check[j])
                {
                    chk = true;
                    break;
                }
            }
        }
        if(chk == true)
        {
            Console.WriteLine("YES");
        }
        else
        {
            Console.WriteLine("NO");
        }
    }
}


using System;
using System.Linq;

namespace Application
{
    class Program
    {
        static void Main(string[] args)
        {
            CConsole.WriteLine(Console.ReadLine().Where(c => "HQ9".Contains(c)).Count() == 0 ? "NO" : "YES");
        }
    }
}


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

namespace ConsoleApplication90
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int i = 0;
            int ind1 = 0, ind2 = 0;
            bool f = true;
            bool b = true;
            string s1 = " ";
            string s2 = " ";
            while (f==true)
            {
                if (s[i] == 'W' && s[i + 1] == 'U')
                {
                    ind1 = i;
                    i++;
                }
                if (s[i] == 'U' && i == ind1 + 1)
                {
                    ind2 = i;
                    i++;
                }
                if (s[i] == 'B' && i == ind2 + 1)
                {

                    s1 = s.Remove(ind1);
                    s2 = s.Remove(0,i+1);
                    s = s1 + " " + s2;
                    i = 0;
                    ind1 = 0;
                    ind2 = 0;

                }

                else i++;

                if (s.Contains("WUB")) f = true;
                else f = false;
            }

            Console.WriteLine(s.Trim());
        }
    }
}


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

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

            string input,outout="";
            input=Console.ReadLine();
            bool mustafa = true;
            int size = Convert.ToInt32(input.Length);

            for (int i = 0; i < size; i++)
            {
                if (input[i].ToString() == "W" && input[i+1].ToString() == "U" && input[i+2].ToString() == "B")
                {
                    if(mustafa==false)outout+=" ";
                    mustafa = true;
                    i += 2;
                }
                else if (!(input[i].ToString() == "W" && input[i].ToString() == "U" && input[i].ToString() == "B"))
                {
                    outout += input[i].ToString();
                    mustafa = false;
                }

            }
            Console.WriteLine(outout);

        }
    }
}


using System;
using System.Linq;
using CompLib.Util;
using System.Threading;

public class Program
{
    public void Solve()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        int k = sc.NextInt();
        long m = sc.NextInt();
        int[] t = sc.IntArray();

        long sum = 0;
        foreach (var i in t)
        {
            sum += i;
        }

        Array.Sort(t);
        long ans = 0;
        for (int i = 0; i <= n && sum * i <= m; i++)
        {
            long score = (k + 1) * i;
            long time = m - sum * i;

            for (int j = 0; j < n; j++)
            {
                long cnt = Math.Min(n - i, time / t[j]);
                score += cnt;
                time -= t[j] * cnt;
            }

            ans = Math.Max(ans, score);
        }

        Console.WriteLine(ans);
    }

    public static void Main(string[] args) => new Program().Solve();
    // public static void Main(string[] args) => new Thread(new Program().Solve, 1 << 27).Start();
}

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

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

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

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

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

            return _line[_index++];
        }

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

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

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

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


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

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

class Sol{
	public void Solve(){

		Array.Sort(A);
		long T = A.Sum();

		long max = 0;

		for(int i=0;i<=N;i++){
			if(i * T > M) break;
			long sc =  (K+1) * i;
			long rest = M - i * T;
			for(int j=0;j<K;j++){
				int r = N - i;
				if(rest > r * A[j]){
					sc += r;
					rest -= r * A[j];
					if(j == K-1) sc += r;
				} else {
					sc += rest/A[j];
					if(j == K-1) sc += rest/A[i];
					break;
				}
			}
			//Console.WriteLine("{0} {1}",i,sc);
			max = Math.Max(max,sc);
		}
		Console.WriteLine(max);

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

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


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

namespace CodeForces
{
    class Program
    {
        static void Main( string[] args )
        {
            string[] firstLine = Console.ReadLine().Split( ' ' );
            int N = int.Parse( firstLine[0] );
            int M = int.Parse( firstLine[1] );

            string[] piecesStrings = Console.ReadLine().Split( ' ' );
            int[] pieces = new int[M];
            for ( int n = 0; n < M; n++ )
            {
                pieces[n] = int.Parse( piecesStrings[n] );
            }

            Array.Sort( pieces );

            int minDiff = int.MaxValue;
            var chosen = new Dictionary<int, int>();

            for ( int n = 0; n < N; n++ )
            {
                if ( chosen.ContainsKey( pieces[n] ) )
                {
                    chosen[pieces[n]]++;
                }
                else
                {
                    chosen.Add( pieces[n], 1 );
                }
            }
            {
                int diff = chosen.Max( x => x.Key ) - chosen.Min( x => x.Key );
                if ( diff < minDiff )
                {
                    minDiff = diff;
                }
            }

            for ( int n = N; n < M; n++ )
            {
                if ( chosen.ContainsKey( pieces[n] ) )
                {
                    chosen[pieces[n]]++;
                }
                else
                {
                    chosen.Add( n, 1 );
                }
                chosen[pieces[n - N]]--;
                if ( chosen[pieces[n - N]] == 0 )
                {
                    chosen.Remove( pieces[n - N] );
                }

                int diff = chosen.Max( x => x.Key ) - chosen.Min( x => x.Key );
                if ( diff < minDiff )
                {
                    minDiff = diff;
                }
            }

            Console.WriteLine( minDiff );
        }
    }
}


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

class PairVariable : IComparable<PairVariable>
{
    public decimal a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = decimal.Parse(q[0]);
        b = decimal.Parse(q[1]);
    }
    public PairVariable(decimal a, decimal b)
    {
        this.a = a;
        this.b = b;
    }

    public int CompareTo(PairVariable other)
    {
        return this.a.CompareTo(other.a);
    }
}

namespace ConsoleApplication254
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            ulong a = ulong.Parse(ss[0]);
            ulong m = ulong.Parse(ss[1]);
            while (a <= 1000000000)
            {
                if (a % m == 0)
                {
                    Console.WriteLine("Yes");
                    return;
                }
                a += a % m;
            }
            Console.WriteLine("No");
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static void Main()
    {
        var am = Console.ReadLine().Split().Select(long.Parse).ToArray();
        var a = am[0];
        var m = am[1];
        var t = new List<long>();
        while (true)
        {
            var te = (a % m);
            if (te == 0L)
            {
                Console.WriteLine("Yes");
                return;
            }
            if (t.Contains(te))
            {
                Console.WriteLine("No");
                return;
            }
            a += te;
            t.Add(te);
        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static bool isPrime(int number)
        {
            if (number < 2) return false;
            for (int i = 2; i <= Math.Sqrt(number); i++)
            {
                if (number % i == 0) return false;
            }
            return true;
        }
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] s1 = s.Split(' ');
            int a = int.Parse(s1[0]);
            int m = int.Parse(s1[1]);
            int[] b = new int[100000];
            int j=1;
            bool c = false;
            for (int i = 2; i <= 100000; i++)
                if (isPrime(i))
                {
                    b[j] = i;
                    j++;
                }
            for (int i = 1; i<=j; i++)
                if (m == b[i])&&
                {
                    Console.WriteLine("No");
                    c = true;
                    break;
                }
            if (!c) Console.WriteLine("Yes");
        }
    }
}


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

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] input = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();

            long a = input[0],
                b = input[1];

            long res = 0;

            while (b - a != 1 && b - a != 0)
            {
                if (a < b)
                {
                    res++;

                    var t = b;
                    b = a;
                    a = t;

                    a -= b;

                    t = b;
                    b = a;
                    a = t;
                }
                else
                {
                    var @int = a / b;
                    res += @int;
                    a -= @int * b;
                }
            }

            res += b;

            Console.WriteLine(res);
        }
    }
}


using System;

namespace CSharp
{
    class _991C
    {
        public static void Main()
        {
            long n = long.Parse(Console.ReadLine());

            long l = 0;
            long r = n;

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

                long v = 0;
                long p = 0;
                long remaining = n;

                while (remaining > 0)
                {
                    if (remaining < m)
                    {
                        v += remaining;
                        remaining = 0;
                    }
                    else
                    {
                        v += m;
                        remaining -= m;
                    }

                    p += remaining / 10;
                    remaining = remaining - remaining / 10;
                }

                if (v < p)
                {
                    l = m + 1;
                }
                else
                {
                    r = m;
                }
            }

            Console.WriteLine(r);
        }
    }
}


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

namespace _197A
{
    class Program
    {

        public static int[] DoMas(string s, int c)
        {
            int[] mas = new int[c];

            int j = 0;
            string num = "";
            for (int f = 0; f < s.Length; f++)
            {
                while (s[f] != ' ')
                {
                    num = num + s[f];
                    f++;
                    if (f == s.Length)
                    {
                        break;
                    }
                }
                if (num != "")
                {
                    mas[j] = Convert.ToInt32(num);
                    j++;
                }
                num = "";
            }

            return mas;
        }
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int[] mas = DoMas(s, 3);
            int sq = mas[0] * mas[1];
            int sc = Convert.ToInt32(mas[2] * mas[2] * Math.PI);

            if ((sq / sc) % 2 == 0 | sq - sc < 0)
            {
                Console.WriteLine("Second");
            }
            else
            {
                Console.WriteLine("First");
            }

        }
    }
}


Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "codeforces 124 d2 qA", "codeforces 124 d2 qA\codeforces 124 d2 qA.csproj", "{B5C5AB1F-F537-4305-AD88-591CBFC08780}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|x86 = Debug|x86
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{B5C5AB1F-F537-4305-AD88-591CBFC08780}.Debug|x86.ActiveCfg = Debug|x86
		{B5C5AB1F-F537-4305-AD88-591CBFC08780}.Debug|x86.Build.0 = Debug|x86
		{B5C5AB1F-F537-4305-AD88-591CBFC08780}.Release|x86.ActiveCfg = Release|x86
		{B5C5AB1F-F537-4305-AD88-591CBFC08780}.Release|x86.Build.0 = Release|x86
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


using System;

namespace PerfectPair
{
    partial class PerfectPair
    {
        static void Main(string[] args)
        {
            long x, y, m, diff, diffX, diffY, temp, min = 0, max = 0, count = 0;

            x = NextLong();
            y = NextLong();
            m = NextLong();

            diffX = m - x;
            diffY = m - y;

            min = Math.Min(x, y);
            max = Math.Max(x, y);

            if ((min >= 0 && m < 0) || (max <= 0 && m > 0) || (max <= 0 && m > max))
                Console.WriteLine(-1);
            else if (max >= m)
                Console.WriteLine(0);
            else
            {
                while (true)
                {
                    diff = m - min;

                    if (m > 0 && max < diff)
                    {
                        count++;
                        temp = max;
                        max += min;
                        min = temp;

                        min = Math.Min(min, max);
                        max = Math.Max(temp, max);
                    }
                    else
                    {
                        Console.WriteLine(count + 1);
                        break;
                    }
                }
            }
        }
    }

    partial class PerfectPair
    {
        static string[] tokens = new string[0];
        static int cur_token = 0;

        static void ReadArray(char sep)
        {
            cur_token = 0;
            tokens = Console.ReadLine().Split(sep);
        }

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

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

        static int NextInt()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return tokens[cur_token++];
        }

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


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

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

            string[] tokens = Console.ReadLine().Split(' ');

            long   x=0, y=0, m = 0;
            x =long.Parse(tokens[0]);
            y = long.Parse(tokens[1]);
            m = long.Parse(tokens[2]);

            int p=mperfect(x, y, m);

            Console.WriteLine(p);
            Console.ReadLine();

        }

        protected static int mperfect(long x, long y, long m)
        {
            int i = 0;
            if (x < 0 && y < 0 && ((x < m) && (y < m)))
                return -1;
            else if ((x == 0 && y < 0 && (x < m && y < m)) || ((y == 0) && (x < 0) && (x < m && y < m)))
                return -1;
            else if (x == 0 && y == 0 && y < m)
                return -1;
            else
            {
                while (x < m && y < m)
                {
                    if (x < y)
                    {
                        x = x + y;
                        i++;
                        if (x >= m || y >= m)
                            return i;
                    }
                    else
                    {
                        y = x + y;
                        i++;
                        if (x >= m || y >= m)
                            return i;
                    }

                }

                return 0;

            }

        }
    }
}


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

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

            string[] tokens = Console.ReadLine().Split(' ');

            long   x=0, y=0, m = 0;
            x =long.Parse(tokens[0]);
            y = long.Parse(tokens[1]);
            m = long.Parse(tokens[2]);

            long p=mperfect(x, y, m);

            Console.WriteLine(p);
            Console.ReadLine();

        }

        protected static long mperfect(long x, long y, long m)
        {
            long i = 0;

            if (x >= m || y >= m)
                return 0;
            else if (x < 0 && y < 0 && ((x < m) && (y < m)))
                return -1;
            //else if ((x == 0 && y < 0 && (x < m && y < m)) || ((y == 0) && (x < 0) && (x < m && y < m)))
              //  return -1;
            else if (x == 0 && y == 0 && y < m)
                return -1;

            else
            {
                if (x < 0 && y > 0)
                {
                    i = -x / y;
                    x = x + y * i;
                }
                else if (y < 0 && x > 0)
                {
                    i = -y / x;
                    y = y + x * i;
                }

                while (x < m && y < m)
                {
                    if (x < y)
                    {
                        x = x + y;
                        i++;
                        if (x >= m || y >= m)
                            return i;
                    }
                    else
                    {
                        y = x + y;
                        i++;
                        if (x >= m || y >= m)
                            return i;
                    }

                }

                return i;

            }

        }
    }
}


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

namespace Testriep
{
    public class Program
    {

        public static void Main(string[] args)
        {
            var line=Console.ReadLine().Split(' ');
            var p = int.Parse(line[0]);
            var h = int.Parse(line[1]);
            if (h % 2 == 0)
            {
                h--;
            }
            while (h > p)
            {
                if (isGood(h,p))
                {
                    Console.WriteLine(h);
                    return;
                }
                h -= 2;
            }
            Console.WriteLine(-1);
            //Console.WriteLine(Console.ReadLine().Split(' ').Select(e => int.Parse(e)).Where(e => e != 0).Distinct().Count());
        }

        static bool isGood(int n,int p)
        {
           for(int i = 2; i <= p; i++)
            {
                if (n % i == 0)
                {
                    return false;
                }
            }
            return true;
        }}}


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

namespace Acyclic
{
    class B467
    {
        public static void Main()
        {
            string[] tmp = Console.ReadLine().Split(' ');
            double p = Int32.Parse(tmp[0]);
            int y = Int32.Parse(tmp[1]);

            int x = y;
            while(x!=p)
            {
                bool flag = true;
                int range = (int)Math.Max(p, Math.Floor(y / p));

                for (long i=2;i<=range;i++)
                {
                    int low = (int)Math.Min(p, Math.Floor((double)y / i));
                    if ((x % i) == 0)
                    {
                        if (x / i <= low)
                        {
                            flag = false;
                            break;
                        }

                    }
                }
                if(flag)
                {
                    Console.WriteLine(x);
                    return;
                }
                x--;
            }
            if (x == p) Console.WriteLine(-1);

        }
    }
}


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

namespace ProgrammingContest.Codeforces.Round39
{
    class B
    {
        public static void Main()
        {
            Scanner scanner = Scanner.FromConsole();
            long n = scanner.NextLong(), m = scanner.NextLong(),
                t = scanner.NextLong();
            long p = n * m;
            for(int i = 1; n > 0 && m > 0; i++)
            {

                if (i == t)
                {
                    long res = 0;
                    res += (n+1)/2;
                    //Console.WriteLine(res);
                    if(m%2 == 0) res += n-(n+1)/2;
                    else res += (n + 1) / 2;
                    //Console.WriteLine(res);
                    if(m-2 >0)
                    {
                        m -= 2;
                        res += (m - (m + 1) / 2) * 2;
                        //Console.WriteLine(res);
                    }
                    Console.WriteLine(res);
                    return;
                    //2 * x + 2 * y;
                }
                n -= 2; m -= 2;
            }
            Console.WriteLine(0);
        }

        #region Scanner
        public class Scanner : IDisposable
        {
            const int MAX_BUFFER_SIZE = 1024 * 1024 * 16;
            const string DELIMITER = " \r\n\t";

            System.IO.TextReader stream;
            int pos = 0, len = 0;
            bool endStream = false;
            int BufferSize = MAX_BUFFER_SIZE;
            char[] buffer = new char[MAX_BUFFER_SIZE];

            public enum Option { Buffering, NoBuffering }

            public Scanner(System.IO.TextReader stream, Option bufferingOption)
            {
                this.stream = stream;
                if (bufferingOption == Option.NoBuffering) BufferSize = 1;
            }

            void ReadBuffer()
            {
                pos = 0;
                len = stream.ReadBlock(buffer, 0, BufferSize);
                endStream = len == 0;
            }

            void SkipDelimiter()
            {
                while (!endStream && IsDelimiter(Peek())) NextChar();
            }

            static bool IsDelimiter(char c)
            {
                return DELIMITER.Contains(c);
            }

            bool Continue(char c)
            {
                return !endStream && !IsDelimiter(c);
            }

            char Peek()
            {
                if (pos >= len) ReadBuffer();
                return buffer[pos];
            }

            public char NextChar()
            {
                if (pos >= len) ReadBuffer();
                return buffer[pos++];
            }

            public string NextString()
            {
                SkipDelimiter();
                StringBuilder res = new StringBuilder();
                for (char c = NextChar(); Continue(c); c = NextChar()) res.Append(c);
                return res.ToString();
            }

            public int NextInt()
            {
                SkipDelimiter();
                int res = 0;
                char c = NextChar();
                int sign = 1;
                if (c == '-') { sign = -1; c = NextChar(); }
                for (; Continue(c); c = NextChar())
                    res = res * 10 + (c - '0');
                return sign * res;
            }

            public long NextLong()
            {
                SkipDelimiter();
                long res = 0;
                char c = NextChar();
                long sign = 1;
                if (c == '-') { sign = -1; c = NextChar(); }
                for (; Continue(c); c = NextChar())
                    res = res * 10 + (c - '0');
                return sign * res;
            }

            public int[] NextInts(int n)
            {
                int[] res = new int[n];
                for (int i = 0; i < n; i++) res[i] = NextInt();
                return res;
            }

            public long[] NextLongs(int n)
            {
                long[] res = new long[n];
                for (int i = 0; i < n; i++) res[i] = NextLong();
                return res;
            }

            public string[] NextStrings(int n)
            {
                string[] res = new string[n];
                for (int i = 0; i < n; i++) res[i] = NextString();
                return res;
            }

            public static Scanner FromString(string s)
            {
                return new Scanner(new System.IO.StreamReader(new System.IO.MemoryStream(Encoding.ASCII.GetBytes(s))), Option.Buffering);
            }

            public static Scanner FromFile(string path)
            {
                return new Scanner(new System.IO.StreamReader(path), Option.Buffering);
            }

            public static Scanner FromConsole()
            {
                return new Scanner(Console.In, Option.Buffering);
            }

            public void Dispose()
            {
                stream.Close();
            }
        }
        #endregion
    }
}


using System;

class Program
{
    static void Main()
    {
        string[] inp = Console.In.ReadToEnd().Split(' ', '\n');
        int n = int.Parse(inp[0]),
            m = int.Parse(inp[1]),
            x = int.Parse(inp[2]);
        int[,] t = new int[n, m];
        int k = 0;
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < m; j++)
            {
                if ((i + j) % 2 == 0)
                {
                    if(Math.Min(i, Math.Min(n - i - 1, Math.Min(j, n - j - 1))) + 1 == x)
                        k++;
                }
            }
        }
        Console.WriteLine(k);
    }
}


using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
class Solve{
    public Solve(){}
    StringBuilder sb;
    ReadData re;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        re = new ReadData();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        int K = re.i();
        int A = 0;
        for(int i=0;i<K;i++){
            A = Math.Max(A,re.i());
        }
        int count = A-25;
        sb.Append(count+"\n");
    }
}
class ReadData{
    string[] str;
    int counter;
    public ReadData(){
        counter = 0;
    }
    public string s(){
        if(counter == 0){
            str = Console.ReadLine().Split(' ');
            counter = str.Length;
        }
        counter--;
        return str[str.Length-counter-1];
    }
    public int i(){
        return int.Parse(s());
    }
    public long l(){
        return long.Parse(s());
    }
    public double d(){
        return double.Parse(s());
    }
    public int[] ia(int N){
        int[] ans = new int[N];
        for(int j=0;j<N;j++){
            ans[j] = i();
        }
        return ans;
    }
    public int[] ia(){
        str = Console.ReadLine().Split(' ');
        counter = 0;
        int[] ans = new int[str.Length];
        for(int j=0;j<str.Length;j++){
            ans[j] = int.Parse(str[j]);
        }
        return ans;
    }
    public long[] la(int N){
        long[] ans = new long[N];
        for(int j=0;j<N;j++){
            ans[j] = l();
        }
        return ans;
    }
    public long[] la(){
        str = Console.ReadLine().Split(' ');
        counter = 0;
        long[] ans = new long[str.Length];
        for(int j=0;j<str.Length;j++){
            ans[j] = long.Parse(str[j]);
        }
        return ans;
    }
    public double[] da(int N){
        double[] ans = new double[N];
        for(int j=0;j<N;j++){
            ans[j] = d();
        }
        return ans;
    }
    public double[] da(){
        str = Console.ReadLine().Split(' ');
        counter = 0;
        double[] ans = new double[str.Length];
        for(int j=0;j<str.Length;j++){
            ans[j] = double.Parse(str[j]);
        }
        return ans;
    }
    public List<int>[] g(int N,int[] f,int[] t){
        List<int>[] ans = new List<int>[N];
        for(int j=0;j<N;j++){
            ans[j] = new List<int>();
        }
        for(int j=0;j<f.Length;j++){
            ans[f[j]].Add(t[j]);
            ans[t[j]].Add(f[j]);
        }
        return ans;
    }
    public List<int>[] g(int N,int M){
        List<int>[] ans = new List<int>[N];
        for(int j=0;j<N;j++){
            ans[j] = new List<int>();
        }
        for(int j=0;j<M;j++){
            int f = i()-1;
            int t = i()-1;
            ans[f].Add(t);
            ans[t].Add(f);
        }
        return ans;
    }
    public List<int>[] g(){
        int N = i();
        int M = i();
        List<int>[] ans = new List<int>[N];
        for(int j=0;j<N;j++){
            ans[j] = new List<int>();
        }
        for(int j=0;j<M;j++){
            int f = i()-1;
            int t = i()-1;
            ans[f].Add(t);
            ans[t].Add(f);
        }
        return ans;
    }
}
public static class Define{
    public const long mod = 1000000007;
}
public static class Debug{
    public static void Print(double[,,] k){
        for(int i=0;i<k.GetLength(0);i++){
            for(int j=0;j<k.GetLength(1);j++){
                for(int l=0;l<k.GetLength(2);l++){
                    Console.Write(k[i,j,l]+" ");
                }
                Console.WriteLine();
            }
            Console.WriteLine();
        }
    }
    public static void Print(double[,] k){
        for(int i=0;i<k.GetLength(0);i++){
            for(int j=0;j<k.GetLength(1);j++){
                Console.Write(k[i,j]+" ");
            }
            Console.WriteLine();
        }
    }
    public static void Print(double[] k){
        for(int i=0;i<k.Length;i++){
            Console.WriteLine(k[i]);
        }
    }
    public static void Print(long[,,] k){
        for(int i=0;i<k.GetLength(0);i++){
            for(int j=0;j<k.GetLength(1);j++){
                for(int l=0;l<k.GetLength(2);l++){
                    Console.Write(k[i,j,l]+" ");
                }
                Console.WriteLine();
            }
            Console.WriteLine();
        }
    }
    public static void Print(long[,] k){
        for(int i=0;i<k.GetLength(0);i++){
            for(int j=0;j<k.GetLength(1);j++){
                Console.Write(k[i,j]+" ");
            }
            Console.WriteLine();
        }
    }
    public static void Print(long[] k){
        for(int i=0;i<k.Length;i++){
            Console.WriteLine(k[i]);
        }
    }
    public static void Print(int[,,] k){
        for(int i=0;i<k.GetLength(0);i++){
            for(int j=0;j<k.GetLength(1);j++){
                for(int l=0;l<k.GetLength(2);l++){
                    Console.Write(k[i,j,l]+" ");
                }
                Console.WriteLine();
            }
            Console.WriteLine();
        }
    }
    public static void Print(int[,] k){
        for(int i=0;i<k.GetLength(0);i++){
            for(int j=0;j<k.GetLength(1);j++){
                Console.Write(k[i,j]+" ");
            }
            Console.WriteLine();
        }
    }
    public static void Print(int[] k){
        for(int i=0;i<k.Length;i++){
            Console.WriteLine(k[i]);
        }
    }
}


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

namespace CodeForces
{
    public static class MainClass
    {

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

        static void ReadInt(ref int a)
        {
            a = ReadIntArrayLine()[0];
        }

        static void ReadInts(ref int a, ref int b)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1];
        }

        static void ReadInts(ref int a, ref int b, ref int c)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d, ref int e)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3]; e = x[4];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d, ref int e, ref int f)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3]; e = x[4]; f = x[5];
        }

        static int[] ReadIntArrayLine()
        {
            char[] sep = { ' ' };
            return Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        static void PrintLn(object obj)
        {
            Console.WriteLine(obj.ToString());
        }

        public static string Reverse(string s)
        {
            char[] charArray = s.ToCharArray();
            Array.Reverse(charArray);
            return new string(charArray);
        }

        public static void PrintLnCollection<T>(IEnumerable<T> col)
        {
            PrintLn(string.Join(" ", col));
        }

        public static void PrintLn(params object[] v)
        {
            PrintLnCollection(v);
        }

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

        public static string MySubstring(this string str, int start, int finish)
        {
            if (start > finish) return "";
            return str.Substring(start, finish - start + 1);
        }

        public static bool IsInRange(this int a, int lb, int ub)
        {
            return (a >= lb) && (a <= ub);
        }

        private static void mergeDS(int i, int j, int[] a)
        {
            int t = a[j];
            for (int ii = 0; ii < a.Length; ii++)
            {
                if (a[ii] == t)
                    a[ii] = a[i];
            }
        }

        private static T MyMax<T>(params T[] a)
        {
            return a.Max();
        }

        private static T MyMin<T>(params T[] a)
        {
            return a.Min();
        }

        private static int[] GetPrimesLessThan(int x)
        {
            if (x < 2)
                return new int[0];

            int[] a = new int[x];

            a[0] = 1; a[1] = 1;

            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] == 0)
                    for (int j = 2 * i; j < a.Length; j += i)
                    {
                        a[j] = 1;
                    }
            }

            var abc = new List<int>(x);

            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] == 0)
                    abc.Add(i);
            }

            return abc.ToArray();
        }

        private static int FindNearestLEQElementInTheArray(int[] a, int startIndex, int endIndex, int target)
        {
            if (startIndex == endIndex)
            {
                if (a[startIndex] <= target)
                    return startIndex;
                else
                    return -1;
            }

            if (startIndex + 1 == endIndex)
            {
                if (a[endIndex] <= target)
                    return endIndex;
                else if (a[startIndex] <= target)
                    return startIndex;
                else
                    return -1;
            }

            int mid = (startIndex + endIndex) / 2;
            if (target == a[mid])
                return mid;
            else if (target < a[mid])
                return FindNearestLEQElementInTheArray(a, startIndex, mid - 1, target);
            else
                return FindNearestLEQElementInTheArray(a, mid, endIndex, target);
        }

        private static int FindNearestLEQElementInTheArray(int[] a, int target)
        {
            return FindNearestLEQElementInTheArray(a, 0, a.Length - 1, target);
        }

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

        //----------------------------------------------------------------------------

        static string GetSha1(string filePath)
        {
            using (FileStream fs = new FileStream(filePath, FileMode.Open))
            using (BufferedStream bs = new BufferedStream(fs))
            {
                using (SHA1Managed sha1 = new SHA1Managed())
                {
                    byte[] hash = sha1.ComputeHash(bs);
                    StringBuilder formatted = new StringBuilder(2 * hash.Length);
                    foreach (byte b in hash)
                    {
                        formatted.AppendFormat("{0:X2}", b);
                    }

                    return formatted.ToString();
                }
            }
        }

        static bool canFit(int a1, int b1, int a2, int b2)
        {
            int[] r1 = { a1, b1 };
            int[] r2 = { a2, b2 };

            Array.Sort(r1);
            Array.Sort(r2);

            bool ans = (r1[0] <= r2[0]) && (r1[1] <= r2[1]);

            return ans;

        }

        static Dictionary<int, int> dcnt = new Dictionary<int, int>();

        static int cntd(int x)
        {
            if (x == 1) return 1;

            if (dcnt.ContainsKey(x))
                return dcnt[x];

            int ans = 0;
            for (int i = 1; i <= x/2; i++)
            {
                if (x % i == 0)
                    ans++;
            }

            ans++;
            dcnt[x] = ans;
            return ans;
        }

        static void Main(string[] args)
        {

            int[] a = ReadIntArrayLine();

            int ans = 0;
            for (int i = 1; i <= a[0]; i++)
                for (int j = 1; j <= a[1]; j++)
                    for (int k = 1; k <= a[2]; k++)
                    {
                        if (dcnt.ContainsKey(i * j * k)) ans = (ans+ dcnt[i * j * k])% 1073741824;
                        else
                        {
                            ans = (ans+cntd(i*j*k)) % 1073741824;
                        }
                    }

            PrintLn(ans);
        }

        private static int cntdp(int i, int j)
        {
            if (dcnt.ContainsKey(i * j))
                return dcnt[i * j];

            int d = gcd(i, j);

            int a = i / d;
            int b = j / d;

            int temp = dcnt[i * j] = cntd(a) * cntd(b * d * d);

            return temp;

        }
    }
}


using System;

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            var s1 = s.Split(' ');
            long r =0;
            long n = long.Parse(s1[0]);
            long a = long.Parse(s1[1]);
            long b = long.Parse(s1[2]);
            long c = long.Parse(s1[3]);
            if (n % 4 == 0)
                r = 0;
            else
            {
                if (n % 4 == 1)
                {
                    if (c < 3 * a || c < a + b)
                        r = c;
                    else
                    {
                        if (3 * a < c || 3 * a < a + b)
                            r = 3 * a;
                        else
                            r = a + b;
                    }
                }
                else
                {
                    if (n % 4 == 2)
                    {
                        if (b < 2 * a || b < 2 * c)
                            r = b;
                        else
                        {
                            if (2 * a < b || 2 * a < 2 * c)
                                r = 2 * a;
                            else
                                r = 2 * c;
                        }
                    }
                    else
                    {
                        if (a < 3 * c || a < c + b)
                            r = a;
                        else
                        {
                            if (3 * c < a || 3 * c < c + b)
                                r = 3 * c;
                            else
                                r = c + b;
                        }
                    }
                }
            }
                Console.WriteLine(r);
            Console.ReadLine();
        }
    }
}


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

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

            int a, b, c,n = 0;

            string all_nums = Console.ReadLine();

            String[] numbers = new String[4];
            numbers=all_nums.Split(',');

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

            int to_buy = 4 - ((n) % 4);

            if (n < 4)
                to_buy = 4 - n;

            if (to_buy == 0 || to_buy %4==0)
                Console.WriteLine(0);

            if(to_buy==1)

                Console.WriteLine(a);
            if(to_buy==2)
            {
                int x = 2 * a;
                int y = b;
                if (x > y)
                    Console.WriteLine(y);
                else
                    Console.WriteLine(x);
            }

            if(to_buy==3)
            {

                int x = 3*a;
                int y=a+b;
                int z=c;
                int h=b+(2*a);

                int min=x;

                if(y<min)
                    min=y;
                if(z<min)
                    min=z;

                if(h<min)
                    min=h;

                Console.WriteLine(min.ToString());

            }

        }
    }
}


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

namespace Ejercicio5
{
    class Program
    {
        static void Main(string[] args)
        {
            double n;
            double k;
            int numberNotebooks;

            n = Convert.ToDouble(Console.ReadLine());
            k = Convert.ToDouble(Console.ReadLine());

            if (n>=1 && k<=Math.Pow(10, 8))
            {
                numberNotebooks = getNumberOfSheets(n, k);

                Console.WriteLine(numberNotebooks);
            }
        }

        public static int getNumberOfSheets(double n, double k)
        {
            int neededSheets;
            int red;
            int green;
            int blue;

            red = (int)Math.Ceiling(Convert.ToDecimal((2 * n) / k));
            green = (int)Math.Ceiling(Convert.ToDecimal((5 * n) / k));
            blue = (int)Math.Ceiling(Convert.ToDecimal((8 * n) / k));

            neededSheets = red + green + blue;

            return neededSheets;
        }
    }
}


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 m = int.Parse(Console.ReadLine());

        var z = n;

        var res = 0;

        while (z<=m)
        {
            if (z == m)
            {
                Console.WriteLine("YES");
                Console.WriteLine(res);
                return;
            }

            res++;
            z *= n;
        }

        Console.WriteLine("NO");
    }
}


using System;

namespace WrongSubtraction
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = new int[2];
            arr = Array.ConvertAll(Console.ReadLine().Split(' '), arTemp => Convert.ToInt32(arTemp));
            int r;
            while (arr[1] > 0) {
                r = arr[0]%10;
                if (r > 0)
                {
                    if (r <= arr[1])
                    {
                        arr[0] -= r;
                        arr[1] -= r;
                    }
                }
                else
                {
                    arr[0]/=10;
                    arr[1]--;
                }

            }
             Console.WriteLine(arr[0]);
            }
        }
    }


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

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜

namespace dd
{
	class MainClass
	{
		const long MOD = 1000 * 1000 * 1000 + 7;

		public static long BinPow(long a , long b)
		{
			if (b == 0)
				return 1;
			if (b % 2 == 0)
			{
				long Q = BinPow(a, b / 2); Q %= MOD;
				return (Q * Q) % MOD;
			}
			return ((BinPow(a, b - 1) % MOD) * a) % MOD;
		}

		public static void Main(string[] args)
		{
			long n = Reader.NextLong();
			long m = Reader.NextLong();
			long k = Reader.NextLong();
			long ans = 0;
			if (k == -1 && (n % 2 != m % 2))
			{
				Console.WriteLine(ans);
				return;
			}
			else
			{
				n = (n - 1) * (m - 1);
				ans = BinPow(2, n);
				Console.WriteLine(ans);
			}
		}

		class Reader
		{
			public static int NextInt()
			{
				int cnt = 0, sign = 1;
				char ch = Convert.ToChar(Console.Read());
				while (!(ch >= '0' && ch <= '9') && ch != '-')
					ch = Convert.ToChar(Console.Read());
				if (ch == '-')
				{
					sign = -1;
					ch = Convert.ToChar(Console.Read());
				}
				while (ch >= '0' && ch <= '9')
				{
					int t = Convert.ToInt32(ch);
					cnt = cnt * 10 + ch - '0';
					ch = Convert.ToChar(Console.Read());
				}
				return cnt * sign;
			}
			public static long NextLong()
			{
				long cnt = 0, sign = 1;
				char ch = Convert.ToChar(Console.Read());
				while (!(ch >= '0' && ch <= '9') && ch != '-')
					ch = Convert.ToChar(Console.Read());
				if (ch == '-')
				{
					sign = -1;
					ch = Convert.ToChar(Console.Read());
				}
				while (ch >= '0' && ch <= '9')
				{
					long t = Convert.ToInt64(ch);
					cnt = cnt * 10 + ch - '0';
					ch = Convert.ToChar(Console.Read());
				}
				return cnt * sign;
			}
		}
	}
}


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

namespace Codeforces_235_2
{
    class Program
    {
        static void Main(string[] args)
        {
            long n, m, t, ret = 0;
            string[] d = Console.ReadLine().Split(' ');
            n = d[0].Length;
            long.TryParse(d[1], out m);
            int[] N = new int[10];
            for (int i = 0; i < n; ++i) ++N[ d[0][i] - '0' ];
            t = m;
            do
            {
                string s = t.ToString();
                int L = s.Length;
                if (L > n) break;
                if (L == n)
                {
                    int[] T = new int[10];
                    for (int i = 0; i < n; ++i) ++T[s[i] - '0'];
                    if (N[0] == T[0] && N[1] == T[1] && N[2] == T[2] && N[3] == T[3] && N[4] == T[4] && N[5] == T[5]
                         && N[6] == T[6] && N[7] == T[7] && N[8] == T[8] && N[9] == T[9]) ++ret;
                }
                t += m;
            } while (true);
            Console.WriteLine(ret);
        }
    }
}


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

namespace ConsoleApp1
{
    public class UserInput
    {
        public static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int k = int.Parse(Console.ReadLine());

            for (int i = 0; i < k; i++)
            {
                if (n % 10 != 0)
                {
                    n -= 1;
                }
                else
                {
                    n /= 10;
                }
            }

            Console.WriteLine(n);
        }
    }
}


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

namespace Learning
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Split(' ');
            var al = Int32.Parse(line[0]);
            var ar = Int32.Parse(line[1]);
            line = Console.ReadLine().Split(' ');
            var bl = Int32.Parse(line[0]);
            var br = Int32.Parse(line[1]);
            if (bl >= ar-1 && bl <= ar + 3)
            {
                Console.Out.WriteLine("YES");
                return;
            }
            if(br >= al-1 && br <= al + 3)
            {
                Console.Out.WriteLine("YES");
                return;
            }
            Console.Out.WriteLine("NO");
            //Console.ReadLine();
        }

    }
}


using System;

namespace CodeForces9
{
	class Program
	{
		static void Main(string[] args)
		{
			long[] data = Array.ConvertAll(Console.ReadLine().Split(' '), a => long.Parse(a));
			long min, max, boy;
			int n = (int)data[0];
			int m = (int)data[1];
			long k = data[2];
			int x = (int)data[3];
			int y = (int)data[4];
			if (n==1)
			{
				max = k / (n * m) + (k % m > 0 ? 1 : 0);
				min = k / (n * m);
				boy = k / m + y % m;
			}
			if (n==2)
			{
				max = k / (n * m) + (k % m > 0 ? 1 : 0);
				min = k / (n * m);
				boy = k / (n * m) + (k % (n * m) >= (x - 1) * m + y ? 1 : 0);
			}
			else
			{
				long cicl = k / ((2 * n - 2) * m); //количество циклов, где по 1 проходу у краев и по два у центров
				k -= cicl * ((2 * n - 2) * m);
				int lastplace = (int)k % m;
				lastplace = lastplace == 0 ? m : lastplace;
				min = cicl + k / (n * m) + (lastplace == 100 && k / (n * m) == 0 ? 1 : 0);
				max = 2 * cicl + (k > m ? 1 : 0) + (k - n * m > 0 ? 1 : 0);
				boy = (x == 1 | x == n ? cicl : 2 * cicl) + (k / ((x - 1) * m + y) > 0 ? 1 : 0) + (k >= ((2 * n - x) * m + y) && x < n ? 1 : 0);
			}

			Console.WriteLine($"{max} {min} {boy}");

		}
	}
}


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

    public class Solver
    {
        public void Solve()
        {
            var n = sc.Integer();
            var T = sc.Integer();
            var a = sc.Long(n);
            long ans = 0;
            if (n * T <= 100000)
            {
                ans = Algorithm.LNDS(a, T);
                Debug.WriteLine(ans);
            }
            else
            {
                var s = a.Distinct().ToList();
                s.Add(-1);
                s.Sort();
                for (int i = 0; i < n; i++)
                    a[i] = s.BinarySearch(a[i]);
                var m = s.Count;

                var DP = Enumerate(m + 1, x => new int[m, m]);
                for (int i = 0; i < m; i++)
                    for (int j = i; j < m; j++)
                    {
                        DP[0][i, j] = 0;
                        var dp = Enumerate(m * m + 100, x => 1L << 60);
                        for (int k = 0; k < m; k++)
                        {
                            foreach (var x in a)
                            {
                                if (x  j) continue;
                                dp[dp.UpperBound(x)] = x;
                            }
                            DP[k + 1][i, j] = dp.LowerBound(1L << 60);
                        }
                    }
                long max = 0;
                for (int i = 0; i < m; i++)
                    max = Math.Max(max, DP[1][i, i]);
                var to = new int[m];
                for (int i = 0; i < m; i++)
                {
                    foreach (var x in a)
                        if (x == i) to[i]++;
                }
                for (int i = 1; i < m; i++)
                    to[i] = Math.Max(to[i], to[i - 1]);
                for (int i = 1; i <= m; i++)
                {
                    for (int j = 0; j < m; j++)
                    {
                        for (int k = j; k < m; k++)
                        {
                            var cost = DP[i][j, k];
                            var rem = T - i;
                            max = Math.Max(max, cost + rem * to[k]);
                        }
                    }
                }
                ans = Math.Max(ans, max);

            }
            IO.Printer.Out.WriteLine(ans);
        }
        public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
        static T[] Enumerate<T>(int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }
        static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
    }

}

#region main
static class Ex
{
    static public string AsString(this IEnumerable<char> ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }
    static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
    static public void Main()
    {
        var solver = new Program.Solver();
        solver.Solve();
        Program.IO.Printer.Out.Flush();
    }
}
#endregion
#region Ex
namespace Program.IO
{
    using System.IO;
    using System.Text;
    using System.Globalization;
    public class Printer : StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, T[] source) { base.Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, T[] source) { base.WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(Stream stream) { str = stream; }
        public readonly Stream str;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }
        private byte read()
        {
            if (isEof) return 0;
            if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while ((b < 33 || 126 = 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }
        public string ScanLine()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b != '\n'; b = (char)read())
                if (b == 0) break;
                else if (b != '\r') sb.Append(b);
            return sb.ToString();
        }
        public long Long()
        {
            if (isEof) return long.MinValue;
            long ret = 0; byte b = 0; var ng = false;
            do b = read();
            while (b != 0 && b != '-' && (b < '0' || '9' < b));
            if (b == 0) return long.MinValue;
            if (b == '-') { ng = true; b = read(); }
            for (; true; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                else ret = ret * 10 + b - '0';
            }
        }
        public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }
        public double Double() { var s = Scan(); return s != "" ? double.Parse(Scan(), CultureInfo.InvariantCulture) : double.NaN; }
        private T[] enumerate<T>(int n, Func<T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f();
            return a;
        }

        public char[] Char(int n) { return enumerate(n, Char); }
        public string[] Scan(int n) { return enumerate(n, Scan); }
        public double[] Double(int n) { return enumerate(n, Double); }
        public int[] Integer(int n) { return enumerate(n, Integer); }
        public long[] Long(int n) { return enumerate(n, Long); }
    }
}
#endregion
#region LIS long[]
static public partial class Algorithm
{
    /// Strictly Increasing SubSequence
    static public int LIS(this long[] a)
    {
        const long max = 1L << 60;
        var n = a.Length;
        var dp = new long[n + 1];
        for (int i = 0; i <= n; i++)
            dp[i] = max;
        foreach (var v in a)
            dp[dp.LowerBound(v)] = v;
        return dp.LowerBound(max);
    }
    /// Longest NonDecreasing SubSequence
    static public int LNDS(this long[] a, int T)
    {
        const long max = 1L << 60;
        var n = a.Length;
        var dp = new long[n * T + 1];
        for (int i = 0; i < dp.Length; i++)
            dp[i] = max;
        for (int i = 0; i < T; i++)
        {
            foreach (var v in a)
                dp[dp.UpperBound(v)] = v;
        }
        return dp.LowerBound(max);
    }
}
#endregion
#region BinarySearch for long[]
static public partial class Algorithm
{

    static public int LowerBound(this long[] arr, long v)
    {
        int l = 0, h = arr.Length - 1;
        while (l <= h)
        {
            int m = ((h + l) >> 1);
            if (arr[m] < v) l = m + 1;
            else h = m - 1;
        }
        return l;
    }
    static public int UpperBound(this long[] a, long v)
    {
        int l = 0, h = a.Length - 1;
        while (l <= h)
        {
            int m = ((h + l) >> 1);
            if (a[m] <= v) l = m + 1;
            else h = m - 1;
        }
        return l;
    }

}
#endregion


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

namespace Symmetric_and_Transitive
{
    internal class Program
    {
        private const int mod = 1000000007;
        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 readonly long[] a = new long[4001];

        private static long A(int n)
        {
            if (n == 1)
                return 1;
            if (n == 2)
                return 3;

            if (a[n] == 0)
                a[n] = (3*A(n - 1) + A(n - 2))%mod;
            return a[n];
        }

        private static void Main(string[] args)
        {
            int n = Next();
            writer.WriteLine(A(n)%mod);
            writer.Flush();
        }

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


using System;
class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            char[] dt = {'H', 'Q', 9' };
            for (int i = 0; i < 3; ++i)
                if (input.IndexOf(dt[i]) >= 0) { dt[0] = 's'; break; }
            Console.WriteLine(dt[0] == 's' ?"YES":"NO");
        }
    }


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

namespace PracticeForDummies
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            for (int i = 0; i < str.Length; i++)
            {
                if (str.Contains("H")|| str.Contains("Q") || str.Contains("9" )
                {
                    Console.WriteLine("YES");
                    break;
                }

                else
                {
                    Console.WriteLine("NO");
                    break;
                }
            }

        }
    }
}


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

namespace contest
{

    class contest
    {

        static void Main(string[] args)
        {

            //int n = int.Parse(Console.ReadLine());
            //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int a = num[0];
            int target = num[1];
            int dif = num[2];

            if (a == target) Console.WriteLine("YES");
            else if (dif == 0) Console.WriteLine("NO");
            else if (target < a && dif > 0) Console.WriteLine("NO");
            else if ((target - a) % dif == 0) Console.WriteLine("YES");
            else Console.WriteLine("NO");

            //Console.WriteLine();

            ・//Console.Read();

        }

    }

}


using System;
using System.Linq;

class Program
{
    static void Main()
    {
        string inputString = Console.ReadLine();

        int n = inputString.Length;

        var firstString = inputString.Take(n / 2).ToArray();
        var secondString = inputString.Skip(n / 2 + 1).ToArray();

        firstString = firstString.Reverse().ToArray();

        int cnt = firstString.Where((t, i) => t != secondString[i]).Count();

        Console.WriteLine(cnt != 1 ? "NO" : "YES");
    }
}


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

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    double Fun(double x, double y, double z)
    {
        return z * Math.Log(y) + Math.Log(Math.Log(x));
    }

    double Fun2(double x, double y, double z)
    {
        return Math.Log(y) + Math.Log(z) + Math.Log(Math.Log(x));
    }

    double Fun3(double x, double y, double z)
    {
        return Math.Pow(x, Math.Pow(y, z));
    }

    double Fun4(double x, double y, double z)
    {
        return Math.Pow(Math.Pow(x, y), z);
    }

    public void Solve()
    {
        double x = ReadDouble();
        double y = ReadDouble();
        double z = ReadDouble();

        double max = double.MinValue;
        string ans = "";
        Action<double, string> act = (v, s) =>
        {
            if (v > max)
            {
                max = v;
                ans = s;
            }
        };
        if (x <= 1 && y <= 1 && z <= 1)
        {
            act(Fun3(x, y, z), "x^y^z");
            act(Fun3(x, z, y), "x^z^y");
            act(Fun4(x, y, z), "(x^y)^z");
            act(Fun4(x, z, y), "(x^z)^y");
            act(Fun3(y, x, z), "y^x^z");
            act(Fun3(y, z, x), "y^z^x");
            act(Fun4(y, x, z), "(y^x)^z");
            act(Fun4(y, z, x), "(y^z)^x");
            act(Fun3(z, x, y), "z^x^y");
            act(Fun3(z, y, x), "z^y^x");
            act(Fun4(z, x, y), "(z^x)^y");
            act(Fun4(z, y, x), "(z^y)^x");
            Write(ans);
            return;
        }

        if (x > 1)
        {
            act(Fun(x, y, z), "x^y^z");
            act(Fun(x, z, y), "x^z^y");
            act(Fun2(x, y, z), "(x^y)^z");
            act(Fun2(x, z, y), "(x^z)^y");
        }
        if (y > 1)
        {
            act(Fun(y, x, z), "y^x^z");
            act(Fun(y, z, x), "y^z^x");
            act(Fun2(y, x, z), "(y^x)^z");
            act(Fun2(y, z, x), "(y^z)^x");
        }
        if (z > 1)
        {
            act(Fun(z, x, y), "z^x^y");
            act(Fun(z, y, x), "z^y^x");
            act(Fun2(z, x, y), "(z^x)^y");
            act(Fun2(z, y, x), "(z^y)^x");
        }

        Write(ans);
    }

    #region Main

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

    #endregion

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


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

namespace ConsoleApplication1
{
    class Program
    {
        static int A, M, prod;
        static bool found = false;
        static string[] read;

        static void Main(string[] args)
        {
            read = Console.ReadLine().Split();
            A = Convert.ToInt32(read[0]);
            M = Convert.ToInt32(read[1]);

            while (A <= 2000000000)
            {
                prod = A % M;
                A += prod;

                if (prod == 0)
                {
                    found = true;
                    break;
                }
            }

            if(found)
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");

            Console.ReadKey();
        }

    }
}


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

namespace Achill
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] nd = Console.ReadLine().Split().Select(item => int.Parse(item)).ToArray();
            List<int> t = Console.ReadLine().Split().Select(item => int.Parse(item)).ToList();
            int res = 0, cur = 0, i = 0;
            while(i < nd[0] && cur <= nd[1] - 10)
            {
                cur += t[i];
                cur += 10;
                res += 2;
                ++i;
            }
            cur += t[i];
            Console.WriteLine(i == nd[0]-1 ? res + (nd[1]-cur)/5 : -1);
        }
    }
}


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

   public class C
    {
          static  bool checkOk(int s , int [] inputs)
        {
            int c = inputs[s*4];
            for(int i = 0;i<4; i++)
            {
                if (c != inputs[s * 4 + i])
                    return false;
            }

            return true;
        }

        static bool  checkRotation(int [,] arr, int [] inp ,int aindex )
        {

            int[] farr = new int[8];
            int[] sarr = new int[8];
            int fp=0, sp = 0;
            for(int  i = 1; i < 9; i++)
            {
                farr[fp++] =  inp[arr[aindex,i]];
                sarr[sp++] = inp[arr[aindex+1, i]];
            }

            bool  checkR = false;
            for(int  i = 0; i < 8; i++)
            {
                if (farr[i] != sarr[(i + 2) % 8])
                    checkR=true;

            }

            if (!checkR)
                return true;

            for (int i = 0; i < 8; i++)
            {
                if (farr[i] != sarr[(i - 2+8) % 8])
                    return false;

            }

            return true;
        }

        static void Main(string[] args)
        {
            int[,] arr = { { 0, 12, 13,4,5,16,17,20,21 },{ 2,14,15,6,7,18,19,22,23}, { 1,1,0,12,14,10,11,23,21 }, { 5,3,2,13,15,8,9,18,16}, { 3, 0,2,4,6,8,10,23,21} ,{ 4,1,3,5,7,9,11,22,20} };

            string inp = Console.ReadLine();
            int[] inputs = new int[24];
            string[] splits = inp.Split(' ');

            for(int i  =0; i < 24; i++)
            {
                inputs[i] = int.Parse(splits[i]);
            }
            bool isPoss = false;
            for(int  i =0; i<6; i+=2)
            {
                if(checkOk(arr[i,0], inputs) && checkOk(arr[i+1, 0], inputs))
                {

                 isPoss  =  checkRotation(arr, inputs, i);
                    break;
                }

            }
            if(isPoss)
                        Console.Write("YES");
                    else
                        Console.Write("NO");

        }
    }


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

namespace Codeforces
{
    internal class Program
    {
        private static void Main()
        {
            if (Debugger.IsAttached)
            {
                Console.SetIn(new StreamReader(@"..\..\..\..\Tests\D3.in"));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                Console.ReadLine();
            }
        }

        private static void Solve()
        {
            var s = Read();
            var intF = new int[10];
            var intS = new int[10];
            foreach (var n in s)
            {
                intF[n - '0']++;
                intS[n - '0']++;
            }
            var res = 0;
            var max = 0;
            var maxIndex = -1;
            for (int i = 0; i < 10; i++)
            {
                var j = (10 - i)%10;
                if(intF[i] > 0 && intS[j] > 0)
                {
                    intF[i]--;
                    intS[j]--;
                    res++;
                    for (int k = 0; k < 10; k++)
                    {
                        res += Math.Min(intF[k], intS[9 - k]);
                    }
                    intF[i]++;
                    intS[j]++;
                }
                if(max < res)
                {
                    max = res;
                    maxIndex = i;
                }
            }
            intF[maxIndex]--;
            intS[(10 - maxIndex)%10]--;
            var resF = new StringBuilder();
            var resS = new StringBuilder();
            resF.Append(maxIndex);
            resS.Append((10 - maxIndex)%10);
            for (int i = 0; i < 10; i++)
            {
                var count = Math.Min(intF[i], intS[9 - i]);
                resF.Append(i.ToString()[0], count);
                resS.Append((9-i).ToString()[0], count);
                intF[i] -= count;
                intS[9 - i] -= count;
            }
            resF.Insert(0, "0", intF[0]);
            resS.Insert(0, "0", intS[0]);
            for (int i = 1; i < 10; i++)
            {
                resF.Append(i.ToString()[0], intF[i]);
                resS.Append(i.ToString()[0], intS[i]);
            }

            Console.WriteLine(new string(resF.ToString().Reverse().ToArray()));
            Console.WriteLine(new string(resS.ToString().Reverse().ToArray()));
        }

        #region Reader

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

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static int[] ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToArray();
            return input;
        }

        private static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }

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

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}