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

namespace A327887 {
    class Program {
        static void Main(string[] args) {
            for (int n = 1; n <= 5000; n++) {
                t = new BigInteger[n];
                p = new BigInteger[n];
                
                for (long v=1; ; v++) {
                    if (ExtendWith(+v)) {
                        Console.WriteLine("{0} {1}", n, +v);
                        break;
                    } else if (ExtendWith(-v)) {
                        Console.WriteLine("{0} {1}", n, -v);
                        break;
                    }
                }
            }
        }

        static bool ExtendWith(long v) {
            if (!Seen(v)) {
                pp.Clear();
                pp[0] = true;
                t[0] = v;
                p[0] = v;
                bool ok = true;

                for (int k = 1; k < t.Length; k++) {
                    t[k] = t[k - 1] - d[k - 1];
                    if (Seen(t[k])) {
                        ok = false;
                        break;
                    }

                    p[k] = p[k - 1] + t[k];
                    if (pp.ContainsKey(p[k])) {
                        ok = false;
                        break;
                    } else {
                        pp[p[k]] = true;
                    }
                }

                if (ok) {
                    d = t;
                    for (int k = 0; k < t.Length; k++) {
                        See(d[k]);
                    }
                    return true;
                }
            }
            return false;
        }

        /// <summary>
        /// Last diagonal.
        /// </summary>
        static BigInteger[] d = { };
        /// <summary>
        /// Next diagonal.
        /// </summary>
        static BigInteger[] t = null;
        /// <summary>
        /// Partial sums of t.
        /// </summary>
        static BigInteger[] p = null;
        /// <summary>
        /// Partial sums of t.
        /// </summary>
        static Dictionary<BigInteger,bool> pp = new Dictionary<BigInteger, bool>();

        static bool Seen(BigInteger v) {
            return bigSeen.ContainsKey(v);
        }

        static void See(BigInteger v) {
            if (Seen(v)) {
                throw new ApplicationException("Already seen: " + v);
            }

            bigSeen[v] = true;
        }

        static readonly Dictionary<BigInteger, bool> bigSeen = new Dictionary<BigInteger, bool>();
    }
}