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

namespace CodeForces
{
	internal class B
	{
		private int MOD = 1000000007;
		private int n;
		private long m;
		private int k;
		private int[,] dp;
		private bool[,] was;
		private int[,] bin, pw;

		int go( int pos, int k )
		{
			if ( pos == n )
			{
				if ( k == 0 ) return 1;
				return 0;
			}
			if ( was[pos, k] )
				return dp[pos, k];
			int res = go( pos + 1, k );

			for ( int i = 1; i <= n && i <= k; ++i )
			{
				int tmp = (int)( ( (long)pw[pos, i] * go( pos + 1, k - i ) ) % MOD );
				res += tmp;
				if ( res >= MOD ) res -= MOD;
			}

			was[pos, k] = true;
			return dp[pos, k] = res;
		}

		private int pow( int a, long b )
		{
			if ( b == 0 ) return 1;
			int tmp = pow( a, b / 2 );
			tmp = (int)( ( (long)tmp * tmp ) % MOD );
			if ( b % 2 == 1 )
			{
				tmp = (int)( ( (long)tmp * a ) % MOD );
			}
			return tmp;
		}

		private void Solve()
		{
			n = NextInt();
			m = NextLong();
			k = NextInt();

			bin = new int[101, 101];
			for ( int i = 0; i <= 100; ++i )
			{
				bin[i, 0] = bin[i, i] = 1;
				for ( int j = 1; j < i; ++j ) bin[i, j] = ( bin[i - 1, j] + bin[i - 1, j - 1] ) % MOD;
			}
			pw = new int[101, 101];
			for ( int pos = 0; pos < n; ++pos )
			{
				long cnt = ( ( ( m - pos ) % n ) == 0 ? ( m - pos ) / n - 1 : ( m - pos ) / n ) + 1;
				for ( int i = 1; i <= n; ++i )
				{
					pw[pos, i] = pow( bin[n, i], cnt );
				}
			}

			dp = new int[n, n * n + 1];
			was = new bool[n, n * n + 1];
			Out.WriteLine( go( 0, k ) );
		}

		#region Local wireup

		public int NextInt()
		{
			return _in.NextInt();
		}

		public long NextLong()
		{
			return _in.NextLong();
		}

		public string NextLine()
		{
			return _in.NextLine();
		}

		public double NextDouble()
		{
			return _in.NextDouble();
		}

		readonly Scanner _in = new Scanner();
		static readonly TextWriter Out = Console.Out;

		void Start()
		{
#if !ONLINE_JUDGE
			var timer = new Stopwatch();
			timer.Start();
#endif
			var t = new Thread( Solve, 20000000 );
			t.Start();
			t.Join();
#if !ONLINE_JUDGE
			timer.Stop();
			Console.WriteLine( string.Format( CultureInfo.InvariantCulture, "Done in {0} seconds.\nPress <Enter> to exit.", timer.ElapsedMilliseconds / 1000.0 ) );
			Console.ReadLine();
#endif
		}

		static void Main()
		{
			new B().Start();
		}

		class Scanner : IDisposable
		{
			#region Fields

			readonly TextReader _reader;
			readonly int _bufferSize;
			readonly bool _closeReader;
			readonly char[] _buffer;
			int _length, _pos;

			#endregion

			#region .ctors

			public Scanner( TextReader reader, int bufferSize, bool closeReader )
			{
				_reader = reader;
				_bufferSize = bufferSize;
				_closeReader = closeReader;
				_buffer = new char[_bufferSize];
				FillBuffer( false );
			}

			public Scanner( TextReader reader, bool closeReader ) : this( reader, 1 << 16, closeReader ) { }

			public Scanner( string fileName ) : this( new StreamReader( fileName, Encoding.Default ), true ) { }

#if ONLINE_JUDGE
			public Scanner() : this( Console.In, false ) { }
#else
			public Scanner() : this( "input.txt" ) { }
#endif

			#endregion

			#region IDisposable Members

			public void Dispose()
			{
				if ( _closeReader )
				{
					_reader.Close();
				}
			}

			#endregion

			#region Properties

			public bool Eof
			{
				get
				{
					if ( _pos < _length ) return false;
					FillBuffer( false );
					return _pos >= _length;
				}
			}

			#endregion

			#region Methods

			private char NextChar()
			{
				if ( _pos < _length ) return _buffer[_pos++];
				FillBuffer( true );
				return _buffer[_pos++];
			}

			private char PeekNextChar()
			{
				if ( _pos < _length ) return _buffer[_pos];
				FillBuffer( true );
				return _buffer[_pos];
			}

			private void FillBuffer( bool throwOnEof )
			{
				_length = _reader.Read( _buffer, 0, _bufferSize );
				if ( throwOnEof && Eof )
				{
					throw new IOException( "Can't read beyond the end of file" );
				}
				_pos = 0;
			}

			public int NextInt()
			{
				var neg = false;
				int res = 0;
				SkipWhitespaces();
				if ( !Eof && PeekNextChar() == '-' )
				{
					neg = true;
					_pos++;
				}
				while ( !Eof && !IsWhitespace( PeekNextChar() ) )
				{
					var c = NextChar();
					if ( c < '0' || c > '9' ) throw new ArgumentException( "Illegal character" );
					res = 10 * res + c - '0';
				}
				return neg ? -res : res;
			}

			public long NextLong()
			{
				var neg = false;
				long res = 0;
				SkipWhitespaces();
				if ( !Eof && PeekNextChar() == '-' )
				{
					neg = true;
					_pos++;
				}
				while ( !Eof && !IsWhitespace( PeekNextChar() ) )
				{
					var c = NextChar();
					if ( c < '0' || c > '9' ) throw new ArgumentException( "Illegal character" );
					res = 10 * res + c - '0';
				}
				return neg ? -res : res;
			}

			public string NextLine()
			{
				SkipUntilNextLine();
				if ( Eof ) return "";
				var builder = new StringBuilder();
				while ( !Eof && !IsEndOfLine( PeekNextChar() ) )
				{
					builder.Append( NextChar() );
				}
				return builder.ToString();
			}

			public double NextDouble()
			{
				SkipWhitespaces();
				var builder = new StringBuilder();
				while ( !Eof && !IsWhitespace( PeekNextChar() ) )
				{
					builder.Append( NextChar() );
				}
				return double.Parse( builder.ToString(), CultureInfo.InvariantCulture );
			}

			private void SkipWhitespaces()
			{
				while ( !Eof && IsWhitespace( PeekNextChar() ) )
				{
					++_pos;
				}
			}

			private void SkipUntilNextLine()
			{
				while ( !Eof && IsEndOfLine( PeekNextChar() ) )
				{
					++_pos;
				}
			}

			private static bool IsWhitespace( char c )
			{
				return c == ' ' || c == '\t' || c == '\n' || c == '\r';
			}

			private static bool IsEndOfLine( char c )
			{
				return c == '\n' || c == '\r';
			}

			#endregion
		}

		#endregion
	}
}


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

namespace Olymp
{
  public class ProblemSolver
  {
    private Tokenizer input;

    public void Solve()
    {
      int n = input.ReadInt();
      var c = new HashSet<int>();
      for (int a = 0; a <= 33; a++)
      {
        for (int b = 0; 7 * b <= 100 - 3 * a; b++)
        {
          c.Add(3 * a + 7 * b);
        }
      }
      for (int i = 0; i < n; i++)
      {
        int x = input.ReadInt();
        Console.WriteLine(c.Contains(x) ? "YES" : "NO");
      }
    }

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

    #region Service functions

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

    #endregion
  }

  #region Service classes

  public class Tokenizer
  {
    private TextReader reader;

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

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

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

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

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

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

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

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

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

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

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

  #endregion
}


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

namespace CodeForces
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			int[] nums = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray ();
			Dictionary<int,int> cards = new Dictionary <int,int> ();
			foreach (int i in nums) {
				if (!cards.ContainsKey (i))
					cards.Add (i, 0);
				cards [i]++;
			}
			int best = nums.Sum ();
			foreach (KeyValuePair<int,int> pair in cards) {
				if (pair.Value > 1) {
					int count = pair.Value;
					if (count > 3)
						count = 3;
					int tmp = nums.Sum () - pair.Key * count;
					if (tmp < best)
						best = tmp;
				}
			}
			Console.WriteLine (best);
		}
	}
}


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

class P {
  static IEnumerable<long> GetNums() {
    for (var i = 0L ;  ; i++) {
      var c = i;
      var res = 0L; var mult = 1L;
      var d4 = 0; var d7 = 0;
      while (c > 0) {
        int dig;
        if (c > 2) {
          var o = (c - 1)%2 + 1;
          c -= o;
          dig = o == 1 ? 4 : 7;
        } else {
          c--;
          dig = (c == 0 ? 4 : 7);
        }
        if (dig == 4) d4++; else d7++;
        res += mult * dig;
        c /= 2;
        mult *= 10;
      }
      if (d4 == d7)
        yield return res;
    }
  }

  public static void Main() {
    long n = long.Parse(Console.ReadLine());
    var res = GetNums().First(x => x >= n);
    Console.Write(res);
  }
}


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

namespace CodeForces
{
    class R200_Div2_C
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            long a = long.Parse(s[0]);
            long b = long.Parse(s[1]);

            long cnt = a/b, x;
            a %= b;
            while (a > 0)
            {
                x = a; a = b; b = x;
                cnt += (a / b);
                a %= b;
            }
            Console.WriteLine(cnt);
        }
    }
}


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

/*
   Aryanium Shadowhunter
*/

namespace CodeForces
{
    class Program
    {

        public static void Main(string[] args)
        {
            GregorianCalendar gCalendar = new GregorianCalendar();
            DateTime dTime = new DateTime(2016,1,1,gCalendar);
            string input = Console.ReadLine();
            int count = 0;
            if (input.Contains("week"))
            {
                int day = int.Parse(input.Replace(" of week", " "));
                DayOfWeek dayWeek = new DayOfWeek();

                switch (day)
                {
                    case 1:dayWeek = DayOfWeek.Monday;break;
                    case 2: dayWeek = DayOfWeek.Tuesday; break;
                    case 3: dayWeek = DayOfWeek.Wednesday; break;
                    case 4: dayWeek = DayOfWeek.Thursday; break;
                    case 5: dayWeek = DayOfWeek.Friday; break;
                    case 6: dayWeek = DayOfWeek.Saturday; break;
                    case 7: dayWeek = DayOfWeek.Sunday; break;

                }

                for (int i = 0; i < gCalendar.GetDaysInYear(2016); i++)
                {
                    if (gCalendar.GetDayOfWeek(dTime) == dayWeek) count++;
                    dTime = gCalendar.AddDays(dTime, 1);
                }
            }
            else
            {
                int day = int.Parse(input.Replace(" of month", " "));
                for (int i = 1; i < 13; i++)
                {
                    if (day <= gCalendar.GetDaysInMonth(2016, i)) count++ ;
                }
            }

            Console.WriteLine(count);

        }

    }
}


using System;

namespace ConsoleApplication1
{

    class Program
    {
        static void Main(string[] args)
        {
            string[] t = Console.ReadLine().Split(' ');
            int l = int.Parse(t[0]);
            int d = int.Parse(t[1]);
            int v = int.Parse(t[2]);
            int g = int.Parse(t[3]);
            int r = int.Parse(t[4]);
            double ans = 0;
            double t1 = (double)d / (double)v;
            double w = (double)l / (double)v;
            t1 %= g + r;
            if (t1 < g)
                ans = w;
            if (t1 == g)
                ans = w + r;
            if (t1 > g)
                ans = w + r - (t1 - g);
            string s = String.Format("{0:0.######}", ans).Replace(',','.');
            Console.WriteLine(s);
        }
    }
}


using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
class Solve{
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        string[] str = Console.ReadLine().Split(' ');
        long X = long.Parse(str[0]);
        long Y = long.Parse(str[1]);
        Generateprimenumber G = new Generateprimenumber(1000003);
        long[] Div = G.Divisor(X);
        long count = 0;
        while(Y != 0){
            long Z = gcd(X,Y);
            X /= Z;
            Y /= Z;
            long min = Y;
            for(int i=0;i<Div.Length;i++){
                if(X % Div[i] == 0){
                    min = Math.Min(min,Y % Div[i]);
                }
            }
            count += min;
            Y -= min;
        }
        sb.Append(count+"\n");
    }
    long gcd(long x,long y){
        if(y == 0){
            return x;
        }
        else{
            return gcd(y,x%y);
        }
    }
}
class Generateprimenumber{
    public long[] p;
    public int length;
    public Generateprimenumber(int n){
        bool[] a = new bool[n+1];
        List<long> pp = new List<long>();
        int j = 2;
        for(int i=0;i<n+1;i++){
            a[i] = true;
        }
        while(j<=n){
            if(a[j]){
                pp.Add(j);
                for(int i=j;(long)i*(long)j<=n;i++){
                    a[i*j] = false;
                }
            }
            j++;
        }
        length = pp.Count;
        p = pp.ToArray();
    }
    public long[] Divisor(long n){
        List<long> pp = new List<long>();
        long num = n;
        for(int i=0;p[i]*p[i] <= num;i++){
            if(num % p[i] == 0){
                pp.Add(p[i]);
            }
            while(num % p[i] == 0){
                num /= p[i];
            }
        }
        if(num != 1){
            pp.Add(num);
        }
        return pp.ToArray();
    }
}


using System;

namespace Xorygol
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = 0;
            int n = Convert.ToInt32(Console.ReadLine());
            for (int a = 1; a <= n; a++)
            {
                for (int b = a; b <= n; b++)
                {
                    int c = a ^ b;
                    if((b + a > c) && (a + c > b) && (c + b > a) && (c >= b) && (c <= n))
                    {
                        count++;
                    }
                }
            }
            Console.WriteLine(count);
        }
    }
}


using System;

namespace CSharp
{
    public class _651A
    {
        public static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split();

            int a1 = int.Parse(tokens[0]);
            int a2 = int.Parse(tokens[1]);

            int minutes = 0;

            while (Math.Min(a1, a2) > 0 && Math.Max(a1, a2) > 1)
            {
                int min = Math.Min(a1, a2);
                int max = Math.Max(a1, a2);

                a1 = min + 1;
                a2 = max - 2;

                minutes++;
            }

            Console.WriteLine(minutes);
        }
    }
}


using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var cnt = Console.ReadLine();
            var split = cnt.Split(' ');
            int n = int.Parse(split[0]);
            int m = int.Parse(split[1]);
            for(int i=0;i<n;i++)
            {
                var t = Console.ReadLine();
                if (t.Contains("C") || t.Contains("M") || t.Contains("Y"))
                {
                    Console.WriteLine("#Color");
                    return;
                }
            }
            Console.WriteLine("#Black&White");
        }
    }
}


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

namespace About_Bacteria
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int k = Next(), b = Next(), n = Next(), t = Next();

            long sum = 1;
            int p = 0;
            while (sum * k + b <= t)
            {
                sum = sum*k + b;
                p++;
            }

            writer.WriteLine(Math.Max(0, n - p));
            writer.Flush();
        }

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


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

namespace Contest_14
{
    class Program
    {
        static void A()
        {
            var t = Console.ReadLine().Split(' ');
            int n = int.Parse(t[0]);
            int m = int.Parse(t[1]);

            int x1 = int.MaxValue, x2 = int.MinValue, y1 = int.MaxValue, y2 = int.MinValue;
            List<string> a = new List<string>();
            for (int i = 0; i < n; i++)
            {
                string s = Console.ReadLine();
                a.Add(s);
                for (int j = 0; j < m; j++)
                {
                    if (s[j] == '*')
                    {
                        if (x1 > i)
                            x1 = i;
                        if (x2 < i)
                            x2 = i;
                        if (y1 > j)
                            y1 = j;
                        if (y2 < j)
                            y2 = j;
                    }
                }
            }

            for (int i = x1; i <= x2; i++)
            {
                for (int j = y1; j <= y2; j++)
                {
                    Console.Write(a[i][j]);
                }
                Console.WriteLine();
            }
        }

        static void B()
        {
            var t = Console.ReadLine().Split(' ');
            int n = int.Parse(t[0]);
            int x = int.Parse(t[1]);

            int min = int.MaxValue;
            int max = int.MinValue;
            int[] a = new int[1001];
            for (int i = 0; i < n; i++)
            {
                t = Console.ReadLine().Split(' ');
                int k = int.Parse(t[0]);
                int l = int.Parse(t[1]);

                if (k > l)
                {
                    int q = k;
                    k = l;
                    l = q;
                }
                if (i == 0)
                {
                    min = k;
                    max = l;
                    continue;
                }
                if (k > min)
                {
                    min = k;
                }
                if (l < max)
                    max = l;
            }
            if (max < min)
            {
                Console.WriteLine(-1);
                return;
            }
            if ((x >= min) && (x <= max))
                Console.WriteLine(0);
            else
                Console.WriteLine(Math.Min(Math.Abs(min - x), Math.Abs(max - x)));
        }

        class Point : IComparer<Point>
        {
            public int x;
            public int y;

            public Point(int x, int y)
            {
                this.x = x;
                this.y = y;
            }

            public int Compare(Point p1, Point p2)
            {
                if (p1.x != p2.x)
                    return p1.x.CompareTo(p2.x);
                else
                    return p1.y.CompareTo(p2.y);
            }

            public bool isGood (Point p)
            {
                if ((x == p.x) && (y != p.y))
                    return true;
                if ((y == p.y) && (x != p.x))
                    return true;
                return false;
            }

            public void deleteInList(List<Point> b)
            {
                for (int j = 0; j < b.Count; j++)
                {
                    Point temp = b[j];
                    if ((temp.x == this.x) && (temp.y == this.y))
                    {
                        b.RemoveAt(j);
                        break;
                    }
                }

            }

        }

        static void C()
        {
            List<int[]> a = new List<int[]>();

            for (int i = 0; i < 4; i++)
            {
                var t = Console.ReadLine().Split(' ');
                var t1 = new int[] { int.Parse(t[0]), int.Parse(t[1]), int.Parse(t[2]), int.Parse(t[3]) };
                for (int j = 0; j < a.Count; j++)
                {
                    var k = a[j];

                    if ((k[0] == t1[0]) && (k[1] == t1[1]) && (k[2] == t1[2]) && (k[3] == t1[3]))
                    {
                        Console.WriteLine("NO");
                        return;
                    }

                    if ((k[2] == t1[0]) && (k[3] == t1[1]) && (k[0] == t1[2]) && (k[1] == t1[3]))
                    {
                        Console.WriteLine("NO");
                        return;
                    }
                }
                a.Add(t1);

            }

            List<Point> b = new List<Point>();

            int xl = int.MaxValue, yl = int.MinValue, xr = int.MinValue, yr = int.MaxValue;

            for (int i = 0; i < 4; i++)
            {
                int[] t = a[i];
                Point l1 = new Point(t[0], t[1]);
                Point l2 = new Point(t[2], t[3]);
                b.Add(l1);
                b.Add(l2);
                if (t[0] < xl)
                    xl = t[0];
                if (t[1] > yl)
                    yl = t[1];
                if (t[2] > xr)
                    xr = t[2];
                if (t[3] < yr)
                    yr = t[3];
                if (!l1.isGood(l2))
                {
                    Console.WriteLine("NO");
                    return;
                }
            }

            Point p1 = new Point(xl, yl);
            Point p2 = new Point(xr, yr);

            for (int i = 0; i < 2; i++)
            {
                p1.deleteInList(b);
                p2.deleteInList(b);
                new Point(p1.x, p2.y).deleteInList(b);
                new Point(p2.x, p1.y).deleteInList(b);
            }
            if (b.Count > 0)
                Console.WriteLine("NO");
            else Console.WriteLine("YES");
        }

        static void Main(string[] args)
        {
            //Console.SetIn(new StreamReader(@"C:\1.txt"));
            C();
        }
    }
}


using System;

namespace codeforces99B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            for(int i=2;i<=n;i++)
            {
                if(n%i==0)
                {
                    s= Reverse(s.Substring(0, i)) + s.Substring(i);
                }
            }
            Console.WriteLine(s);
        }
        private static string Reverse(string str)
        {
            string res = "";
            for (int i = 0; i < str.Length; i++)
                res = str[i] + res;
           // Console.WriteLine(res);
            return res;
        }
    }
}


// Problem: 965A - Paper Airplanes
// Author: Gusztav Szmolik

using System;

class PaperAirplanes
    {
    static int Main ()
        {
        string line = Console.ReadLine ();
        if (line == null)
            return -1;
        char[] delims = {' ', '\t'};
        string[] words = line.Split (delims,StringSplitOptions.RemoveEmptyEntries);
        if (words.Length != 4)
            return -1;
        ushort k;
        if (!UInt16.TryParse (words[0], out k))
            return -1;
        if (k < 1 || k > 10000)
            return -1;
        ushort n;
        if (!UInt16.TryParse (words[1], out n))
            return -1;
        if (n < 1 || n > 10000)
            return -1;
        ushort s;
        if (!UInt16.TryParse (words[2], out s))
            return -1;
        if (s < 1 || s > 10000)
            return -1;
        ushort p;
        if (!UInt16.TryParse (words[3], out p))
            return -1;
        if (p < 1 || p > 10000)
            return -1;
        ushort numSheetEachPeople = Convert.ToUInt16 (n%s == 0 ? n/s : n/s+1);
        uint totalNumSheet = Convert.ToUInt32 (k*numSheetEachPeople);
        uint ans = (totalNumSheet%p == 0 ? totalNumSheet/p : totalNumSheet/p+1);
        Console.WriteLine (ans);
        return 0;
        }
    }


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
namespace learnSharp
{
    public delegate void PayDelegate();
    public delegate void AddDelegate();
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            char[] leeterOfS = s.ToCharArray();
            int n = 0;

            char[] odd = { '1', '3', '5', '7' ,'9' };
            char[] vowel = { 'a', 'i', 'o', 'u', 'e' };

            for(int i = 0; i < s.Length; i++)
            {
                for(int v = 0; v < vowel.Length; v++)
                {
                    if (leeterOfS[i] == vowel[v])
                    {
                        n += 1;
                    }
                }
            }

            for(int i = 0; i < s.Length; i++)
            {
                for(int e = 0; e < odd.Length; e++)
                {
                    if (leeterOfS[i] == odd[e])
                    {
                        n += 1;
                    }
                }
            }

            Console.WriteLine(n);
        }
    }
}


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

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = Convert.ToInt32(Console.ReadLine());
            int[] mass = new int[i];
            string[] q = Console.ReadLine().Split(' ');
            bool flag = true;

            for (int j = 0; j < i; j++)
            {
                mass[j] = Convert.ToInt32(q[j]);
            }

            for (int j = 0; j < i - 1; j++)
            {
                if (Math.Abs(mass[j] - mass[j + 1]) > 1)
                {
                    Console.WriteLine("NO");
                    flag = false;
                    break;
                }
            }

            if (flag)
            {
                Console.WriteLine("YES");
            }

        }
    }
}


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

namespace Blocked_Points
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            long n = Next();

            long count;
            if (n == 1)
                count = 4;

            else if (n == 2)
                count = 8;
            else if (n == 0)
                count = 1;
            else
            {

                long y = (long)Math.Sqrt(n/2*n)+2;
                long nn = n*n;

                while (2*y*y > nn)
                {
                    y--;
                }
                if (y*y + (y+1)*(y+1) > nn)
                {
                    count = (y)*8;
                }
                else
                {
                    count = (2*y + 1)*4;
                }
            }

            writer.WriteLine(count);
            writer.Flush();
        }

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


using System;
using System.Linq;

namespace CSharp
{
    public class _849A
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(token => int.Parse(token)).ToArray();

            Console.WriteLine((a.Length * a.First() * a.Last()) % 2 == 1 ? "Yes" : "No");
        }
    }
}


using System;
using System.Linq;
using System.Collections.Generic;
using Debug = System.Diagnostics.Debug;
using SB = System.Text.StringBuilder;
using System.Numerics;
using static System.Math;
namespace Program {
    public class Solver {
        Random rnd = new Random(0);
        public void Solve() {
            var n = rl;
            var k = ri;
            solve(n, k);
        }
        void solve(long n, int k) {
            Debug.WriteLine($"{n} {k}");
            var rev = Enumerate(100, x => ModInt.Inverse(x));

            ModInt all = 1;
            for (long p = 2; n != 1; p++) {
                if (p * p > n) {
                    p = n;
                }
                if (n % p != 0) continue;
                var cnt = 0;
                while (n % p == 0) {
                    n /= p;
                    cnt++;
                }
                var dp = new ModInt[cnt + 1];
                dp[cnt] = 1;
                for (int i = 0; i < k; i++) {
                    var next = new ModInt[cnt + 1];
                    for (int j = 0; j < dp.Length; j++)
                        for (int jj = 0; jj <= j; jj++) {
                            next[jj] += dp[j] * rev[j + 1];
                        }
                    dp = next;
                }
                ModInt ans = 0;
                for (long i = 0, v = 1; i < dp.Length; i++, v *= p)
                    ans += v * dp[i];
                all *= ans;

            }
            Console.WriteLine(all);
        }
        const long INF = 1L << 60;
        int ri { get { return sc.Integer(); } }
        long rl { get { return sc.Long(); } }
        double rd { get { return sc.Double(); } }
        string rs { get { return sc.Scan(); } }
        public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());

        static T[] Enumerate<T>(int n, Func<int, T> f) {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f(i);
            return a;
        }
        static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
    }
}

#region main
static class Ex {
    static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
    static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") {
        return string.Join(st, ie);
    }
    static public void Main() {
        Console.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });
        var solver = new Program.Solver();
        solver.Solve();
        Console.Out.Flush();
    }
}
#endregion
#region Ex
namespace Program.IO {
    using System.IO;
    using System.Text;
    using System.Globalization;

    public class Printer: StreamWriter {
        public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
        public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
    }

    public class StreamScanner {
        public StreamScanner(Stream stream) { str = stream; }

        public readonly Stream str;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }

        private byte read() {
            if (isEof) return 0;
            if (ptr >= len) {
                ptr = 0;
                if ((len = str.Read(buf, 0, 1024)) <= 0) {
                    isEof = true;
                    return 0;
                }
            }
            return buf[ptr++];
        }

        public char Char() {
            byte b = 0;
            do b = read(); while ((b < 33 || 126 < b) && !isEof);
            return (char)b;
        }
        public string Scan() {
            var sb = new StringBuilder();
            for (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);
            return sb.ToString();
        }
        public string ScanLine() {
            var sb = new StringBuilder();
            for (var b = Char(); b != '\n' && b != 0; b = (char)read()) if (b != '\r') sb.Append(b);
            return sb.ToString();
        }
        public long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }
        public int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }
        public double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }
    }
}

#endregion

#region sieve O(NloglogN)
static public partial class MathEx {
    static public bool[] Sieve(int p, List<int> primes = null) {
        var isPrime = new bool[p + 1];
        for (int i = 2; i < isPrime.Length; i++) isPrime[i] = true;
        for (int i = 2; i * i <= p; i++)
            if (!isPrime[i]) continue;
            else for (int j = i * i; j <= p; j += i) isPrime[j] = false;
        if (primes != null) for (int i = 0; i <= p; i++) if (isPrime[i]) primes.Add(i);

        return isPrime;
    }
    static public List<int> SieveList(int p) { var ret = new List<int>(); Sieve(p, ret); return ret; }
}
#endregion

#region ModInt
/// <summary>
/// [0,<see cref="Mod"/>) までの値を取るような数
/// </summary>
public struct ModInt {
    /// <summary>
    /// 剰余を取る値．
    /// </summary>
    public const long Mod = (int)1e9 + 7;

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

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

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


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

class Program
{
    public class SegmentTreeAssignSum
    {
        int n;
        int h;
        int[] t;
        int[] d;

        public SegmentTreeAssignSum(int capacity)
        {
            this.n = capacity;
            this.t = new int[capacity + capacity];
            this.d = new int[capacity + capacity];
            this.h = 1;
            while (this.h < capacity) this.h *= 2;
            if (h > capacity) h /= 2;
        }

        private void Calc(int p, int k)
        {
            if (d[p] == 0)
                t[p] = t[p << 1] + t[p << 1 | 1];
            else
                t[p] = d[p] * k;
        }

        private void Apply(int p, int value, int k)
        {
            t[p] = value * k;
            if (p < n)
            {
                d[p] = value;
            }
        }

        private void Build(int l, int r)
        {
            int k = 2;
            for (l += n, r += n - 1; l > 1; k <<= 1)
            {
                l >>= 1;
                r >>= 1;
                for (int i = r; i >= l; --i)
                    this.Calc(i, k);
            }
        }

        private void Push(int l, int r)
        {
            int s = h, k = 1 << (h - 1);
            for (l += n, r += n - 1; s > 0; --s, k >>= 1)
                for (int i = l >> s; i <= r >> s; ++i)
                    if (d[i] != 0)
                    {
                        this.Apply(i << 1, d[i], k);
                        this.Apply(i << 1 | 1, d[i], k);
                        d[i] = 0;
                    }
        }

        public void Modify(int l, int r, int value)
        {
            r++;
            if (value == 0) return;
            this.Push(l, l + 1);
            this.Push(r - 1, r);
            int l0 = l, r0 = r, k = 1;
            for (l += n, r += n; l < r; l >>= 1, r >>= 1, k <<= 1)
            {
                if (l % 2 == 1) this.Apply(l++, value, k);
                if (r % 2 == 1) this.Apply(--r, value, k);
            }
            this.Build(l0, l0 + 1);
            this.Build(r0 - 1, r0);
        }

        public int GetSum(int l, int r)
        {
            r++;
            this.Push(l, l + 1);
            this.Push(r - 1, r);
            int result = 0;
            for (l += n, r += n; l < r; l >>= 1, r >>= 1)
            {
                if (l % 2 == 1) result += t[l++];
                if (r % 2 == 1) result += t[--r];
            }
            return result;
        }
    }

    public class SegmentTree2
    {
        private int Mid = 1024 * 128;
        private int[] t;
        private int[] d;

        public SegmentTree2(int[] a)
        {
            this.Mid = 1;
            while (Mid < a.Length) Mid *= 2;
            this.t = new int[Mid + Mid];
            this.d = new int[Mid + Mid];

            for (int i = 0; i < a.Length; i++) t[Mid + i] = a[i];
            for (int i = Mid - 1; i > 0; i--)
                t[i] = t[i + i] + t[i + i + 1];
        }

        private void push(int v)
        {
            if (t[v] != -1)
            {
                t[v * 2] = t[v * 2 + 1] = t[v];
                t[v] = -1;
            }
        }

        public void update(int v, int tl, int tr, int l, int r, int color)
        {
            if (l > r)
                return;
            if (l == tl && tr == r)
                t[v] = color;
            else
            {
                push(v);
                int tm = (tl + tr) / 2;
                update(v * 2, tl, tm, l, Math.Min(r, tm), color);
                update(v * 2 + 1, tm + 1, tr, Math.Max(l, tm + 1), r, color);
            }
        }

        public int get(int v, int tl, int tr, int pos)
        {
            if (tl == tr)
                return t[v];
            push(v);
            int tm = (tl + tr) / 2;
            if (pos <= tm)
                return get(v * 2, tl, tm, pos);
            else
                return get(v * 2 + 1, tm + 1, tr, pos);
        }

    }

    public class AssignmentBf
    {
        private int[] t;
        public AssignmentBf(int capacity)
        {
            this.t = new int[capacity];
        }

        public void Modifu(int l, int r, int v)
        {
            for (int i = l; i <= r; i++) t[i] = v;
        }

        public int GetSum(int l, int r)
        {
            int sum = 0;
            for (int i = l; i <= r; i++) sum += t[i];
            return sum;
        }

        public int GetMax(int l, int r)
        {
            int max = t[l];
            for (int i = l; i <= r; i++)
                max = Math.Max(max, t[i]);
            return max;
        }
    }

    private static StringBuilder sb = new StringBuilder();
    private static bool Can(long x, long y, bool reverse = false)
    {
        if (x > y) return Can(y, x, true);
        if (x == 0) sb.Append(y + (reverse ? "A" : "B"));
        if (x == 0) return true;
        if (x == y) return false;
        sb.Append((y / (x + 1)) + (reverse ? "A" : "B"));
        return Can(y % (x + 1), x, !reverse);
    }

    static void Main(string[] args)
    {
        long x = ReadLong();
        long y = ReadLong();
        if (!Can(x - 1, y - 1))
            Console.WriteLine("Impossible");
        else
            Console.Write(sb.ToString());

        /*
        int[] b = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };

        var st3 = new SegmentTree2(b);

        var q1 = st3.get(6, 9);
        st3.get(9, 9, 8);
        var q2 = st3.get(6, 9);
        st3.get(9, 9, 1);
        var q3 = st3.get(6, 9);

        st3.Update(3, 7, 9);

        st3.Print();

        int id = 0;
        int maxValue = 10;
        int size = 10;

        while (true)
        {
            id++;

            var x = new Random();
            int[] a = new int[size];
            for (int i = 0; i < a.Length; i++) a[i] = x.Next(maxValue);

            //int[] a = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            var st2 = new SegmentTree2(a);
            var bf = new AssignmentBf(a.Length);
            for (int i = 0; i < a.Length; i++) bf.Modifu(i, i, a[i]);

            for (int i = 0; i < 100000; i++)
            {
                int l = x.Next(a.Length);
                int r = x.Next(l, a.Length);
                if (x.Next(5) == 1)
                {
                    int v = x.Next(maxValue);
                    st2.Update(l, r, v);
                    bf.Modifu(l, r, v);
                }
                else
                {
                    var s1 = st2.GetSum(l, r);
                    var s2 = bf.GetSum(l, r);
                    if (s1 != s2)
                    {
                        Console.WriteLine("WRONG");
                    }
                }
            }

        */
        //Console.WriteLine("COMPLETED " + id++);
        //}

        /*
                Verify("abcde", "a", false);
                Verify("abcde", "a%", true);
                Verify("abcde", "%a", false);
                Verify("abcde", "b", false);
                Verify("abcde", "b%", false);
                Verify("abcde", "%b", false);

                Verify("25%", "_5[%]", true);
                Verify("_52", "_5[%]5%", true);

                Verify("ab", "a[a-cdf]]", true);
                Verify("ad", "a[a-cdf]", true);
                Verify("ab", "a[-acdf]", false);
                Verify("a-", "a[-acdf]", true);

                Verify("[]", "'[[]]", true);
                Verify("''", "_'", true);
                Verify("U", "[^a-zA-Z0-9]", false);
                */
        /*
      int n = ReadInt();
      int[] m = ReadIntArray(n);

      double x = -10000;
      double vx = Value(m, x);
      double prevVx = vx;
      double step = 1000;
      int iteration = 0;
      while (iteration < 228)
      {
          iteration++;
          double next = Value(m, x + step);
          if (next <= vx)
          {
              prevVx = vx;
              vx = next;
              x += step;
          }
          else
          {
              x -= step;
              vx = prevVx;
              step = step / 2;
          }
      }

      Console.WriteLine(vx.ToString().Replace(',', '.'));*/
    }

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

        return g;
    }

    private static int[] ReadIntArray()
    {
        string[] tmp = Console.ReadLine().Split(' ');
        int[] ans = new int[tmp.Length];
        for (int i = 0; i < tmp.Length; i++) ans[i] = int.Parse(tmp[i]);
        return ans;
    }

    private static long[] ReadLongArray()
    {
        string[] tmp = Console.ReadLine().Split(' ');
        long[] ans = new long[tmp.Length];
        for (int i = 0; i < tmp.Length; i++) ans[i] = long.Parse(tmp[i]);
        return ans;
    }

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

    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 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 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;
        }
    }
}


using System;

namespace CodeForces
{
	class A
	{
		static long gcd(long a, long b)
		{
			while (b != 0)
			{
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;
		}

		static long lcm(long m, long n)
		{
			return (m / gcd(m, n)) * n;
		}

		static void Main(string[] args)
		{
			string s = Console.ReadLine();
			string[] d = s.Split(' ');
			long n = long.Parse(d[0]);
			int k = int.Parse(d[1]);
			int div = (int) Math.Pow(10, k);

			Console.WriteLine(lcm(n, div));
		}
	}
}


using System;

class Program
{
  static void Main(string[] args)
  {
    int[] array = new int[11];
    for(int i = 0; i < 11; i++)
    {
      array[i] = int.Parse(Console.ReadLine());
    }
    for(int i = 10; i >= 0; i--)
    {
      double a = Math.Sqrt(Math.Abs(array[i]));
      double b = Math.Pow(array[i], 3) * 5;
      double result = a + b;
      if(result <= 400)
      {
        Console.WriteLine(String.Format("f({0}) = {1:0.00}",  array[i], result));
      }
      else
      {
        Console.WriteLine(String.Format("f({0}) = MAGNA NIMIS!",  array[i]));
      }
    }
  }
}


using System;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            int s, v1, v2, t1, t2, a, b;
            s = Convert.ToInt32(str[0]);
            v1 = Convert.ToInt32(str[1]);
            v2 = Convert.ToInt32(str[2]);
            t1 = Convert.ToInt32(str[3]);
            t2 = Convert.ToInt32(str[4]);
            if (v1 * s + t1 * 2 < v2 * s + t2 * 2)
                Console.WriteLine("First");
            else if (v1 * s + t1 * 2 == v2 * s + t2 * 2)
                Console.WriteLine("Friendship");
            else
                Console.WriteLine("Second");
        }
    }
}


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

namespace DiceRolling
{
    class Program
    {
        static void Main(string[] args)
        {
            int q = int.Parse(Console.ReadLine());
            int[] a = new int[q];
            for (int i = 0; i < q; i++)
            {
                a[i] = int.Parse(Console.ReadLine()) / 2;
            }
            foreach (int i in a)
                Console.WriteLine(i);
            Console.ReadLine();
        }
    }
}


using System;
class Program
    {
        public static void Main(string[] args)
        {
            long[] dt;
            //string[] input = Console.In.ReadLine().Split(new char[] { '\t', ' ', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
            {
                dt = new long[3];
                string[] inp = Console.ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                dt[0] = long.Parse(inp[0]);
                dt[1] = long.Parse(inp[1]);
                dt[2] = 1L;
                if(dt[1]==4)
                {
                    dt[2] += (dt[0] - 1L) * (dt[0] - 2L) * dt[0] * (dt[0] - 3L) * 9L / 24L;
                    dt[1]--;
                }
            }
            {
                long temp = dt[0] * dt[0] - dt[0];
                dt[0]--;
                for (long temp2 = 2L, cntr = 2L; cntr <=dt[1];)
                {
                    dt[2] += ((temp * temp2 / cntr) / temp2);
                    temp *= --dt[0];
                    temp2 *= ++cntr;
                }
            }
            Console.WriteLine(dt[2]);
        }

    }


using System;

namespace Olymp
{
    class Program
    {

        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            if (n == 1) Console.WriteLine(1);
            else if (n == 2) Console.WriteLine(2);
            else
                Console.WriteLine(Numb(n));
        }

        static public long Numb(int n)
        {
            long max = n * (n - 1) * (n - 2) / GCD(n, n - 2);
            for (int q = 10;  q > 0; q--)
            {
                long t = n * (n - 1) * (n - 2) / GCD(n, n - 2);
                for (long i = n; i > n - 10 && i > 2; i--)

                    for (long j = i - 1; j > i - 11 && j > 1; j--)

                        for (long k = j - 1; k > i - 12 && k > 0; k--)

                            if ((i * j * k) / GCD(i, k) > t)
                                t = i * j * k / GCD(i, k);

                if (t > max) max = t;
            }
            return max;
        }
        public static long GCD(long a, long b)
        {
            if (b == 0) return a;
            else return GCD(b, a % b);
        }
    }
}


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

public class Matrix {
    public int Row, Col;
    private int[] Data;
    public Matrix(int row, int col) {
        this.Row = row;
        this.Col = col;
        this.Data = new int[Row * Col];
    }

    public int this[int row, int col] {
        set {
            Data[row * Col + col] = value;
        }
        get {
            return Data[row * Col + col];
        }
    }

    static public Matrix UnitMatrix(int n) {
        Matrix matrix = new Matrix(n, n);
        for (int i = 0; i < n; i++) {
            matrix[i, i] = 1;
        }
        return matrix;
    }

    static public Matrix operator +(Matrix A, Matrix B) {
        Matrix C = new Matrix(A.Row, A.Col);
        for (int i = 0; i < C.Data.Length; i++) {
            if (A.Data[i] == int.MaxValue || B.Data[i] == int.MaxValue)
                C.Data[i] = int.MaxValue;
            else
                C.Data[i] = A.Data[i] + B.Data[i];
        }
        return C;
    }

    static public Matrix operator -(Matrix A, Matrix B) {
        Matrix C = new Matrix(A.Row, A.Col);
        for (int i = 0; i < C.Data.Length; i++) {
            C.Data[i] = A.Data[i] - B.Data[i];
        }
        return C;
    }

    static public Matrix operator *(Matrix A, Matrix B) {
        Matrix C = new Matrix(A.Row, B.Col);
        for (int i = 0; i < A.Row; i++) {
            for (int j = 0; j < B.Col; j++) {
                C[i, j] = int.MaxValue;
                for (int k = 0; k < A.Col; k++) {
                    //C[i, j] += A[i, k] * B[k, j];
                    if (A[i, k] == int.MaxValue || B[k, j] == int.MaxValue) continue;
                    C[i, j] = Math.Min(C[i, j], A[i, k] + B[k, j]);
                }
            }
        }
        return C;
    }

    static public Matrix Pow(Matrix A, long n) {
        if (n == 0) return UnitMatrix(A.Row);
        Matrix result = A.Clone(), t = A.Clone(); n--;
        while (n > 0) {
            if ((n & 1) != 0) {
                result = result * t;
            }

            t = t * t;
            n >>= 1;
        }

        return result;
    }

    public Matrix Clone() {
        Matrix clone = new Matrix(Row, Col);
        clone.Data = Data.Clone() as int[];
        return clone;
    }
}

public partial class CodeForces {

    static void UpdateMin<T>(ref T x, T newValue) where T : IComparable<T> {
        if (x.CompareTo(newValue) > 0) x = newValue;
    }

    static public void Solve(TextReader cin, TextWriter cout) {
        var scanner = new Scanner(cin);
        int n = scanner.NextInt32();
        int m = scanner.NextInt32();
        var a = scanner.NextIntArray(n);
        var b = scanner.NextIntArray(n);
        int maxDepth = 2 * n + 1;
        var dp = new int[maxDepth, maxDepth];
        for (int i = 0; i < maxDepth; i++) {
            for (int j = 0; j < maxDepth; j++) {
                dp[i, j] = int.MaxValue;
            }
            dp[i, i] = 0;
        }
        for (int i = 0; i < n; i++) {
            var next = new int[maxDepth, maxDepth];
            for (int j = 0; j < maxDepth; j++) {
                for (int k = 0; k < maxDepth; k++) {
                    next[j, k] = int.MaxValue;
                }
            }
            for (int j = 0; j < maxDepth; j++) {
                for (int k = 0; k < maxDepth; k++) {
                    if (dp[j, k] == int.MaxValue) continue;
                    if (k + 1 < maxDepth)
                        UpdateMin(ref next[j, k + 1], dp[j, k] + a[i]);
                    if (k - 1 >= 0)
                        UpdateMin(ref next[j, k - 1], dp[j, k] + b[i]);
                }
            }

            dp = next;
        }

        /*for (int i = 0; i < maxDepth; i++) {
            for (int j = 0; j < maxDepth; j++) {
                Console.Error.Write(" " + dp[i, j]);
            }
            Console.Error.WriteLine();
        }*/

        Matrix M = new Matrix(maxDepth, maxDepth);

        for (int i = 0; i < maxDepth; i++) {
            for (int j = 0; j < maxDepth; j++) {
                M[i, j] = dp[i, j];
            }
        }

        Matrix A = M.Clone();

        A = Matrix.Pow(A, m);

        cout.WriteLine(A[0, 0]);
    }

    // PREWRITEN CODE BEGINS FROM HERE

    public static void Main(string[] args) {
#if ONLINE_JUDGE
        Solve(Console.In, Console.Out);
#else
        SampleTest();
#endif

    }

    static void SampleTest() {

        var Inputs = @"
2 6
1 2
2 1
------------
1 10000000
2
3
".Split(new[] { "------------" }, StringSplitOptions.None).Select(s => s.Trim()).ToArray();

        var Outputs = @"
12
------------
25000000
".Split(new[] { "------------" }, StringSplitOptions.None).Select(s => s.Trim()).ToArray();

        int caseNo = 1;
        int all = 0, passed = 0;
        foreach (var sample in Inputs.Zip(Outputs, (Input, Output) => new { Input, Output })) {
            var stopWatch = new System.Diagnostics.Stopwatch();
            var writer = new StringWriter();
            stopWatch.Start();
            Solve(new StringReader(sample.Input), writer);
            stopWatch.Stop();
            string time = "";
            if (stopWatch.ElapsedMilliseconds >= 10) {
                time = String.Format("({0} ms)", stopWatch.ElapsedMilliseconds);
            }
            var result = writer.ToString().Trim();
            all++;
            if (result == sample.Output) {
                Console.WriteLine("Sample {0} .... Passed {1}", caseNo++, time);
                passed++;
            } else {
                Console.WriteLine("Sample {0} .... Failed", caseNo++, time);
                Console.WriteLine("Input : ");
                Console.WriteLine("{0}", sample.Input);
                Console.WriteLine("Expected : ");
                Console.WriteLine("{0}", sample.Output);
                Console.WriteLine("Received : ");
                Console.WriteLine("{0}", result);
            }
        }

        Console.WriteLine(" {0} / {1} Passed !!", passed, all);

        Solve(Console.In, Console.Out);
    }

}

public class Scanner {
    private TextReader Reader;
    private Queue<String> TokenQueue = new Queue<string>();
    private CultureInfo ci = new CultureInfo("en-US");

    public Scanner()
        : this(Console.In) {
    }

    public Scanner(TextReader reader) {
        this.Reader = reader;
    }

    public char NextChar() { return Next().Single(); }
    public int NextInt32() { return Int32.Parse(Next(), ci); }
    public long NextInt64() { return Int64.Parse(Next(), ci); }
    public double NextDouble() { return double.Parse(Next(), ci); }
    public string[] NextArray(int size) {
        var array = new string[size];
        for (int i = 0; i < size; i++) array[i] = Next();
        return array;
    }
    public int[] NextIntArray(int size) {
        var array = new int[size];
        for (int i = 0; i < size; i++) array[i] = NextInt32();
        return array;
    }

    public long[] NextInt64Array(int size) {
        var array = new long[size];
        for (int i = 0; i < size; i++) array[i] = NextInt64();
        return array;
    }

    public String Next() {
        if (!TokenQueue.Any()) {
            if (!StockTokens()) throw new InvalidOperationException();
        }
        return TokenQueue.Dequeue();
    }

    public bool HasNext() {
        if (TokenQueue.Count > 0)
            return true;
        return StockTokens();
    }

    private bool StockTokens() {
        while (true) {
            var line = Reader.ReadLine();
            if (line == null) return false;
            var tokens = line.Trim().Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToArray();
            if (tokens.Length == 0) continue;
            foreach (var token in tokens)
                TokenQueue.Enqueue(token);
            return true;
        }
    }
}


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

namespace ConsoleApplication3
{
    class Program
    {
        // FEDCBA9876543210
        // 0010211201010001
        // 543210

        static void Main(string[] args)
        {
            var codes = new[]
            {
                new[,] // 0
                {
                    { 0,1},
                    { 1,1}
                },
                new[,] // 1
                {
                    { 1,0},
                    { 0,0}
                },
                new[,] // 2
                {
                    { 1,0},
                    { 1,0}
                },
                new[,] // 3
                {
                    { 1,1},
                    { 0,0}
                },
                new[,] // 4
                {
                    { 1,1},
                    { 0,1}
                },
                new[,] // 5
                {
                    { 1,0},
                    { 0,1}
                },
                new[,] // 6
                {
                    { 1,1},
                    { 1,0}
                },
                new[,] // 7
                {
                    { 1,1},
                    { 1,1}

                },
                new[,] // 8
                {
                    { 1,0},
                    { 1,1}
                },
                new[,] // 9
                {
                    { 0,1},
                    { 1,0}
                }
            };
            var lists = new List<List<int>> { new List<int>(), new List<int>() };
            foreach (var c in Console.ReadLine())
            {
                var v = (int)char.GetNumericValue(c);
                lists.First().Add(codes[v][0, 0]);
                lists.First().Add(codes[v][0, 1]);
                lists.Last().Add(codes[v][1, 0]);
                lists.Last().Add(codes[v][1, 1]);
            }

            Console.WriteLine(lists.All(_ => _.SequenceEqual(_.ToArray().Reverse())) ? "Yes" : "No");

            //var regex = new Regex("(\\+|-)", RegexOptions.Compiled);
            //var str = regex.Split(Console.ReadLine());
            //var result = int.Parse(str.First());
            //var op = 0;
            //foreach (var s in str.Skip(1))
            //{
            //    if (s == "-") op = 0;
            //    else if (s == "+") op = 1;
            //    else result = op == 0 ? result - int.Parse(s) : result + int.Parse(s);
            //}
            //foreach (var digit in result.ToString())
            //{
            //    for (int i = 0; i < (byte)digit; i++) Console.Write('+');
            //    Console.WriteLine(".>");
            //}
            //var array = Console.ReadLine().Split(' ').Select(byte.Parse).Skip(1).OrderBy(_ => _);
            //for (int i = 0; i < 1000; i++)
            //{
            //    Enumerable.Range(0, 1000).Select(_ => Guid.NewGuid().ToString()).OrderByDescending(_ => _).ToList();
            //}

            //Console.WriteLine(string.Join(" ", array));

            //Console.ReadLine();
            //var a = new List<bool>();
            ////var a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            //var n = 4;
            //while (n-- > 0) a.Add(Console.ReadLine() == "1");

            //var a1 = a[0] ^ a[1];
            //var a2 = a[2] | a[3];
            //var a3 = a[1] & a[2];
            //var a4 = a[0] ^ a[3];

            //var b1 = a1 & a2;
            //var b2 = a3 | a4;

            //Console.WriteLine(b1 ^ b2 ? '1' : '0');

            //Console.WriteLine(query.Max() ^ query.Last());

            //var n = int.Parse(Console.ReadLine());
            //var result = 0;
            //var array = new[]
            //{
            //    0, 4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517,
            //    526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852,
            //    861, 895, 913, 915, 922, 958, 985, 1086, 1111, 1165
            //};
            //result = array[n];

            //Console.WriteLine(result);

            //if (n == 0)
            //{
            //    Console.WriteLine("1");
            //    return;
            //}
            //var r = 0;

            //while (n > 0)
            //{
            //    switch (n % 16)
            //    {
            //        case 0:
            //        case 4:
            //        case 6:
            //        case 9:
            //        case 10:
            //        case 13:
            //            r++;
            //            break;
            //        case 8:
            //        case 11:
            //            r += 2;
            //            break;
            //    }

            //    n /= 16;
            //}
            //Console.WriteLine(r);
        }
    }
}


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

namespace The_Intriguing_Obsession
{
    internal class Program
    {
        private const int mod = 998244353;
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);
        private static readonly long[,] ab = new long[5001,5001];

        private static void Main(string[] args)
        {
            writer.WriteLine(Solve(args));
            writer.Flush();
        }

        private static long Solve(string[] args)
        {
            int a = Next();
            int b = Next();
            int c = Next();

            long ans = (CG(a, b)*CG(a, c))%mod;
            ans = (ans*CG(b, c))%mod;

            return ans;
        }

        private static long CG(int a, int b)
        {
            if (a > b)
            {
                int c = a;
                a = b;
                b = c;
            }

            if (a == 1)
                return b + 1;

            if (ab[a, b] != 0)
                return ab[a, b];

            return ab[a, b] = (CG(a - 1, b) + b*CG(a - 1, b - 1))%mod;
        }

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


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

class Solver
{
    public Scanner sc;
    public void Solve()
    {
        int N, K;
        sc.Make(out N, out K);
        var dp = Create(N + 1, () => new ModInt[N + 1]);
        var newdp = Create(N + 1, () => new ModInt[N + 1]);
        dp[1][1] = 2;
        for (int i = 1; i < N; i++)
        {
            for (int j = 1; j < N+1; j++)
            {
                for (int k = 1; k < j+1; k++)
                {
                    newdp[j][k] = dp[j][k - 1];
                    if (j == k) newdp[j][k] += dp[j - 1][k - 1];
                    newdp[j][1] += dp[j][k];
                }
            }
            swap(ref dp, ref newdp);
        }
        var ct = new ModInt[N + 1];
        for (int i = 0; i <= N; i++)
            for (int j = 0; j <= i; j++)
                ct[i] += dp[i][j];
        ModInt res = 0;
        for(int i = 1; i <= Min(K-1,N); i++)
        {
            var seg = new DualSegmentTree<ModInt>(N, 0, (a, b) => a + b);
            seg.Update(0, Min(N, (K - 1) / i), 1);
            for (int j = 0; j < N - 1; j++)
                seg.Update(j + 1, Min(j + 1 + (K - 1) / i,N), seg.Query(j));
            res += seg.Query(N - 1)*ct[i];
        }
        Console.WriteLine(res);
    }
}

public struct ModInt
{
    //public const long MOD = (int)1e9 + 7;
    public const long MOD = 998244353;
    public long Value { get; set; }
    public ModInt(long n = 0) { Value = n; }
    private static ModInt[] fac, inv, facinv;
    public override string ToString() => Value.ToString();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator +(ModInt l, ModInt r)
    {
        l.Value += r.Value;
        if (l.Value >= MOD) l.Value -= MOD;
        return l;
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator -(ModInt l, ModInt r)
    {
        l.Value -= r.Value;
        if (l.Value < 0) l.Value += MOD;
        return l;
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator *(ModInt l, ModInt r) => new ModInt(l.Value * r.Value % MOD);
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator /(ModInt l, ModInt r) => l * Pow(r, MOD - 2);
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static implicit operator long(ModInt l) => l.Value;
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static implicit operator ModInt(long n)
    {
        n %= MOD; if (n < 0) n += MOD;
        return new ModInt(n);
    }

    public static ModInt Pow(ModInt m, long n)
    {
        if (n == 0) return 1;
        if (n % 2 == 0) return Pow(m * m, n >> 1);
        else return Pow(m * m, n >> 1) * m;
    }

    public static void Build(int n)
    {
        fac = new ModInt[n + 1];
        facinv = new ModInt[n + 1];
        inv = new ModInt[n + 1];
        inv[1] = fac[0] = fac[1] = facinv[0] = facinv[1] = 1;
        for (var i = 2; i <= n; i++)
        {
            fac[i] = fac[i - 1] * i;
            inv[i] = MOD - inv[MOD % i] * (MOD / i);
            facinv[i] = facinv[i - 1] * inv[i];
        }
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt Fac(int n) => fac[n];
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt Inv(int n) => inv[n];
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt FacInv(int n) => facinv[n];
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt Comb(int n, int r)
    {
        if (n < r) return 0;
        if (n == r) return 1;
        return fac[n] * facinv[r] * facinv[n - r];
    }
    public static ModInt Perm(int n, int r)
    {
        if (n < r) return 0;
        return fac[n] * facinv[n - r];
    }

}

public class DualSegmentTree<T>
{
    protected readonly T[] data;
    protected readonly int size;
    protected readonly Func<T, T, T> merge;
    protected readonly T idT;

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    protected int Parent(int i)
        => (i - 1) >> 1;
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    protected int Left(int i)
        => (i << 1) + 1;
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    protected int Right(int i)
        => (i + 1) << 1;
    public T this[int i]
    {
        get { return data[i + size - 1]; }
        set { data[i + size - 1] = value; }
    }

    public DualSegmentTree(int N, T idT, Func<T, T, T> merge)
    {
        this.merge = merge;
        this.size = 1;
        this.idT = idT;
        while (size < N)
            size <<= 1;
        data = new T[2 * this.size - 1];
        for (var i = 0; i < 2 * size - 1; i++)
            data[i] = idT;
    }
    public void Update(int left, int right, T value, int k = 0, int l = 0, int r = -1)
    {
        if (r == -1) r = size;
        if (r <= left || right <= l) return;
        if (left <= l && r <= right) data[k] = merge(data[k], value);
        else
        {
            Update(left, right, value, Left(k), l, (l + r) >> 1);
            Update(left, right, value, Right(k), (l + r) >> 1, r);
        }
    }
    public T Query(int i)
    {
        i += size - 1;
        var value = merge(idT, data[i]);
        while (i > 0)
        {
            i = Parent(i);
            value = merge(value, data[i]);
        }
        return value;
    }

    public int Find(int st, Func<T, bool> check)
    {
        var x = idT;
        return Find(st, check, ref x, 0, 0, size);
    }
    private int Find(int st, Func<T, bool> check, ref T x, int k, int l, int r)
    {
        if (l + 1 == r)
        { x = merge(x, data[k]); return check(x) ? k - size + 1 : -1; }
        var m = (l + r) >> 1;
        if (m <= st) return Find(st, check, ref x, Right(k), m, r);
        if (st <= l && !check(merge(x, data[k])))
        { x = merge(x, data[k]); return -1; }
        var xl = Find(st, check, ref x, Left(k), l, m);
        if (xl >= 0) return xl;
        return Find(st, check, ref x, Right(k), m, r);
    }
}
#region Template
public static class Template
{
    static void Main(string[] args)
    {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        var sol = new Solver() { sc = new Scanner() };
        //var th = new Thread(sol.Solve, 1 << 26);th.Start();th.Join();
        sol.Solve();
        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 void Out<T>(this IList<T> A, out T a) => a = A[0];
    public static void Out<T>(this IList<T> A, out T a, out T b) { a = A[0]; b = A[1]; }
    public static void Out<T>(this IList<T> A, out T a, out T b, out T c) { A.Out(out a, out b); c = A[2]; }
    public static void Out<T>(this IList<T> A, out T a, out T b, out T c, out T d) { A.Out(out a, out b, out c); d = A[3]; }
    public static string Concat<T>(this IEnumerable<T> A, string sp) => string.Join(sp, A);
    public static char ToChar(this int s, char begin = '0') => (char)(s + begin);
    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 ArgMax<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); }
}

#endregion


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

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public void Solve()
    {
        int n = ReadInt();
        int[] arr = ReadToken().Split(new[] { 'W' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Length).ToArray();
        Write(arr.Length);
        WriteArray(arr);

    }

    #region Main

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

    #endregion

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


namespace ContestRuns
{
    using System;
    using System.Collections.Generic;
    using System.Collections.Specialized;
    using System.IO;
    using System.Linq;
    using System.Globalization;
    using System.Threading;
    using System.Text;

    class Program
    {

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

        static long dist(long difX, long difY)
        {
            difX = Math.Abs(difX);
            difY = Math.Abs(difY);
            //int shared = Math.Min(difX, difY);
            //int other = Math.Max(difX, difY) - shared;
            return Math.Max(difX, difY);
        }

        private static void SolveA()
        {
            long n = long.Parse(input.ReadLine());
            long[] nm = input.ReadLine().Split(' ').Select(long.Parse).ToArray();
            long x = nm[0], y = nm[1];

            long d1 = dist(x - 1, y - 1);
            long d2 = dist(x - n, y - n);

            if(d1 <= d2)
            {
                output.WriteLine("White");
                return;
            }

            output.WriteLine("Black");
        }

        static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
            SolveA();
            output.Flush();
        }
    }
}


#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

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

namespace _245b
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
			Console.SetIn(getInput());
#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
                solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }
        }

        static void solution()
        {
            #region SOLUTION
            var d = readIntArray();
            var n = d[0];
            var k = d[1];
            var x = d[2];
            var c = readIntArray();
            var res = 0;
            for (int i = 0; i < n + 1; i++)
            {
                var li = -1;
                var ri = -1;
                var left = 0;
                var right = 0;
                var gl = true;
                var gr = true;
                var lc = -1;
                var rc = -1;

                if (i == 0 && c[i] == x)
                {
                    gl = false;
                    gr = true;
                    right = 1;
                    left = 0;
                    li = -1;
                    lc = -1;
                    rc = x;
                    ri = i;
                }
                else if (i == n && c[n - 1] == x)
                {
                    gl = true;
                    gr = false;
                    right = 0;
                    left = 1;
                    li = n - 1;
                    lc = x;
                    rc = -1;
                    ri = n;
                }
                else if (i > 0 && c[i - 1] == x)
                {
                    right = 0;
                    left = 1;
                    li = i - 1;
                    lc = x;
                    rc = c[i];
                    ri = i;
                    gr = true;
                    gl = true;
                }
                else
                {
                    continue;
                }

                var ls = 0;
                while (true)
                {
                    if (!gl && !gr)
                    {
                        break;
                    }

                    if (gl)
                    {
                        for (; li >= 0; li--)
                        {
                            var next = c[li];
                            if (next != lc)
                            {
                                break;
                            }

                            left++;
                        }
                    }

                    if (gr)
                    {
                        for (; ri < n; ri++)
                        {
                            var next = c[ri];
                            if (next != rc)
                            {
                                break;
                            }

                            right++;
                        }
                    }

                    if (lc == rc)
                    {
                        var sum = right + left;
                        if (sum >= 3)
                        {
                            ls += sum;
                            left = 0;
                            right = 0;
                            if (li >= 0)
                            {
                                lc = c[li];
                                gl = true;
                            }
                            else
                            {
                                gl = false;
                                lc = -1;
                            }

                            if (ri <= n - 1)
                            {
                                rc = c[ri];
                                gr = true;
                            }
                            else
                            {
                                gr = false;
                                rc = -1;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                    else
                    {
                        if (left >= 3)
                        {
                            ls += left;
                            if (li >= 0)
                            {
                                lc = c[li];
                                gl = true;
                            }
                            else
                            {
                                gl = false;
                                lc = -1;
                            }

                            left = 0;
                        }
                        else
                        {
                            gl = false;
                        }

                        if (right >= 3)
                        {
                            ls += right;
                            if (ri <= n - 1)
                            {
                                rc = c[ri];
                                gr = true;
                            }
                            else
                            {
                                gr = false;
                                rc = -1;
                            }

                            right = 0;
                        }
                        else
                        {
                            gr = false;
                        }
                    }
                }

                if (ls > res)
                {
                    res = ls;
                }
            }

            Console.WriteLine(Math.Max(res - 1, 0));

            //var n = readInt();
            //var m = readInt();

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

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

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

        static int[] readIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] readLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
		static StreamReader getInput()
		{
			var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
			var resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);

			return new StreamReader(resource);
		}
#endif
    }
}


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

class Solver
{
	class Node
	{
		public char[,] board = new char[8, 8];

		public Node()
		{
		}

		public int mx;
		public int my;
		public int s;

		public Node Move(int x, int y)
		{
			if (x < 0 || x >= 8 || y < 0 || y >= 8)
				return null;	//	盤外

			if (board[x, y] == 'S')
				return null;	//	Sあり

			var next = new Node();
			next.board = new char[8,8];
			for (int xx = 0; xx < 8; xx++)
			{
				for (int yy = 6; yy >= 0; yy--)
				{
					if (this.board[xx, yy] == 'S')
					{
						//	落下

						if (xx == x && yy + 1 == y)
							return null;	//	接触

						next.board[xx, yy + 1] = 'S';
						next.s++;
					}
				}
			}
			next.mx = x;
			next.my = y;

			return next;
		}
	}

	public void Solve()
	{
		var list = new List<Node>();
		var s = new Node();
		for (int y = 0; y < 8; y++)
		{
			var ss = CF.ReadLine();
			for (int x = 0; x < 8; x++)
			{
				s.board[x, y] = ss[x];
				if (ss[x] == 'S')
					s.s++;
			}
		}
		s.my = 7;
		s.mx = 0;
		list.Add(s);

		for (; ; )
		{
			if (list.Count == 0)
			{
				CF.WriteLine("LOSE");
				return;
			}

			var list2 = new List<Node>();

			foreach(var n in list)
			{
				for (int dx = -1; dx <= 1; dx++)
				{
					for (int dy = -1; dy <= 1; dy++)
					{
						var next = n.Move(n.mx + dx, n.my + dy);
						if (next == null)
							continue;	//	移動不可

						if (
							next.s == 0 ||
							(next.mx==7&&next.my==0))
						{
							CF.WriteLine("WIN");
							return;
						}

						list2.Add(next);
					}
				}
			}

			list = list2;
		}
    }

	//  test
	static Utils CF = new Utils(new[]{
@"
.......A
........
........
........
........
........
........
M.......
",
 @"
.......A
........
........
........
........
........
SS......
M.......
",
 @"
.......A
........
........
........
........
.S......
S.......
MS......
"

    });
    #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.Text;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
class Problem
{
    static void Main()
    {
        //--------------------------------input--------------------------------//

        var str = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );
        int n = str[0], h = str[1], m = str[2];
        var l = new int[m];
        var r = new int[m];
        var x = new int[m];
        for(int i = 0 ; i < m ; i++)
        {
            str = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );
            l[i] = str[0];
            r[i] = str[1];
            x[i] = str[2];
        }

        //--------------------------------solve--------------------------------//

        var houses = new int[n];
        for(int i = 0 ; i < n ; i++)
            houses[i] = h;
        for(int i = 0 ; i < m ; i++)
            for(int j = l[i]-1 ; j <= r[i]-1 ; j++)
                houses[j] = Math.Min(x[i],houses[j]);
        var kq = houses.Select( t => t * t ).ToList();
        Console.WriteLine( kq.Sum() );
    }
}


using System;

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

            int result;
            Int32.TryParse(_numberToCheck, out result);

            bool isWork = true;
            do
            {
                string localResult = result.ToString();
                char[] symbols = localResult.ToCharArray();

                int sum = 0;
                foreach(var ch in symbols)
                {
                    sum += Int32.Parse(ch.ToString());
                }

                if(sum % 4 == 0)
                {
                    isWork = false;
                    Console.WriteLine(result);
                }
                else
                {
                    result++;
                }
            }
            while (isWork);
        }
    }
}