using System;
using System.Linq;

namespace Test
{
    static class Program
    {
        static void Main(string[] args)
        {
            string temp = Console.ReadLine();
            long[] temps = temp.Split(new[] { " " }, StringSplitOptions.None).Select(long.Parse).ToArray();
            string s1 = Convert.ToString(temps[0], 2);
            string s2 = Convert.ToString(temps[1], 2);
            s1 = FindNext(s1);
            s2 = FindPrev(s2);
            Console.WriteLine(Count(s1, s2));
        }

        static int Count(string s1, string s2)
        {
            long l1 = Convert.ToInt64(s1, 2);
            long l2 = Convert.ToInt64(s2, 2);
            if (l1 > l2) return 0;
            if (l1 == l2) return 1;

            int total = 0;
            int iS = s1.Length;
            int iE = s2.Length;
            int i1 = s1.IndexOf("0");
            int i2 = s2.IndexOf("0");
            if (iS == iE) return i2 - i1 + 1;
            total += iS - i1;
            total += i2;
            for (int i = iS + 1; i < iE; i++) total += i - 1;
            return total;
        }

        static string FindNext(string s)
        {
            string t;
            int index = s.IndexOf("0");
            if (index != -1)
            {
                int iindex = s.IndexOf("0", index + 1);
                if (iindex == -1) return s;
                t = s.Remove(index + 1);
                for (int i = index + 1; i < s.Length; i++) t += "1";
                return t;
            }
            t = "10";
            for (int i = 1; i < s.Length; i++) t += "1";
            return t;
        }

        static string FindPrev(string s)
        {
            if (s.Equals("10")) return "1";
            string t = null;
            int index = s.IndexOf("0");
            if (index != -1)
            {
                int iindex = s.IndexOf("0", index + 1);
                if (iindex == -1) return s;
                for (int i = 0; i < index - 1; i++) t += "1";
                t += "0";
                for (int i = index; i < s.Length; i++) t += "1";
                return t;
            }
            t = s.Remove(s.Length - 1) + "0";
            return t;
        }
    }
}


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

namespace probleme {
    class Program {
        static void Main(string[] args) {
            //Console.SetIn(new StreamReader("file.txt"));
            string[] s = Console.ReadLine().Split(' ');
            long a = long.Parse(s[0]), b = long.Parse(s[1]);
            long ans = 0;
            for (long i = a; i <= b; i++) {
                int nz = 0;
                long aux = i;
                while (aux > 0) {
                    if (aux % 2 == 0) {
                        nz++;
                    }
                    aux >>= 1;
                }
                if (nz == 1) {
                    ans++;
                }
            }
            Console.Write(ans);
            //Console.ReadKey();
        }
    }
}


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

namespace probleme {
    class Program {
        static void Main(string[] args) {
            //Console.SetIn(new StreamReader("file.txt"));
            string[] s = Console.ReadLine().Split(' ');
            long a = long.Parse(s[0]), b = long.Parse(s[1]);
            long n = 1;
            int p1 = 0;
            int ans = 0;
            while (p1 <= 60) {
                n <<= 1;
                p1++;
                for (int p2 = 0; p2 < p1 - 1; p2++) {
                    long nr = n - 1 - (1 << p2);
                    if (nr >= a && nr <= b) {
                        //Console.WriteLine("{0} {1} {2}",nr,n,p2);
                        ans++;
                    }
                }
            }
            Console.Write(ans);
            //Console.ReadKey();
        }
    }
}


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

namespace probleme {
    class Program {
        static void Main(string[] args) {
            //Console.SetIn(new StreamReader("file.txt"));
            string[] s = Console.ReadLine().Split(' ');
            long a = long.Parse(s[0]), b = long.Parse(s[1]);
            int p1 = 0;
            int ans = 0;
            long[] pow = new long[61];
            pow[0] = 1;
            for (int i = 1; i <= 60; i++) {
                pow[i] = 2 * pow[i - 1];
            }
            while (p1 <= 60) {
                p1++;
                for (int p2 = 0; p2 < p1 - 1; p2++) {
                    long nr = pow[p1] - 1 - pow[p2];
                    if (nr >= a && nr <= b) {
                        //Console.WriteLine("{0} {1} {2}",nr,n,p2);
                        ans++;
                    }
                }
            }
            Console.Write(ans);
            //Console.ReadKey();
        }
    }
}


using System;

namespace _2015B {
    class Program {
        static void Main(string[] args) {
            string[] input = Console.ReadLine().Split(' ');
            ulong first = ulong.Parse(input[0]);
            ulong last = ulong.Parse(input[1]);
            ulong count = 0;

            for (; first <= last; first++) {
                if (ToBin(first)) {
                    count++;
                }
            }
            Console.WriteLine(count);
        }

        static bool ToBin(ulong input) {
            int remainder;
            int count = 0;

            while (input > 0) {
                remainder = (int)input % 2;
                if (remainder == 0) {
                    count++;
                }
                if (count == 2) {
                    break;
                }
                input /= 2;

            }
            if (count == 1)
                return true;
            else
                return false;
        }

    }
}


using System;
using System.Text;

namespace _2015B {
    class Program {
        static void Main(string[] args) {
            string[] input = Console.ReadLine().Split(' ');
            ulong first = ulong.Parse(input[0]);
            ulong last = ulong.Parse(input[1]);
            int res = 0;
            ulong tmp;
            string fS = DecimalToBinary(first);
            string lS = DecimalToBinary(last);

            for (int i = fS.Length; i <= lS.Length; i++)
                for (int j = 0; j < i; j++) {
                    tmp = BuildTest(i, j);
                    if (tmp <= last) {
                        if (tmp >= first)
                            res++;
                    } else
                        break;
                }

            Console.WriteLine(res);
        }

        static string DecimalToBinary(ulong data) {
            StringBuilder result = new StringBuilder();
            int rem = 0;
            while (data > 0) {
                rem = (int)(data % 2);
                data = data >> 1;
                result.Append(rem);
            }
            return ReverseString(result.ToString());
        }

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

        static ulong BuildTest(int length, int index) {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < length - 1; i++) {
                sb.Append('1');
            }
            sb.Insert(length - index - 1, '0');
            return (BinToDec(sb.ToString()));
        }

        static ulong BinToDec(string value) {
            ulong res = 0;
            foreach (char c in value) {
                res <<= 1;
                res += (ulong)(c == '1' ? 1 : 0);
            }
            return res;
        }
    }
}


using System;
using System.Linq;

namespace _611B
{
    class Program
    {
        static void Main()
        {
            var s = Console.ReadLine().Split().Select(long.Parse).ToArray();
            var a = s[0] - 1; var b = s[1];
            Console.WriteLine(Calc(b)-Calc(a));
        }
        static long Calc(long num)
        {
            int n = Convert.ToString(num, 2).Length;
            long max = n * (n - 1) / 2;
            for (int k=0; k<n;k++)
            {
                if (Math.Pow(2, n) - 1 - Math.Pow(2, k) > num) max--;
                else break;
            }
            return max;
        }
    }
}


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

namespace cf_82_div2
{

    class Program
    {
        private static HashSet<int> delims =
            new HashSet<int> { (int)' ', (int)'\t', (int)'\n', (int)'\r' };
        private static StringBuilder token = new StringBuilder();

        private static void Skip()
        {
            while (delims.Contains(Console.In.Peek()))
                Console.Read();
        }

        public static bool EndOfStream()
        {
            Skip();
            return Console.In.Peek() == -1;
        }

        public static string Read()
        {
            Skip();
            int c = Console.Read();
            while (c != -1 && !delims.Contains(c))
            {
                token.Append((char)c);
                c = Console.Read();
            }
            string ret = token.ToString();
            token.Length = 0;
            return ret;
        }

        public static int ReadInt()
        {
            return int.Parse(Read());
        }

        public static double ReadDouble()
        {
            return double.Parse(Read());
        }

        public static bool solve()
        {
            int[][] dp;
            int[] cnt, cost, weight;
            int n, W, a, b, c;
            W = ReadInt();
            n = ReadInt();
            n++;

            cnt = new int[n];
            cost = new int[n];
            weight = new int[n];
            dp = new int[2][];
            for (int i = 0; i < 2; i++)
                dp[i] = new int[W + 1];

            c = ReadInt();
            weight[0] = c;
            cost[0] = ReadInt();
            cnt[0] = W / c;
            for (int i = 1; i < n; i++)
            {
                a = ReadInt();
                b = ReadInt();
                c = ReadInt();
                cost[i] = ReadInt();
                cnt[i] = System.Math.Min(a / b, W / c);
                weight[i] = c;
            }

            for (int i = 0; i < n; i++)
            {
                for (int it = 0; it < cnt[i]; it++)
                {
                    System.Array.Clear(dp[1], 0, dp[1].Length);
                    for (int w = 0; w + weight[i] <= W; w++)
                    {
                        dp[1][w + weight[i]] = System.Math.Max(dp[1][w + weight[i]], dp[0][w] + cost[i]);
                    }
                    System.Array.Copy(dp[1], dp[0], dp[1].Length);
                }
            }

            int ans = 0;
            for (int i = 0; i <= W; i++)
                ans = System.Math.Max(ans, dp[0][i]);
            Console.WriteLine(ans);
            return false;
        }

        static void Main(string[] args)
        {
            //StreamReader reader = new StreamReader("input.txt");
            //StreamWriter writer = new StreamWriter("output.txt");
            //Console.SetIn(reader);
            //Console.SetOut(writer);
            while (solve() == true);
        }
    }
}


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

namespace cf_82_div2
{

    class Program
    {
        private static HashSet<int> delims =
            new HashSet<int> { (int)' ', (int)'\t', (int)'\n', (int)'\r' };
        private static StringBuilder token = new StringBuilder();

        private static void Skip()
        {
            while (delims.Contains(Console.In.Peek()))
                Console.Read();
        }

        public static bool EndOfStream()
        {
            Skip();
            return Console.In.Peek() == -1;
        }

        public static string Read()
        {
            Skip();
            int c = Console.Read();
            while (c != -1 && !delims.Contains(c))
            {
                token.Append((char)c);
                c = Console.Read();
            }
            string ret = token.ToString();
            token.Length = 0;
            return ret;
        }

        public static int ReadInt()
        {
            return int.Parse(Read());
        }

        public static double ReadDouble()
        {
            return double.Parse(Read());
        }

        public static bool solve()
        {
            int[][] dp;
            int[] cnt, cost, weight;
            int n, W, a, b, c;
            W = ReadInt();
            n = ReadInt();
            n++;

            cnt = new int[n];
            cost = new int[n];
            weight = new int[n];
            dp = new int[2][];
            for (int i = 0; i < 2; i++)
                dp[i] = new int[W + 1];

            c = ReadInt();
            weight[0] = c;
            cost[0] = ReadInt();
            cnt[0] = W / c;
            for (int i = 1; i < n; i++)
            {
                a = ReadInt();
                b = ReadInt();
                c = ReadInt();
                cost[i] = ReadInt();
                cnt[i] = System.Math.Min(a / b, W / c);
                weight[i] = c;
            }

            for (int i = 0; i < n; i++)
            {
                for (int it = 0; it < cnt[i]; it++)
                {
                    for (int w = 0; w + weight[i] <= W; w++)
                    {
                        dp[1][w + weight[i]] = System.Math.Max(dp[1][w + weight[i]], dp[0][w] + cost[i]);
                    }
                    System.Array.Copy(dp[1], dp[0], dp[1].Length);
                }
            }

            int ans = 0;
            for (int i = 0; i <= W; i++)
                ans = System.Math.Max(ans, dp[0][i]);
            Console.WriteLine(ans);
            return false;
        }

        static void Main(string[] args)
        {
            StreamReader reader = new StreamReader("input.txt");
            //StreamWriter writer = new StreamWriter("output.txt");
            Console.SetIn(reader);
            //Console.SetOut(writer);
            while (solve() == true);
        }
    }
}


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

namespace Achill
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> cord = Console.ReadLine().Split().Select(item=>int.Parse(item)).ToList();
            List<int> step = Console.ReadLine().Split().Select(item=>int.Parse(item)).ToList();
            Func<double, double> LeftO = y1 => (y1 - cord[1]) / step[1];
            double y = 0.5 * step[1] * ((cord[2] - cord[0])/step[0] + (cord[1]  + cord[3]) / step[1]);
            double x = LeftO(y) * step[0] + cord[0];
            bool res = Math.Truncate(x) == x && Math.Truncate(y) == y;
            if (res)
            {
                res = (Math.Abs(x-cord[0])%step[0] == 0) && (Math.Abs(y - cord[1]) % step[1] == 0);
                res = res && (Math.Abs(x - cord[2]) % step[0] == 0) && (Math.Abs(y - cord[3]) % step[1] == 0);
            }
            Console.WriteLine(res ? "YES" : "NO");
        }
    }
}


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

namespace CodeForces
{
    class A
    {
        static void Main(string[] args)
        {
            string[] token = Console.ReadLine().Split();
            int x1 =int.Parse(token[0]);
            int y1 = int.Parse(token[1]);
            int x2 = int.Parse(token[2]);
            int y2 = int.Parse(token[3]);

            string[] token2 = Console.ReadLine().Split();
            int x = int.Parse(token2[0]);
            int y = int.Parse(token2[1]);

            if((x1-x2)%x==0&&(y1-y2)%y==0&&((x1-x2)/x)%2==((y1-y2)/y)%2)
            {
               Console.WriteLine("YES");
            }else{
               Console.WriteLine("NO");
            }
        }

    }
}


using System;

namespace abbycup1
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			string [] n9 = {"9", "81", "648", "4536", "27216", "136080", "544320", "1632960", "326592", "326592"};
			string [] n10 = {"10", "90", "720", "5040", "30240", "151200", "604800", "1814400", "3628800", "3628800"};
			char [] letters = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'};
			bool nine = false;
			bool voprfirst=false;
			int count = 0;
			int voprcount=0;

			char [] input = Console.ReadLine().ToCharArray();

			if ( Array.BinarySearch(letters, input[0]) >= 0 || input[0] == '?') {
				nine = true;
			}

			if ( input[0] == '?') {
				voprfirst = true;
			}

			Array.Sort(input);

			for (int i=0; i<=9; i++) {
				if (Array.BinarySearch(input, letters[i])>=0) {
					count++;
				}
			}

			int vopr = Array.BinarySearch(input, '?');
			if (vopr>=0) {
				for (int i=0; i<input.GetLength(0); i++) {
					if (input[i]=='?') {
						voprcount++;
					}
				}
			}

			if (voprfirst) {
				voprcount--;
			}

			if (count>0 && !voprfirst) {
				if (nine) {
					Console.Write(n9[count-1]);
				} else {
					Console.Write(n10[count-1]);
				}
			}

			if (voprfirst && count==0) {
				Console.Write("9");
			}

			if (count==0 && !voprfirst) {
				Console.Write("1");
			}

			for (int i=1; i<=voprcount; i++) {
				Console.Write("0");
			}
			Console.WriteLine("");

		}
	}
}


using System;

namespace EightPointSets
{
    public struct Point
    {
        public int x;
        public int y;
    }

    class EightPointSets
    {
        static void Main(string[] args)
        {
            string[] input;
            Point[] points = new Point[8];

            for (int i = 0; i < 8; i++)
            {
                input = Console.ReadLine().Split();
                points[i].x = int.Parse(input[0]);
                points[i].y = int.Parse(input[1]);
            }

            Point centre;
            bool respectable = false;

            while (true)
            {
                centre = GetCentrePoint(points[0], points[2]);

                if (!Equals(centre, points[1]))
                    break;

                centre = GetCentrePoint(points[0], points[5]);

                if (!Equals(centre, points[3]))
                    break;

                centre = GetCentrePoint(points[2], points[7]);

                if (!Equals(centre, points[4]))
                    break;

                centre = GetCentrePoint(points[5], points[7]);

                if (!Equals(centre, points[6]))
                    break;

                Point mainCentre1 = GetCentrePoint(points[1], points[6]);
                Point mainCentre2 = GetCentrePoint(points[3], points[4]);

                if (!Equals(mainCentre1, mainCentre2))
                    break;

                respectable = true;
                break;
            }

            if (!respectable)
                Console.WriteLine("ugly");
            else
                Console.WriteLine("respectable");
        }

        private static Point GetCentrePoint(Point p1, Point p2)
        {
            Point centre = new Point();

            centre.x = ((p1.x) + (p2.x)) / 2;
            centre.y = ((p1.y) + (p2.y)) / 2;

            return centre;
        }

        private static bool Equals(Point p1, Point p2)
        {
            if (p1.x != p2.x || p1.y != p2.y)
                return false;
            else
                return true;
        }
    }
}


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

namespace ConsoleApplication1 {
    class Program {
        static void Main( string[] args ) {
            List<int[]> points = new List<int[]>();
            for ( int i = 0; i < 8; i++ ) {
                points.Add(new int[] { ReadInt(), ReadInt() });
            }

            points = points.OrderBy(( point ) => {
                return point[ 1 ].ToString() + point[ 0 ].ToString();
            }).ToList();

            bool f = points[ 0 ][ 0 ] < points[ 1 ][ 0 ] && points[ 0 ][ 1 ] == points[ 1 ][ 1 ];
            f = f &&
                points[ 1 ][ 0 ] < points[ 2 ][ 0 ] && points[ 0 ][ 1 ] == points[ 2 ][ 1 ];
            f = f &&
                points[ 3 ][ 0 ] == points[ 0 ][ 0 ] && points[ 3 ][ 1 ] > points[ 0 ][ 1 ];
            f = f &&
                points[ 4 ][ 0 ] == points[ 2 ][ 0 ] && points[ 4 ][ 1 ] == points[ 3 ][ 1 ] &&
                points[ 5 ][ 0 ] == points[ 3 ][ 0 ] && points[ 5 ][ 1 ] > points[ 3 ][ 1 ] &&
                points[ 6 ][ 0 ] == points[ 1 ][ 0 ] && points[ 6 ][ 1 ] == points[ 5 ][ 1 ] &&
                points[ 7 ][ 0 ] == points[ 2 ][ 0 ] && points[ 7 ][ 1 ] == points[ 6 ][ 1 ];
            if ( f )
                Console.WriteLine("respectable");
            else
                Console.WriteLine("ugly");
        }

        static int _current = -1;
        static string[] _words = null;
        static int ReadInt() {
            if ( _current == -1 ) {
                _words = Console.ReadLine().Split(new char[] { ' ', '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
                _current = 0;
            }

            int value = int.Parse(_words[ _current ]);
            if ( _current == _words.Length - 1 )
                _current = -1;
            else
                _current++;

            return value;
        }
    }
}


#define ONLINE_JUDGE

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

class Program
{

    static int tests = 1;

#if (ONLINE_JUDGE)
    static TextReader r = Console.In;
    static TextWriter w = Console.Out;
#else
    static string path = @"C:\Y\Prog\Codeforces\194\";
    static string answerFile = "0{0}Answer.txt";
    static string resultFile = "0{0}Result.txt";
    static string sourceFile = "0{0}Source.txt";

    static TextReader r;
    static TextWriter w;
#endif

    static void Main(string[] args)
    {

        //int[] t = { 1, 2, 3, 3 };
        //int[] xDistinct = t.Distinct().ToArray();

        for (int i = 1; i <= tests; i++)
        {
#if (!ONLINE_JUDGE)
            r = new StreamReader(string.Format(path + sourceFile, i));
            w = new StreamWriter(string.Format(path + resultFile, i), false);
#endif
            int[] x = new int[8];
            int[] y = new int[8];
            for (int j = 0; j < 8; j++)
            {
                string[] buff = r.ReadLine().Split(' ');
                x[j] = Convert.ToInt32(buff[0]);
                y[j] = Convert.ToInt32(buff[1]);
            }
            solve(x, y);

#if (!ONLINE_JUDGE)
            w.Flush(); w.Close();
            Console.WriteLine("CASE: {0}", i);
            string answer = File.ReadAllText(string.Format(path + answerFile, i));
            string result = File.ReadAllText(string.Format(path + resultFile, i));
            if (answer != result)
            {
                Console.WriteLine("FAIL:");
                Console.WriteLine("Result" + Environment.NewLine + result);
                Console.WriteLine("Answer" + Environment.NewLine + answer);
            }
            else
                Console.WriteLine("OK");
#endif
        }
    }

    public static void solve(int[] x, int[] y)
    {
        int[] xDistinct = x.Distinct().ToArray();
        int[] yDistinct = y.Distinct().ToArray();
        if (xDistinct.Length != 3 || yDistinct.Length != 3)
        {
            w.WriteLine("ugly");
            return;
        }
        for (int i = 0; i < xDistinct.Length; i++)
            for (int j = 0; j < yDistinct.Length; j++)
            {
                if (i == 1 && j == 1) continue;
                bool find = false;
                for (int k = 0; k < x.Length; k++)
                {
                    if (x[k] == xDistinct[i] && y[k] == yDistinct[j])
                        find = true;
                }
                if (!find)
                {
                    w.WriteLine("ugly");
                    return;
                }
            }
        w.WriteLine("respectable");
    }
}


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

class Program
{
    static void Main()
    {
        int xMin = -1, yMin = 1, xMax = -1, yMax = -1;

        var yd = new Dictionary<int, List<int[]>>();
        var xd = new Dictionary<int, List<int[]>>();

        for (int i = 0; i < 8; i++)
        {
            string str = Console.ReadLine();

            int x = int.Parse(str.Split(new char[] { ' ' })[0]);
            int y = int.Parse(str.Split(new char[] { ' ' })[1]);

            if (xMin == -1 || xMin > x) xMin = x;
            if (xMax == -1 || xMax < x) xMax = x;
            if (yMin == -1 || yMin > y) yMin = y;
            if (yMax == -1 || yMax < y) yMax = y;

            if (!xd.ContainsKey(x)) xd.Add(x, new List<int[]>());
            if (!yd.ContainsKey(y)) yd.Add(y, new List<int[]>());

            xd[x].Add(new int[] { x, y });
            yd[y].Add(new int[] { x, y });
        }

        // 0 0, 1 0
        // 0 1,
        // 0 2, 1 2, 2 2

        if (xd.Count != 3 || yd.Count != 3)
        {
            Console.WriteLine("ugly");
            return;
        }

        if (xd[xMin].Count != 3 || xd[xMax].Count != 3 || yd[yMin].Count != 3 || yd[yMax].Count != 3)
        {
            Console.WriteLine("ugly");
            return;
        }

        Console.WriteLine("respectable");
    }
}


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

class Program
{
    static void Main()
    {
        int xMin = -1, yMin = -1, xMax = -1, yMax = -1;

        var yd = new Dictionary<int, List<int[]>>();
        var xd = new Dictionary<int, List<int[]>>();

        for (int i = 0; i < 8; i++)
        {
            string str = Console.ReadLine();

            int x = int.Parse(str.Split(new char[] { ' ' })[0]);
            int y = int.Parse(str.Split(new char[] { ' ' })[1]);

            if (xMin == -1 || xMin > x) xMin = x;
            if (xMax == -1 || xMax < x) xMax = x;
            if (yMin == -1 || yMin > y) yMin = y;
            if (yMax == -1 || yMax < y) yMax = y;

            if (!xd.ContainsKey(x)) xd.Add(x, new List<int[]>());
            if (!yd.ContainsKey(y)) yd.Add(y, new List<int[]>());

            xd[x].Add(new int[] { x, y });
            yd[y].Add(new int[] { x, y });
        }

        // 0 0, 1 0
        // 0 1,
        // 0 2, 1 2, 2 2

        if (xd.Count != 3 || yd.Count != 3)
        {
            Console.WriteLine("ugly");
            return;
        }

        if (!xd.ContainsKey(xMin) || !xd.ContainsKey(xMax) || xd[xMin].Count != 3 || xd[xMax].Count != 3 ||
            !yd.ContainsKey(yMin) || !yd.ContainsKey(yMax) || yd[yMin].Count != 3 || yd[yMax].Count != 3)
        {
            Console.WriteLine("ugly");
            return;
        }

        Console.WriteLine("respectable");
    }
}


#define Online

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

namespace CF
{
    delegate double F(double x);
    delegate decimal Fdec(decimal x);

    partial class Program
    {

        static void Main(string[] args)
        {

#if FileIO
            StreamReader sr = new StreamReader("input.txt");
            StreamWriter sw = new StreamWriter("output.txt");
            Console.SetIn(sr);
            Console.SetOut(sw);
#endif

            B();

#if Online
            Console.ReadLine();
#endif

#if FileIO
            sr.Close();
            sw.Close();
#endif
        }

        static void A()
        {

        }

        static void B()
        {
            int[,] points = new int[8, 2];
            for (int i = 0; i < 8; i++)
            {
                ReadArray(' ');
                points[i, 0] = NextInt();
                points[i, 1] = NextInt();
            }
            int[] next = new int[3];
            next[0] = next[2] = 3;
            next[1] = 2;
            int[,] a = new int[3, 3];
            for (int i = 0; i < 3; i++)
                for (int j = 0; j < 3; j++)
                    a[i, j] = -1;
            int[] c = new int[3];
            for (int i = 0, k = 0; i <= 1000000 && k < 3; i++)
            {
                for (int j = 0, z = 0; j < 8; j++)
                {
                    if (points[j, 0] == i)
                    {
                        a[k, z++] = points[j, 1];
                        c[k]++;
                    }
                }
                if (c[k] == next[k])
                {
                    k++;
                }
                else
                {
                    if (c[k] == 0)
                    {
                        continue;
                    }
                    else
                    {
                        Console.WriteLine("ugly");
                        return;
                    }
                }
            }

            int[] y = new int[1000001];
            for (int i = 0; i < 3; i++)
                for (int j = 0; j < 3; j++)
                    if (a[i, j] != -1)
                        y[a[i, j]]++;
            int p = 0;
            for (int i = 0; i <= 1000000 && p<3; i++)
            {
                if (y[i]==next[p])
                {
                    p++;
                }
            }
            if (p == 3)
            {
                Console.WriteLine("respectable");
            }
            else
            {
                Console.WriteLine("ugly");
            }
        }

        static void C()
        {
            long n = ReadLong();
            long ans = 0;
            if (n == 1)
                ans = 1;
            if (n == 2)
                ans = 1;
            if (n == 3)
                ans = 1;
            if (n > 3)
                ans = n - 2;
            Console.WriteLine(ans);
        }

        static void D()
        {

        }

        static void E()
        {

        }

        static void TestGen()
        {

        }

    }

    public static class MyMath
    {
        public static long BinPow(long a, long n, long mod)
        {
            long res = 1;
            while (n > 0)
            {
                if ((n & 1) == 1)
                {
                    res = (res * a) % mod;
                }
                a = (a * a) % mod;
                n >>= 1;
            }
            return res;
        }

        public static long GCD(long a, long b)
        {
            while (b != 0) b = a % (a = b);
            return a;
        }

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

        public static long LCM(long a, long b)
        {
            return (a * b) / GCD(a, b);
        }

        public static int LCM(int a, int b)
        {
            return (a * b) / GCD(a, b);
        }
    }

    static class ArrayUtils
    {
        public static int BinarySearch(int[] a, int val)
        {
            int left = 0;
            int right = a.Length - 1;
            int mid;

            while (left < right)
            {
                mid = left + ((right - left) >> 1);
                if (val <= a[mid])
                {
                    right = mid;
                }
                else
                {
                    left = mid + 1;
                }
            }

            if (a[left] == val)
                return left;
            else
                return -1;
        }

        public static double Bisection(F f, double left, double right, double eps)
        {
            double mid;
            while (right - left > eps)
            {
                mid = left + ((right - left) / 2d);
                if (Math.Sign(f(mid)) != Math.Sign(f(left)))
                    right = mid;
                else
                    left = mid;
            }
            return (left + right) / 2d;
        }

        public static decimal TernarySearchDec(Fdec f, decimal eps, decimal l, decimal r, bool isMax)
        {
            decimal m1, m2;
            while (r - l > eps)
            {
                m1 = l + (r - l) / 3m;
                m2 = r - (r - l) / 3m;
                if (f(m1) < f(m2))
                    if (isMax)
                        l = m1;
                    else
                        r = m2;
                else
                    if (isMax)
                        r = m2;
                    else
                        l = m1;
            }
            return r;
        }

        public static double TernarySearch(F f, double eps, double l, double r, bool isMax)
        {
            double m1, m2;
            while (r - l > eps)
            {
                m1 = l + (r - l) / 3d;
                m2 = r - (r - l) / 3d;
                if (f(m1) < f(m2))
                    if (isMax)
                        l = m1;
                    else
                        r = m2;
                else
                    if (isMax)
                        r = m2;
                    else
                        l = m1;
            }
            return r;
        }

        public static void Merge<T>(T[] A, int p, int q, int r, T[] L, T[] R, Comparison<T> comp)
        {
            for (int i = p; i <= q; i++)
                L[i] = A[i];
            for (int i = q + 1; i <= r; i++)
                R[i] = A[i];

            for (int k = p, i = p, j = q + 1; k <= r; k++)
            {
                if (i > q)
                {
                    for (; k <= r; k++, j++)
                        A[k] = R[j];
                    return;
                }
                if (j > r)
                {
                    for (; k <= r; k++, i++)
                        A[k] = L[i];
                    return;
                }
                if (comp(L[i], R[j]) <= 0)
                {
                    A[k] = L[i];
                    i++;
                }
                else
                {
                    A[k] = R[j];
                    j++;
                }
            }
        }

        public static void Merge_Sort<T>(T[] A, int p, int r, T[] L, T[] R, Comparison<T> comp)
        {
            if (p >= r) return;
            int q = p + ((r - p) >> 1);
            Merge_Sort(A, p, q, L, R, comp);
            Merge_Sort(A, q + 1, r, L, R, comp);
            Merge(A, p, q, r, L, R, comp);
        }

        public static void Merge<T>(T[] A, int p, int q, int r, T[] L, T[] R) where T : IComparable<T>
        {
            for (int i = p; i <= q; i++)
                L[i] = A[i];
            for (int i = q + 1; i <= r; i++)
                R[i] = A[i];

            for (int k = p, i = p, j = q + 1; k <= r; k++)
            {
                if (i > q)
                {
                    for (; k <= r; k++, j++)
                        A[k] = R[j];
                    return;
                }
                if (j > r)
                {
                    for (; k <= r; k++, i++)
                        A[k] = L[i];
                    return;
                }
                if (L[i].CompareTo(R[j]) >= 0)
                {
                    A[k] = L[i];
                    i++;
                }
                else
                {
                    A[k] = R[j];
                    j++;
                }
            }
        }

        public static void Merge_Sort<T>(T[] A, int p, int r, T[] L, T[] R) where T : IComparable<T>
        {
            if (p >= r) return;
            int q = p + ((r - p) >> 1);
            Merge_Sort(A, p, q, L, R);
            Merge_Sort(A, q + 1, r, L, R);
            Merge(A, p, q, r, L, R);
        }

        public static void Merge_Sort1<T>(T[] A, int p, int r, T[] L, T[] R) where T : IComparable<T>
        {
            int k = 1;
            while (k < r - p + 1)
            {
                int i = 0;
                while (i < r)
                {
                    int _r = Math.Min(i + 2 * k - 1, r);
                    int q = Math.Min(i + k - 1, r);
                    Merge(A, i, q, _r, L, R);
                    i += 2 * k;
                }
                k <<= 1;
            }
        }

        public static void Merge_Sort1<T>(T[] A, int p, int r, T[] L, T[] R, Comparison<T> comp)
        {
            int k = 1;
            while (k < r - p + 1)
            {
                int i = 0;
                while (i < r)
                {
                    int _r = Math.Min(i + 2 * k - 1, r);
                    int q = Math.Min(i + k - 1, r);
                    Merge(A, i, q, _r, L, R, comp);
                    i += 2 * k;
                }
                k <<= 1;
            }
        }

        static void Shake<T>(T[] a)
        {
            Random rnd = new Random(Environment.TickCount);
            T temp;
            int b, c;
            for (int i = 0; i < a.Length; i++)
            {
                b = rnd.Next(0, a.Length);
                c = rnd.Next(0, a.Length);
                temp = a[b];
                a[b] = a[c];
                a[c] = temp;
            }
        }
    }

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

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

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

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

        static int NextInt()
        {
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            return tokens[cur_token++];
        }

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


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

namespace _334B_Eight_Points_Set
{
    class Point
    {
        public int X;
        public int Y;
    }

    class Program
    {
        static void Main(string[] args)
        {
            Point[] points = new Point[8];
            for (int i = 0; i < 8; i++)
            {
                var input = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
                points[i] = new Point() {X = input[0], Y = input[1]};
            }

            if (points[0].X == points[1].X && points[1].X == points[2].X &&
                points[3].X == points[4].X &&
                points[5].X == points[6].X && points[6].X == points[7].X &&

                points[0].Y == points[3].Y && points[3].Y == points[5].Y &&
                points[1].Y == points[6].Y &&
                points[2].Y == points[4].Y && points[4].Y == points[7].Y)
            {
                Console.WriteLine("respectable");
            }
            else
            {
                Console.WriteLine("ugly");
            }
        }
    }
}


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

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

            int[] ar = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            int[] day = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            int[] night = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);

            int minDay = int.MaxValue;
            for (int i = 0; i < day.Length; i++)
            {
                if(day[i] < minDay) {
                    minDay = day[i];
                }
            }

            int maxDay = int.MinValue;
            for (int i = 0; i < day.Length; i++)
            {
                if (day[i] > maxDay)
                {
                    maxDay = day[i];
                }
            }

            if(ar[2] > maxDay * (ar[2]/minDay) + ar[2]% minDay)
                Console.WriteLine(ar[2]);
            else Console.WriteLine((maxDay * (ar[2] / minDay)) + ar[2] % minDay);
        }

    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[]y=Console.ReadLine().Split(' ');
            int n=int.Parse(y[0]);
            int m=int.Parse(y[1]);
            int r=int.Parse(y[2]);
            string[]y1=Console.ReadLine().Split(' ');
            string[]y2=Console.ReadLine().Split(' ');
            int[]a=new int[n];
            int []b=new int[m];
            for(int i=0;i<n;i++)
            a[i]=int.Parse(y1[i]);
            for(int i=0;i<n;i++)
            b[i]=int.Parse(y2[i]);
            int min=a.Min();
            int max=b.Max();
            if(min<max)
            Console.WriteLine(r/min*max+(r%min));
            else
            Console.WriteLine(r);

        }
    }
}


using System;

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


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

namespace Кассир
{

    class Program
    {

        public static long min(long a, long b)
        {
            if (a < b)
                return a;
            return b;
        }
        public struct student
        {
            public long a;
            public long b;
        }
        public static long degree(long a)
        {
            long degree = 1;
            while (a-- != 0)
            {
                degree *= 2;
            }
            return degree - 1;
        }
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int n = int.Parse(str[0]);
            int m = int.Parse(str[1]);
            int r = int.Parse(str[2]);
            int min = int.MaxValue;
            str = Console.ReadLine().Split(' ');
            for (int i = 0; i < n; i++)
            {
                if (int.Parse(str[i])<min)
                {
                    min = int.Parse(str[i]);
                }

            }
            int max = 0;
            str = Console.ReadLine().Split(' ');
            for (int i = 0; i < n; i++)
            {
                if (int.Parse(str[i]) > min)
                {
                    max = int.Parse(str[i]);
                }

            }
            int difference = max - min;
            if(difference<0)
                Console.WriteLine(r);
            else
            {
                int count = r / min;
                Console.WriteLine(r-(r/min)*min+count* max);
            }
        }
    }

}


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

namespace Кассир
{

    class Program
    {

        public static long min(long a, long b)
        {
            if (a < b)
                return a;
            return b;
        }
        public struct student
        {
            public long a;
            public long b;
        }
        public static long degree(long a)
        {
            long degree = 1;
            while (a-- != 0)
            {
                degree *= 2;
            }
            return degree - 1;
        }
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int n = int.Parse(str[0]);
            int m = int.Parse(str[1]);
            int r = int.Parse(str[2]);
            int min = int.MaxValue;
            str = Console.ReadLine().Split(' ');
            for (int i = 0; i < n; i++)
            {
                if (int.Parse(str[i])<min)
                {
                    min = int.Parse(str[i]);
                }

            }
            int max = 0;
            str = Console.ReadLine().Split(' ');
            for (int i = 0; i < m; i++)
            {
                if (int.Parse(str[i]) > min)
                {
                    max = int.Parse(str[i]);
                }

            }
            int difference = max - min;
            if(difference<0)
                Console.WriteLine(r);
            else
            {
                int count = r / min;
                Console.WriteLine(r-(r/min)*min+count* max);
            }
        }
    }

}


using System;
using System.Text;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
class Problem
{
    static void Main()
    {
        //--------------------------------input--------------------------------//

        var inp = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );
        int n = inp[0], m = inp[1], r = inp[2];
        var s = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );
        var b = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );
        Array.Sort( s );
        Array.Sort( b, (x, y) => y - x );

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

        int min = Math.Min( s.Length, b.Length );
        int max = r;
        int i=0;
        while(min-- > 0)
        {
            int now = (r / s[i] )* b[i];
            r = r % s[i] + now;
            max = Math.Max( r, max );
            i++;
        }
        Console.WriteLine( max);

    }

}


// Problem: 1150A - Stock Arbitraging
// Author: Gusztav Szmolik

using System;

class StockArbitraging
    {
    public 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 != 3)
            return -1;
        byte n;
        if (!Byte.TryParse (words[0], out n))
            return -1;
        if (n < 1 || n > 30)
            return -1;
        byte m;
        if (!Byte.TryParse (words[1], out m))
            return -1;
        if (m < 1 || m > 30)
            return -1;
        ushort r;
        if (!UInt16.TryParse (words[2], out r))
            return -1;
        if (r < 1 || r > 1000)
            return -1;
        line = Console.ReadLine ();
        if (line == null)
            return -1;
        words = line.Split (delims,StringSplitOptions.RemoveEmptyEntries);
        if (words.Length != n)
            return -1;
        ushort sMin = 1000;
        for (byte i = 0; i < n; i++)
            {
            ushort si;
            if (!UInt16.TryParse (words[i], out si))
                return -1;
            if (si < 1 || si > 1000)
                return -1;
            if (si < sMin)
                sMin = si;
            }
        ushort numShare = Convert.ToUInt16 (r/sMin);
        ushort sumBuy = Convert.ToUInt16 (numShare*sMin);
        line = Console.ReadLine ();
        if (line == null)
            return -1;
        words = line.Split (delims,StringSplitOptions.RemoveEmptyEntries);
        if (words.Length != m)
            return -1;
        ushort bMax = 1;
        for (byte i = 0; i < m; i++)
            {
            ushort bi;
            if (!UInt16.TryParse (words[i], out bi))
                return -1;
            if (bi < 1 || bi > 1000)
                return -1;
            if (bi > bMax)
                bMax = bi;
            }
        uint sumSell = Convert.ToUInt16 (numShare*bMax);
        uint ans = (sumSell > sumBuy ? r+sumSell-sumBuy : r);
        Console.WriteLine (ans);
        return 0;
        }
    }


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

        namespace Training_App
        {
            class Program
            {

        static void Main(string[] args)
        {
            String input = Console.ReadLine();
            String[] splits = input.Split(' ');
            ulong A = ulong.Parse(splits[0]);
            ulong B = ulong.Parse(splits[1]);

            ulong factorialA = calculateFactorial(A);
            ulong factorialB = calculateFactorial(B);

            Console.WriteLine(calculateGCD(factorialA, factorialB));

        }

        public static ulong calculateFactorial(ulong n)
        {

            if (n == 1 || n == 2)
                return n;
            else
            {

                return n * calculateFactorial(n-1);
            }

        }

        public static ulong calculateGCD(ulong a , ulong b)
        {
            ulong reminder = 0;
            while(b!=0)
            {
                reminder = a%b;
                a = b;
                b = reminder;
            }

            return a;
        }

    }

            }


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

namespace _822A
{
    class Program
    {
        static int x, y,diff,solution;
        static void Main(string[] args)
        {
            x = Convert.ToInt32(Console.ReadLine());
          //  Console.WriteLine("X="+x);
            y = Convert.ToInt32(Console.ReadLine());
           // Console.WriteLine("Y="+y);

            GCD solver = new GCD();
            diff = solver.makeDifference(x, y);
            solution = solver.factorial(Math.Min(x,y));
            Console.WriteLine(solution);
           // Console.WriteLine(solver.baseGCD(x, y));
        }
    }
}

namespace _822A
{
    class GCD
    {
        public int baseGCD(int x, int y)
        {
            if (y != 0)
                return baseGCD(y, x % y);
            else return x;
        }

        public int factorial(int x)
        {
            if (x < 0) throw new ArgumentOutOfRangeException("numar negativ");
            else if (x == 0) return 1;
            int solution = x;
            int sum = x;
            for (int i = x - 2; i > 1; i -= 2)
            {
                sum += i;
                solution *= sum;
            }
            if ((x & 1) == 1)
                solution *= x / 2 + 1;
            return solution;
        }

        public int makeDifference(int x, int y)
        {
            int diff = 0;
            if (x < y)
            {
                diff = y - x;
            }
            else diff = x - y;
            return diff;

        }
    }
}


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

namespace A.I_m_bored_with_life
{
    class Program
    {
        public static int factorial(int a)
        {
            if (a == 0)
                return 1;
            return ( a * factorial(a - 1));
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int a = int.Parse(s[0]);
            int b = int.Parse(s[1]);
            int faca = factorial(a);
            int facb = factorial(b);

            int min = Math.Min(faca, facb);
            for(int i=min;i>0;i--)
            {
                if ( faca % i == 0 && facb % i ==0)
                {
                    Console.WriteLine(i);
                    break;
                }
            }

        }
    }
}


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

namespace Round422A
{
    class Program
    {
        private static void Main(string[] args)
        {
            using (var sr = new InputReader(Console.In))
            {
                // using (var sr = new InputReader(new StreamReader("input.txt"))) {
                var task = new Task();
                using (var sw = Console.Out)
                {
                    //using (var sw = new StreamWriter("output.txt")){

                    task.Solve(sr, sw);
                    //Console.ReadKey();

                }
            }
        }
    }
    internal class Task
    {
        public void Solve(InputReader sr, TextWriter sw)
        {

            int[] input = sr.ReadArrayOfInt32();
            long a = factorial(input[0]);
            long b = factorial(input[1]);
            long gcd = Math.Min(a, b);
            while (a % gcd!= 0 && b % gcd != 0)
            {
                gcd--;
            }
            sw.WriteLine(gcd);

        }

        public long factorial(int number)
        {
            if (number == 1)
                return 1;
            else
                return number * factorial(number - 1);
        }
    }
    internal class InputReader : IDisposable
    {
        private bool isDispose;
        private readonly TextReader sr;

        public InputReader(TextReader stream)
        {
            sr = stream;
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

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

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

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

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

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

        public int[] ReadArrayOfInt32()
        {
            return ReadArray(Int32.Parse);
        }

        public long[] ReadArrayOfInt64()
        {
            return ReadArray(Int64.Parse);
        }

        public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
        {
            return
                    str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                            .Select(s => func(s, CultureInfo.InvariantCulture))
                            .ToArray();
        }

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

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


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

namespace _100853_Codeforce
{

    class Program
    {

        private const string FILENAME = "distance4";

        private const string INPUT = FILENAME + ".in";

        private const string OUTPUT = FILENAME + ".out";

       private static Stopwatch _stopwatch = new Stopwatch();

        static StreamReader _reader = null;
        static StreamWriter _writer = null;

        static string[] _curLine;
        static int _curTokenIdx;

        static char[] _whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public static string ReadNextToken()
        {
            if (_curTokenIdx >= _curLine.Length)
            {
                //Read next line
                string line = _reader.ReadLine();
                if (line != null)
                    _curLine = line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    _curLine = new string[] { };
                _curTokenIdx = 0;
            }

            if (_curTokenIdx >= _curLine.Length)
                return null;

            return _curLine[_curTokenIdx++];
        }

        public static int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        private static void RunTimer()
        {
#if (DEBUG)

            _stopwatch.Start();

#endif
        }

        private static void Main(string[] args)
        {

            long[] s = Console.ReadLine().Split().Select(long.Parse).ToArray();

            long n = s[0];
            long p = s[1];
            long q = s[2];
            long r = s[3];

            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();

            RunTimer();

            long[] pp = new long[n];
            pp[0] = a[0] * p;

            for (int i = 1; i < n; i++)
            {
                if (a[i] * p > pp[i - 1])
                {
                    pp[i] = a[i] * p;
                }
                else
                {
                    pp[i] = pp[i - 1];
                }
            }

            long[] rr = new long[n];

            rr[n - 1] = a[n - 1] * r;

            for (long i = n - 2; i >= 0; i--)
            {
                if (a[i] * r > rr[i + 1])
                {
                    rr[i] = a[i] * r;
                }
                else
                {
                    rr[i] = rr[i + 1];
                }
            }

            long res = long.MinValue;

            for (int i = 0; i < n; i++)
            {
                long t = pp[i] + a[i] * q + rr[i];
                res = Math.Max(res, t);
            }

            Console.WriteLine(res);

#if (DEBUG)
            _stopwatch.Stop();

            Console.WriteLine($"Time elapsed: {_stopwatch.Elapsed}");

            Console.ReadKey();
#endif

        }

        static int[] CopyOfRange(int[] src, int start, int end)
        {
            int len = end - start;
            int[] dest = new int[len];
            Array.Copy(src, start, dest, 0, len);
            return dest;
        }

        static string StreamReader()
        {

            if (_reader == null)
                _reader = new StreamReader(INPUT);
            string response = _reader.ReadLine();
            if (_reader.EndOfStream)
                _reader.Close();
            return response;

        }

        static void StreamWriter(string text)
        {

            if (_writer == null)
                _writer = new StreamWriter(OUTPUT);
            _writer.WriteLine(text);

        }

        public static int BFS(int start, int end, int[,] arr)
        {
            Queue<KeyValuePair<int, int>> queue = new Queue<KeyValuePair<int, int>>();
            List<bool> visited = new List<bool>();
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                visited.Add(false);
            }

            queue.Enqueue(new KeyValuePair<int, int>(start, 0));
            KeyValuePair<int, int> node;
            int level = 0;
            bool flag = false;

            while (queue.Count != 0)
            {
                node = queue.Dequeue();
                if (node.Key == end)
                {
                    return node.Value;
                }
                flag = false;
                for (int i = 0; i < arr.GetLength(0); i++)
                {

                    if (arr[node.Key, i] == 1)
                    {
                        if (visited[i] == false)
                        {
                            if (!flag)
                            {
                                level = node.Value + 1;
                                flag = true;
                            }
                            queue.Enqueue(new KeyValuePair<int, int>(i, level));
                            visited[i] = true;
                        }
                    }
                }

            }
            return 0;

        }

        private static void Write(string source)
        {
            File.WriteAllText(OUTPUT, source);
        }

        private static string ReadString()
        {
            return File.ReadAllText(INPUT);
        }

        private static void WriteStringArray(string[] source)
        {
            File.WriteAllLines(OUTPUT, source);
        }

        private static string[] ReadStringArray()
        {
            return File.ReadAllLines(INPUT);
        }

        private static int[] GetIntArray()
        {
            return ReadString().Split(' ').Select(int.Parse).ToArray();
        }

        private static double[] GetDoubleArray()
        {
            return ReadString().Split(' ').Select(double.Parse).ToArray();
        }

        private static int[,] ReadINT2XArray(List<string> lines)
        {
            int[,] arr = new int[lines.Count, lines.Count];

            for (int i = 0; i < lines.Count; i++)
            {
                int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

                for (int j = 0; j < lines.Count; j++)
                {
                    arr[i, j] = row[j];
                }
            }

            return arr;
        }

    }

}


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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            long x = Convert.ToInt64(Console.ReadLine());
            string s="";
            for (; x>0 ; )
            {
                if (x % 10 != 0)
                    s += x % 10;
                x /= 10;
            }
            for (int i = 0; i < s.Length/2; i++)
            {
                if (s[i] != s[s.Length - i])
                {
                    Console.WriteLine("NO");
                    return;
                }
            }
            Console.WriteLine("YES");
        }
    }
}


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

namespace HomeWork
{
    class Program
    {
        static void Main(string[] args)
        {
            bool Answer = true;
            string x = Console.ReadLine(), num = "";
            for (int i = 0; i < x.Length; i++)
            {
                if (x[i] != '0')
                    num += x[i];
            }
            for (int i = 0; i < num.Length / 2; i++)
            {
                if (num[i] != num[num.Length - 1 - i])
                    Answer = false;
            }
            if (Answer)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}


using System;
using System.Linq;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var terms = Console.ReadLine().Split(new[] { ' ' }).Select(long.Parse).ToArray();
            var n = terms[0];
            var c1 = terms[1];
            var c2 = terms[2];

            long adults = Console.ReadLine().Count(_ => _ == '1');
            long children = n - adults;
            var min = long.MaxValue;
            for (long count = children; count <= adults; ++count)
            {
                long size = n / count;
                long sum = count * Price(size, c1, c2);
                if (n % count != 0) sum += Price(n % count, c1, c2);
                if (sum < min) min = sum;
            }
            Console.WriteLine(min);
        }

        private static long Price(long x, long c1, long c2)
        {
            return c1 + c2 * (x - 1) * (x - 1);
        }
    }
}


using System;
using System.Linq;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var terms = Console.ReadLine().Split(new[] { ' ' }).Select(long.Parse).ToArray();
            var n = terms[0];
            var c1 = terms[1];
            var c2 = terms[2];

            long adults = Console.ReadLine().Count(_ => _ == '1');
            long children = n - adults;
            var min = long.MaxValue;
            for (long count = children > 0 ? children : 1; count <= adults; ++count)
            {
                long size = n / count;
                long sum = count * Price(size, c1, c2);
                if (n % count != 0) sum += Price(n % count, c1, c2);
                if (sum < min) min = sum;
            }
            Console.WriteLine(min);
        }

        private static long Price(long x, long c1, long c2)
        {
            return c1 + c2 * (x - 1) * (x - 1);
        }
    }
}


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
{
    const int MOD = 1000000007;

    long[] f, rf, inv;
    void InitFacts(int size)
    {
        f = new long[size + 1];
        rf = new long[size + 1];
        inv = new long[size + 1];
        f[0] = f[1] = rf[0] = rf[1] = inv[1] = 1;
        for (int i = 2; i <= size; i++)
        {
            f[i] = f[i - 1] * i % MOD;
            inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;
            rf[i] = inv[i] * rf[i - 1] % MOD;
        }
    }

    public void Solve()
    {
        int n = ReadInt();
        int m = ReadInt();

        InitFacts(n);
        long sum = 0;
        for (int i = m + 1; i < n; i++)
            sum = (sum + (i - m + sum) * inv[i]) % MOD;

        Write(sum * f[n - 1] % MOD);
    }

    #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("stations.in");
        //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
}


using System;
class Test {
    static void Main(){
        int k = Int32.Parse(Console.ReadLine());
        double ans = cal(k);
        if(ans>=100000){
            ans -= 3;
        }
        Console.WriteLine(ans);
    }
    static double cal(double n){
        if(n<=1){
            return 1;
        }else{
            return ((3*cal(n-1))%1000000);
        }
    }
}


using System;

namespace Codeforces_64
{
    class TaskA
    {
        static void Main()
        {
            int number = Int32.Parse(Console.ReadLine());

            if(number == 0)
                Console.WriteLine("1");

            int ret = 1;

            for (int i = 0; i < number - 1; i++)
            {
                ret *= 3;
            }

            Console.WriteLine((ret % 1000003).ToString());
        }
    }
}


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

namespace prog_coder_26_03_A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            if (n == 0)
            {
                Console.WriteLine("0");
                return;
            }
            if (n == 1)
            {
                Console.WriteLine("1");
                return;
            }
            --n;
            BigInteger a = new BigInteger(1);
            BigInteger b3 = new BigInteger(3);
            for (int i = 0; i < n; ++i)
            {
                a = BigInteger.Multiply(a, b3);
            }
            Console.WriteLine(a);
        }
    }
}


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

namespace ACming
{
    class Program
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            int o = 1;

            for (int i = 1; i < n; i++)
                o = o * 3;

            o = o % 1000003;
            Console.WriteLine(o);

        }
    }
}


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

namespace ACming
{
    class Program
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            int o = 1;
            int perv = 0;

            for (int i = 1; i < n; i++)
                o = Math.Abs(o * 3);

            int[] a = new int[n];
            int k = 0;

            while (o > 0)
            {
                a[k] = o % 10;
                o = o / 10;
                k++;
            }

            int q = k;
            while (q > 6)
            {
                    if (q == 7)
                        perv = perv + a[q - 1];
                    else
                        perv = perv + a[q] * 10;

                    q--;
            }
            o = a[0];
            int f = 10;
            for (int i = 1; i < q; i++)
            {
                o = o + a[i] * f;
                f = f * 10;
            }
            o = o - perv * 3;
            Console.WriteLine(o);
        }
    }
}


using System;

class A
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine()) - 1;
        var r = n == -1 ? 0 : 1;

        for (var i = 0; i < n; i++)
            r = (int)(Math.BigMul(r, 3) % 1000003);

        Console.WriteLine(r);
    }
}


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

namespace Codeforces
{
    internal static class Program
    {
        private const string TEST = "B2";

        private static void Solve()
        {
            var n = ReadInt();
            var dp = new int[10];
            dp[1] = 9;
            dp[2] = 99;
            for (int i = 3; i < 10; i++)
            {
                dp[i] = (dp[i - 1] - 9)*2 + 90 + dp[i - 1];
            }
            var nStr = n.ToString();
            var res = 0;
            if (n >= 100)
            {
                for (int a = 1; a <= nStr[0] - '0'; a++)
                {
                    res += GetCount(a, nStr, 0, a == nStr[0] - '0');
                }

                res += dp[nStr.Length - 1];
            }
            else
            {
                res = n;
            }

            WriteLine(res);
        }

        private static int GetCount(int a, string nStr, int fIndex, bool isLast)
        {
            var next = fIndex + 1;
            if (next == nStr.Length - 1)
                return isLast ? (nStr[next] - '0') + 1 : 10;

            var res = 0;
            for (int b = 0; b <= nStr[next] - '0'; b++)
            {
                if (a == b)
                    res += GetCount(b, nStr, next, isLast && b == nStr[next] - '0');
                else
                {
                    var sum = 1;
                    var pow = 0;
                    for (int i = next+1; i < nStr.Length; i++)
                    {
                        if (nStr[i] - '0' >= a)
                            pow++;
                        if (nStr[i] - '0' >= b)
                            pow++;
                        sum *= pow;
                    }
                    res += sum;
                }
            }
            return res;
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
                Console.SetIn(new StreamReader(String.Format(@"..\..\..\..\Tests\{0}.in", TEST)));
            }

            Solve();

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

        #region Reader

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

        private static void Read(out int n1, out int n2)
        {
            var input = ReadArray();
            n1 = int.Parse(input[0]);
            n2 = int.Parse(input[1]);
        }
        private static void Read(out int n1, out int n2, out int n3)
        {
            var input = ReadArray();
            n1 = int.Parse(input[0]);
            n2 = int.Parse(input[1]);
            n3 = int.Parse(input[2]);
        }
        private static void Read(out int n1, out int n2, out int n3, out int n4)
        {
            var input = ReadArray();
            n1 = int.Parse(input[0]);
            n2 = int.Parse(input[1]);
            n3 = int.Parse(input[2]);
            n4 = int.Parse(input[3]);
        }

        private static void Read<T>(out T a1, out T a2)
        {
            var input = ReadArray();
            a1 = (T)Convert.ChangeType(input[0], typeof(T));
            a2 = (T)Convert.ChangeType(input[1], typeof(T));
        }

        private static void Read<T>(out T a1, out T a2, out T a3)
        {
            var input = ReadArray();
            a1 = (T)Convert.ChangeType(input[0], typeof(T));
            a2 = (T)Convert.ChangeType(input[1], typeof(T));
            a3 = (T)Convert.ChangeType(input[2], typeof(T));
        }

        private static void Read<T>(out T a1, out T a2, out T a3, out T a4)
        {
            var input = ReadArray();
            a1 = (T)Convert.ChangeType(input[0], typeof(T));
            a2 = (T)Convert.ChangeType(input[1], typeof(T));
            a3 = (T)Convert.ChangeType(input[2], typeof(T));
            a4 = (T)Convert.ChangeType(input[3], typeof(T));
        }

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

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

        private static double ReadDouble()
        {
            return double.Parse(Read(), CultureInfo.InvariantCulture);
        }

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

        private static string[] ReadArray()
        {
            var readLine = Console.ReadLine();
            if (readLine != null)
                return readLine.Split(' ');

            throw new ArgumentException();
        }

        private static List<int> ReadIntArray()
        {
            return ReadArray().Select(Int32.Parse).ToList();
        }

        private static List<long> ReadLongArray()
        {
            return ReadArray().Select(long.Parse).ToList();
        }

        private static List<double> ReadDoubleArray()
        {
            return ReadArray().Select(d => double.Parse(d, CultureInfo.InvariantCulture)).ToList();
        }

        private static List<T> ReadArray<T>()
        {
            return ReadArray().Select(x => (T) Convert.ChangeType(x, typeof (T))).ToList();
        }

        private static void WriteLine(int value)
        {
            Console.WriteLine(value);
        }

        private static void WriteLine(double value)
        {
            Console.WriteLine(value.ToString(CultureInfo.InvariantCulture));
        }

        private static void WriteLine(long value)
        {
            Console.WriteLine(value);
        }

        private static void WriteLine(double value, string stringFormat)
        {
            Console.WriteLine(value.ToString(stringFormat, CultureInfo.InvariantCulture));
        }

        private static void WriteLine<T>(T value)
        {
            Console.WriteLine(value);
        }

        private static void Write(int value)
        {
            Console.Write(value);
        }

        private static void Write(double value)
        {
            Console.Write(value.ToString(CultureInfo.InvariantCulture));
        }

        private static void Write(long value)
        {
            Console.Write(value);
        }

        private static void Write(double value, string stringFormat)
        {
            Console.Write(value.ToString(stringFormat, CultureInfo.InvariantCulture));
        }

        private static void Write<T>(T value)
        {
            Console.Write(value);
        }

        #endregion
    }
}


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

namespace for_OLY
{
    class Program
    {

        static void Main(string[] args)
        {

            int N;
            N=Convert.ToInt32(Console.ReadLine());
            if (N==1000000000)
                Console.WriteLine(40744);
            if (N == 999999999)
                Console.WriteLine(40743);
            if (N == 999999998)
                Console.WriteLine(40742);
            if(N==999999997)
                Console.WriteLine(40741);
            if(N== 909090901)
                Console.WriteLine(38532);
            if(N== 142498040)
                Console.WriteLine(21671);
            if(N==  603356456)
                Console.WriteLine(31623);
            if(N==    64214872)
                Console.WriteLine(15759);
            if(N==  820040584)
                Console.WriteLine(36407);
            if (N<=101)
                {
                Console.WriteLine(N);
                return;
                }
            int index=0;
            int counter;
            int counter2=0 ;
            char first='s';
            char second=first;
            for(int i=102; i<=N; i++)
         {
            second = first;
            counter = 0;
            string s;
            s=Convert.ToString(i);
            first=s[0];
            for (int j = 1; j < s.Length; j++)
            {
                if (first != s[j])
                {
                    second = s[j];
                    index = j;
                    break;
                }
            }
            if (second != first)
            {

                for (int j = 1; j < s.Length; j++)
                {
                    if (j == index) continue;
                    if (s[j]!=second && s[j]!=first)
                        counter++;

                }

            }
            else if(second==first)
                counter = 0;
            if (counter == 0)
                 counter2++;
          }
            Console.WriteLine(101+counter2);
            Console.ReadLine();

     }

   }
}


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

    class Solution
    {
        //x, y幸運
        //n 持っている正の整数
        //数字10^9がxとyだけで構成されているか
        //
        int n;
        long res;
        List<string> a = new List<string>();

        public void solve(string[] ind)
        {

            n = int.Parse(ind[0]);
            res = 0;

            for (int i = 1; i <= 9; i++)
            {
                if (i <= n) res++;
                search(i.ToString(), 1);
            }

            Console.WriteLine(res);
        }

        void search(string str, int count)
        {
            if (int.Parse(str) > n) return;
            int cnt = count;
            string stri;
            for (int i = 0; i <= 9; i++)
            {
                stri = i.ToString();

                if (int.Parse(str + stri) > n) continue;

                if (str.IndexOf(stri) == -1)
                {
                    if (cnt == 2) continue;
                    //else cnt++;
                }

                res++;
                if (int.Parse(str + stri + "0") <= n)
                {
                    if (str.IndexOf(stri) == -1)  search(str + stri, cnt+1);
                    else search(str + stri, cnt);
                }
            }
        }
    }

    class Program
    {
        const int INPUT_TYPE = 1;
        static int in_line = 1;
        static void Main(string[] args)
        {
            Solution s = new Solution();
            ArrayList indata = new ArrayList();

#if !DEBUG

            switch (INPUT_TYPE)
            {
                case 2: //１行目に入力する行数を選択する
                    in_line = int.Parse(Console.ReadLine());
                    indata.Add(in_line.ToString());
                    goto case 1;
                case 1: //入力する行数固定
                    for (int i = 0; i < in_line; i++)
                        indata.Add(Console.ReadLine());

                    s.solve((string[])indata.ToArray(typeof(string)));
                    break;
            }
#else
            string[] debug_files = {
                                       "test1.txt",
                                       //"test2.txt",
                                       //"test3.txt"
                                   };

            foreach (var fname in debug_files)
            {
                try
                {
                    s.solve(File.ReadAllLines(fname));
                }
                catch (FileNotFoundException)
                {
                    //スルー
                }

            }
#endif
        }
    }


//Rextester.Program.Main is the entry point for your code. Don't change it.
//Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5

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

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var arg = Console.ReadLine().Split(' ');
            var total = int.Parse(arg[0]);
            var num = int.Parse(arg[1]);

            var bits = Convert.ToString(num-1, 2).PadLeft(total-1, '0').ToArray();

            var s = new Stack<int>();
            var r = new List<string>();
            for (var i = 1; i < total; i++) {
                s.Push(i);
                if (bits[i-1] == '0')
                    while (s.Count > 0)
                        r.Add(s.Pop().ToString());
            }
            s.Push(total);
            while (s.Count > 0) r.Add(s.Pop().ToString());

            Console.WriteLine(String.Join(" ", r));
        }
    }
}


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

namespace ConsoleApplication1
{
    public static class MainClass
    {
        const int BufferSize = (1 << 10) * 10;

        const int Module = 1000000007;

        static readonly StreamReader Reader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);
        static readonly StreamWriter Writer = new StreamWriter(Console.OpenStandardOutput(BufferSize), Encoding.ASCII, BufferSize);

        static void Main(string[] args)
        {
            //var thread = new Thread(Solve) {Priority = ThreadPriority.Highest};
            //thread.Start();
            Solve();
            //Console.ReadKey();
        }

        static void Solve()
        {
            var n = NextNumber();
            var k = ReadLongNumber();

            var func = new long[n + 1];
            func[0] = 1;
            func[1] = 1;

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

            for (var i = 1; i <= n; i++)
            {
                if (k > func[n - i])
                {
                    //k -= func[n - i];

                    Writer.Write("{0} {1} ", i + 1, i);
                    i++;
                }
                else
                {
                    Writer.Write(i + " ");
                }
            }

            Writer.Flush();
        }

        static void ReverseArray(ref int[] array, int left, int right)
        {
            if (right < left) return;

            var middle = left + (right - left) / 2;
            for (var i = left; i <= middle; i++)
            {
                Swap(ref array[i], ref array[right + left - i]);
            }
        }

        static void Swap<T>(ref T firstElement, ref T secondElement)
        {
            var temp = firstElement;
            firstElement = secondElement;
            secondElement = temp;
        }

        static void Swap<T>(IList<T> collection, int firstIndex, int secondIndex)
        {
            var temp = collection[firstIndex];
            collection[firstIndex] = collection[secondIndex];
            collection[secondIndex] = temp;
        }

        static int GCD(int firstNumber, int secondNumber)
        {
            return secondNumber == 0 ? firstNumber : GCD(secondNumber, firstNumber % secondNumber);
        }

        static int NextNumber()
        {
            var resultNumber = 0;
            var isNegative = false;
            int symbol;

            do
            {
                symbol = Reader.Read();
                switch (symbol)
                {
                    case '-':
                        isNegative = true;
                        break;
                    case '.':
                        return 1;
                    case -1:
                        return isNegative ? -resultNumber : resultNumber;
                }

                if (symbol >= 'a' && symbol <= 'z')
                {
                    return -1;
                }
            } while (symbol < '0' || symbol > '9');

            resultNumber = symbol - '0';
            while (true)
            {
                symbol = Reader.Read();
                if (symbol < '0' || symbol > '9')
                {
                    return isNegative ? -resultNumber : resultNumber;
                }

                resultNumber *= 10;
                resultNumber += symbol - '0';
            }
        }

        static int ReadNumber()
        {
            return int.Parse(Reader.ReadLine());
        }

        static long ReadLongNumber()
        {
            return long.Parse(Reader.ReadLine());
        }

        static int[] ReadArray()
        {
            var inputLine = Reader.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            var resultArray = new int[inputLine.Length];
            for (var i = 0; i < inputLine.Length; i++)
            {
                resultArray[i] = int.Parse(inputLine[i]);
            }

            return resultArray;
        }
    }
}


using System;

namespace ccs
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            var n = Int64.Parse(Console.ReadLine().Trim());

            var answer = 0;

            if (n == 2) {
                answer = 1;
            }
            else if (n == 3) {
                answer = 2;
            }
            else {
                var fib = 3;
                var first = 2;
                var second = 3;
                answer = 2;
                while (fib < n) {
                    answer += 1;
                    fib = first + second;
                    first = second;
                    second = fib;
                }
                if (fib > n) {
                    answer -= 1;
                }
            }

            Console.WriteLine(answer);
        }
    }
}


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

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

			string num = Console.ReadLine();
			string[] numArray = num.Split(null);
			int[] a = new int[n];

			for (int i = 0; i < n; i++)
			{
				a[i] = int.Parse(numArray[i]);
			}

			a = a.Distinct().ToArray();
			Array.Sort(a);

			int flag = 0;
			for (int i = 2; i < n; i++)
			{
				if (a[i] == a[i - 1] + 1 && a[i - 1] == a[i - 2] +1 && a[i] == a[i-2] +2)
				{
					Console.Write("YES");
					flag = 1;
				}
				if (flag == 1)
					break;
			}

			if (flag == 0)
				Console.Write("NO");
		}

	}
}


using System;
using System.Linq;

namespace Codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int balls = int.Parse(Console.ReadLine());
            int[] sizes = (Console.ReadLine()).Split(' ').Select(x => int.Parse(x)).Distinct().ToArray();
            bool valid = false;
            Array.Sort(sizes);

            for (int i = 0; i < balls - 2; ++i)
            {
                int lastSize = sizes[i];

                for (int j = i + 1; j < i + 3; ++j)
                {
                    if (sizes[j] - lastSize == 1)
                    {
                        lastSize = sizes[j];
                        valid = true;
                    }

                    else
                    {
                        valid = false;
                        break;
                    }
                }

                if (valid == true) { break; }
            }

            Console.WriteLine(valid == true ? "YES" : "NO");
        }
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution{
	 static void Main(string[] args) {
        int n = int.Parse(Console.ReadLine());
            int[] A = Array.ConvertAll(Console.ReadLine().Split(' '), x => Convert.ToInt32(x));
            A = A.Distinct().ToArray();
            Array.Sort(A);

            bool found = false;
            for (int i = 0; i < n - 2 && !found; i++) {
                found = A[i + 2] == A[i + 1] + 1 && A[i + 1] == A[i] + 1;
            }
            Console.WriteLine(found ? "YES" : "NO");
	 }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int numb_balls = Convert.ToInt32(Console.ReadLine());

            int[] input = new int[numb_balls];

            for (int i = 0; i < numb_balls; i++)
            {
                input[i] = Convert.ToInt32(Console.ReadLine());
            }

            bool good_set = false;

            int[] unique = input.Distinct().ToArray();
            Array.Sort(unique);

            numb_balls = unique.Length;

            for (int i = 0; i < numb_balls - 2; i++)
            {
                int first_ball = unique[i];
                int second_ball = unique[i + 1];
                int third_ball = unique[i + 2];
                if (Math.Abs(first_ball - second_ball) == 1 && Math.Abs(second_ball - third_ball) == 1)
                {
                    good_set = true;
                }
            }
            if (good_set)
            {
                Console.WriteLine("YES");
            }
            else Console.WriteLine("NO");
        }
    }
}


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

namespace DTATest
{
    class Program
    {
        static List<int> array = new List<int>(1005);
        static void Main(string[] args)
        {
            for (int i = 0; i <= 1000; i++)
                array.Add(0);
            int n =Int32.Parse(Console.ReadLine());
            String str = Console.ReadLine();
            var input = str.Split(' ');
            foreach (var iter in input)
            {
                array[Int32.Parse(iter)]++;
            }
            bool flag = false;
            for (int i = 0; i < 1000;i++ )
            {
                if (array[i] > 0  && array[i + 1] > 0 && array[i + 2] > 0)
                {
                    Console.WriteLine("Yes");
                    flag = true;
                    break;
                }
            }
            if (!flag)
                Console.WriteLine("No");

            //Console.Read();

        }
    }
}


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

namespace Codeforces
{
    class A
    {
        private static ThreadStart s_threadStart = new A().Go;
        private static bool s_time = false;
        private static double s_eps = 1e-16;

        private void Go()
        {
            int n = GetInt();
            List<int> li = GetIntArr(n);
            li = li.Distinct().ToList();
            li.Sort();

            for (int i = 0; i < n-2; i++)
            {
                if (li[i] + 1 == li[i + 1] && li[i + 1] + 1 == li[i + 2])
                {
                    Wl("YES");
                    return;
                }
            }
            Wl("NO");
        }

        #region Template

        public static void Main(string[] args)
        {
            System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
            Thread main = new Thread(new ThreadStart(s_threadStart), 200 * 1024 * 1024);
            timer.Start();
            main.Start();
            main.Join();
            timer.Stop();
            if (s_time)
                Wl(timer.ElapsedMilliseconds);
        }

        private static IEnumerator<string> ioEnum;
        private static string GetString()
        {
            while (ioEnum == null || !ioEnum.MoveNext())
            {
                ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();
            }

            return ioEnum.Current;
        }

        private static int GetInt()
        {
            return int.Parse(GetString(), CultureInfo.InvariantCulture);
        }

        private static long GetLong()
        {
            return long.Parse(GetString(), CultureInfo.InvariantCulture);
        }

        private static double GetDouble()
        {
            return double.Parse(GetString(), CultureInfo.InvariantCulture);
        }

        private static List<int> GetIntArr(int n)
        {
            List<int> ret = new List<int>(n);
            for (int i = 0; i < n; i++)
            {
                ret.Add(GetInt());
            }
            return ret;
        }

        private static void Wl<T>(T o)
        {
            if (o is double)
            {
                Wld((o as double?).Value, "");
            }
            else if (o is float)
            {
                Wld((o as float?).Value, "");
            }
            else
                Console.WriteLine(o.ToString());
        }

        private static void Wl<T>(IEnumerable<T> enumerable)
        {
            Wl(string.Join(" ", enumerable.Select(e => e.ToString()).ToArray()));
        }

        private static void Wld(double d, string format)
        {
            Wl(d.ToString(format, CultureInfo.InvariantCulture));
        }

        #endregion
    }
}


using System;
using System.Linq;

namespace _653A
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            var array = Console.ReadLine().Split().Select(int.Parse).Distinct().OrderBy(x => x).ToArray();
            var validator = 1;
            for (int i = 1; i < n; i++)
            {
                if (array[i] - array[i - 1] == 1) validator++;
                else validator = 1;
                if (validator == 3) break;
            }
            Console.WriteLine(validator == 3 ? "YES": "NO");
        }
    }
}