//

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

namespace sar_cs
{
    static class Helpers
    {
        // Mono lacks this override of string.Join()
        public static string Join<T>(this IEnumerable<T> objs, string sep)
        {
            var sb = new StringBuilder();
            foreach (var s in objs) { if (sb.Length != 0) sb.Append(sep); sb.Append(s); }
            return sb.ToString();
        }

        public static string AsString(this double a, int digits)
        {
            return a.ToString("F" + digits, CultureInfo.InvariantCulture);
        }

        public static Stopwatch SW = Stopwatch.StartNew();
    }

    public class Program
    {
        #region Helpers

        public class Parser
        {
            const int BufSize = 8000;
            TextReader s;
            char[] buf = new char[BufSize];
            int bufPos;
            int bufDataSize;
            bool eos;   // eos read to buffer
            int lastChar = -2;
            int nextChar = -2;
            StringBuilder sb = new StringBuilder();

            void FillBuf()
            {
                if (eos) return;
                bufDataSize = s.Read(buf, 0, BufSize);
                if (bufDataSize == 0) eos = true;
                bufPos = 0;
            }

            int Read()
            {
                if (nextChar != -2)
                {
                    lastChar = nextChar;
                    nextChar = -2;
                }
                else
                {
                    if (bufPos == bufDataSize) FillBuf();
                    if (eos) lastChar = -1;
                    else lastChar = buf[bufPos++];
                }
                return lastChar;
            }

            void Back()
            {
                if (lastChar == -2) throw new Exception();  // no chars were ever read
                nextChar = lastChar;
            }

            public Parser()
            {
                s = Console.In;
            }

            public int ReadInt()
            {
                int res = 0;
                int sign = -1;
                int c;
                do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));
                if (c == '-') { sign = 1; c = Read(); }
                int len = 0;
                while (c >= 0 && !char.IsWhiteSpace((char)c))
                {
                    if ((uint)(c -= 48) >= 10) throw new FormatException();
                    len++;
                    res = checked(res * 10 - c);
                    c = Read();
                }
                if (len == 0) throw new FormatException();
                Back();
                return checked(res * sign);
            }

            public long ReadLong()
            {
                long res = 0;
                int sign = -1;
                int c;
                do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));
                if (c == '-')
                {
                    sign = 1;
                    c = Read();
                }
                int len = 0;

                while (c >= 0 && !char.IsWhiteSpace((char)c))
                {
                    if ((uint)(c -= 48) >= 10) throw new FormatException();
                    len++;
                    res = checked(res * 10 - c);
                    c = Read();
                }
                if (len == 0) throw new FormatException();
                Back();
                return checked(res * sign);
            }

            public int ReadLnInt()
            {
                int res = ReadInt(); ReadLine(); return res;
            }

            public long ReadLnLong()
            {
                long res = ReadLong(); ReadLine(); return res;
            }

            public double ReadDouble()
            {
                int c;
                do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));

                int sign = 1;
                if (c == '-') { sign = -1; c = Read(); }

                sb.Length = 0;
                while (c >= 0 && !char.IsWhiteSpace((char)c))
                {
                    sb.Append((char)c); c = Read();
                }

                Back();
                var res = double.Parse(sb.ToString(), CultureInfo.InvariantCulture);
                return res * sign;
            }

            public string ReadLine()
            {
                int c = Read();
                sb.Length = 0;
                while (c != -1 && c != 13 && c != 10)
                {
                    sb.Append((char)c); c = Read();
                }
                if (c == 13) { c = Read(); if (c != 10) Back(); }
                return sb.ToString();
            }

            public bool SeekEOF
            {
                get
                {
                L0:
                    int c = Read();
                    if (c == -1) return true;
                    if (char.IsWhiteSpace((char)c)) goto L0;
                    Back();
                    return false;
                }
            }

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

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

        static void pe() { Console.WriteLine("???"); Environment.Exit(0); }
        static void re() { Environment.Exit(55); }
        static void Swap<T>(ref T a, ref T b) { T t = a; a = b; b = t; }
        static int Sqr(int a) { return a * a; }
        static long SqrL(int a) { return (long)a * a; }
        static long Sqr(long a) { return a * a; }
        static double Sqr(double a) { return a * a; }

        static StringBuilder sb = new StringBuilder();
        static Random rand = new Random(5);

        #endregion Helpers

        static int[] minQ;

        const int M = 1000000007;

        static int C(int n, int k)
        {
            return sar_cs_structs.Combinations.Count(n + k - 1, k) % M;
        }

        static long f(int n, int d)
        {
            checked
            {
                //if (d == 10) return n == 0 ? 1 : 0;
                if (n < minQ[d]) return 0;
                //if (n == 0) return 0;

                if (n == 0 || d > 9) throw new Exception();

                long result = 0;
                for (int i = minQ[d]; i <= n; i++)
                {
                    long t1;

                    if (i == 0)
                    {
                        if (d == 9) t1 = n == 0 ? 1 : 0;
                        else t1 = f(n, d + 1);
                    }
                    else if (i == n)
                    {
                        if (minQ.Skip(d + 1).Any(q => q > 0)) t1 = 0;
                        else if (d == 0 && i > 1) t1 = 0;
                        else t1 = 1;
                    }
                    else
                    {
                        if (d == 9)
                            t1 = 0;
                        else
                        {
                            t1 = f(n - i, d + 1);
                            long t2 = d == 0 ? C(n - i, i) : C(n - i + 1, i);
                            //t2 /= sar_cs_structs.Permutations.Factorial(i);
                            t1 *= t2;
                        }
                    }

                    t1 %= M;
                    result = (result + t1) % M;
                }

                return result;
            }
        }

        static void Main(string[] args)
        {
            checked
            {
                //Console.SetIn(File.OpenText("_input"));
                var parser = new Parser();
                while (!parser.SeekEOF)
                {
                    int n = parser.ReadInt();
                    minQ = parser.ReadIntArr(10);

                    //for (int i = 100; i <= 999; i++) if (i.ToString().Contains('0') && i.ToString().Contains('1')) Console.WriteLine(i);
                    //Console.WriteLine("");
                    //Console.Write(f(3, 0));

                    for (int d = 0; d <= 9; d++)
                    {
                        Console.Write("d=" + d + ": ");
                        for (int i = 1; i <= n; i++)
                            Console.Write(f(i, d) + " ");
                        Console.WriteLine();
                    }

                    Console.WriteLine(f(n, 0));
                }
            }
        }

        //static void Main(string[] args)
        //{
        //    new Thread(Main2, 50 << 20).Start();
        //}
    }
}


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

namespace Code
{
    class Program
    {

        static void Method()
        {
            int n = Int32.Parse(Console.ReadLine());

            int a = n / 2;
            int b = n - a;

            if(b-a==1)
            {
                Console.WriteLine("{0} {1}", a,b);
            }
            else
            {
                if(a%2==0)
                {
                    a--;
                    b++;
                    Console.WriteLine("{} {}", a,b);
                }
                else
                {
                    a -= 2;
                    b += 2;
                    Console.WriteLine("{0} {1}",a,b);
                }
            }
        }

        static void Main(string[] args)
        {
            Method();
        //    String str = Console.ReadLine();
        //    String[] n = str.Split();

        //    Double nK = Double.Parse(n[0]);
        //    Double k = Double.Parse(n[1]);
        //    if(k==0&&k==nK)
        //    {
        //        Console.WriteLine("0 0");
        //    }
        //    else
        //    {
        //        if (k < nK / 2)
        //            Console.WriteLine("1 {0}", k + 1);
        //        else if (k == nK / 2)
        //            Console.Write("1 {0}", k);
        //        else
        //        {
        //            double c = nK - k;
        //            Console.WriteLine("1 {0}", nK % k);

        //        }
        //    }
        }
    }
}


using System;

namespace Vacations
{
    class Program
    {

        static void Main(string[] args)
        {
            byte n = byte.Parse(Console.ReadLine());
            byte[] days = Array.ConvertAll(Console.ReadLine().Split(), byte.Parse);
            int min = minDay(days, 0, ' ');
            Console.WriteLine(min);
        }

        public static int minDay(byte[] days , byte cd,char y)
        {
            byte temp = Convert.ToByte(cd + 1);
            //recurrence bottom up
            if (cd == days.Length)
            {
                return 0;
            }
            if (cd == 0)
            {
                switch (days[cd]){
                    case 0:
                        {
                            return 1 + minDay(days, temp, 'r');
                        }
                    case 1:
                        {
                            return 0+minDay(days, temp, 'c');
                        }
                    case 2:
                        {
                            return 0+minDay(days, temp, 'g');
                        }
                    case 3:
                        {

                            return 0 + Math.Min(minDay(days, temp, 'g'), minDay(days, temp, 'c'));
                        }
                    default:
                        {
                            break;
                        }
                }

            }
            else
            {
                if (y == 'r')
                {
                    if (days[cd] == 0)
                    {
                        return 1 + minDay(days, temp, 'r');
                    }
                    if (days[cd]==1)
                    {
                        return 0+minDay(days, temp, 'c');
                    }
                    else if(days[cd] == 2)
                    {
                        return 0+minDay(days, temp, 'g');
                    }
                    else if (days[cd] == 3)
                    {
                        return 0 +Math.Min(minDay(days, temp, 'g'), minDay(days, temp, 'c'));
                    }
                }
                else if (y == 'c')
                {
                    if ((days[cd] == 2 || days[cd] == 3))
                    {
                        return 0+minDay(days, temp, 'g');
                    }
                    else if ((days[cd] == 0 || days[cd] == 1))
                    {
                        return 1 + minDay(days, temp, 'r');
                    }

                }
                else if (y == 'g')
                {
                    if ((days[cd] == 1 || days[cd] == 3))
                    {
                        return 0 + minDay(days, temp, 'c');
                    }

                    else if (days[cd] == 0 || days[cd] == 2)
                    {
                        return 1 + minDay(days, temp, 'r');
                    }
                }
            }

            return 0;
        }
    }
}


class MainClass
	{
		public static void ProblemA() {
			string[] source = Console.ReadLine().Split(' ');
			int n = int.Parse(source[0]), k = int.Parse(source[1]);
			source = Console.ReadLine().Split(' ');
			int ans = k;
			for(int i = 0; i < n; i++) {
				int a = int.Parse(source[i]);
				if(k % a == 0) ans = Math.Min(ans, k / a);
			}
			Console.WriteLine(ans);
		}
		public static void Main(string[] args) {
			ProblemA();
		}
	}


using System;
class Test {
    static void Main(){
        string str = Console.ReadLine();
        double n = Double.Parse(str);
        double s = 0;
        int i = 1;
        while(true){
            str = Convert.ToString(i);
            s = 0;
            double min = (i * i) + (1 * i);
            if(min > n){
                Console.WriteLine(-1);
                break;
            }
            for(int j = 0 ; j < str.Length ; j++){
                s += Double.Parse(str[j].ToString());
            }
            double ans = (i * i) + (s * i);
            if(ans == n){
                Console.WriteLine(i);
                break;
            }
            i++;
        }
    }
}


using System;

namespace Nekvadratnoe_yravnenie
{
    class Program
    {
        static void Main()
        {
            ulong n = Convert.ToUInt64(System.Console.ReadLine());

            double granica = Math.Round(Math.Sqrt(n));
            ulong x = 1;

            while (x - granica < 1)
            {
                if (n % x == 0)
                {
                    if (x * x + fun(x) * x == n)
                    {
                        System.Console.WriteLine(x);
                        return;
                    }
                }
                x++;
            }

            System.Console.WriteLine(-1);

        }
        static ulong fun(ulong x)
        {
            ulong sum = 0;
            while (x != 0)
            {
                sum += (x % 10);
                x /= 10;
            }
            return sum;
        }
    }
}


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

namespace NonSquareEquation
{
    class Program
    {
        static void Main(string[] args)
        {
            long n=Convert.ToInt64(Console.ReadLine());
            for (long i = 0; i < Int64.MaxValue; i++)
            {
                if(i*i+(s(i)*i)==n)
                {
                    Console.WriteLine(i);
                    return;
                }
            }
            Console.WriteLine("-1");
            return;
        }

        public static int s(long x)
        {
            int temp=0;
            while (x > 0)
            {
                temp = temp + (int)(x % 10);
                x = x / 10;
            }
            return temp;
        }
    }
}


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

public class C1
{
  public static void Main ( )
  {
#if MYTRIAL
    Console.SetIn ( new StreamReader ( @"e:\zin.txt" ) );
#endif
    //solve ( );
    Console.WriteLine ( solve ( ) );
  }

  private static int solve ( )
  {
    int N = int.Parse ( Console.ReadLine ( ) );
    for ( int b = 0; b <= 90; b++ )
    {
      double D = GetDisc ( 1, b, -N );
      if ( D < 0 )
        continue;
      double sqrtd = Math.Sqrt ( D );
      double x1 = ( -b + sqrtd ) / 2.0;
      if ( x1 == Math.Floor ( x1 ) && x1 >= 0 )
      {
        if ( b == sumd ( ( int ) x1 ) )
          return ( int ) x1;
      }

      double x2 = ( -b - sqrtd ) / 2.0;
      if ( x2 == Math.Floor ( x2 ) && x2 >= 0 )
      {
        if ( b == sumd ( ( int ) x2 ) )
          return ( int ) x2;
      }
    }

    return -1;
  }

  static int sumd ( int x )
  {
    int sum=0;
    while ( x > 0 )
    {
      sum += x % 10;
      x = x / 10;
    }
    return sum;
  }

  static double GetDisc ( double a, double b, double c )
  {
    return b * b - 4 * a * c;
  }

  public static int[] ReadLineToInts ( int length )
  {
    string line = Console.ReadLine ( ).Trim ( );
    string[] arStrings = line.Split ( ' ' );

    int[] ints = new int[length];
    for ( int i=0; i < length; i++ )
      ints[i] = int.Parse ( arStrings[i] );
    return ints;
  }

}


using System;

class P {
  static void Main(){
    var map = new int[1000];
    map[(int)'>'] = 8;
    map[(int)'<'] = 9;
    map[(int)'+'] = 10;
    map[(int)'-'] = 11;
    map[(int)'.'] = 12;
    map[(int)','] = 13;
    map[(int)'['] = 14;
    map[(int)']'] = 15;

    var res = 0;
    foreach (var c in Console.ReadLine())
      res = (res * 16 + map[(int)c]) % 1000003);
    Console.Write(res);
  }
}


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

namespace CFTraining.B_s
{
    class RandomTeams273
    {
        public static void Main(string[] args)
        {
            String[] line = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(line[0]), m = Convert.ToInt32(line[1]);
            long kmax = 0, kmin = 0;

            int minPlayerNum = n / m;
            int excess = n - (minPlayerNum * m);
            int[] teamDistribution = new int[m];
            for (int i = 0; i < m; i++)
            {
                teamDistribution[i] = minPlayerNum;
                if (excess-- > 0) teamDistribution[i]++;
                kmin += SequenceSum(teamDistribution[i]);
            }
            kmax = SequenceSum(n - (m - 1));
            Console.WriteLine(kmin + " " + kmax);
        }
        public static long SequenceSum(long n)
        {
            return (n * (n - 1)) / 2;
        }
    }
}


public class Oleg
{
	public static void Main()
	{
		var input = System.Console.ReadLine().Split(null as char[]);
		long a, b;
		a = int.Parse(input[0]);
		b = int.Parse(input[1]);

		while(a != 0 && b != 0)
		{
			if (a >= 2*b)
			{
				a -= 2*b;
				continue;
			}
			else if(b >= 2*a)
			{
				b -= 2*a;
				continue;
			}
			else
			{
				break;
			}
		}

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


using System;
using System.Linq;
using Xunit.Abstractions;

namespace CodeForce
{
    internal class Quserty
    {
        private static void Main(string[] args)
        {
            var input = Console.ReadLine();
            var inps = input.Split(' ');
            var length =  int.Parse(inps.First());
            var diameter =  int.Parse(inps[1]);

            input = Console.ReadLine();
            var array =  input.Split(' ').Select(int.Parse).OrderBy(it => it).ToArray();
            var max = array[array.Length - 1];

            var isInSet = new int[max + 1];
            for (var i = 0; i < array.Length; i++)
            {
                var el = array[i];
                isInSet[el] += 1;
            }

            for (var i = 1; i < isInSet.Length; i++)
            {
                isInSet[i] = isInSet[i - 1] + isInSet[i];
            }

            var result = int.MaxValue;

            for (var i = 0;; i++)
            {
                var leftElement = array[i];
                var rightElement = leftElement + diameter;
                if (rightElement > max)
                {
                    rightElement = max;
                }

                var diff = isInSet[rightElement] - isInSet[leftElement - 1];
                var newResult = array.Length - diff;
                result = Math.Min(result, newResult);

                if (rightElement == max)
                {
                    break;
                }
            }

            Console.WriteLine(result);
        }
    }
}


using System;

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

            long n = int.Parse(Console.ReadLine());
            long m = int.Parse(Console.ReadLine());

            long result = m % Convert.ToInt64(Math.Pow(2, n));
            Console.WriteLine(result);
        }
    }
}


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

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int C = input[0];
            int D = input[1];
            int[] nm = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int N = nm[0];
            int M = nm[1];
            int K = int.Parse(Console.ReadLine());
            int[] problems = new int[N * M + N + 1];
            for (int i = 0; i < problems.Length; i++)
            {
                problems[i] = int.MaxValue;
            }
            problems[1] = D;
            problems[N] = C;
            problems[0] = 0;
            for (int i = 2; i < problems.Length; i++)
            {
                if (i - N >= 0)
                {
                    problems[i] = Math.Min(problems[i - N] + C, problems[i - 1] + D);
                }
                else
                {
                    problems[i] = problems[i - 1] + D;
                }
            }
            int P = N * M - K;
            int min = int.MaxValue;
            for (int i = P; i < problems.Length; i++)
            {
                min = Math.Min(min, problems[i]);
            }
            Console.Write(min);
            //Console.ReadKey();
        }
    }
}


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

class LuckyProbability
{

    static int[] L = new int[1024];
    static int[] st = new int[10];
    static int LPos = 0;

    public static int Main()
    {
        //citire
        string[] citire = Console.ReadLine().Split(' ');
        int x1, x2, y1, y2, k;
        x1 = Convert.ToInt32(citire[0]);
        x2 = Convert.ToInt32(citire[1]);
        y1 = Convert.ToInt32(citire[2]);
        y2 = Convert.ToInt32(citire[3]);
        k = Convert.ToInt32(citire[4]);

        //solve
        back(1); L[1023] = 1000000001;
        Array.Sort(L, 1, 1022); //stocare numere Lucky

        int i, j; long Rez = 0;
        for (i = 1; i <= (1023 - k); i++)
        {
            j = i + k - 1;
            Rez += (long)Intersectie(x1, x2, L[i - 1] + 1, L[i]) * (long)Intersectie(y1, y2, L[j], L[j + 1] - 1);
            Rez += (long)Intersectie(y1, y2, L[i - 1] + 1, L[i]) * (long)Intersectie(x1, x2, L[j], L[j + 1] - 1);
        }

        long Posibilitati = (long)(x2 - x1 + 1) * (long)(y2 - y1 + 1);
        decimal Afis = (decimal)Rez / (decimal)Posibilitati;
        Console.WriteLine(Afis.ToString("N12"));
        Console.ReadKey();

        return 0;
    }

    public static void back(int k)
    {
        int i, j, x;
        for (i = 4; i <= 7; i += 3)
        {
            st[k] = i;
            if (k < 9) back(k + 1);
            x = 0;
            for (j = 1; j <= k; j++) x = x * 10 + st[j];
            L[++LPos] = x;
         }
    }

    public static long Intersectie(int stA, int drA, int stB, int drB)
    {
        if (drA < stB || drB < stA) return 0;
        if (stA <= stB && drB <= drA) return drB - stB + 1;
        if (stB <= stA && drA <= drB) return drA - stA + 1;
        if (stA <= stB && drA <= drB) return drA - stB + 1;
        if (stB <= stA && drB <= drA) return drB - stA + 1;
        return 0;
    }
}


using System;
using System.IO;
//using System.Reflection;
//using System.Collections;
using System.Collections.Generic;
using System.Linq;
//using System.Text;
//using System.Text.RegularExpressions;
using System.Threading;

namespace ConsoleApplication1
{
    class Program
    {
        static class Scanner
        {
            readonly static IEnumerator<string> Tokens;
            static Scanner()
            {
                Tokens = Enumerable.Range(Int32.MinValue, Int32.MaxValue).
                    Select(s => Console.ReadLine()).
                    TakeWhile(s => s != null).
                    SelectMany(s => s.Split(new[] { ' ', '\r', '\n', '\t' }, StringSplitOptions.RemoveEmptyEntries)).
                    Concat(Enumerable.Repeat(0, 1).Select(_ => (string)null)).
                    GetEnumerator();
            }

            public static string NextToken()
            {
                Tokens.MoveNext();
                return Tokens.Current;
            }
        }

        int nextInt()
        {
            return int.Parse(Scanner.NextToken());
        }

        bool GoodValue(int a)
        {
            if (a <= 0) return false;
            while (a != 0)
            {
                if (a % 10 != 7 && a % 10 != 4) return false;
                a /= 10;
            }
            return true;
        }

        int[] GenSequence()
        {
            var l = new List<int>();
            var q = new Queue<int>();
            q.Enqueue(0);
            while (q.Count != 0)
            {
                int cur = q.Dequeue();
                l.Add(cur);
                if (GoodValue(cur * 10 + 4)) q.Enqueue(cur * 10 + 4);
                if (GoodValue(cur * 10 + 7)) q.Enqueue(cur * 10 + 7);
            }
            return l.OrderBy(c => c).ToArray();
        }

        int LowerBound(int v, int[] a)
        {
            int x = 0, y = a.Length;
            while (y - x > 1)
            {
                int z = (x + y) / 2;
                if (a[z] <= v) x = z;
                else y = z;
            }
            return x;
        }

        int Len(int x, int y, int[] a, int p)
        {
            if (p < 1 || p >= a.Length) return 0;
            int tx = Math.Max(x, a[p - 1]), ty = Math.Min(y, a[p]);
            if (GoodValue(tx)) tx++;
            if (GoodValue(ty)) ty--;
            return Math.Max(ty - tx + 1, 0);
        }

        void Solve()
        {
            var values = GenSequence();
            int pl = nextInt(), pr = nextInt(),
                vl = nextInt(), vr = nextInt(),
                k = nextInt();
            long res = 0;
            for (int x = 1; x < values.Length; x++)
            {
                long pc = Len(pl, pr, values, x);
                long rc1 = Len(vl, vr, values, x + k),
                    rc2 = Len(vl, vr, values, x - k);
                res += pc * (rc1 + rc2);
                if (x + k - 1 < values.Length && values[x + k - 1] >= vl && values[x + k - 1] <= vr) res += pc;
                if (x - k > 0 && values[x - k] >= vl && values[x - k] <= vr) res += pc;

                if (values[x] >= pl && values[x] <= pr)
                {
                    res += Len(vl, vr, values, x - k + 1);
                    res += Len(vl, vr, values, x + k);

                    res += new[] { x + k - 1, x - k + 1 }.Distinct().Where(
                        c => c > 0 && c < values.Length &&
                            values[c] >= vl && values[c] <= vr
                        ).Count();
                }
            }
            long all = (pr - pl + 1);
            all *= (vr - vl + 1);
            Console.Write("{0:F12}", (double)res / (double)(all));
        }

        static void Main()
        {
#if MY_SUPER_PUPER_ONLINE_JUDGE
            string dir = Directory.GetCurrentDirectory();
            dir = Directory.GetParent(dir).FullName;
            dir = Directory.GetParent(dir).FullName;
            Console.SetIn(new StreamReader(dir + "\\input.txt"));
            Console.SetOut(new StreamWriter(dir + "\\output.txt"));
#endif
            Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
            new Program().Solve();
#if MY_SUPER_PUPER_ONLINE_JUDGE
            Console.In.Close();
            Console.Out.Close();
#endif
        }
    }
}


using System;
using System.Linq;
using System.Globalization;

namespace _630
{
    class Program
    {
        static void Main()
        {
            var a = double.Parse(Console.ReadLine());
            var n = 2 * a - 2;
            var ans = (((n - a) >= 1) ? 3 : 1) * Math.Pow(4, Math.Max(0, n - a - 1)) * 2 + (((n - a - 1) >= 1) ? 1 : 0) *
               9 * (n - a - 1) * Math.Pow(4, Math.Max(0, n - a - 2)) ;
            ans *= 4;
            Console.WriteLine(ans);
        }
    }
}


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

namespace CodeForcesBlockTowers
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, m, a = 2;
            n = int.Parse(Console.ReadLine());
            m = int.Parse(Console.ReadLine());
            if (n == 0)
            {
                Console.WriteLine(m * 3);
            }
            else if (m == 0)
            {
                Console.WriteLine(n * 2);
            }
            else if (n != 0 && m != 0)
            {
                while (n!=0 || m!=0)
                {
                    if (a % 2 == 0 && a % 3 == 0)
                    {
                        if (n > m && n>0)
                        {
                            n--;
                        }
                        else if (m > n && m>0)
                        {
                            m--;
                        }
                        else if (n == m && m>0)
                        {
                            m--;
                        }
                    }
                    else if (a % 2 == 0 && n>0)
                    {
                        n--;
                    }
                    else if (a % 3 == 0 && m>0)
                    {
                        m--;
                    }
                    a++;
                }
                Console.WriteLine(a - 1);
            }
            Console.ReadLine();
        }
    }
}


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

namespace Codeforces.R337.C
{
    public static class Solver
    {
        public static void Main()
        {
            using (var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false })
            {
                Solve(Console.In, sw);
            }
        }

        public static void Solve(TextReader tr, TextWriter tw)
        {
            WriteAnswer(tw, Parse(tr));
        }

        private static void WriteAnswer(TextWriter tw, int answer)
        {
            tw.WriteLine(answer);
        }

        private static int Parse(TextReader tr)
        {
            var w = tr.ReadLine().Split();
            return Calc(int.Parse(w[0]), int.Parse(w[1]), int.Parse(w[2]));
        }

        public static int Calc(int n, int m, int k)
        {
            var y = n - m;
            var b = y * (k - 1);
            var r = m - b;
            if (r <= 0)
                return m;
            var x = r / k;
            var a = r % k;
            return ((1 << x + 1) - 2) * k + a + b;
        }
    }
}


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 input = Console.ReadLine();//6 3
            string[] input_array = input.Split(); //{"6", "3"}
            int[] input_int = Array.ConvertAll(input_array, int.Parse);//{6, 3}

            //int[] input = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            int a = input_int[0], b = input_int[0], c = input_int[0];
            int y = input_int[1];
            int count = 0;
            while (a != y || b != y || c != y)
            {
                Change(ref a, b, c, y, ref count);
                Change(ref b, a, c, y, ref count);
                Change(ref c, b, a, y, ref count);
            }
            Console.WriteLine(count);
        }

        private static void Change(ref int a, int b, int c, int y, ref int count)
        {
            int buf = a;
            while (a > y && Proverka(a - 1, b, c))
            { a--; }
            if (buf != a)
                count++;
        }

        public static bool Proverka(int a, int b, int c)
        {
            if ((a + b > c) && (a + c > b) && (c + b > a))
                return true;
            else return false;
        }
    }
}


using System;

namespace Ex9_Traingles
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inputXY = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            int[] abc = { inputXY[0], inputXY[0], inputXY[0] };
            int d = inputXY[1];
            int buf;
            int countOperation = 0;
            while (abc[0] != d || abc[1] != d || abc[2] != d)
            {
                for (int i = 2; i >= 0; i--)
                {
                    buf = abc[i];
                    while (abc[i] != d && isTraingles(abc[i] - 1, abc[(i + 1) % 3], abc[(i + 2) % 3]))
                    {
                        abc[i]--;
                    }
                    if (buf != abc[i])
                        countOperation++;
                }
            }
            Console.WriteLine(countOperation);
        }

        static bool isTraingles(int a, int b, int c)
        {
            return (a + b > c && a + c > b && b + c > a);
        }
    }
}


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

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

    }

    public PairVariable(int a, int b, int c)
    {
        this.a = a;
        this.b = b;
        this.c = c;

    }

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

namespace ConsoleApplication3
{
    class Program
    {

        static bool isPrime(int n)
        {
            for (int i = 2; i <= Math.Sqrt(n); i++)
            {
                if (n % i == 0)
                {
                    return false;
                }
            }
            return true;
        }
        static int gcd(int a, int b)
        {
            if (b == 0)
            {
                return a;
            }
            else
            {
                return gcd(b, a % b);
            }
        }
        static int factorial(int a)
        {
            int s = 1;
            for (int i = 1; i <= a; i++)
            {
                s *= i;
            }
            return s;
        }

        static int start = 0;
        static int end = 0;
        static int[] mark;
        static int[] prev;
        static Dictionary<int, List<int>> d = new Dictionary<int, List<int>>();
        static void dfs(int v)
        {

            bool f = false;
            mark[v] = 1;
            if (!f)
            {
                for (int i = 0; i < d[v].Count; i++)
                {
                    if (mark[d[v][i]] == 0)
                    {
                        prev[d[v][i]] = v;

                        dfs(d[v][i]);
                    }
                    else
                    {
                        end = v;
                        start = d[v][i];
                        f = true;
                        return;
                    }
                }
            }

        }
        static bool foo(int a, int b, int c)
        {
            return a + b > c && a + c > b && b + c > a;
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int a = int.Parse(s[0]);
            int x = int.Parse(s[1]);
            int b, c;
            b = c = a;
            int[] m = { a, b, c };
            int ans = 0;
            while (true)
            {

                if (m[0] == m[1] && m[1] == m[2] && m[2] == x)
                {
                    Console.WriteLine(ans / 2 + 2);
                    return;
                }
                Array.Sort(m);
                ans++;
                m[2] = Math.Max(x, (m[1] - m[0] + 1));

            }

        }
    }
}


using System;
using System.Linq;

namespace Preparation
{
    public class CoderForceCompetitionC
    {
        public static void Swap(ref int x1, ref int x2, ref int x3)
        {
            if (x1 > x2)
            {
                var t = x1;
                x1 = x2;
                x2 = t;
            }

            if (x1 > x3)
            {
                var t = x1;
                x1 = x3;
                x3 = t;
            }

            if (x2 > x3)
            {
                var t = x2;
                x2 = x3;
                x3 = t;
            }
        }

        public static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var x = input[0];
            var y = input[1];

            int x1, x2, x3;
            x1 = x2 = x3 = x;
            int result = 0;
            x1 = Math.Max(x1/3, y);
            x2 = Math.Max(x3-x1+1, y);
            result = 2;

            while (x1 != y || x2 != y || x3 != y)
            {
                Swap(ref x1, ref x2, ref x3);
                x3 = Math.Max(Math.Max(x2 - x1 + 1, y), x3/3 - 1);
                result++;
            }

            Console.WriteLine(result);
        }
    }
}


/*
 * TemplateCS
 * Copyright (C) 2014-2016 Markus Himmel
 * This file is distributed under the terms of the MIT license
 */

//#define CodeJam
#define CodeForces

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Xml.Serialization;

// ReSharper disable RedundantUsingDirective
using System.IO;

// ReSharper restore RedundantUsingDirective

// ReSharper disable UnusedMember.Local

// ReSharper disable once CheckNamespace

namespace ProgrammingCompetitions
{
    internal class Program
    {
        #region GCJ

#if CodeJam
		private static bool DEBUG = false;

		static void debug()
		{
		}

		static string solveCase(int num)
		{
			checked
			{
				return null;
			}
		}
#endif

        #endregion

        #region CodeForces

#if CodeForces
#if DEBUG
        private static readonly Queue<string> testInput = new Queue<string>(@"

22 4

".Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries));
#endif

        private static int sim(int s, int v, int t)
        {
            List<int> a = new List<int> { v, s, s };
            int res = 1;
            while (a[2] != t)
            {
                a[2] = Math.Max(a[1] - a[0] + 1, t);
                a.Sort();
                res++;
            }
            return res;
        }

        private static object solve()
        {
            // ReSharper disable once RedundantOverflowCheckingContext
            checked
            {
                int f, t;
                read(out f, out t);
                int l = t - 1, r = f - 1;
                while (r - l > 1)
                {
                    int mid = (l + r) >> 1;
                    if (sim(f, mid, t) < sim(f, mid + 1, t))
                        r = mid;
                    else
                        l = mid;
                }
                return sim(f, l + 1, t);
            }
        }
#endif

        #endregion

        // Everything after this comment is template code

        private static T read<T>()
        {
            return (T)Convert.ChangeType(read(), typeof(T));
        }

        private static T[] readMany<T>()
        {
            // ReSharper disable once PossiblyMistakenUseOfParamsMethod
            return readMany<T>(' ');
        }

        private static T[] readMany<T>(params char[] ___)
        {
            return read().Split(___).Select(__ => (T)Convert.ChangeType(__, typeof(T))).ToArray();
        }

        private static string[] readMany()
        {
            return readMany<string>();
        }

        private static T[][] readMany<T>(int n)
        {
            var res = new T[n][];
            for (int i = 0; i < n; i++)
                res[i] = readMany<T>();
            return res;
        }

        private static T[][] readField<T>(int height, Func<char, T> map)
        {
            var res = new T[height][];
            for (int _ = 0; _ < height; _++)
                res[_] = read().Select(map).ToArray();
            return res;
        }

        private static char[][] readField(int height)
        {
            return readField(height, c => c);
        }

        private static T[][] readField<T>(int height, Dictionary<char, T> dic)
        {
            return readField(height, c => dic[c]);
        }

        private static void read<T1>(out T1 t1)
        {
            string[] vals = readMany();
            t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));
        }

        private static void read<T1, T2>(out T1 t1, out T2 t2)
        {
            string[] vals = readMany();
            t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));
            t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));
        }

        private static void read<T1, T2, T3>(out T1 t1, out T2 t2, out T3 t3)
        {
            string[] vals = readMany();
            t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));
            t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));
            t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));
        }

        private static void read<T1, T2, T3, T4>(out T1 t1, out T2 t2, out T3 t3, out T4 t4)
        {
            string[] vals = readMany();
            t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));
            t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));
            t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));
            t4 = (T4)Convert.ChangeType(vals[3], typeof(T4));
        }

        private static void read<T1, T2, T3, T4, T5>(out T1 t1, out T2 t2, out T3 t3, out T4 t4, out T5 t5)
        {
            string[] vals = readMany();
            t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));
            t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));
            t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));
            t4 = (T4)Convert.ChangeType(vals[3], typeof(T4));
            t5 = (T5)Convert.ChangeType(vals[4], typeof(T5));
        }

        private static Func<T1, TResult> dp<T1, TResult>(Func<T1, Func<T1, TResult>, TResult> f)
        {
            var cache = new Dictionary<Tuple<T1>, TResult>();
            Func<T1, TResult> res = null;
            res = t1 =>
            {
                Tuple<T1> key = Tuple.Create(t1);
                if (!cache.ContainsKey(key))
                    cache.Add(key, f(t1, res));
                return cache[key];
            };
            return res;
        }

        private static Func<T1, T2, TResult> dp<T1, T2, TResult>(Func<T1, T2, Func<T1, T2, TResult>, TResult> f)
        {
            var cache = new Dictionary<Tuple<T1, T2>, TResult>();
            Func<T1, T2, TResult> res = null;
            res = (t1, t2) =>
            {
                Tuple<T1, T2> key = Tuple.Create(t1, t2);
                if (!cache.ContainsKey(key))
                    cache.Add(key, f(t1, t2, res));
                return cache[key];
            };
            return res;
        }

        private static Func<T1, T2, T3, TResult> dp<T1, T2, T3, TResult>(Func<T1, T2, T3, Func<T1, T2, T3, TResult>, TResult> f)
        {
            var cache = new Dictionary<Tuple<T1, T2, T3>, TResult>();
            Func<T1, T2, T3, TResult> res = null;
            res = (t1, t2, t3) =>
            {
                Tuple<T1, T2, T3> key = Tuple.Create(t1, t2, t3);
                if (!cache.ContainsKey(key))
                    cache.Add(key, f(t1, t2, t3, res));
                return cache[key];
            };
            return res;
        }

        private static Func<T1, T2, T3, T4, TResult> dp<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, Func<T1, T2, T3, T4, TResult>, TResult> f)
        {
            var cache = new Dictionary<Tuple<T1, T2, T3, T4>, TResult>();
            Func<T1, T2, T3, T4, TResult> res = null;
            res = (t1, t2, t3, t4) =>
            {
                Tuple<T1, T2, T3, T4> key = Tuple.Create(t1, t2, t3, t4);
                if (!cache.ContainsKey(key))
                    cache.Add(key, f(t1, t2, t3, t4, res));
                return cache[key];
            };
            return res;
        }

        private static IEnumerable<T> single<T>(T it)
        {
            yield return it;
        }

        private static IEnumerable<long> range(long first, long last, long step = 1)
        {
            for (long i = first; i <= last; i += step)
                yield return i;
        }

        private static IEnumerable<int> range(int first, int last, int step = 1)
        {
            for (int i = first; i <= last; i += step)
                yield return i;
        }

        private static T id<T>(T a)
        {
            return a;
        }

        public static T[][] Mkarr<T>(int x, int y)
        {
            var res = new T[x][];
            for (int i = 0; i < x; i++)
                res[i] = new T[y];
            return res;
        }

        public static T[][][] Mkarr<T>(int x, int y, int z)
        {
            var res = new T[x][][];
            for (int i = 0; i < x; i++)
            {
                res[i] = new T[y][];
                for (int j = 0; j < y; j++)
                    res[i][j] = new T[z];
            }
            return res;
        }

        private static bool[] tf = { true, false };

#if CodeJam

		static void Main(string[] args)
		{
			if (DEBUG)
			{
				debug();
			}
			else
			{
				Initialize();
				SolveAll(solveCase);
			}
			Console.ReadKey();
		}

		private static StreamReader inf;
		private static StreamWriter outf;

		private delegate void o(string format, params object[] args);
		private static o Output;

		public static void Initialize()
		{
			Console.ForegroundColor = ConsoleColor.Yellow;
			Console.Write("File name: ");
			string name = Console.ReadLine();
			inf = new StreamReader($"D:\\Users\\marku\\Downloads\\{name}.in");
			outf = new StreamWriter($"D:\\Users\\marku\\Downloads\\{name}.out");
			Console.ForegroundColor = ConsoleColor.White;
			Output = highlightedPrint;
			Output += outf.WriteLine;
		}

		private static void highlightedPrint(string format, params object[] args)
		{
			ConsoleColor prev = Console.ForegroundColor;
			Console.ForegroundColor = ConsoleColor.Green;
			Console.WriteLine(format, args);
			Console.ForegroundColor = prev;
		}

		public static void SolveAll(Func<int, string> calc)
		{
			int cases = int.Parse(inf.ReadLine());
			for (int _ = 1; _ <= cases; _++)
			{
				Output($"Case #{_}: {calc(_)}");
			}
			inf.Close();
			outf.Close();
			Console.ForegroundColor = ConsoleColor.Cyan;
			Console.WriteLine("Eureka!");
		}

		private static string read()
		{
			return inf.ReadLine();
		}
#endif

#if CodeForces
        private static string asString(object s)
        {
            if (s is double)
                return ((double)s).ToString("0.000000000", CultureInfo.InvariantCulture);
            return s.ToString();
        }

        public static void Main(string[] args)
        {
#if DEBUG
            Stopwatch sw = new Stopwatch();
            sw.Start();
#endif
            object o = solve();
            if (o != null)
            {
                string s;
                IEnumerable e = o as IEnumerable;
                if ((e != null) && !(o is string))
                    s = string.Join(" ", e.OfType<object>().Select(asString));
                else
                    s = asString(o);
                if (!string.IsNullOrEmpty(s))
                    Console.WriteLine(s);
            }
#if DEBUG
            sw.Stop();
            Console.WriteLine(sw.Elapsed);
            Console.ReadKey();
#endif
        }

        private static string read()
        {
#if !DEBUG
			return Console.ReadLine();
#else
            return testInput.Dequeue();
#endif
        }
#endif
    }

    public static class ExtensionMethods
    {
        public static int BinarySearch<T>(this IList<T> it, Func<T, bool> compare)
        {
            int len = it.Count;
            int first = 0;

            while (len > 0)
            {
                int half = len >> 1;
                T middle = it[first + half];
                if (compare(middle))
                    len = half;
                else
                {
                    first += half + 1;
                    len -= half + 1;
                }
            }

            return first;
        }

        public static int Upper<T>(this IList<T> it, T val)
        {
            Comparer<T> comp = Comparer<T>.Default;
            return it.BinarySearch(other => comp.Compare(val, other) < 0);
        }

        public static int Lower<T>(this IList<T> it, T val)
        {
            Comparer<T> comp = Comparer<T>.Default;
            return it.BinarySearch(other => comp.Compare(other, val) >= 0);
        }

        public static T[] Of<T>(this int n, Func<T> gen)
        {
            return n.Of2(gen).ToArray();
        }

        public static T[] Of<T>(this int n, Func<long, T> gen)
        {
            return n.Of2(gen).ToArray();
        }

        public static T[] Of<T>(this int n, T gen)
        {
            return n.Of2(gen).ToArray();
        }

        public static IEnumerable<T> Of2<T>(this int n, Func<T> gen)
        {
            for (int i = 0; i < n; i++)
                yield return gen();
        }

        public static IEnumerable<T> Of2<T>(this int n, Func<long, T> gen)
        {
            for (int i = 0; i < n; i++)
                yield return gen(i);
        }

        public static IEnumerable<T> Of2<T>(this int n, T gen)
        {
            for (int i = 0; i < n; i++)
                yield return gen;
        }

        public static IEnumerable<TOut> Cartesian<T1, T2, TOut>(this IEnumerable<T1> first, IEnumerable<T2> second, Func<T1, T2, TOut> collector)
        {
            return first.SelectMany(f => second.Select(s => collector(f, s)));
        }

        public static IEnumerable<Tuple<T1, T2>> Cartesian<T1, T2>(this IEnumerable<T1> first, IEnumerable<T2> second)
        {
            return first.Cartesian(second, Tuple.Create);
        }

        public static IEnumerable<Tuple<T1, T2>> CartesianE<T1, T2>(this IEnumerable<T1> first, IEnumerable<T2> second)
        {
            // Calling CartesianE prevents selection of the wrong overload of Cartesian when you want a tuple of tuples to be returned
            return first.Cartesian(second);
        }

        public static IEnumerable<Tuple<T1, T2, T3>> Cartesian<T1, T2, T3>(this IEnumerable<Tuple<T1, T2>> first, IEnumerable<T3> second)
        {
            return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, y));
        }

        public static IEnumerable<Tuple<T1, T2, T3, T4>> Cartesian<T1, T2, T3, T4>(this IEnumerable<Tuple<T1, T2, T3>> first, IEnumerable<T4> second)
        {
            return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, x.Item3, y));
        }

        public static IEnumerable<Tuple<T1, T2, T3, T4, T5>> Cartesian<T1, T2, T3, T4, T5>(this IEnumerable<Tuple<T1, T2, T3, T4>> first, IEnumerable<T5> second)
        {
            return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, x.Item3, x.Item4, y));
        }

        public static IEnumerable<IEnumerable<T>> Cartesian<T>(this IEnumerable<IEnumerable<T>> source)
        {
            IEnumerable<T>[] enumerable = source as IEnumerable<T>[] ?? source.ToArray();
            IEnumerable<IEnumerable<T>> res = enumerable.First().Select(single);
            return enumerable.Skip(1).Aggregate(res, (current, next) => current.Cartesian(next, (sofar, n) => sofar.Concat(single(n))));
        }

        public static IEnumerable<IEnumerable<T>> Pow<T>(this IEnumerable<T> it, int num)
        {
            return Enumerable.Repeat(it, num).Cartesian();
        }

        public static IEnumerable<T> Demask<T>(this IEnumerable<Tuple<T, bool>> inp)
        {
            foreach (Tuple<T, bool> pair in inp)
                if (pair.Item2)
                    yield return pair.Item1;
        }

        public static IEnumerable<IEnumerable<IEnumerable<T>>> Partition<T>(this IEnumerable<T> source, int groups)
        {
            T[] src = source as T[] ?? source.ToArray();
            foreach (int[] part in Enumerable.Range(0, groups).Pow(src.Length).Select(x => x.ToArray()))
                yield return Enumerable.Range(0, groups).Select(x => src.Where((item, idx) => part[idx] == x));
        }

        public static IEnumerable<IEnumerable<T>> Combinations<T>(this IEnumerable<T> it)
        {
            T[] itt = it as T[] ?? it.ToArray();
            foreach (IEnumerable<bool> conf in new[] { true, false }.Pow(itt.Length))
                yield return itt.Zip(conf, Tuple.Create).Demask();
        }

        private static IEnumerable<T> single<T>(T it)
        {
            yield return it;
        }

        private static IEnumerable<T> exceptSingle<T>(this IEnumerable<T> first, T it, IEqualityComparer<T> comp = null)
        {
            comp = comp ?? EqualityComparer<T>.Default;
            bool seen = false;
            foreach (T a in first)
                if (!seen && comp.Equals(a, it))
                    seen = true;
                else
                    yield return a;
        }

        public static IEnumerable<IEnumerable<T>> Permutations<T>(this IEnumerable<T> it)
        {
            T[] src = it as T[] ?? it.ToArray();
            if (src.Length < 2)
            {
                yield return src;
                yield break;
            }

            foreach (T first in src)
                foreach (IEnumerable<T> part in Permutations(src.exceptSingle(first)))
                    yield return single(first).Concat(part);
        }

        public static T[][] Rho<T>(this IEnumerable<T> source, int x, int y)
        {
            T[][] res = Program.Mkarr<T>(x, y);

            int i = 0, j = 0;

            T[] src = source as T[] ?? source.ToArray();
            while (true)
            {
                foreach (T item in src)
                {
                    res[i][j] = item;
                    j++;
                    if (j == y)
                    {
                        j = 0;
                        i++;
                        if (i == x)
                            break;
                    }
                }
                if (i == x)
                    break;
            }

            return res;
        }

        public static T[][][] Rho<T>(this IEnumerable<T> source, int x, int y, int z)
        {
            T[][][] res = Program.Mkarr<T>(x, y, z);

            int i = 0, j = 0, k = 0;
            T[] src = source as T[] ?? source.ToArray();
            while (true)
            {
                foreach (T item in src)
                {
                    res[i][j][k] = item;
                    k++;
                    if (k == z)
                    {
                        k = 0;
                        j++;
                        if (j == y)
                        {
                            j = 0;
                            i++;
                            if (i == x)
                                break;
                        }
                    }
                }
                if (i == x)
                    break;
            }

            return res;
        }
    }
}


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

namespace codeforces3621a
{
	class Program
	{
		static void Main(string[] args)
		{
#if DEBUG
			TextReader reader = new StreamReader("..\\..\\input.txt");
#else
			TextReader reader = new StreamReader(Console.OpenStandardInput());
#endif
			TextWriter writer = new StreamWriter(Console.OpenStandardOutput());

			var n = reader.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

			var triangle = new[] { n[0], n[0], n[0] };
			var y = n[1];

			var result = 0;

			if (n[0] >= 2 * y)
			{
				triangle = triangle.OrderBy(x => x).ToArray();
				triangle[2] = (triangle[2] - y) / 2 + y;
				result++;
			}

			while(!triangle.All(x => x == y))
			{
				result++;
				triangle = triangle.OrderBy(x => x).ToArray();
				triangle[2] = Math.Max(triangle[1] - triangle[0] + 1, y);
			}

			writer.WriteLine(result);

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


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

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

        int cnt = 0;
        int min = 0;
        foreach (var c in S)
        {
            if (c == '(') cnt++;
            else cnt--;
            min = Math.Min(min, cnt);
        }
        /*
         * Sを部分文字列に含むカッコ列の個数
         */

        // i文字目まで作る、カウンタ、Sより前、Sより後
        var dp = new ModInt[2 * N + 1, N + 1, 2];
        dp[0, 0, 0] = 1;
        for (int i = 0; i < 2 * N; i++)
        {
            for (int j = 0; j <= N; j++)
            {
                // (
                if (j + 1 <= N)
                {
                    dp[i + 1, j + 1, 0] += dp[i, j, 0];
                    dp[i + 1, j + 1, 1] += dp[i, j, 1];
                }

                // )
                if (j - 1 >= 0)
                {
                    dp[i + 1, j - 1, 0] += dp[i, j, 0];
                    dp[i + 1, j - 1, 1] += dp[i, j, 1];
                }

                if (i + S.Length <= 2 * N && j + min >= 0 && j + cnt <= N)
                {
                    dp[i + S.Length, j + cnt, 1] += dp[i, j, 0];
                    dp[i + S.Length, j + cnt, 0] -= dp[i, j, 0];
                }
            }
        }

        Console.WriteLine(dp[2 * N, 0, 1]);
    }

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

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

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

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

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

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

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

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

        public string Next()
        {
            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;

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

            string number1_str = input[0];
            string number2_str = input[1];

            int number1 = Convert.ToInt32(number1_str);
            int number2 = Convert.ToInt32(number2_str);

            int first_result = number1 + number2;
            string first_result_str = first_result.ToString();

            string nd_number_1_str = "";

            for(int i = 0; i < number1_str.Length; i++)
            {
                if(number1_str[i] != '0')
                {
                    nd_number_1_str += number1_str[i];
                }
            }

            string nd_number_2_str = "";

            for (int i = 0; i < number2_str.Length; i++)
            {
                if (number1_str[i] != '0')
                {
                    nd_number_2_str += number2_str[i];
                }
            }

            string first_res_without_zer = "";

            for (int i = 0; i < first_result_str.Length; i++)
            {
                if(first_result_str[i] != '0')
                {
                    first_res_without_zer += first_result_str[i];
                }
            }

            int first_res_nozer = Convert.ToInt32(first_res_without_zer);

            int nd_number1 = Convert.ToInt32(nd_number_1_str);
            int nd_number2 = Convert.ToInt32(nd_number_2_str);

            int nd_result = nd_number1 + nd_number2;

            if(first_res_nozer == nd_result)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }

        }
    }
}


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

namespace LifeOutOfZeros
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            string b = Console.ReadLine();
            int lonC = Convert.ToInt32(a) + Convert.ToInt32(b);
            string c = Convert.ToString(lonC);

            int k = a.IndexOf('0');
            int l = b.IndexOf('0');
            int m = c.IndexOf('0');

            if ((k == -1) & (l == -1) & (m == -1)) { Console.WriteLine("YES"); return; }

            while ((k != -1) | (l != -1) | (m != -1))
            {
                a = a.Trim('0'); b = b.Trim('0'); c = c.Trim('0');
                k = a.IndexOf('0');l = b.IndexOf('0');m = c.IndexOf('0');
                long x = Convert.ToInt64(a); long y = Convert.ToInt64(b); long z = Convert.ToInt64(c);

                if ((x != 0) & (k != -1)) a = a.Remove(k, k);
                if ((y != 0) & (l != -1)) b = b.Remove(l, l);
                if ((z != 0) & (m != -1)) c = c.Remove(m, m);

                if ((x != 0) & (k == 0)) a = a.Remove(k, k + 1);
                if ((y != 0) & (l == 0)) b = b.Remove(l, l + 1);

                if (((x == 0) & (k == 0)) | ((y == 0) & (l == 0))) break;
            }
            if (Convert.ToInt32(a) + Convert.ToInt32(b) == Convert.ToInt32(c)) Console.WriteLine("YES");
            else Console.WriteLine("NO");
        }
    }
}


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

namespace Olymp
{
  public class ProblemSolver
  {
    private Tokenizer input;

    private ISet<long> s = new HashSet<long>();

    public void Solve()
    {
      var n = input.ReadLong();
      InitSquares(n);
      var m = (long)Math.Sqrt(n);
      var ans = 1L;
      for (int i = 1; i <= m; i++)
      {
        if (n % i == 0)
        {
          if (IsBeauty(n / i))
          {
            ans = n / i;
            break;
          }
          else if (IsBeauty(i))
          {
            ans = i;
          }
        }
      }
      Console.Write(ans);
    }

    private void InitSquares(long n)
    {
      var k = 2L;
      while (k <= n)
      {
        s.Add(k * k);
        k++;
      }
    }

    private bool IsSquare(long x)
    {
      return s.Contains(x);
    }

    private bool IsBeauty(long n)
    {
      var m = (long)Math.Sqrt(n);
      for (int i = 1; i <= m; i++)
      {
        if (n % i == 0 && (IsSquare(i) || IsSquare(n / i)))
        {
          return false;
        }
      }
      return true;
    }

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

  #region Service classes

  public class Tokenizer
  {
    private TextReader reader;

    public int ReadInt()
    {
      var c = SkipWS();
      if (c == -1)
        throw new EndOfStreamException();
      bool isNegative = false;
      if (c == '-' || c == '+')
      {
        isNegative = c == '-';
        c = this.reader.Read();
        if (c == -1)
          throw new InvalidOperationException();
      }
      if (!char.IsDigit((char)c))
        throw new InvalidOperationException();
      int result = (char)c - '0';
      c = this.reader.Read();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        if (!char.IsDigit((char)c))
          throw new InvalidOperationException();
        result = result * 10 + (char)c - '0';
        c = this.reader.Read();
      }
      if (isNegative)
        result = -result;
      return result;
    }

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

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

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

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

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

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

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

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

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

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

  #endregion
}


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

namespace ConsoleApplication1
{
    class Program
    {
        private static void MyMain()
        {
            long n = RLong();

            long [] store = new long[n];
            for (long i = 1; i <= n; i++)
            {
                var x = n % i;
                if (x == 0)
                {
                    store[store.Length-1] = (n / i);
                }
            }

            for (long i = 0; i < store[]; i++)
            {
                bool flag = false;
                for (long j = 2; j < store[i]; j++)
                {
                    if (store[i] % (j * j) == 0)
                    {

                        flag = true;
                        break;
                    }
                }
                if (flag == false)
                {
                    WLine(store[i]);
                    return;
                }
            }
        }

        static void Main()
        {
#if !HOME
            MyMain();
#else
            var tmp = Console.In;
            Console.SetIn(new StreamReader("in.txt"));
            while (Console.In.Peek() > 0)
            {
                MyMain();
            }
            Console.In.Close();
            Console.SetIn(tmp);
            Console.ReadKey();
#endif
        }

        #region Utils
        static string RLine()
        {
            return Console.ReadLine();
        }

        static int RInt()
        {
            var str = Console.ReadLine();
            return Convert.ToInt32(str);
        }

        static long RLong()
        {
            var str = Console.ReadLine();
            return Convert.ToInt64(str);
        }

        static int[] RInts()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), s => Convert.ToInt32(s));
        }

        static void RInts(out int a, out int b)
        {
            var ints = RInts();
            a = ints[0];
            b = ints[1];
        }

        static void WLine<T>(T s)
        {
            Console.WriteLine(s);
        }
        #endregion
    }
}


using System;
using System.Linq;

namespace Codeforces
{
    internal static class Program
    {
        private static void Main()
        {
            Console.WriteLine(Result(int.Parse(Console.ReadLine())));
        }

        private static long Result(int n)
        {
            return 1 + Enumerable.Range(1, n).Sum() * 6;
        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Int64 n = Int64.Parse(Console.ReadLine()), res = 0, j = 0;
            for (int i = 0; i < n; i++)
            {
                j = j + 6;
                res = res + j;
            }
            Console.Write(res+1);
        }
    }
}


using System;
class Program{
    public static void Main(string[] args){
        long n = long.Parse(Console.ReadLine());
        ulong res = 0;
        for(int i = 1; i <= n; i++)
            res += (ulong)6 * i;
        Console.WriteLine(res);
    }
}


using System;
class Program{
    public static void Main(string[] args){
        long n = long.Parse(Console.ReadLine());
        ulong res = 1;
        for(int i = 1; i <= n; i++)
            res += (ulong)(6 * i);
        Console.WriteLine(res);
    }
}


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

namespace Codeforces_Round_219_2
{

    class TaskB
    {
        public static int S(double a)
        {
            int n = 1;
            while (a >= 10)
            {
                n++;
                a /= 10;
            }
            return n;
        }

        static void Main(string[] args)
        {
            double w, m, k;
            string s = Console.ReadLine();
            string[] str = s.Split();
            w = double.Parse(str[0]);
            m = double.Parse(str[1]);
            k = double.Parse(str[2]);

            if (w < k)
            {
                Console.WriteLine(0);
                return;
            }
            else
                w /= k;

            int l = 0;
            int s_cur = S(m);

            while (w >= s_cur)
            {
                l++;
                w -= s_cur;
                s_cur = S(++m);
            }

            Console.WriteLine(l);
        }
    }
}


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

namespace Codeforces_Round_219_2
{

    class TaskB
    {
        public static int S(double a)
        {
            int n = 1;
            while (a >= 10)
            {
                n++;
                a /= 10;
            }
            return n;
        }

        public static double ToNextLevel(double a)
        {
            double n = 1;
            int r = S(a);
            for (int i = 0; i < r; i++)
                n *= 10;

            return n - a;
        }

        public static double NextLevel(double a)
        {
            double n = 1;
            int r = S(a);
            for (int i = 0; i < r; i++)
                n *= 10;

            return n;
        }

        static void Main(string[] args)
        {
            double w, m, k;
            string s = Console.ReadLine();
            string[] str = s.Split();
            w = double.Parse(str[0]);
            m = double.Parse(str[1]);
            k = double.Parse(str[2]);

            if (w < k)
            {
                Console.WriteLine(0);
                return;
            }
            else
                w /= k;

            double l = 0;
            int s_cur = S(m);

            while (true)
            {
                if (ToNextLevel(m) < w / S(m))
                {
                    l += ToNextLevel(m);
                    w -= ToNextLevel(m) * S(m);
                    m = NextLevel(m);
                }
                else
                {
                    w /= S(m);
                    l += (int)w;
                    break;
                }
            }

            Console.WriteLine(l);
        }
    }
}


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

namespace CodeForce
{
    public class SolutionB
    {
        public static void Main(string[] args)
        {
            string[] ulaz = System.Console.ReadLine().Split(new char[] {' '});

            Int64 w = Int64.Parse(ulaz[0]);
            Int64 m = Int64.Parse(ulaz[1]);
            Int64 k = Int64.Parse(ulaz[2]);

            Decimal start = 0;
            Int64 cnt = 0;
            Int64 rez = 0;

            int cifre = getnum(m);
            while (true)
            {

                if ((((long)Math.Pow(10,cifre))-m)*k<w)
                {
                    w = w - (((long) Math.Pow(10, cifre )) - m)*k;
                    rez += (((long) Math.Pow(10, cifre )) - m);
                    cifre++;
                    m = (long)Math.Pow(10, cifre - 1);
                }
                else
                {
                    long t = w/(k*cifre);
                    rez += t;
                    break;
                }

            }

            System.Console.WriteLine(rez);
            System.Console.ReadLine();

        }

        private static int getnum(Int64 m)
        {
            int rv = 0;
            while (m > 0)
            {
                m = m / 10;
                rv++;

            }
            return rv;
        }

    }
}


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

namespace A.Infinite_Sequence
{
    class Program
    {
        static void Main(string[] args)
        {
            long nth = int.Parse(Console.ReadLine());
            long answer = 1;
            long  inc = 1;
            long i = 1;
            long temp = 0;
            while (inc<=nth)
            {
                temp = inc;
                inc+=i;
                i++;

            }
            while (temp<nth)
            {
                answer++;
                temp++;
            }
            Console.WriteLine(answer);
            Console.ReadLine();
        }
    }
}


class Solution {
    static void Main(String[] args) {

        string[] l=Console.ReadLine().Split();
        int n= Convert.ToInt32(l[0]);
        int i = 0;
        int s = 0;
        while(i < n)
        {
            s = s + i + (i - s);
            i++;
        }
        Console.WriteLine(n - s + i);
    }
}


/*
 * User: ������
 * Date: 11.02.2016
 * Time: 11:49

A. ����������� ������������������
���������� ����������� ������������������ ����� �����: 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5....
��� ������������������ ���������� ��������� �������: ������� �������� ����� 1, ����� ����� �� 1 �� 2,
����� ����� �� 1 �� 3, ����� ����� �� 1 �� 4 � ��� �����.
�������� ��������, ��� ��� ������������������ ����� �����, � �� ����.
��������, ����� 10 ������� ����������� � ���� ������������������ �� 55 ������� (�������� ���������� � �������).
������� �����, ����������� �� n-� �������, ���� ��������� ���������� � �������.
������� ������
� ������������ ������ ��������� ����� ����� n (1 <= n <= 10^14) � ������� �����, ������� ����� �����.
�������� ��������, ��� �������� ����� �� ���������� � 32-������ ���� ������.
��� ���������� ����� �� ������ ������������, ��������, ��� long long � ����� C++ ��� ��� long � ����� Java.
�������� ������
�������� n-� ������� ������������������ (�������� ���������� � �������).
������� ������
������� ������
3
�������� ������
2
������� ������
5
�������� ������
2
������� ������
10
�������� ������
4
������� ������
55
�������� ������
10
������� ������
56
�������� ������
1

 */

using System;

namespace Edu003A
{
	class Program
	{
		public static void Main(string[] args)
		{
			Int64 n = Int64.Parse (Console.ReadLine ());
			Int64 m = int.Parse (Console.ReadLine ());
			int [] a = new int [n];
			for ( int i=0; i < n; i++ )
				a [i] = int.Parse (Console.ReadLine ());

			Array.Sort (a);

			int k=0, m=0;
			for ( int j=n-1; k < b; j--, m++ )
				k += a [j];

			Console.WriteLine (m);

//			Console.ReadKey(true);
		}
	}
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using CompLib.Util;

public class Program
{
    private int N;
    private List<(int to, int num)>[] E;
    private int[] U, V;
    private int Max;

    private int R;
    private bool[] IsX;
    private bool Found;
    private int XSize;

    private int[] Len;
    private int[] Dist;
    private int TmpX;
    private int TmpY;

    void Scan()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        E = new List<(int to, int num)>[N];
        U = new int[N - 1];
        V = new int[N - 1];
        for (int i = 0; i < N; i++)
        {
            E[i] = new List<(int to, int num)>();
        }

        for (int i = 0; i < N - 1; i++)
        {
            int u = sc.NextInt() - 1;
            int v = sc.NextInt() - 1;
            U[i] = u + 1;
            V[i] = v + 1;
            E[u].Add((v, i));
            E[v].Add((u, i));
        }

        Max = 2 * N * N / 9;
    }

    void SetFlag(int cur, int par)
    {
        foreach ((int to, int num) e in E[cur])
        {
            if (e.to == par) continue;
            SetFlag(e.to, cur);
        }

        IsX[cur] = true;
    }

    int Go(int cur, int par)
    {
        var ls = new List<(int to, int size)>();
        int size = 1;
        foreach (var e in E[cur])
        {
            if (e.to == par) continue;
            int tmp = Go(e.to, cur);
            ls.Add((e.to, tmp));
            size += tmp;
        }

        // if (par != -1)
        // {
        //     ls.Add((par, N - size));
        // }

        // 親側は処理が難しいので飛ばす
        // x,y逆になってもいいので問題ない
        bool[,] dp = new bool[ls.Count + 1, N];
        dp[0, 0] = true;
        for (int i = 0; i < ls.Count; i++)
        {
            for (int j = 0; j < N; j++)
            {
                if (dp[i, j]) dp[i + 1, j + ls[i].size] = true;
            }
        }

        if (!Found)
        {
            int x = -1;
            for (int i = 0; i < N; i++)
            {
                if (!dp[ls.Count, i]) continue;
                int y = N - 1 - i;
                if (Max < (i + 1) * (y + 1))
                {
                    x = i;
                    break;
                }
            }

            if (x != -1)
            {
                XSize = x;
                R = cur;
                for (int i = ls.Count - 1; i >= 0; i--)
                {
                    if (x - ls[i].size >= 0 && dp[i, x - ls[i].size])
                    {
                        SetFlag(ls[i].to, cur);
                        x -= ls[i].size;
                    }
                }

                Found = true;
            }
        }

        return size;
    }

    // r、x,yの頂点を決める
    void SearchR()
    {
        IsX = new bool[N];
        Found = false;
        Go(0, -1);
    }

    // 現在地、親、par-curが辺num
    void SetX(int cur, int par, int num)
    {
        Dist[cur] = TmpX++;
        if (par != -1)
        {
            Len[num] = Dist[cur] - Dist[par];
        }

        foreach ((int to, int num) e in E[cur])
        {
            if (e.to == par) continue;
            if (!IsX[e.to]) continue;
            SetX(e.to, cur, e.num);
        }
    }

    void SetY(int cur, int par, int num)
    {
        Dist[cur] = TmpY;
        TmpY += (XSize + 1);
        if (par != -1)
        {
            Len[num] = Dist[cur] - Dist[par];
        }

        foreach ((int to, int num) e in E[cur])
        {
            if (e.to == par) continue;
            if (IsX[e.to]) continue;
            SetY(e.to, cur, e.num);
        }
    }

    void SetLen()
    {
        // 辺の長さ
        Len = new int[N - 1];
        // R->頂点までの距離
        Dist = new int[N];
        // X側の頂点はRに近い順に距離1~Xを割り当てる
        // それぞれの頂点までの距離になるように頂点の長さを割り当てる
        TmpX = 0;
        SetX(R, -1, -1);

        // Y (X+1)刻みで割り当てる
        TmpY = 0;
        SetY(R, -1, -1);
    }

    void Write()
    {
        var sb = new StringBuilder();
        for (int i = 0; i < N - 1; i++)
        {
            sb.AppendLine($"{U[i]} {V[i]} {Len[i]}");
        }

        Console.Write(sb);
    }

    public void Solve()
    {
        // ある頂点rを境目に2つに分ける
        // 片方x個 もう片方 y個 x + y + 1 = N
        // 片方でrからの距離 0~xをつくる
        // 残り x+1刻みで y個
        // 0 <= p < (x+1)(y+1)できる

        Scan();
        SearchR();
        SetLen();
        Write();
    }

    public static void Main(string[] args)
    {
        new Thread(new ThreadStart(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 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.Text;
using System.Threading;
using CompLib.Util;

public class Program
{
    private int N;
    private List<(int to, int num)>[] E;
    private int[] U, V;
    private int Max;

    private int R;
    private bool[] IsX;
    private bool Found;
    private int XSize;

    private int[] Len;
    private int[] Dist;
    private int TmpX;
    private int TmpY;

    void Scan()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        E = new List<(int to, int num)>[N];
        U = new int[N - 1];
        V = new int[N - 1];
        for (int i = 0; i < N; i++)
        {
            E[i] = new List<(int to, int num)>();
        }

        for (int i = 0; i < N - 1; i++)
        {
            int u = sc.NextInt() - 1;
            int v = sc.NextInt() - 1;
            U[i] = u + 1;
            V[i] = v + 1;
            E[u].Add((v, i));
            E[v].Add((u, i));
        }

        Max = 2 * N * N / 9;
    }

    void SetFlag(int cur, int par)
    {
        foreach ((int to, int num) e in E[cur])
        {
            if (e.to == par) continue;
            SetFlag(e.to, cur);
        }

        IsX[cur] = true;
    }

    int Go(int cur, int par)
    {
        var ls = new List<(int to, int size)>();
        int size = 1;
        foreach (var e in E[cur])
        {
            if (e.to == par) continue;
            int tmp = Go(e.to, cur);
            ls.Add((e.to, tmp));
            size += tmp;
        }

        // if (par != -1)
        // {
        //     ls.Add((par, N - size));
        // }

        if (!Found)
        {
            // 親側は処理が難しいので飛ばす
            // x,y逆になってもいいので問題ない
            bool[,] dp = new bool[ls.Count + 1, N];
            dp[0, 0] = true;
            for (int i = 0; i < ls.Count; i++)
            {
                for (int j = 0; j < N; j++)
                {
                    if (dp[i, j]) dp[i + 1, j + ls[i].size] = true;
                }
            }

            int x = -1;
            for (int i = 0; i < N; i++)
            {
                if (!dp[ls.Count, i]) continue;
                int y = N - 1 - i;
                if (Max < (i + 1) * (y + 1))
                {
                    x = i;
                    break;
                }
            }

            if (x != -1)
            {
                XSize = x;
                R = cur;
                for (int i = ls.Count - 1; i >= 0; i--)
                {
                    if (x - ls[i].size >= 0 && dp[i, x - ls[i].size])
                    {
                        SetFlag(ls[i].to, cur);
                        x -= ls[i].size;
                    }
                }

                Found = true;
            }
        }

        return size;
    }

    // r、x,yの頂点を決める
    void SearchR()
    {
        IsX = new bool[N];
        Found = false;
        Go(0, -1);
        if (!Found) throw new Exception();
    }

    // 現在地、親、par-curが辺num
    void SetX(int cur, int par, int num)
    {
        Dist[cur] = TmpX++;
        if (par != -1)
        {
            Len[num] = Dist[cur] - Dist[par];
        }

        foreach ((int to, int num) e in E[cur])
        {
            if (e.to == par) continue;
            if (!IsX[e.to]) continue;
            SetX(e.to, cur, e.num);
        }
    }

    void SetY(int cur, int par, int num)
    {
        Dist[cur] = TmpY;
        TmpY += (XSize + 1);
        if (par != -1)
        {
            Len[num] = Dist[cur] - Dist[par];
        }

        foreach ((int to, int num) e in E[cur])
        {
            if (e.to == par) continue;
            if (IsX[e.to]) continue;
            SetY(e.to, cur, e.num);
        }
    }

    void SetLen()
    {
        // 辺の長さ
        Len = new int[N - 1];
        // R->頂点までの距離
        Dist = new int[N];
        // X側の頂点はRに近い順に距離1~Xを割り当てる
        // それぞれの頂点までの距離になるように頂点の長さを割り当てる
        TmpX = 0;
        SetX(R, -1, -1);

        // Y (X+1)刻みで割り当てる
        TmpY = 0;
        SetY(R, -1, -1);
    }

    void Write()
    {
        var sb = new StringBuilder();
        for (int i = 0; i < N - 1; i++)
        {
            sb.AppendLine($"{U[i]} {V[i]} {Len[i]}");
        }

        Console.Write(sb);
    }

    public void Solve()
    {
        // ある頂点rを境目に2つに分ける
        // 片方x個 もう片方 y個 x + y + 1 = N
        // 片方でrからの距離 0~xをつくる
        // 残り x+1刻みで y個
        // 0 <= p < (x+1)(y+1)できる

        Scan();
        SearchR();
        SetLen();
        Write();
    }

    public static void Main(string[] args)
    {
        new Thread(new ThreadStart(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 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.Generic;
using System.Linq;
using System.Text;

namespace code_32
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            long a = int.Parse(s.Substring(0,s.IndexOf(' ')));
            s = s.Substring(s.IndexOf(' ') + 1);
            long b = int.Parse(s.Substring(0, s.IndexOf(' ')));
            s = s.Substring(s.IndexOf(' ') + 1);
            long x = int.Parse(s.Substring(0, s.IndexOf(' ')));
            long y = int.Parse(s.Substring( s.IndexOf(' ')+1));

            long t = 2;

            while (true)
            {
                if (t > x || t > y) break;
                if (x % t == 0 && y % t == 0)
                {
                    x /= t;
                    y /= t;
                }
                else
                    t++;

            }
            long k=Math.Min(a/x,b/y);
            Console.WriteLine(k*x + " " + k*y);
          }
    }
}


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

namespace _16C___Монитор
{
    class Program
    {
        static long gcd(long a, long b)
        {
            while (a != b)
            {
                if (a < b) b -= a;
                else if (b < a) a -= b;
            }
            return a;
        }
        static void Main(string[] args)
        {
            string[] t = Console.ReadLine().Split(' ');
            long a = long.Parse(t[0]);
            long b = long.Parse(t[1]);
            long x = long.Parse(t[2]);
            long y = long.Parse(t[3]);
            if (Math.Min(x,y)>10000)
            {
                int d = gcd(x, y);
                x = x / d;
                y = y / d;
            }
            else
            {
                long d = 1;
                long min = Math.Min(x,y);
                for (int i = 1; i <= min; i++)
                {
                    if (x % i == 0 && y % i == 0)
                        d = i;
                }
                x = x / d;
                y = y / d;
            }
            double r1 = a * 1.0 / b;
            double r2 = x * 1.0 / y;
            if (r1 == r2)
            {
                Console.WriteLine(a + " " + b);
                return;
            }
            long newA = 0;
            long newB = 0;
            if (r1 > r2)
            {
                newB = (b / y) * y;
                newA = newB * x / y;
            }
            else
            {
                newA = (a / x) * x;
                newB = newA * y / x;
            }
            Console.WriteLine(newA + " " + newB);
        }
    }
}


using System;

namespace ConsoleApplication1
{
    internal class Program
    {
        #region vvv
        //private static string s = string.Empty;
        //private static string res = string.Empty;
        //private static string t = string.Empty;

        //private const string alph = "*ABCDEFGHIJKLMNOPQRSTUVWXYZ";

        //static string RC(string x)
        //{
        //    t = res = "";

        //    var ind = 0;

        //    for (int i = 1; i < x.Length; i++)
        //    {
        //        if (x[i] == 'C')
        //        {
        //            ind = i + 1;
        //            break;
        //        }

        //        t += x[i];
        //    }

        //    res = t;

        //    t = "";

        //    for (int i = ind; i < x.Length; i++)
        //    {
        //        t += x[i];
        //    }

        //    var a = int.Parse(t);

        //    if (a <= 26)
        //    {
        //        res = alph[a] + res;
        //    }
        //    else
        //    {
        //        res = alph[a % 26] + res;

        //        while (true)
        //        {
        //            var k = a/26;

        //            t = "";

        //            if (k < 27)
        //            {
        //                t += alph[k];
        //                break;
        //            }

        //            t += alph[26];
        //            a /= 26;
        //        }

        //        res = t + res;
        //    }

        //    return res;
        //}
        #endregion

        private static void Main(string[] args)
        {
            string[] a = {"vaporeon", "jolteon", "flareon", "espeon", "umbreon", "leafeon", "glaceon", "sylveon"};

            var n = int.Parse(Console.ReadLine());

            var s = Console.ReadLine();

            var f = 0;
            var ind = 0;

            for (int i = 0; i < 8; i++)
            {
                if (a[i].Length != n)
                    continue;

                var temp = 0;

                for (int j = 0; j < n; j++)
                {
                    if (a[i][j] == s[j])
                        temp++;
                }

                if (f < temp)
                {
                    f = temp;
                    ind = i;
                }
            }

            Console.WriteLine(a[ind]);
        }
    }
}