using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using static System.Console;
using static System.Convert;
using static System.Math;
using static Template;
using Pi = Pair<int, int>;

class Solver
{
    public void Solve(Scanner sc)
    {
        var G = sc.Grid(10);
        var gh = new[] { 0,  0, 1, 1, 1, -1, -1, -1 };
        var gw = new[] { 1,  -1, 1, 0, -1, 1, 0, -1 };
        for (int i = 0; i < 10; i++)
            for (int j = 0; j < 10; j++)
            {
                for(int k = 0; k < 8; k++)
                {
                    var t = 0;
                    var c = 0;
                    for(int l = 0; l < 5; l++)
                    {
                        int y = gh[k] * l + i, x = gw[k] * l + j;
                        if (0 <= y && y < 10 && 0 <= x && x < 10)
                        {
                            t += ToInt32(G[y][x] == 'X');
                            c += ToInt32(G[y][x] == '.');
                        }
                        else goto END;
                    }
                    if (t == 4 && c == 1) Fail("YES");
                END:;
                }
            }
        Console.WriteLine("NO");
    }
}

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

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2> p)
    {
        var c = Comparer<T1>.Default.Compare(v1, p.v1);
        if (c == 0)
            c = Comparer<T2>.Default.Compare(v2, p.v2);
        return c;
    }
    public override string ToString() => $"{v1.ToString()} {v2.ToString()}";
    public void Deconstruct(out T1 a, out T2 b) { a = v1; b = v2; }
}

public class Pair<T1, T2, T3> : Pair<T1, T2>, IComparable<Pair<T1, T2, T3>>
{
    public T3 v3;
    public Pair() : base() { }
    public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)
    { this.v3 = v3; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2, T3> p)
    {
        var c = base.CompareTo(p);
        if (c == 0)
            c = Comparer<T3>.Default.Compare(v3, p.v3);
        return c;
    }
    public override string ToString() => $"{base.ToString()} {v3.ToString()}";
    public void Deconstruct(out T1 a, out T2 b, out T3 c) { Deconstruct(out a, out b); c = v3; }
}
#endregion


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

namespace cfr25
{
    class MainClass
    {
		public static void Main(string[] args)
		{
			string[] arr = new string[10];
			for (int i = 0; i < 10; i++)
				arr[i] = Console.ReadLine();
			bool flag = false;
			for (int i = 0; i < 10; i++)
				for (int j = 0; j <= (10 - 5); j++)
				{
					int dot = 0;
					int xxx = 0;
					for (int kl = j; kl < j + 5; kl++)
					{
						if ((arr[i])[kl] == 'X') xxx++;
						if ((arr[i])[kl] == '.') dot++;
					}
					if ((dot == 1) && (xxx == 4)) flag = true;
				}
			if (flag == false)
				for (int i = 0; i < 10; i++)
					for (int j = 0; j <= (10 - 5); j++)
					{
						int dot = 0;
						int xxx = 0;
						for (int kl = j; kl < j + 5; kl++)
						{
							if ((arr[kl])[i] == 'X') xxx++;
							if ((arr[kl])[i] == '.') dot++;
						}
						if ((dot == 1) && (xxx == 4)) flag = true;
					}
			if (flag == false)
				for (int i = 0; i <= (10 - 5); i++)
					for (int j = 0; j <= (10 - 5); j++)
					{
						int dot = 0;
						int xxx = 0;
						for (int kl = j, kll = i; kl < j + 5; kl++, kll++)
						{
							if ((arr[kll])[kl] == 'X') xxx++;
							if ((arr[kll])[kl] == '.') dot++;
						}
						if ((dot == 1) && (xxx == 4)) flag = true;
					}
			if (flag == false)
				for (int i = 9; i >= 4; i--)
					for (int j = 0; j <= (10 - 5); j++)
					{
						int dot = 0;
						int xxx = 0;
						for (int kl = j, kll = i; kl < j + 5; kl++, kll--)
						{
							if ((arr[kll])[kl] == 'X') xxx++;
							if ((arr[kll])[kl] == '.') dot++;
						}
						if ((dot == 1) && (xxx == 4)) flag = true;
					}
			if (!flag)
				Console.WriteLine("NO");
			else Console.WriteLine("YES");
		}
    }
}


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

class Solver
{
    //  test
    static CodeforcesUtils CF = new CodeforcesUtils( new[]{

@"
100 200 250 150 200 250
"
,
@"
100 50 50 200 200 100
"
,
@"
100 10 200 20 300 30
"
    ,
@"
0 0 0 0 0 0
"

,
@"
1 1 0 1 1 1
"
,
@"
1 0 1 2 1 2
"
,
@"
100 1 100 1 0 1
"

    });

    public void Solve()
    {
        var ss = CF.ReadLine().Split(' ');
        List<int> a = new List<int>();
        foreach (var s in ss)
            a.Add(int.Parse(s));

        if (a[2] == 0 && a[3] > 0)
            CF.WriteLine("Ron");
        else if (a[0]*a[2] == 0 && a[1]*a[3] > 0)
            CF.WriteLine("Ron");
        else if (a[0]*a[2] * a[4] == 0 && a[1]*a[3] * a[5] > 0)
            CF.WriteLine("Ron");

        else if (a[1] * a[3] * a[5] > a[0] * a[2] * a[4])
            CF.WriteLine("Ron");
        else
            CF.WriteLine("Hermione");

    }

    #region test

    static void Main(string[] args)
    {
        System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ru-RU");

#if DEBUG
        for (int t=0;t<CF.TestCount;t++ )
        {
            CF.Test(t);
            new Solver().Solve();
        }
#else
        new Solver().Solve();
#endif
        CF.Close();
    }

    static void TLE()
    {
        for (; ; ) ;
    }

    class CodeforcesUtils
    {
        public void Test(int t)
        {
            _lines = new List<string>();
            string[] ss = _test_input[t].Replace("\n", "").Split('\r');
            for (int i = 0; i < ss.Length; i++)
            {
                if (
                    (i == 0 || i == ss.Length - 1) &&
                    ss[i].Length == 0
                    )
                    continue;

                _lines.Add(ss[i]);
            }
        }

        public int TestCount
        {
            get
            {
                return _test_input.Length;
            }
        }

        public string ReadLine()
        {
#if DEBUG
            string s = null;
            if (_lines.Count > 0)
            {
                s = _lines[0];
                _lines.RemoveAt(0);
            }
            return s;

#else
            //return _sr.ReadLine();
        return Console.In.ReadLine();
#endif
        }

        public void WriteLine(object o)
        {
#if DEBUG
            System.Diagnostics.Trace.WriteLine(o);
#else
            //_sw.WriteLine(o);
        Console.WriteLine(o);
#endif
        }

        public void Write(object o)
        {
#if DEBUG
            System.Diagnostics.Trace.Write(o);
#else
                //_sw.Write(o);
        Console.Write(o);
#endif
        }

        string[] _test_input;

        List<string> _lines;

#if DEBUG
        public CodeforcesUtils(string[] test_input)
        {
            _test_input = test_input;
        }
#else

        public CodeforcesUtils(string[] dummy)
        {
            //_sr = new System.IO.StreamReader("input.txt");
            //_sw = new System.IO.StreamWriter("output.txt");
        }
#endif

        public void Close()
        {
            if( _sr!= null)
                _sr.Close();
            if( _sw != null)
                _sw.Close();
        }

        System.IO.StreamReader _sr=null;
        System.IO.StreamWriter _sw=null;

    }

    #endregion
}


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

    class Program
    {
        static void Main(string[] args)
        {
            string[] werte = Console.ReadLine().Split(' ');
            int a, b, c, d, e, f;

            a = Convert.ToInt32(werte[0]);
            b = Convert.ToInt32(werte[1]);
            c = Convert.ToInt32(werte[2]);
            d = Convert.ToInt32(werte[3]);
            e = Convert.ToInt32(werte[4]);
            f = Convert.ToInt32(werte[5]);

            if (istOk(a, b, c, d, e, f) == true)
            {
                Console.WriteLine("Ron");
            }
            else
            {
                Console.WriteLine("Hermione");
            }

            Console.ReadLine();
        }

        public static bool istOk(int a, int b, int c, int d, int e, int f)
        {
            bool ex_istOk = false;

            int a1, b1, c1, d1, e1, f1;
            a1 = 0;
            b1 = 0;
            c1 = 0;
            d1 = 0;
            e1 = 0;
            f1 = 0;

            if ( d != 0 )
            {
                if(c==0) ex_istOk = true;

                if (c != 0 && b != 0)
                {
                    if (a == 0) ex_istOk = true;

                    else if(a != 0 && f != 0)
                    {
                        if (e == 0) ex_istOk = true;
                        else
                        {
                            e1 = Delimoe((Delimoe(b, c) / c * d), e);
                            d1 = e1;
                            f1 = e1 / e * f;
                            c1 = d1 / d * c;
                            b1 = c1;
                            a1 = b1 / b * a;

                            if (f1 > a1) ex_istOk = true;
                        }
                    }
                }

            }
            return ex_istOk;
        }

        public static int Delimoe (int a, int b)
        {
            int maxDel = Math.Max(a,b);

            while (maxDel % a != 0 || maxDel % b != 0)
                    maxDel++;

            return maxDel;
        }

    }


using System;
using System.Collections.Generic;
using System.Linq;
using Solver.Ex;
using Watch = System.Diagnostics.Stopwatch;
using StringBuilder = System.Text.StringBuilder;
namespace Solver
{

    public class Solver
    {
        public void Solve()
        {
            var n = sc.Integer();
            var k = sc.Integer();
            var t = sc.Integer();
            var l = new List<Pair<int>>();
            for (int i = 0; i < n; i++)
            {
                var v = sc.Integer();
                if (l.Count == 0)
                    l.Add(new Pair<int>(v, 1));
                else
                {
                    var end = l[l.Count - 1];
                    if (end.L == v)
                        l[l.Count - 1] = new Pair<int>(v, end.R + 1);
                    else l.Add(new Pair<int>(v, 1));
                }
            }
            var ret = 1;
            for (int u = 0; u < l.Count; u++)
            {
                var st = new Stack<Pair<int>>();
                var count = 0;
                for (int i = 0; i < u; i++)
                    st.Push(l[i]);
                st.Push(new Pair<int>(t, 1));
                for (int i = u; i < l.Count; i++)
                {
                    if (!st.Any())
                        break;
                    var last = st.Peek();
                    var next = l[i];
                    if (last.L == next.L && last.R + next.R >= 3)
                    {
                        st.Pop();
                        count += last.R + next.R;
                    }
                    else break;
                }
                ret = Math.Max(ret, count);

            }
            IO.Printer.Out.PrintLine(ret - 1);

        }
        internal IO.StreamScanner sc;
    }

    #region Main and Settings
    static class Program
    {
        static void Main(string[] arg)
        {
#if DEBUG
            var errStream = new System.IO.FileStream(@"..\..\dbg.out", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
            System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, "debugStream"));
            System.Diagnostics.Debug.AutoFlush = false;
            var sw = new Watch();
            sw.Start();
            try
            {
#endif
                var solver = new Solver();
                solver.sc = new IO.StreamScanner(Console.OpenStandardInput());
                IO.Printer.Out = new IO.Printer(new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
                solver.Solve();
                IO.Printer.Out.Flush();
#if DEBUG
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                Console.Error.WriteLine(ex.StackTrace);
            }
            finally
            {
                sw.Stop();
                Console.ForegroundColor = ConsoleColor.Green;
                Console.Error.WriteLine("Time:{0}ms", sw.ElapsedMilliseconds);
                System.Diagnostics.Debug.Close();
                System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
            }
#endif
        }

    }
    #endregion
}
#region IO Helper
namespace Solver.IO
{
    public class Printer
    {
        static Printer()
        {
            Out = new Printer(Console.Out);
        }
        public static Printer Out { get; set; }
        private readonly System.IO.TextWriter writer;
        private readonly System.Globalization.CultureInfo info;
        public string Separator { get; set; }
        public string NewLine { get { return writer.NewLine; } set { writer.NewLine = value ?? "\n"; } }
        public Printer(System.IO.TextWriter tw = null, System.Globalization.CultureInfo ci = null, string separator = null, string newLine = null)
        {
            writer = tw ?? System.IO.TextWriter.Null;
            info = ci ?? System.Globalization.CultureInfo.InvariantCulture;
            NewLine = newLine;
            Separator = separator ?? " ";
        }
        public void Print(int num) { writer.Write(num.ToString(info)); }
        public void Print(int num, string format) { writer.Write(num.ToString(format, info)); }
        public void Print(long num) { writer.Write(num.ToString(info)); }
        public void Print(long num, string format) { writer.Write(num.ToString(format, info)); }
        public void Print(double num) { writer.Write(num.ToString("F12", info)); }
        public void Print(double num, string format) { writer.Write(num.ToString(format, info)); }
        public void Print(string str) { writer.Write(str); }
        public void Print(string format, params object[] arg) { writer.Write(string.Format(info, format, arg)); }
        public void Print<T>(string format, IEnumerable<T> sources) { writer.Write(format, sources.OfType<object>().ToArray()); }
        public void Print(IEnumerable<char> sources) { writer.Write(sources.AsString()); }
        public void Print<T>(IEnumerable<T> sources)
        {
            var res = new System.Text.StringBuilder();
            foreach (var x in sources)
            {
                res.AppendFormat(info, "{0}", x);
                if (string.IsNullOrEmpty(Separator))
                    res.Append(Separator);
            }
            writer.Write(res.ToString(0, res.Length - Separator.Length));
        }
        public void PrintLine() { writer.WriteLine(); }
        public void PrintLine(int num) { writer.WriteLine(num.ToString(info)); }
        public void PrintLine(int num, string format) { writer.WriteLine(num.ToString(format, info)); }
        public void PrintLine(long num) { writer.WriteLine(num.ToString(info)); }
        public void PrintLine(long num, string format) { writer.WriteLine(num.ToString(format, info)); }
        public void PrintLine(double num) { writer.WriteLine(num.ToString("F12", info)); }
        public void PrintLine(double num, string format) { writer.WriteLine(num.ToString(format, info)); }
        public void PrintLine(string str) { writer.WriteLine(str); }
        public void PrintLine(string format, params object[] arg) { writer.WriteLine(string.Format(info, format, arg)); }
        public void PrintLine<T>(string format, IEnumerable<T> sources) { writer.WriteLine(format, sources.OfType<object>().ToArray()); }
        public void PrintLine<T>(IEnumerable<T> sources)
        {
            var res = new StringBuilder();
            foreach (var x in sources)
            {
                res.AppendFormat(info, "{0}", x);
                if (!string.IsNullOrEmpty(Separator))
                    res.Append(Separator);
            }
            writer.WriteLine(res.ToString(0, res.Length - Separator.Length));
        }
        public void Flush() { writer.Flush(); }
    }
    public class StreamScanner
    {
        public StreamScanner(System.IO.Stream stream)
        {
            iStream = stream;
        }
        private readonly System.IO.Stream iStream;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        private bool eof = false;
        public bool EndOfStream { get { return eof; } }
        private byte readByte()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            if (ptr >= len)
            {
                ptr = 0;
                len = iStream.Read(buf, 0, 1024);
                if (len <= 0)
                {
                    eof = true;
                    return 0;
                }
            }
            return buf[ptr++];
        }
        private bool inSpan(byte c)
        {
            const byte lb = 33, ub = 126;
            return !(c >= lb && c <= ub);
        }
        private byte skip()
        {
            byte b = 0;
            do b = readByte();
            while (!eof && inSpan(b));
            return b;
        }
        public char Char()
        {
            return (char)skip();
        }
        public char[] Char(int n)
        {
            var a = new char[n];
            for (int i = 0; i < n; i++)
                a[i] = (char)skip();
            return a;
        }
        public char[][] Char(int n, int m)
        {
            var a = new char[n][];
            for (int i = 0; i < n; i++)
                a[i] = Char(m);
            return a;
        }
        public string Scan()
        {

            const byte lb = 33, ub = 126;
            if (eof) throw new System.IO.EndOfStreamException();

            do
            {
                while (ptr < len && (buf[ptr] < lb || ub < buf[ptr]))
                {
                    ptr++;
                }
                if (ptr < len)
                    break;
                ptr = 0;
                len = iStream.Read(buf, 0, 1024);
                if (len <= 0)
                {
                    eof = true;
                    return null;
                }
                continue;
            } while (true);

            StringBuilder sb = null;
            do
            {
                var i = ptr;
                while (i < len)
                {
                    if (buf[i] < lb || ub < buf[i])
                    {
                        string s;
                        if (sb != null)
                        {
                            sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                            s = sb.ToString();
                        }
                        else s = new string(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                        ptr = i + 1;
                        return s;
                    }
                    i++;
                }
                i = len - ptr;
                if (sb == null) sb = new StringBuilder(i + 32);
                sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i));
                ptr = 0;
            } while ((len = iStream.Read(buf, 0, 1024)) > 0);
            eof = true;
            return sb.ToString();
        }
        public string[] Scan(int n)
        {
            var a = new string[n];
            for (int i = 0; i < n; i++)
                a[i] = Scan();
            return a;
        }
        public string ScanLine()
        {
            const byte el = 10, cr = 13;
            if (eof) throw new System.IO.EndOfStreamException();
            StringBuilder sb = null;
            do
            {
                var i = ptr;
                while (i < len)
                {
                    if (buf[i] == cr || buf[i] == el)
                    {
                        string s;
                        if (sb != null)
                        {
                            sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                            s = sb.ToString();
                        }
                        else s = new string(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                        if (buf[i] == cr) i++;
                        if (buf[i] == el) i++;
                        ptr = i;
                        return s;
                    }
                    i++;
                }
                i = len - ptr;
                if (sb == null) sb = new StringBuilder(i + 32);
                sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i));
                ptr = 0;
            } while ((len = iStream.Read(buf, 0, 1024)) > 0);
            eof = true;
            return sb.ToString();
        }
        public double Double()
        {
            return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture);
        }
        public double[] Double(int n)
        {
            var a = new double[n];
            for (int i = 0; i < n; i++)
                a[i] = Double();
            return a;
        }
        public int Integer()
        {
            var ret = 0;
            byte b = 0;
            bool isMynus = false;
            const byte zero = 48, nine = 57, mynus = 45;
            do b = readByte();
            while (!eof && !((b >= zero && b <= nine) || b == mynus));

            if (b == mynus)
            {
                isMynus = true;
                b = readByte();
            }
            while (true)
            {
                if (b >= zero && b <= nine)
                {
                    ret = ret * 10 + b - zero;
                }
                else return isMynus ? -ret : ret;
                b = readByte();
            }

        }
        public int[] Integer(int n)
        {
            var a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = Integer();
            return a;
        }
        public long Long()
        {
            long ret = 0;
            byte b = 0;
            bool isMynus = false;
            const byte zero = 48, nine = 57, mynus = 45;
            do b = readByte();
            while (!eof && !((b >= zero && b <= nine) || b == mynus));
            if (b == '-')
            {
                isMynus = true;
                b = readByte();
            }
            while (true)
            {
                if (b >= zero && b <= nine)
                    ret = ret * 10 + (b - zero);
                else return isMynus ? -ret : ret;
                b = readByte();
            }

        }
        public long[] Long(int n)
        {
            var a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = Long();
            return a;
        }
        public void Flush()
        {
            iStream.Flush();
        }

    }

}
#endregion
#region Extension
namespace Solver.Ex
{
    static public partial class EnumerableEx
    {
        static public string AsString(this IEnumerable<char> source)
        {
            return new string(source.ToArray());
        }
        static public string AsJoinedString<T>(this IEnumerable<T> source, string separator = " ")
        {
            return string.Join(separator, source);
        }
        static public T[] Enumerate<T>(this int n, Func<int, T> selector)
        {
            var res = new T[n];
            for (int i = 0; i < n; i++)
                res[i] = selector(i);
            return res;
        }
    }
}
#endregion
#region Pair<T>

public struct Pair<T>
{
    public T L;
    public T R;
    public Pair(T l, T r)
        : this()
    {
        L = l;
        R = r;
    }
    public Pair(params T[] arg)
        : this(arg[0], arg[1])
    {
    }
    public override string ToString()
    {
        return string.Format("{0} {1}", L, R);
    }
}
#endregion


using System;

namespace AllProblems
{
    class Program
    {
        static void Main(string[] args)
        {
            _430B_BallsGame.Run();
        }
    }
    public class _430B_BallsGame
    {
        public static void Run()
        {
            var s1 = Console.ReadLine().Split(' ');
            var n = Int32.Parse(s1[0]);
            //var k = Int32.Parse(s1[1]);
            var x = Int32.Parse(s1[2]);

            var s2 = Console.ReadLine().Split(' ');
            var cols = new int[n];
            for (var i = 0; i < n; i++)
            {
                cols[i] = Int32.Parse(s2[i]);
            }

            var d = DoIt(cols, n, x);
            Console.WriteLine(d);
        }

        private static int DoIt(int[] cols, int n, int x)
        {
            var max = 0;
            for (var i = 1; i < n; i++)
            {
                var c = InsertItem(cols, i, x);
                while (c.Length > 0)
                {
                    var old = c.Length;
                    c = Delete3S(c);
                    if (c.Length == old) break;
                }
                var len = n - c.Length;
                if (len > max) max = len;
                if (max == n) return max;
            }

            return max;
        }

        private static int[] InsertItem(int[] num, int index, int x)
        {
            var len = num.Length + 1;
            var arr = new int[len];

            for (var i = 0; i < index; i++)
            {
                arr[i] = num[i];
            }
            arr[index] = x;
            for (var i = index + 1; i < len; i++)
            {
                arr[i] = num[i - 1];
            }

            return arr;
        }

        private static int[] Delete3S(int[] num)
        {
            var len = num.Length;
            if (len == 0) return new int[0];
            var start = 0;
            var ctr = 1;
            var prev = num[0];
            for (var i = 1; i < len; i++)
            {
                var cur = num[i];
                if (cur == prev)
                {
                    ++ctr;
                }else {
                    if (ctr > 2)
                    {
                        break;
                    }
                    ctr = 1;
                    start = i;
                }
                prev = cur;
            }

            var end = start + ctr;
            if (ctr > 2)
            {
                var arr = new int[len - ctr];
                for (var i = 0; i < start; i++)
                {
                    arr[i] = num[i];
                }
                for (var i = end; i < len; i++)
                {
                    arr[i - ctr] = num[i];
                }

                return arr;
            }
            return num;
        }
    }
}


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

namespace Nicholas_and_Permutation
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] r = Console.ReadLine().Split(' ');
            int ind1 = -1;
            int indN = -1;
            for (int i = 0; i < n; i++)
            {
                int a = int.Parse(r[i]);
                if (a == 1) ind1 = i + 1;
                else if (a == n) indN = i + 1;
            }
            int d = -1;
            if (ind1 == 1 && indN == n) d = n - 2;
            int d1 = Math.Abs(ind1 - 1);
            int d2 = Math.Abs(ind1 - n);
            int d3 = Math.Abs(indN - 1);
            int d4 = Math.Abs(indN - n);
            d = Math.Max(d, d1);
            d = Math.Max(d, d2);
            d = Math.Max(d, d3);
            d = Math.Max(d, d4);
            Console.WriteLine(d);
            Console.ReadLine();
        }
    }
}


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

namespace s1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] ss = new string[1];
            ss = s.Split(' ');
            int t = Convert.ToInt32(ss[0]);
            string r = Console.ReadLine();
            string[] rr = new string[t];
            rr = r.Split(' ');
            int[] a = new int[t];
            for (int i = 0; i < t; i++)
            {
                a[i] = Convert.ToInt32(rr[i]);
            }
            int max = 0;
            int min = 0;
            int max1 = 0;
            int min1= 0;
            int max2=0;
            int max3 = 0;
            for (int i = 0; i < t; i++)
            {
                if (a[i] == 1 )
                {
                     max = t - i-1;
                     min = i;
                     if (max > min)
                     {
                         max2 = max;
                     }
                     else
                     {
                         max2 = min;
                     }
                }
                if (a[i] == t)
                {
                    max1 = t - i-1;
                    min1 = i;
                    if (max1 > min1)
                    {
                        max3 = max1;
                    }
                    else
                    {
                        max3 = min1;
                    }
                }
            }
            if (max3 > max2)
            {
                Console.WriteLine(max3);
            }
            else
            {
                Console.WriteLine(max2);
            }

        }
    }
}


using System;
class Demo
{
    static void Main()
    {
        bool ans;
        var s = Console.ReadLine().Split();
        int x = int.Parse(s[0]);
        int y = int.Parse(s[1]);
        double a = Math.Sqrt(x * x + y * y) % 2;
        ans = a > 1;
        if (Math.Sign(x) * Math.Sign(y) < 0 && a != 0 && a != 1) ans = !ans;
        Console.WriteLine(ans ? "white" : "black");
    }
}


using System;

namespace qwetry {
  class Program {
    static void Main() {
      string[] s = Console.ReadLine().Split(' ');
      int x = int.Parse(s[0]);
      int y = int.Parse(s[1]);
      if (x == 0 || y == 0) {
        Console.Write("black");
        return;
      }
      if (x * y > 0) {
        if (Math.Sqrt(x * x + y * y) % 2 >= 0 && Math.Sqrt(x * x + y * y) % 2 <= 1) {
          Console.Write("black");
        } else {
          Console.Write("white");
        }
      } else {
        if (Math.Sqrt(x * x + y * y) % 2 >= 1 || Math.Sqrt(x * x + y * y) % 2 == 0) {
          Console.Write("black");
        } else {
          Console.Write("white");
        }
      }
    }
  }
}


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

public class SyllableSorting
{

    public static long bigMod(long b, long p, long m)
    {
        long ans = 1;
        string str = Convert.ToString(p, 2);
        for (int i = 0; i < str.Length; i++)
        {
            ans = (ans * ans) % m;
            if (str[i] == '1')
            {
                ans = (ans * b) % m;
            }
        }
        return (ans-2)>=0? ans-2 : ans-2+m;
    }
    public static void Main()
    {
        //Console.SetIn(new StreamReader("C:\\Users\\saib\\Desktop\\abc.txt"));
        string str = Console.ReadLine();
        string[] values = str.Split(' ');
        int n = int.Parse(values[0]);
        int m = int.Parse(values[1]);
        int k = int.Parse(values[2]);
        if (k > m)
        {
            Console.WriteLine(m);
        }
        else if (n - (n / k) >= m)
        {
            Console.WriteLine(m);
        }
        else
        {
            int ans = (n - m) * (k - 1);
            int rem = m - ans;
            int temp = 0;
            int pow = rem/k;
            temp = (int)(bigMod(2, pow + 1, 1000000009));
            temp = (int)(((long)temp * k) % (1000000009));
            temp += (rem % k);
            temp = temp % (1000000009);

            ans= ans%(1000000009);
            ans = ans + temp;
            ans = ans % (1000000009);
            Console.WriteLine(ans);
        }
       // Console.SetIn(new StreamReader(Console.OpenStandardInput()));
        Console.ReadLine();
     }
}


using System;
using System.IO;

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(long n, int m, int k)
        {
            var modulo = new Modulo(1000000009);
            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 (modulo.Pow(2, x + 1) - 2) * k + a + b;
        }
    }

    public class Modulo
    {
        readonly int mod;
        public Modulo(int mod)
        {
            this.mod = mod;
        }

        public ModuloInteger Create(long v)
        {
            return new ModuloInteger(v, mod);
        }

        public ModuloInteger Pow(int value, long exponent)
        {
            return ModuloInteger.Pow(Create(value), exponent);
        }

        public ModuloInteger Multiply(int left, int right)
        {
            return Create(left) * right;
        }
    }

    public struct ModuloInteger : IEquatable<ModuloInteger>
    {
        readonly long value;
        readonly int mod;

        internal ModuloInteger(long value, int mod)
        {
            this.value = (value + mod) % mod;
            this.mod = mod;
        }

        public bool Equals(ModuloInteger other)
        {
            return mod == other.mod && value == other.value;
        }

        public static ModuloInteger Pow(ModuloInteger x, long n)
        {
            var res = new ModuloInteger(1, x.mod);

            for (; n > 0; n >>= 1, x *= x)
                if ((n & 1) == 1)
                    res *= x;

            return res;
        }

        public override bool Equals(object obj)
        {
            return obj is ModuloInteger && Equals((ModuloInteger)obj);
        }

        public override int GetHashCode()
        {
            return value.GetHashCode() ^ mod.GetHashCode();
        }

        public static bool operator ==(ModuloInteger left, ModuloInteger right)
        {
            return left.Equals(right);
        }

        public static bool operator !=(ModuloInteger left, ModuloInteger right)
        {
            return !(left == right);
        }

        public static ModuloInteger LeftShift(ModuloInteger left, int right)
        {
            return left * Pow(new ModuloInteger(2, left.mod), right);
        }

        public static ModuloInteger operator <<(ModuloInteger left, int right)
        {
            return LeftShift(left, right);
        }

        public static ModuloInteger Add(ModuloInteger left, long right)
        {
            return new ModuloInteger(left.value + right, left.mod);
        }

        public static ModuloInteger operator +(ModuloInteger left, long right)
        {
            return Add(left, right);
        }

        public static ModuloInteger operator -(ModuloInteger left, ModuloInteger right)
        {
            return left - (long)right;
        }

        public static ModuloInteger operator -(ModuloInteger left, long right)
        {
            return new ModuloInteger(left.value - right, left.mod);
        }

        public static ModuloInteger operator -(long left, ModuloInteger right)
        {
            return new ModuloInteger(left - right.value, right.mod);
        }

        public static ModuloInteger operator ++(ModuloInteger m)
        {
            return Increment(m);
        }
        public static ModuloInteger Increment(ModuloInteger item)
        {
            return item + 1;
        }

        public static ModuloInteger Multiply(ModuloInteger left, long right)
        {
            return new ModuloInteger(left.value * right, left.mod);
        }

        public static ModuloInteger operator *(ModuloInteger left, long right)
        {
            return Multiply(left, right);
        }

        public static ModuloInteger operator /(ModuloInteger left, long right)
        {
            return Pow(new ModuloInteger(right, left.mod), left.mod - 2) * left;
        }

        public static implicit operator int(ModuloInteger value)
        {
            return ToInt32(value);
        }

        public static int ToInt32(ModuloInteger value)
        {
            return (int)value.value;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.VisualBasic;

public static class Cin
{
    public static string ReadString()
    {
        StringBuilder tokenChars = new StringBuilder();
        bool tokenFinished = false;
        bool skipWhiteSpaceMode = true;
        while (!tokenFinished)
        {
            int nextChar = Console.Read();
            if (nextChar == -1)
            {
                // End of stream reached
                tokenFinished = true;
            }
            else
            {
                char ch = (char) nextChar;
                if (char.IsWhiteSpace(ch))
                {
                    if (!skipWhiteSpaceMode)
                    {
                        tokenFinished = true;
                        if (ch == '\r' && (Environment.NewLine == "\r\n"))
                        {
                            // Reached '\r' in Windows --> skip the next '\n'
                            Console.Read();
                        }
                    }
                }
                else
                {
                    // Character reached --> append it to the output
                    skipWhiteSpaceMode = false;
                    tokenChars.Append(ch);
                }
            }
        }

        string token = tokenChars.ToString();
        return token;
    }

    public static int ReadInt()
    {
        string token = ReadString();
        return int.Parse(token);
    }

    public static long ReadLong()
    {
        string token = ReadString();
        return long.Parse(token);
    }

    public static T[] ReadArrayFromLine<T>(Func<string, T> factory)
    {
        return Console.ReadLine()?.Split(' ').Select(factory).ToArray();
    }

    public static int[] ReadIntArrayFromLine()
    {
        return ReadArrayFromLine(int.Parse);
    }

    public static long[] ReadLongArrayFromLine()
    {
        return ReadArrayFromLine(long.Parse);
    }

    public static double ReadDouble(bool acceptAnyDecimalSeparator = true)
    {
        string token = ReadString();
        if (acceptAnyDecimalSeparator)
        {
            token = token.Replace(',', '.');
            double result = double.Parse(token, CultureInfo.InvariantCulture);
            return result;
        }
        else
        {
            double result = double.Parse(token);
            return result;
        }
    }
}

class Program
{
    static void Main()
    {
        int t = Cin.ReadInt();
        while (t-- > 0)
        {
            Console.WriteLine($"{Test()}");
        }
    }

    static long Test()
    {
        var n = Cin.ReadInt();
        var set = new HashSet<long>();

        var result = 0;
        for (long i = 1; i * i <= n; ++i)
        {
            if (i * i <= n && !set.Contains(i * i))
            {
                ++result;
                set.Add(i * i);
            }

            if (i * i * i <= n && !set.Contains(i * i * i))
            {
                ++result;
                set.Add(i * i * i);
            }

        }

        return result;
    }
}


// Problem: 1619B - Squares and Cubes
// Author: Gusztav Szmolik

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

public class SquaresAndCubes {

    public static void Main () {
        StringBuilder ans = new StringBuilder ();
        byte t = byte.Parse (Console.ReadLine ());

        for (byte i = 0; i < t; i++) {
            int n = int.Parse (Console.ReadLine ());
            HashSet<int> favNumbers = new HashSet<int> ();
            int j = 1;
            int k = 1;

            while (k <= n) {
                favNumbers.Add (k);
                j++;
                k = j*j;
            }

            j = 1;
            k = 1;

            while (k <= n) {

                if (!favNumbers.Contains (k))
                    favNumbers.Add (k);

                j++;
                k = j*j*j;
            }

            int ansi = favNumbers.Count;
            ans.Append (ansi);
            ans.AppendLine ();
        }

        Console.Write (ans);
    }
}


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

namespace CD93D
{
    class Program
    {
        static void Main(string[] args)
        {
            var temp = Console.ReadLine().Split(new char[]{' '},StringSplitOptions.RemoveEmptyEntries);

            long t1, t2, x1, x2, t0;
            t1 = long.Parse(temp[0]);
            t2 = long.Parse(temp[1]);
            x1 = long.Parse(temp[2]);
            x2 = long.Parse(temp[3]);
            t0 = long.Parse(temp[4]);
            long y1 = 0, y2 = 0;
            double e = 0.1;
            double emax = 10000000000000000000000000000000.0;
            long y1MAX = 1, y2MAX = 1;
            if (t1 == t2)
            {
                Console.WriteLine(x1 + " " + x2);
            }
            else if (t2 == t0)
            {
                Console.WriteLine("0 " + x2);
            }
            else if (t1 == t0)
            {
                Console.WriteLine(x1 + " 0");
            }
            else
            {
                double y1DIVy2 = (t2 - t0) / ((double)t0 - t1);
                bool t = true;
                for (y2 = 0; t || ((y1 <= x1) && (y2 <= x2)); y2++)
                {

                    y1 = (long)((y2 * y1DIVy2) + 0.0002);
                    e = (t1 * y1 + t2 * y2) / ((double)(y1 + y2)) - t0;
                  //  if((y2 == 1341) || (y2 == 49998))
                       //  Console.WriteLine(y1 +"   " + y2+ "  "+ y1DIVy2 +"          " + e);
                    if (e >= 0 && (Math.Abs(e) -Math.Abs(emax) <= 0)  )
                    {
                        if (t || ((y1 <= x1) && (y2 <= x2)))
                        {
                            t = false;
                            emax = e;
                            if (y1 > x1)
                                y1 = x1;
                            if (y2 > x2)
                                y2 = x2;
                            y1MAX = y1;
                            y2MAX = y2;
                        }
                    }
                }

                Console.WriteLine(y1MAX + " " + y2MAX);

            }

            Console.ReadLine();
        }
    }
}


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

namespace CF_93_A
{
    class Program
    {
        public static double getTemp(Int64 t1, Int64 t2, Int64 y1, Int64 y2)
        {
            return ((double)((Int64)(t1 * y1) + (Int64)t2 * y2)) / (y1 + y2);
        }

        static void Main(string[] args)
        {
            int t1, t2, x1, x2, t0;

            string s = Console.ReadLine();
            //string s = "1 100000 1000 1 2";

            string[] ss = s.Split(' ');
            t1 = int.Parse(ss[0]);
            t2 = int.Parse(ss[1]);
            x1 = int.Parse(ss[2]);
            x2 = int.Parse(ss[3]);
            t0 = int.Parse(ss[4]);

            int y1 = 0, y2 = x2;
            double temp = getTemp(t1, y2, y1, y2);

            for (int i = 0; i <= x1; i++)
            {
                double t = getTemp(t1, t2, i, x2);
                if (t == temp && i + x2 > y1 + y2)
                {
                    y1 = i;
                    y2 = x2;
                }
                if (t >= t0 &&( Math.Abs(t0 - t) < Math.Abs(t0 - temp) || temp < t0))
                {
                    y1 = i;
                    y2 = x2;
                    temp = t;
                }
            }

            for (int i = 0; i <= x2; i++)
            {
                double t = getTemp(t1, t2, x1, i);
                if (t == temp && i + x1 > y1 + y2)
                {
                    y1 = x1;
                    y2 = i;
                }
                if (t >= t0 && (Math.Abs(t0 - t) < Math.Abs(t0 - temp) || temp < t0))
                {
                    y1 = x1;
                    y2 = i;
                    temp = t;
                }
            }

            if (y1 == x1 && y1 != 0)
            {
                double rat = ((double)y2)/y1;
                for (int i = x1 - 1; i >= 0; i--)
                {
                    int ny2 = (int)(i * rat);
                    for (int j = ny2 - 1; j <= ny2 + 1; j++)
                    {
                        if (j < 0 || j > x2)
                            continue;

                        double t = getTemp(t1, t2, i, j);
                        if (t == temp && i + j > y1 + y2)
                        {
                            y1 = i;
                            y2 = j;
                        }
                        if (t >= t0 && (Math.Abs(t0 - t) < Math.Abs(t0 - temp) || temp < t0))
                        {
                            y1 = i;
                            y2 = j;
                            temp = t;
                        }
                    }
                }
            }

            else if (y2 == x2 && y2 != 0)
            {
                double rat = ((double)y1) / y2;
                for (int i = x2 - 1; i >= 0; i--)
                {
                    int ny1 = (int)(i * rat);
                    for (int j = ny1 - 1; j <= ny1 + 1; j++)
                    {
                        if (j < 0 || j > x1)
                            continue;

                        double t = getTemp(t1, t2, j, i);
                        if (t == temp && i + j > y1 + y2)
                        {
                            y1 = j;
                            y2 = i;
                        }
                        if (t >= t0 && (Math.Abs(t0 - t) < Math.Abs(t0 - temp) || temp < t0))
                        {
                            y2 = i;
                            y1 = j;
                            temp = t;
                        }
                    }
                }
            }

            Console.Write("{0} {1}", y1, y2);
            Console.ReadLine();
        }
    }
}


using System;
using System.Linq;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s;
            int number;
            s = Console.ReadLine();
            number = Int32.Parse(Console.ReadLine());
            if (s == "")
            {
                Console.WriteLine(number*2);
                return;
            }
            var strpl = new string('*', number);
            s += strpl;
            s = new string(s.ToArray().Reverse().ToArray());
            int a1 = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (Check(s, i) > a1)
                    a1 = Check(s, i);
            }
            Console.WriteLine(a1);
            return;
        }

        public static int Check(string s, int start)
        {
            bool check = false;
            for (int i = s.Length/2; i >= 0; i--)
            {
                int j;
                for (j=start; j < i+start; j++)
                {
                    if (j + i > s.Length-1)
                    {
                        check = false;
                        break;
                    }
                    if ((s[j] == s[j + i]) || (s[j] == '*') || (s[j + i] == '*'))
                        check = true;
                    else
                    {
                        check = false;
                        break;
                    }
                }
                if (check)
                {
                    return i*2;
                }
            }
            return 0;
        }

    }
}


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

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

class Sol{
	public void Solve(){
		char[] CC=new char[K];
		for(int i=0;i<K;i++)CC[i]='*';
		T=S+new String(CC);

		int Max=0;
		for(int i=2;i<=T.Length;i++){
			if(chk(i))Max=i;
		}

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

	bool chk(int t){
		if(t%2!=0)return false;
		int n=t/2;
		int cnt=0;
		for(int i=0;i+n<T.Length;i++){
			if(T[i]==T[i+n]||T[i+n]=='*'){
				cnt++;
			}
			if(T[i]!=T[i+n]&&T[i+n]!='*'&&T[i]!='*'){
				cnt=0;
			}
			if(cnt==n)return true;
		}
		return false;
	}

	String S;
	String T;
	int K;
	public Sol(){
		S=rs();
		K=ri();
	}

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


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

class Solver
{
    public void Solve()
    {
        var ss = CF.ReadLine().Split(' ');
        int[] ns = new int[3];
        int i = 0;
        foreach (var s in ss)
        {
            int n = 0;
            switch (s)
            {
                case "C": n = 0; break;
                case "C#": n = 1; break;
                case "D": n = 2; break;
                case "D#": n = 3; break;
                case "E": n = 4; break;
                case "F": n = 5; break;
                case "F#": n = 6; break;
                case "G": n = 7; break;
                case "G#": n = 8; break;
                case "A": n = 9; break;
                case "B": n = 10; break;
                case "H": n = 11; break;
            }
            ns[i++] = n;
        }

        int r1 = (12 + ns[1] - ns[0]) % 12;
        int r2 = (12 + ns[2] - ns[0]) % 12;

        if (
            (r1 == 4 && r2 == 7) ||
            (r1 == 7 && r2 == 4) ||
            (r1 == 3 && r2 == 8) ||
            (r1 == 8 && r2 == 3) ||
            (r1 == 5 && r2 == 9) ||
            (r1 == 9 && r2 == 5)
            )
            CF.WriteLine("major");
        else if (
            (r1 == 3 && r2 == 7) ||
            (r1 == 7 && r2 == 3) ||
            (r1 == 5 && r2 == 8) ||
            (r1 == 8 && r2 == 5) ||
            (r1 == 4 && r2 == 9) ||
            (r1 == 9 && r2 == 4)
            )
            CF.WriteLine("minor");
        else
            CF.WriteLine("strange");
    }

    //  test
    static Utils CF = new Utils(new[]{
@"
C E G
",

@"
C# B F
",
@"
A B H
"

    });
    #region test

    static void Main(string[] args)
    {
#if DEBUG
        for (int t=0;t<CF.TestCount;t++ )
        {
            CF.Test(t);
            new Solver().Solve();
        }
#else
        new Solver().Solve();
#endif
    }

    class Utils
    {
        public void Test(int t)
        {
            _lines = new List<string>();
            string[] ss = _test_input[t].Replace("\n", "").Split('\r');
            for (int i = 0; i < ss.Length; i++)
            {
                if (
                    (i == 0 || i == ss.Length - 1) &&
                    ss[i].Length == 0
                    )
                    continue;

                _lines.Add(ss[i]);
            }
        }

        public int TestCount
        {
            get
            {
                return _test_input.Length;
            }
        }

        public string ReadLine()
        {
#if DEBUG
            string s = null;
            if (_lines.Count > 0)
            {
                s = _lines[0];
                _lines.RemoveAt(0);
            }
            return s;

#else
            //return _sr.ReadLine();
        return Console.In.ReadLine();
#endif
        }

        public void WriteLine(object o)
        {
#if DEBUG
            System.Diagnostics.Trace.WriteLine(o);
#else
            //_sw.WriteLine(o);
        Console.WriteLine(o);
#endif
        }

        public void Write(object o)
        {
#if DEBUG
            System.Diagnostics.Trace.Write(o);
#else
                //_sw.Write(o);
        Console.Write(o);
#endif
        }

        string[] _test_input;

        List<string> _lines;

#if DEBUG
        public Utils(string[] test_input)
        {
            _test_input = test_input;
        }
#else

        public Utils(string[] dummy)
        {
            //_sr = new System.IO.StreamReader("input.txt");
            //_sw = new System.IO.StreamWriter("output.txt");
        }
#endif

    }

    #endregion
}


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

namespace codeforces_cs
{
    class Program
    {
        static string[] c = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "B", "H"};
        static Dictionary<string, int> d = new Dictionary<string, int>();
        static int dist(int x, int y)
        {
            return (y - x + 12) % 12;
        }
        static void Main(string[] args)
        {
            for (int i = 0; i < c.Length; i++)
            {
                d[c[i]] = i;
            }

            string input = Console.ReadLine();
            string[] inputs = input.Split(' ');
            List<int> sinputs = new List<int>();
            for (int i = 0; i < 3; i++)
            {
                sinputs.Add(d[inputs[i]]);
            }
            for (int i = 0; i < 12; i++)
            {
                for(int j=0;j<3;j++)
                {
                    sinputs[j] = (sinputs[j]+1)%12;
                }
                sinputs.Sort();
                int X = sinputs[0];
                int Y = sinputs[1];
                int Z = sinputs[2];
                if (dist(X, Y) == 4 && dist(Y, Z) == 3)
                {
                    Console.WriteLine("major");
                    return;
                }
                else if (dist(X, Y) == 3 && dist(Y, Z) == 4)
                {
                    Console.WriteLine("minor");
                    return;
                }
            }
            Console.WriteLine("strange");
        }
    }
}


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

class Program
{
    public static long ScalarProduct(long x1, long y1, long x2, long y2)
    {
        return x1 * y2 - x2 * y1;
    }

    private static int Log(int radix, long value)
    {
        int ans = 0;
        while (value > 1)
        {
            ans++;
            value /= radix;
        }

        return ans;
    }

    private static bool IsPowerOf2(long x)
    {
        return (x & (x - 1)) == 0;
    }

    private static long BinPower(long x, int power)
    {
        long ans = 1;
        while (power > 0)
        {
            if (power % 2 == 1)
                ans = (ans * x);

            x = x * x;
        }

        return ans;
    }

    private static long Fact(int x)
    {
        long ans = 1;
        for (int i = 2; i <= x; i++)
            ans *= i;
        return ans;
    }

    private static long Placing(int k, int n)
    {
        long ans = Fact(n) / (Fact(k) * Fact(n - k));

        return ans;
    }

    private const int Mod = 1000000007;
    static void Main(string[] args)
    {
        int n = ReadInt();
        int b = ReadInt();
        int p = ReadInt();

        //p *= n;
        /*int count = 0;
        while (n > 1)
        {
            int cnt = n / 2;
            count += cnt;
            n -= cnt;
        }*/

        Console.WriteLine((2 * b + 1) * (n - 1) + " " + p * n);

    }

    private static List<int>[] ReadGraph(int n, int m)
    {
        List<int>[] g = new List<int>[n + 1];
        for (int i = 0; i <= n; i++) g[i] = new List<int>();
        for (int i = 0; i < m; i++)
        {
            int a = ReadInt();
            int b = ReadInt();
            g[a].Add(b);
            g[b].Add(a);
        }

        return g;
    }

    private static int[,] ReadGraphAsMatrix(int n, int m)
    {
        int[,] matrix = new int[n + 1, n + 1];
        for (int i = 0; i < m; i++)
        {
            int a = ReadInt();
            int b = ReadInt();
            matrix[a, b] = matrix[b, a] = 1;
        }

        return matrix;
    }

    private static void Sort(ref int a, ref int b)
    {
        if (a > b) Swap(ref a, ref b);
    }

    private static void Swap(ref int a, ref int b)
    {
        int tmp = a;
        a = b;
        b = tmp;
    }

    private const int BufferSize = 1 << 16;
    private static readonly StreamReader consoleReader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);

    private static int ReadInt()
    {
        int ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static ulong ReadULong()
    {
        ulong ans = 0;
        int chr;
        do
        {
            chr = consoleReader.Read();
            if (chr == -1)
                return 0;
        } while (chr < '0' || chr > '9');

        ans = (uint)(chr - '0');
        while (true)
        {
            chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans;
            ans = ans * 10 + (uint)(chr - '0');
        }
    }

    private static long ReadLong()
    {
        long ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static int[] ReadIntArray(int n)
    {
        int[] ans = new int[n];
        for (int i = 0; i < n; i++)
            ans[i] = ReadInt();
        return ans;
    }

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

    private static char[] ReadString()
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (ans < 'a' || ans > 'z');

        List<char> s = new List<char>();
        do
        {
            s.Add((char)ans);
            ans = consoleReader.Read();
        } while (ans >= 'a' && ans <= 'z');

        return s.ToArray();
    }

    private static char[] ReadString(int n)
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (ans < 'a' || ans > 'z');

        char[] s = new char[n];
        int pos = 0;
        do
        {
            s[pos++] = (char)ans;
            ans = consoleReader.Read();
        } while (ans >= 'a' && ans <= 'z');

        return s;
    }

    private static char ReadLetter()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'))
                return (char)ans;
        }
    }

    private static char ReadDigit()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (ans >= '0' && ans <= '9')
                return (char)ans;
        }
    }

    private static int ReadDigitInt()
    {
        while (true)
        {
            return ReadDigit() - (int)'0';
        }
    }

    private static char ReadAnyChar()
    {
        return (char)consoleReader.Read();
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var inp = Console.ReadLine().Split(' ');
            Int32 n = Convert.ToInt32(inp[0]);
            Int32 b = Convert.ToInt32(inp[1]);
            Int32 p = Convert.ToInt32(inp[2]);

            Int32 bottles = 0;
            Int32 papers = n * p;

            while(n > 1)
            {
                Int32 k = 1;
                while (k <= n)
                    k *= 2;
                k /= 2;
                bottles += (2 * b + 1) * (k / 2);
                n -= k / 2;
            }

            Console.WriteLine("{0} {1}", bottles, papers);
        }
    }
}


using System;

public class Test
{

	public static void Main()

	{

          int n=Convert.ToInt32(Console.ReadLine());

         string str=Console.ReadLine();

         int num=0;

        for (int i = 0; i < n; i++) {
            if (str[i] == '1') {
                num++;
            }
            else {
                Console.Write(num);
                num = 0;
            }
        }
        Console.WriteLine(num);

	}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Globalization;
using System.Diagnostics;
using static System.Console;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;
//using System.Numerics;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().Solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    Random rnd = new Random();
    Stopwatch sw = new Stopwatch();
    readonly int[] dd = { 0, 1, 0, -1, 0 };
    readonly int mod = 1000000007;
    readonly string alfa = "abcdefghijklmnopqrstuvwxyz";

    void Solve()
    {
        int N = cin.Nextint;
        var V = cin.Next;
        long ans = 0;
        int cnt = 0;
        for (int i = 0; i < N; i++)
        {
            if (V[i] == '1') cnt++;
            else
            {
                ans = ans * 10 + cnt;
                while (i + 1 < N && V[i + 1] == '0')
                {
                    i++;
                    ans *= 10;
                }
                cnt = 0;
            }
        }
        ans = ans * 10 + cnt;
        WriteLine(ans);
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] Scan { get { return ReadLine().Split(); } }
    public int[] Scanint { get { return Array.ConvertAll(Scan, int.Parse); } }
    public long[] Scanlong { get { return Array.ConvertAll(Scan, long.Parse); } }
    public double[] Scandouble { get { return Array.ConvertAll(Scan, double.Parse); } }
    public string Next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return Next;
        }
    }
    public int Nextint { get { return int.Parse(Next); } }
    public long Nextlong { get { return long.Parse(Next); } }
    public double Nextdouble { get { return double.Parse(Next); } }
}


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

namespace olimpcsharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = new int[101];
            foreach(var item in Console.ReadLine().Split(' ').Select(int.Parse))
            {
                arr[item]++;
            }
            int sum = 0;
            int maxDel = 0;
            for (int i = 0; i < arr.Length; i++)
            {
                sum += i * arr[i];
                if (arr[i] > 1)
                {
                    int k = Math.Min(arr[i], 3) * i;
                    maxDel = Math.Max(maxDel, k);
                }
            }
            Console.WriteLine(sum - maxDel);
            Console.ReadLine();
        }
    }
}


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

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

int All_sum=0;

string[] split = s.Split(new char[] { ' ' });
int[] mas = new int[split.Length];
for (int i = 0; i < split.Length; i++)
{
mas[i] = int.Parse(split[i]);

All_sum += mas[i];

}

byte kolvo;
int sum_help, sum_gl=0;

for(int i=0;i<mas.Length;i++)
{
if(mas[i]!=-273)
{
kolvo = 1;
sum_help = mas[i];

for (int ii=i+1;ii<mas.Length;ii++)
{
if(kolvo<3)
{if(mas[i]==mas[ii])
{
sum_help += mas[i];kolvo++;mas[ii] = -273;
}
}

}
if (kolvo == 1) sum_help = 0;

mas[i] = -273;if (sum_help > sum_gl) sum_gl = sum_help;

}

}

Console.WriteLine((All_sum - sum_gl).ToString());

}
}
}


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

namespace Temp
{
    struct PointInt
    {
        public long X;

        public long Y;

        public PointInt(long x, long y)
            : this()
        {
            this.X = x;
            this.Y = y;
        }

        public static PointInt operator +(PointInt a, PointInt b)
        {
            return new PointInt(a.X + b.X, a.Y + b.Y);
        }

        public static PointInt operator -(PointInt a, PointInt b)
        {
            return new PointInt(a.X - b.X, a.Y - b.Y);
        }

        public static PointInt operator *(PointInt a, long k)
        {
            return new PointInt(k * a.X, k * a.Y);
        }

        public static PointInt operator *(long k, PointInt a)
        {
            return new PointInt(k * a.X, k * a.Y);
        }

        public bool IsInsideRectangle(long l, long b, long r, long t)
        {
            return (l <= X) && (X <= r) && (b <= Y) && (Y <= t);
        }
    }

    struct LineInt
    {
        public LineInt(PointInt a, PointInt b)
            : this()
        {
            A = a.Y - b.Y;
            B = b.X - a.X;
            C = a.X * b.Y - a.Y * b.X;
        }

        public long A, B, C;

        public bool ContainsPoint(PointInt p)
        {
            return A * p.X + B * p.Y + C == 0;
        }
    }

    class MatrixInt
    {
        private long[,] m_Matrix;

        public int Size
        {
            get
            {
                return m_Matrix.GetLength(0) - 1;
            }
        }

        public long Mod { get; private set; }

        public MatrixInt(int size, long mod = 0)
        {
            m_Matrix = new long[size + 1, size + 1];
            Mod = mod;
        }

        public MatrixInt(long[,] matrix, long mod = 0)
        {
            this.m_Matrix = matrix;
            Mod = mod;
        }

        public static MatrixInt GetIdentityMatrix(int size, long mod = 0)
        {
            long[,] matrix = new long[size + 1, size + 1];

            for (int i = 1; i <= size; i++)
            {
                matrix[i, i] = 1;
            }

            return new MatrixInt(matrix, mod);
        }

        public long this[int i, int j]
        {
            get
            {
                return m_Matrix[i, j];
            }

            set
            {
                m_Matrix[i, j] = value;
            }
        }

        public static MatrixInt operator +(MatrixInt a, MatrixInt b)
        {
            int n = a.Size;
            long mod = Math.Max(a.Mod, b.Mod);
            long[,] c = new long[n, n];
            for (int i = 1; i <= n; i++)
            {
                for (int j = 1; j <= n; j++)
                {
                    c[i, j] = a[i, j] + b[i, j];
                }
            }

            if (mod > 0)
            {
                for (int i = 1; i <= n; i++)
                {
                    for (int j = 1; j <= n; j++)
                    {
                        c[i, j] %= mod;
                    }
                }
            }

            return new MatrixInt(c, mod);
        }

        public static MatrixInt operator *(MatrixInt a, MatrixInt b)
        {
            int n = a.Size;
            long mod = Math.Max(a.Mod, b.Mod);

            long[,] c = new long[n, n];

            for (int i = 1; i <= n; i++)
            {
                for (int j = 1; j <= n; j++)
                {
                    for (int k = 1; k <= n; k++)
                    {
                        c[i, j] += a[i, k] * b[k, j];
                        if (mod > 0)
                        {
                            c[i, j] %= mod;
                        }
                    }
                }
            }

            return new MatrixInt(c, mod);
        }
    }

    static class Algebra
    {
        public static long Phi(long n)
        {
            long result = n;
            for (long i = 2; i * i <= n; i++)
            {
                if (n % i == 0)
                {
                    while (n % i == 0)
                    {
                        n /= i;
                    }

                    result -= result / i;
                }
            }

            if (n > 1)
            {
                result -= result / n;
            }

            return result;
        }

        public static long BinPower(long a, long n, long mod)
        {
            long result = 1;

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

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

            return result;
        }

        public static class Permutations
        {
            public static int[] GetRandomPermutation(int n)
            {
                int[] p = new int[n];
                for (int i = 0; i < n; i++)
                {
                    p[i] = i;
                }

                Random random = new Random();
                for (int i = n - 1; i > 0; i--)
                {
                    int j = random.Next(i + 1);
                    int tmp = p[i];
                    p[i] = p[j];
                    p[j] = tmp;
                }

                return p;
            }
        }

        public static T[] Shuffle<T>(this T[] array)
        {
            int length = array.Length;
            int[] p = Permutations.GetRandomPermutation(length);
            T[] result = new T[length];
            for (int i = 0; i < length; i++)
            {
                result[i] = array[p[i]];
            }

            return result;
        }

        public static MatrixInt MatrixBinPower(MatrixInt a, long n)
        {
            MatrixInt result = new MatrixInt(a.Size);

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

                a *= a;
                n >>= 1;
            }

            return result;
        }

        public static long Gcd(long a, long b)
        {
            return b == 0 ? a : Gcd(b, a % b);
        }

        public static long ExtendedGcd(long a, long b, out long x, out long y)
        {
            if (b == 0)
            {
                x = 1;
                y = 0;
                return a;
            }

            long x1;
            long y1;
            long d = ExtendedGcd(b, a % b, out x1, out y1);
            x = y1;
            y = x1 - (a / b) * y1;
            return d;
        }

        public static long Lcm(long a, long b)
        {
            return (a / Gcd(a, b)) * b;
        }

        public static bool[] GetPrimes(int n)
        {
            n = Math.Max(n, 2);
            bool[] prime = new bool[n + 1];
            for (int i = 2; i <= n; i++)
            {
                prime[i] = true;
            }

            for (int i = 2; i * i <= n; i++)
            {
                if (prime[i])
                {
                    if ((long)i * i <= n)
                    {
                        for (int j = i * i; j <= n; j += i)
                        {
                            prime[j] = false;
                        }
                    }
                }
            }

            return prime;
        }

        public static long GetFibonacciNumber(long n, long mod = 0)
        {
            long[,] matrix = new long[,] { { 0, 0, 0 }, { 0, 0, 1 }, { 0, 1, 1 } };

            MatrixInt result = MatrixBinPower(new MatrixInt(matrix, mod), n);

            return result[2, 2];
        }

        public static long[] GetFibonacciSequence(int n)
        {
            long[] result = new long[n];
            result[0] = result[1] = 1;

            for (int i = 2; i < n; i++)
            {
                result[i] = result[i - 1] + result[i - 2];
            }

            return result;
        }

        public static long GetInverseElement(long a, long mod)
        {
            long x, y;
            long g = ExtendedGcd(a, mod, out x, out y);

            if (g != 1)
            {
                return -1;
            }

            return ((x % mod) + mod) % mod;
        }

        public static long[] GetAllInverseElements(long mod)
        {
            long[] result = new long[mod];
            result[1] = 1;
            for (int i = 2; i < mod; i++)
            {
                result[i] = (mod - (((mod / i) * result[mod % i]) % mod)) % mod;
            }

            return result;
        }
    }

    internal static class Reader
    {
        public static void ReadInt(out int a)
        {
            int[] number = new int[1];
            ReadInt(number);
            a = number[0];
        }

        public static void ReadInt(out int a, out int b)
        {
            int[] numbers = new int[2];
            ReadInt(numbers);
            a = numbers[0];
            b = numbers[1];
        }

        public static void ReadInt(out int int1, out int int2, out int int3)
        {
            int[] numbers = new int[3];
            ReadInt(numbers);
            int1 = numbers[0];
            int2 = numbers[1];
            int3 = numbers[2];
        }

        public static void ReadInt(out int int1, out int int2, out int int3, out int int4)
        {
            int[] numbers = new int[4];
            ReadInt(numbers);
            int1 = numbers[0];
            int2 = numbers[1];
            int3 = numbers[2];
            int4 = numbers[3];
        }

        public static void ReadLong(out long a)
        {
            long[] number = new long[1];
            ReadLong(number);
            a = number[0];
        }

        public static void ReadLong(out long a, out long b)
        {
            long[] numbers = new long[2];
            ReadLong(numbers);
            a = numbers[0];
            b = numbers[1];
        }

        public static void ReadLong(out long int1, out long int2, out long int3)
        {
            long[] numbers = new long[3];
            ReadLong(numbers);
            int1 = numbers[0];
            int2 = numbers[1];
            int3 = numbers[2];
        }

        public static void ReadLong(out long int1, out long int2, out long int3, out long int4)
        {
            long[] numbers = new long[4];
            ReadLong(numbers);
            int1 = numbers[0];
            int2 = numbers[1];
            int3 = numbers[2];
            int4 = numbers[3];
        }

        public static void ReadInt(int[] numbers)
        {
            // ReSharper disable PossibleNullReferenceException
            var list = Console.ReadLine().Split();
            // ReSharper restore PossibleNullReferenceException

            int count = Math.Min(numbers.Length, list.Length);

            for (int i = 0; i < count; i++)
            {
                numbers[i] = int.Parse(list[i]);
            }
        }

        public static int[] ReadDigits()
        {
            // ReSharper disable AssignNullToNotNullAttribute
            return Console.ReadLine().Select(x => int.Parse(x.ToString())).ToArray();
            // ReSharper restore AssignNullToNotNullAttribute
        }

        public static void ReadLong(long[] numbers)
        {
            // ReSharper disable PossibleNullReferenceException
            var list = Console.ReadLine().Split();
            // ReSharper restore PossibleNullReferenceException

            int count = Math.Min(numbers.Length, list.Length);

            for (int i = 0; i < count; i++)
            {
                numbers[i] = long.Parse(list[i]);
            }
        }

        public static void ReadDouble(double[] numbers)
        {
            // ReSharper disable PossibleNullReferenceException
            var list = Console.ReadLine().Split();
            // ReSharper restore PossibleNullReferenceException

            int count = Math.Min(numbers.Length, list.Length);

            for (int i = 0; i < count; i++)
            {
                numbers[i] = double.Parse(list[i]);
            }
        }

        public static void ReadDouble(out double a, out double b)
        {
            double[] numbers = new double[2];
            ReadDouble(numbers);
            a = numbers[0];
            b = numbers[1];
        }

        public static void ReadDouble(out double int1, out double int2, out double int3)
        {
            double[] numbers = new double[3];
            ReadDouble(numbers);
            int1 = numbers[0];
            int2 = numbers[1];
            int3 = numbers[2];
        }

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

    static class MyMath
    {
        public static int GetMinimalPrimeDivisor(int n)
        {
            for (int i = 2; i * i <= n; i++)
            {
                if (n % i == 0)
                {
                    return i;
                }
            }

            return n;
        }

        public static long Sqr(long x)
        {
            return x * x;
        }
    }

    public interface IGraph
    {
        int Vertices  { get; set; }

        IList<int> this[int i] { get; }

        void AddEdge(int u, int v);

        void AddOrientedEdge(int u, int v);
    }

    public class Graph : IGraph
    {
        private List<int>[] m_Edges;

        public int Vertices { get; set; }

        public IList<int> this[int i]
        {
            get
            {
                return this.m_Edges[i];
            }
        }

        public Graph(int vertices)
        {
            this.Vertices = vertices;

            this.m_Edges = new List<int>[vertices];

            for (int i = 0; i < vertices; i++)
            {
                this.m_Edges[i] = new List<int>();
            }
        }

        public void AddEdge(int u, int v)
        {
            this.AddOrientedEdge(u, v);
            this.AddOrientedEdge(v, u);
        }

        public void AddOrientedEdge(int first, int second)
        {
            this.m_Edges[first].Add(second);
        }

        public int[] Bfs(int start)
        {
            int[] d = new int[Vertices];
            for (int i = 0; i < Vertices; i++)
            {
                d[i] = -1;
            }

            Queue<int> queue = new Queue<int>();
            queue.Enqueue(start);
            d[start] = 0;

            while (queue.Count > 0)
            {
                int v = queue.Dequeue();
                foreach (int t in this.m_Edges[v].Where(t => d[t] == -1))
                {
                    queue.Enqueue(t);
                    d[t] = d[v] + 1;
                }
            }

            return d;
        }
    }

    class SimpleSumTable
    {
        private readonly int[,] m_Sum;

        public SimpleSumTable(int n, int m, int[,] table)
        {
            m_Sum = new int[n + 1, m + 1];

            for (int i = 1; i < n + 1; i++)
            {
                for (int j = 1; j < m + 1; j++)
                {
                    m_Sum[i, j] = m_Sum[i, j - 1] + m_Sum[i - 1, j] - m_Sum[i - 1, j - 1] + table[i, j];
                }
            }
        }

        public int GetSum(int l, int b, int r, int t)
        {
            return m_Sum[r, t] - m_Sum[r, b] - m_Sum[l, t] + m_Sum[l, b];
        }
    }

    class SegmentTreeSimpleInt<T>
    {
        public int Size { get; private set; }

        private readonly T[] m_Tree;

        private Func<T, T, T> m_Operation;

        private T m_Null;

        public SegmentTreeSimpleInt(int size, Func<T, T, T> operation, T nullElement, IList<T> array = null)
        {
            this.Size = size;
            this.m_Operation = operation;
            this.m_Null = nullElement;

            m_Tree = new T[4 * size];
            if (array != null)
            {
                this.Build(array, 1, 0, size - 1);
            }
        }

        private void Build(IList<T> array, int v, int tl, int tr)
        {
            if (tl == tr)
            {
                m_Tree[v] = array[tl];
            }
            else
            {
                int tm = (tl + tr) / 2;
                this.Build(array, 2 * v, tl, tm);
                this.Build(array, 2 * v + 1, tm + 1, tr);
                this.CalculateNode(v);
            }
        }

        public T GetSum(int l, int r)
        {
            return GetSum(1, 0, Size - 1, l, r);
        }

        private T GetSum(int v, int tl, int tr, int l, int r)
        {
            if (l > r)
            {
                return m_Null;
            }

            if (l == tl && r == tr)
            {
                return m_Tree[v];
            }

            int tm = (tl + tr) / 2;

            return this.m_Operation(GetSum(2 * v, tl, tm, l, Math.Min(r, tm)),GetSum(2 * v + 1, tm + 1, tr, Math.Max(l, tm + 1), r));
        }

        public void Update(int pos, T newValue)
        {
            Update(1, 0, Size - 1, pos, newValue);
        }

        private void Update(int v, int tl, int tr, int pos, T newValue)
        {
            if (tl == tr)
            {
                m_Tree[v] = newValue;
            }
            else
            {
                int tm = (tl + tr) / 2;
                if (pos <= tm)
                {
                    Update(2 * v, tl, tm, pos, newValue);
                }
                else
                {
                    Update(2 * v + 1, tm + 1, tr, pos, newValue);
                }
                this.CalculateNode(v);
            }
        }

        private void CalculateNode(int v)
        {
            m_Tree[v] = this.m_Operation(m_Tree[2 * v], m_Tree[2 * v + 1]);
        }
    }

    struct Pair<TFirst, TSecond>
    {
        public Pair(TFirst first, TSecond second)
            : this()
        {
            this.First = first;
            this.Second = second;
        }

        public TFirst First { set; get; }

        public TSecond Second { set; get; }
    }

    class Program
    {
        private static StreamReader m_InputStream;

        private static StreamWriter m_OutStream;

        private static void OpenFiles()
        {
            m_InputStream = File.OpenText("input.txt");
            Console.SetIn(m_InputStream);

            m_OutStream = File.CreateText("output.txt");
            Console.SetOut(m_OutStream);
        }

        private static void CloseFiles()
        {
            m_OutStream.Flush();

            m_InputStream.Dispose();
            m_OutStream.Dispose();
        }

        static void Main()
        {
            //OpenFiles();

            new Solution().Solve();

            //CloseFiles();
        }
    }

    internal class Solution
    {
        private int[,,,] pos;

        private Card[] cards;

        public void Solve()
        {
            int n;
            Reader.ReadInt(out n);

            cards = new Card[n];

            string s = Reader.ReadLine();
            var split = s.Split();
            for (int i = 0; i < n; i++)
            {
                cards[i] = new Card(split[i], i);
            }

            pos = new int[n + 1,n,n,n];

            Console.Write(this.IsPossible(n, n - 3, n - 2, n - 1) == 1 ? "YES" : "NO");
        }

        private int IsPossible(int n, int a, int b, int c)
        {
            if (n == 1)
            {
                return 1;
            }

            if (n == 2)
            {
                return this.Compatible(cards[b], cards[c]) ? 1 : 2;
            }

            if (pos[n, a, b, c] != 0)
            {
                return pos[n, a, b, c];
            }

            if (this.Compatible(cards[b], cards[c]) && this.IsPossible(n - 1, n - 4, a, c) == 1 ||
                n > 3 && this.Compatible(cards[n - 4], cards[c]) && this.IsPossible(n - 1, c, a, b) == 1)
            {
                pos[n, a, b, c] = 1;
                return 1;
            }
            else
            {
                pos[n, a, b, c] = 2;
                return 2;
            }
        }

        class Card
        {
            public Card(string card, int id)
            {
                Value = card[0];
                Suit = card[1];
                Id = id;
            }

            public char Value;

            public char Suit;

            public int Id;
        }

        private bool Compatible(Card a, Card b)
        {
            return a.Value == b.Value || a.Suit == b.Suit;
        }
    }
}


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

namespace Task_2
{
    class Program
    {
        static void Main(string[] args)
        {
            string s;
            int N;
            int k = -1 ;
            N = Console.Read();
            Console.ReadLine();
            s = Console.ReadLine();
            int j = 0;
            for(int i = 0 ;i<s.Length; i++){

               // if (j == 0)
               // {
                    for (j = 0; j < i+1; j++)
                    {
                        if (i + j +1< s.Length)
                        {
                            if (s[j] != s[i + j +1])
                            {
                                break;
                            }
                        }
                        else break;

                    }
                    if (j == i+1 && i != 0)
                    {
                      //  i = i + j;
                        k = j;
                    }
                   // else
                   // {
                    //    j = 0;
                    //    k++;
                   // }

            }
            int sum;
            if (k <= 1) k = 1;
            sum = s.Length - k + 1;
            Console.Write(sum);

        }
    }
}


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

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

         int ans = n;
         int dup = 0;

         if(n==1){
           Console.Write(1);
           return;
         }

         int up = (n%2==0)?n/2:(n-1)/2;
         string m1 = s[0] + "" + s[1];

         for(int i=2;i<=up;i++){
           string m2 = "";
           for(int j=i; ;j++){
             m2 += s[j]+"";
             if(m2.Length==i)break;
           }

           if(m2==m1){
             dup = Math.Max(dup,m2.Length);
           }

           m1 += s[i]+"";

         }

        if(dup>1){
          ans -= dup;
          ans++;
        }

         Console.WriteLine(ans);

      }
   }
}


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

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

        long k = nums[0];
        long n = nums[1];
        long r = k + n;
        Console.WriteLine(r);

    }
}


using System;

namespace _409H_ABStrikeBack
{
    class Program
    {
        static void Main(string[] args)
        {
            var temp = Array.ConvertAll(Console.ReadLine().Split(' '), x => Convert.ToInt32(x));
            int A = temp[0];
            int B = temp[1];
            int sum = A + B - 2 + 2;

            Console.WriteLine(sum);
        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main()
        {
            string s =Console.ReadLine();
            string [] all=s.Split(' ');
            int a = Convert.ToInt32(all[0]);
            int b = Convert.ToInt32(all[1]);
            Console.Write(a + b);
        }
    }
}