using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using static System.Math;
using System.Text;

namespace Program
{
    public static class CODEFORCES1
    {
        static public void Solve()
        {
            var x = NN;
            var mod = x % 4;
            if (mod == 1)
            {
                Console.WriteLine("0 A");
                return;
            }
            else if (mod == 2)
            {
                Console.WriteLine("1 B");
                return;
            }
            else if (mod == 3)
            {
                Console.WriteLine("2 A");
                return;
            }
            else
            {
                Console.WriteLine("1 A");
                return;
            }
        }

        static public void Main(string[] args) { if (args.Length == 0) { var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Console.SetOut(sw); } Solve(); Console.Out.Flush(); }
        static Random rand = new Random();
        static class Console_
        {
            static Queue<string> param = new Queue<string>();
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public static string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }
        }
        static long NN => long.Parse(Console_.NextString());
        static double ND => double.Parse(Console_.NextString());
        static string NS => Console_.NextString();
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static IEnumerable<T> OrderByRand<T>(this IEnumerable<T> x) => x.OrderBy(_ => rand.Next());
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static IEnumerable<T> Repeat<T>(T v, long n) => Enumerable.Repeat<T>(v, (int)n);
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static IEnumerable<int> Range(long s, long c) => Enumerable.Range((int)s, (int)c);
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static void RevSort<T>(T[] l) where T : IComparable { Array.Sort(l, (x, y) => y.CompareTo(x)); }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static void RevSort<T>(T[] l, Comparison<T> comp) where T : IComparable { Array.Sort(l, (x, y) => comp(y, x)); }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static IEnumerable<long> Primes(long x) { if (x < 2) yield break; yield return 2; var halfx = x / 2; var table = new bool[halfx + 1]; var max = (long)(Math.Sqrt(x) / 2); for (long i = 1; i <= max; ++i) { if (table[i]) continue; var add = 2 * i + 1; yield return add; for (long j = 2 * i * (i + 1); j <= halfx; j += add) table[j] = true; } for (long i = max + 1; i <= halfx; ++i) if (!table[i] && 2 * i + 1 <= x) yield return 2 * i + 1; }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static IEnumerable<long> Factors(long x) { if (x < 2) yield break; while (x % 2 == 0) { x /= 2; yield return 2; } var max = (long)Math.Sqrt(x); for (long i = 3; i <= max; i += 2) while (x % i == 0) { x /= i; yield return i; } if (x != 1) yield return x; }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static IEnumerable<long> Divisor(long x) { if (x < 1) yield break; var max = (long)Math.Sqrt(x); for (long i = 1; i <= max; ++i) { if (x % i != 0) continue; yield return i; if (i != x / i) yield return x / i; } }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static long GCD(long a, long b) { while (b > 0) { var tmp = b; b = a % b; a = tmp; } return a; }
        static long LCM(long a, long b) => a * b / GCD(a, b);
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static Mat<T> Pow<T>(Mat<T> x, long y) => Mat<T>.Pow(x, y);
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static T Pow<T>(T x, long y) { T a = (dynamic)1; while (y != 0) { if ((y & 1) == 1) a *= (dynamic)x; x *= (dynamic)x; y >>= 1; } return a; }
        static List<long> _fact = new List<long>() { 1 };
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static void _B(long n) { if (n >= _fact.Count) for (int i = _fact.Count; i <= n; ++i) _fact.Add(_fact[i - 1] * i); }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static long Comb(long n, long k) { _B(n); if (n == 0 && k == 0) return 1; if (n < k || n < 0) return 0; return _fact[(int)n] / _fact[(int)(n - k)] / _fact[(int)k]; }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static long Perm(long n, long k) { _B(n); if (n == 0 && k == 0) return 1; if (n < k || n < 0) return 0; return _fact[(int)n] / _fact[(int)(n - k)]; }
        class PQ<T> where T : IComparable
        {
            List<T> h; Comparison<T> c; public T Peek => h[0]; public int Count => h.Count;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public PQ(int cap, Comparison<T> c, bool asc = true) { h = new List<T>(cap); this.c = asc ? c : (x, y) => c(y, x); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public PQ(Comparison<T> c, bool asc = true) { h = new List<T>(); this.c = asc ? c : (x, y) => c(y, x); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public PQ(int cap, bool asc = true) : this(cap, (x, y) => x.CompareTo(y), asc) { }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public PQ(bool asc = true) : this((x, y) => x.CompareTo(y), asc) { }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public void Push(T v) { var i = h.Count; h.Add(v); while (i > 0) { var ni = (i - 1) / 2; if (c(v, h[ni]) >= 0) break; h[i] = h[ni]; i = ni; } h[i] = v; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public T Pop() { var r = h[0]; var v = h[h.Count - 1]; h.RemoveAt(h.Count - 1); if (h.Count == 0) return r; var i = 0; while (i * 2 + 1 < h.Count) { var i1 = i * 2 + 1; var i2 = i * 2 + 2; if (i2 < h.Count && c(h[i1], h[i2]) > 0) i1 = i2; if (c(v, h[i1]) <= 0) break; h[i] = h[i1]; i = i1; } h[i] = v; return r; }
        }
        class PQ<TK, TV> where TK : IComparable
        {
            PQ<Tuple<TK, TV>> q; public Tuple<TK, TV> Peek => q.Peek; public int Count => q.Count;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public PQ(int cap, Comparison<TK> c, bool asc = true) { q = new PQ<Tuple<TK, TV>>(cap, (x, y) => c(x.Item1, y.Item1), asc); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public PQ(Comparison<TK> c, bool asc = true) { q = new PQ<Tuple<TK, TV>>((x, y) => c(x.Item1, y.Item1), asc); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public PQ(int cap, bool asc = true) : this(cap, (x, y) => x.CompareTo(y), asc) { }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public PQ(bool asc = true) : this((x, y) => x.CompareTo(y), asc) { }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public void Push(TK k, TV v) => q.Push(Tuple.Create(k, v));
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public Tuple<TK, TV> Pop() => q.Pop();
        }
        public class UF
        {
            long[] d;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public UF(long s) { d = Repeat(-1L, s).ToArray(); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public bool Unite(long x, long y) { x = Root(x); y = Root(y); if (x != y) { if (d[y] < d[x]) { var t = y; y = x; x = t; } d[x] += d[y]; d[y] = x; } return x != y; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public bool IsSame(long x, long y) => Root(x) == Root(y);
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public long Root(long x) => d[x] < 0 ? x : d[x] = Root(d[x]);
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public long Count(long x) => -d[Root(d[x])];
        }
        struct Mod : IEquatable<object>
        {
            static public long _mod = 1000000007; long _val;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public Mod(long x) { if (x < _mod && x >= 0) _val = x; else if ((_val = x % _mod) < 0) _val += _mod; }
            static public implicit operator Mod(long x) => new Mod(x);
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public implicit operator long(Mod x) => x._val;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mod operator +(Mod x, Mod y) => x._val + y._val;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mod operator -(Mod x, Mod y) => x._val - y._val;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mod operator *(Mod x, Mod y) => x._val * y._val;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mod operator /(Mod x, Mod y) => x._val * Inverse(y._val);
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public bool operator ==(Mod x, Mod y) => x._val == y._val;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public bool operator !=(Mod x, Mod y) => x._val != y._val;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public long Inverse(long x) { long b = _mod, r = 1, u = 0, t = 0; while (b > 0) { var q = x / b; t = u; u = r - q * u; r = t; t = b; b = x - q * b; x = t; } return r < 0 ? r + _mod : r; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            bool IEquatable<object>.Equals(object obj) => obj == null ? false : Equals((Mod)obj);
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public override bool Equals(object obj) => obj == null ? false : Equals((Mod)obj);
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public bool Equals(Mod obj) => obj == null ? false : _val == obj._val;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public override int GetHashCode() => _val.GetHashCode();
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public override string ToString() => _val.ToString();
            static List<Mod> _fact = new List<Mod>() { 1 };
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static void B(long n) { if (n >= _fact.Count) for (int i = _fact.Count; i <= n; ++i) _fact.Add(_fact[i - 1] * i); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mod Comb(long n, long k) { B(n); if (n == 0 && k == 0) return 1; if (n < k || n < 0) return 0; return _fact[(int)n] / _fact[(int)(n - k)] / _fact[(int)k]; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mod Perm(long n, long k) { B(n); if (n == 0 && k == 0) return 1; if (n < k || n < 0) return 0; return _fact[(int)n] / _fact[(int)(n - k)]; }
        }
        struct Mat<T>
        {
            T[,] m;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public Mat(T[,] v) { m = (T[,])v.Clone(); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public implicit operator Mat<T>(T[,] v) => new Mat<T>(v);
            public T this[int r, int c] { get { return m[r, c]; } set { m[r, c] = value; } }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mat<T> operator +(Mat<T> a, T x) { var tm = (T[,])a.m.Clone(); for (int r = 0; r < tm.GetLength(0); ++r) for (int c = 0; c < tm.GetLength(1); ++c) tm[r, c] += (dynamic)x; return tm; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mat<T> operator +(Mat<T> a, Mat<T> b) { var tm = (T[,])a.m.Clone(); for (int r = 0; r < tm.GetLength(0); ++r) for (int c = 0; c < tm.GetLength(1); ++c) tm[r, c] += (dynamic)b[r, c]; return tm; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mat<T> operator -(Mat<T> a, T x) { var tm = (T[,])a.m.Clone(); for (int r = 0; r < tm.GetLength(0); ++r) for (int c = 0; c < tm.GetLength(1); ++c) tm[r, c] -= (dynamic)x; return tm; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mat<T> operator -(Mat<T> a, Mat<T> b) { var tm = (T[,])a.m.Clone(); for (int r = 0; r < tm.GetLength(0); ++r) for (int c = 0; c < tm.GetLength(1); ++c) tm[r, c] -= (dynamic)b[r, c]; return tm; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mat<T> operator *(Mat<T> a, T x) { var tm = (T[,])a.m.Clone(); for (int r = 0; r < tm.GetLength(0); ++r) for (int c = 0; c < tm.GetLength(1); ++c) tm[r, c] *= (dynamic)x; return tm; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mat<T> operator *(Mat<T> a, Mat<T> b) { var nr = a.m.GetLength(0); var nc = b.m.GetLength(1); var tm = new T[nr, nc]; for (int i = 0; i < nr; ++i) for (int j = 0; j < nc; ++j) tm[i, j] = (dynamic)0; for (int r = 0; r < nr; ++r) for (int c = 0; c < nc; ++c) for (int i = 0; i < a.m.GetLength(1); ++i) tm[r, c] += a[r, i] * (dynamic)b[i, c]; return tm; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            static public Mat<T> Pow(Mat<T> x, long y) { var n = x.m.GetLength(0); var t = (Mat<T>)new T[n, n]; for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) t[i, j] = (dynamic)(i == j ? 1 : 0); while (y != 0) { if ((y & 1) == 1) t *= x; x *= x; y >>= 1; } return t; }
        }
        class Tree
        {
            long N; int l; List<long>[] p; int[] d; long[][] pr; long r; Tuple<long, long, int>[] e; Tuple<long, long>[] b; bool lca; bool euler; bool bfs;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public Tree(List<long>[] p_, long r_) { N = p_.Length; p = p_; r = r_; lca = false; euler = false; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public Tuple<long, long>[] FromRoot() { if (!bfs) { var nb = new List<Tuple<long, long>>(); var q = new Queue<long>(); var d = new bool[N]; nb.Add(Tuple.Create(r, -1L)); d[r] = true; q.Enqueue(r); while (q.Count > 0) { var w = q.Dequeue(); foreach (var i in p[w]) { if (d[i]) continue; d[i] = true; q.Enqueue(i); nb.Add(Tuple.Create(i, w)); } } b = nb.ToArray(); bfs = true; } return b; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public Tuple<long, long>[] FromLeaf() => FromRoot().Reverse().ToArray();
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public Tuple<long, long, int>[] Euler() { if (!euler) { var ne = new List<Tuple<long, long, int>>(); var s = new Stack<Tuple<long, long>>(); var d = new bool[N]; d[r] = true; s.Push(Tuple.Create(r, -1L)); while (s.Count > 0) { var w = s.Peek(); var ad = true; foreach (var i in p[w.Item1]) { if (d[i]) continue; d[i] = true; ad = false; s.Push(Tuple.Create(i, w.Item1)); } if (!ad || p[w.Item1].Count == 1) ne.Add(Tuple.Create(w.Item1, w.Item2, 1)); if (ad) { s.Pop(); ne.Add(Tuple.Create(w.Item1, w.Item2, -1)); } } e = ne.ToArray(); euler = true; } return e; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public long LCA(long u, long v) { if (!lca) { l = 0; while (N > (1 << l)) l++; d = new int[N]; pr = Repeat(0, l).Select(_ => new long[N]).ToArray(); d[r] = 0; pr[0][r] = -1; var q = new Stack<long>(); q.Push(r); while (q.Count > 0) { var w = q.Pop(); foreach (var i in p[w]) { if (i == pr[0][w]) continue; q.Push(i); d[i] = d[w] + 1; pr[0][i] = w; } } for (var k = 0; k + 1 < l; k++) for (var w = 0; w < N; w++) if (pr[k][w] < 0) pr[k + 1][w] = -1; else pr[k + 1][w] = pr[k][pr[k][w]]; lca = true; } if (d[u] > d[v]) { var t = u; u = v; v = t; } for (var k = 0; k < l; k++) if ((((d[v] - d[u]) >> k) & 1) != 0) v = pr[k][v]; if (u == v) return u; for (var k = l - 1; k >= 0; k--) if (pr[k][u] != pr[k][v]) { u = pr[k][u]; v = pr[k][v]; } return pr[0][u]; }
        }
        class BT<T> where T : IComparable
        {
            class Node { public Node l; public Node r; public T v; public bool b; }
            Comparison<T> c; Node r; bool ch; T lm;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public BT(Comparison<T> _c) { c = _c; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public BT() : this((x, y) => x.CompareTo(y)) { }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            bool R(Node n) => n != null && !n.b;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            bool B(Node n) => n != null && n.b;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Node RtL(Node n) { Node m = n.r, t = m.l; m.l = n; n.r = t; return m; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Node RtR(Node n) { Node m = n.l, t = m.r; m.r = n; n.l = t; return m; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Node RtLR(Node n) { n.l = RtL(n.l); return RtR(n); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Node RtRL(Node n) { n.r = RtR(n.r); return RtL(n); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public void Add(T x) { r = A(r, x); r.b = true; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Node A(Node n, T x) { if (n == null) { ch = true; return new Node() { v = x }; } var r = c(x, n.v); if (r < 0) { n.l = A(n.l, x); return Bl(n); } if (r > 0) { n.r = A(n.r, x); return Bl(n); } ch = false; return n; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Node Bl(Node n) { if (!ch) return n; if (!B(n)) return n; if (R(n.l) && R(n.l.l)) { n = RtR(n); n.l.b = true; } else if (R(n.l) && R(n.l.r)) { n = RtLR(n); n.l.b = true; } else if (R(n.r) && R(n.r.l)) { n = RtRL(n); n.r.b = true; } else if (R(n.r) && R(n.r.r)) { n = RtL(n); n.r.b = true; } else ch = false; return n; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public void Remove(T x) { r = Rm(r, x); if (r != null) r.b = true; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Node Rm(Node n, T x) { if (n == null) { ch = false; return n; } var r = c(x, n.v); if (r < 0) { n.l = Rm(n.l, x); return BlL(n); } if (r > 0) { n.r = Rm(n.r, x); return BlR(n); } if (n.l == null) { ch = n.b; return n.r; } n.l = RmM(n.l); n.v = lm; return BlL(n); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Node RmM(Node n) { if (n.r != null) { n.r = RmM(n.r); return BlR(n); } lm = n.v; ch = n.b; return n.l; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Node BlL(Node n) { if (!ch) return n; if (B(n.r) && R(n.r.l)) { var b = n.b; n = RtRL(n); n.b = b; n.l.b = true; ch = false; } else if (B(n.r) && R(n.r.r)) { var b = n.b; n = RtL(n); n.b = b; n.r.b = true; n.l.b = true; ch = false; } else if (B(n.r)) { ch = n.b; n.b = true; n.r.b = false; } else { n = RtL(n); n.b = true; n.l.b = false; n.l = BlL(n.l); ch = false; } return n; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Node BlR(Node n) { if (!ch) return n; if (B(n.l) && R(n.l.r)) { var b = n.b; n = RtLR(n); n.b = b; n.r.b = true; ch = false; } else if (B(n.l) && R(n.l.l)) { var b = n.b; n = RtR(n); n.b = b; n.l.b = true; n.r.b = true; ch = false; } else if (B(n.l)) { ch = n.b; n.b = true; n.l.b = false; } else { n = RtR(n); n.b = true; n.r.b = false; n.r = BlR(n.r); ch = false; } return n; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public bool Have(T x) { var t = FindUpper(x); return t.Item1 && t.Item2.CompareTo(x) == 0; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public Tuple<bool, T> FindUpper(T x) { var v = FU(r, x); return v == null ? Tuple.Create(false, default(T)) : v; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Tuple<bool, T> FU(Node n, T x) { if (n == null) return null; var r = c(x, n.v); if (r < 0) { var v = FU(n.l, x); return v == null ? Tuple.Create(true, n.v) : v; } if (r > 0) return FU(n.r, x); return Tuple.Create(true, n.v); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public Tuple<bool, T> FindLower(T x) { var v = FL(r, x); return v == null ? Tuple.Create(false, default(T)) : v; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            Tuple<bool, T> FL(Node n, T x) { if (n == null) return null; var r = c(x, n.v); if (r < 0) return FL(n.l, x); if (r > 0) { var v = FL(n.r, x); return v == null ? Tuple.Create(true, n.v) : v; } return Tuple.Create(true, n.v); }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public T Min() { Node n = r, p = null; while (n != null) { p = n; n = n.l; } return p == null ? default(T) : p.v; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public T Max() { Node n = r, p = null; while (n != null) { p = n; n = n.r; } return p == null ? default(T) : p.v; }
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public bool Any() => r != null;
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public int CountSlow() => L(r).Count();
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            public IEnumerable<T> List() => L(r);
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            IEnumerable<T> L(Node n) { if (n == null) yield break; foreach (var i in L(n.l)) yield return i; yield return n.v; foreach (var i in L(n.r)) yield return i; }
        }
    }
}


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

namespace Solution
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var cat = N % 4;
            var rankA = rank(cat);
            var index = 0;
            for (var i = 0; i <= 2; i++)
            {
                var newrank = rank( (N + i) % 4 );
                if (newrank < rankA)
                {
                    rankA = newrank;
                    index = i;
                }
            }
            Console.WriteLine($"{index} {rankA.ToString()}");
        }

        private static char rank(int N){
            switch (N)
            {
                case 1: return 'A';
                case 3: return 'B';
                case 2: return 'C';
                case 0 : default: return 'D';
            }
        }
    }
}


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

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

             int n=int.Parse(Console.ReadLine());
             char[]c=new char[3];
             if(n%4==1)
             c[0]='A';
             else if(n%4==3)
             c[0]='B';
             else if(n%4==2)
             c[0]='C';
             else if(n%4==0)
             c[0]='D';

             if((n+1)%4==1)
             c[1]='A';
             else if((n+1)%4==3)
             c[1]='B';
             else if((n+1)%4==2)
             c[1]='C';
             else if((n+1)%4==0)
             c[1]='D';

             if((n+2)%4==1)
             c[2]='A';
             else if((n+2)%4==3)
             c[2]='B';
             else if((n+2)%4==2)
             c[2]='C';
             else if((n+2)%4==0)
             c[2]='D';

             string alph="ABCD";

             int min=999999;
             int treo=0;
             string orf="";
             for(int i=0;i<3;i++)
             {
                  if(alph.Contains(c[i]))
                  {
                       if(alph.IndexOf(c[i])<min)
                       {
                            orf=c[i].ToString();
                            min=alph.IndexOf(c[i]);
                            treo=i;
                       }
                  }
             }
             Console.WriteLine("{0} {1}",treo,orf);
             //Console.WriteLine(alph.IndexOf(c[1]));

        }
    }
}


// Problem: 1191A - Tokitsukaze and Enhancement
// Author: Gusztav Szmolik

using System;

class TokitsukazeAndEnhancement
    {
    public static int Main ()
        {
        string line = Console.ReadLine ();
        if (line == null)
            return -1;
        char[] delims = new char[] {' ', '\t'};
        string[] words = line.Split (delims,StringSplitOptions.RemoveEmptyEntries);
        if (words.Length != 1)
            return -1;
        byte x;
        if (!Byte.TryParse (words[0], out x))
            return -1;
        if (x < 30 || x > 100)
            return -1;
        byte remain = Convert.ToByte (x%4);
        string[] answers = new string[] {"1 A", "0 A", "1 B", "2 A"};
        Console.WriteLine (answers[remain]);
        return 0;
        }
    }


using System;
class Program
{
    static void Main()
    {
        switch (int.Parse(Console.ReadLine()) % 4)
        {
            case 0: Console.WriteLine(1 + " A"); break;
            case 1: Console.WriteLine(0 + " A"); break;
            case 2: Console.WriteLine(1 + " B"); break;
            case 3: Console.WriteLine(2 + " A"); break;
        }
    }
}


using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace Olymp
{
  public class ProblemSolver
  {
    private readonly Tokenizer input;

    public void Solve()
    {
      var x = input.ReadInt();
      var l = new[] { 'D', 'A', 'C', 'B' };
      Func<int, int, char> c = (int i, int k) => l[(i + k) % 4];
      var d = 0;
      if (c(x, d) > c(x, 1))
        d = 1;
      if (c(x, d) > c(x, 2))
        d = 2;
      Write(d + " " + c(x, d));
    }

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

  #region Service classes

  public class Tokenizer
  {
    private readonly TextReader reader;

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

    public int ReadInt()
    {
      var c = SkipWS();
      if (c == -1)
        throw new EndOfStreamException();
      var isNegative = false;
      if (c == '-' || c == '+')
      {
        isNegative = c == '-';
        c = reader.Read();
        if (c == -1)
          throw new EndOfStreamException("Digit expected, but end of stream occurs");
      }

      if (!char.IsDigit((char)c))
        throw new InvalidOperationException($"Digit expected, but was: '{(char)c}'");
      var result = (char)c - '0';
      c = reader.Read();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        if (!char.IsDigit((char)c))
          throw new InvalidOperationException($"Digit expected, but was: '{(char)c}'");
        result = result * 10 + (char)c - '0';
        c = reader.Read();
      }

      if (isNegative)
        result = -result;
      return result;
    }

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

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

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

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

    public (int, int) Read2Int() =>
      (ReadInt(), ReadInt());

    public (int, int, int) Read3Int() =>
      (ReadInt(), ReadInt(), ReadInt());

    public (int, int, int, int) Read4Int() =>
      (ReadInt(), ReadInt(), ReadInt(), ReadInt());

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

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

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

      return sb.ToString();
    }

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

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

  internal class Program
  {
    public static void Main()
    {
      var solver = new ProblemSolver(In);
      solver.Solve();
    }
  }

  #endregion
}


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

namespace TestApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int input = Int32.Parse(Console.ReadLine());
            int remainder = input % 4;

            if (remainder == 0)
            {
                Console.WriteLine("1 A");
            }
            else if(remainder == 1)
            {
                Console.WriteLine("0 A");
            }
            else if(remainder == 2)
            {
                Console.WriteLine("1 B");
            }
            else if(remainder == 3)
            {
                Console.WriteLine("2 A");
            }
        }
    }
}


using System;
class Program
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine()) % 4;
        Console.WriteLine($"{Math.Abs(n - 1)} {(n == 2 ? "B" : "A")}");
    }
}


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

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

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

        private static string Solve(string[] args)
        {
            switch (Next()%4)
            {
                case 0:
                    return "1 A";
                case 1:
                    return "0 A";
                case 2:
                    return "1 B";
                case 3:
                    return "2 A";
            }
            return "";
        }

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


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            if(a%4==1)
            {
                Console.WriteLine("0 A");
            }
            if(a%4==3)
            {
                Console.WriteLine("2 A");
            }
            if(a%4==2)
            {
                Console.WriteLine("1 B");
            }
            if(a%4==0)
            {
                Console.WriteLine("1 A");
            }
        }
    }
}


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

namespace Olimp1
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var number = int.Parse(Console.ReadLine());
            var ostatok = number % 4;

            if (ostatok == 1)
                Console.WriteLine("0 A");

            else if (ostatok == 3)
                Console.WriteLine("2 A");

            else if (ostatok == 2)
                Console.WriteLine("1 B");

            else if (ostatok == 0)
                Console.WriteLine("1 A");

        }
    }
}


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

namespace _571
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetIn(new StreamReader("input.txt"));

            //solve_571C3();

            int[] tests = new int[] {2, 5, 1, 6, 8, 10, 13, 15, 20, 10, 3};

            //size 3 mean 4 elements. Because the counting starts from 0.
            //runPrefSumForEveryIndex(tests, 3);
            //Console.WriteLine();
            //runPrefXorForEveryIndex(tests, 3);
            solve_573A();
        }

        public static void solve_573A()
        {
            int x =  Convert.ToInt32(Console.ReadLine());

            int mod1 = x % 4;
            int mod2 = 0;
            int mod3 = int.MaxValue;
            int count = 0;
            char  l = 'A';

            mod2 = ++x % 4;
            mod3 = ++x % 4;

            if (mod1 == 3)
            {
                mod1 = 2;
            }
            else if (mod1 == 2)
            {
                mod1  = 3;
            }
            else if (mod1 == 0)
            {
                mod1  = 4;
            }

            if (mod2 == 3)
            {
                mod2 = 2;
            }
            else if (mod2 == 2)
            {
                mod2  = 3;
            }
            else if (mod2 == 0)
            {
                mod2  = 4;
            }

            if (mod3 == 3)
            {
                mod3 = 2;
            }
            else if (mod3 == 2)
            {
                mod3  = 3;
            }
            else if (mod3 == 0)
            {
                mod3  = 4;
            }

            int mod = Math.Min(Math.Min(mod1, mod2), mod3);

            if (mod == mod2)
            {
                count = 1;
            }
            else if (mod == mod3)
            {
                count = 2;
            }

            switch(mod)
            {
                case 1:
                    l = 'A';
                break;
                case 2:
                    l = 'B';
                break;
                case 3:
                    l = 'C';
                break;
                case 4:
                    l = 'D';
                break;
            }

            Console.Write("{0} {1}", count, l);
        }

        public static void runPrefSumForEveryIndex(int[] nums, int size) //Func<int[], int, int>  algo)
        {
            for (int i = 0; i < nums.Length - size; i++)
            {
                Console.WriteLine("l={0}, r={1}, sum={2} ", i, size + i, prefixSum(nums, i, size + i));
            }
        }
        public static void runPrefXorForEveryIndex(int[] nums, int size) //Func<int[], int, int>  algo)
        {
            for (int i = 0; i < nums.Length - size; i++)
            {
                Console.WriteLine("l={0}, r={1}, sum={2} ", i, size + i, prefixXor(nums, i, size + i));
            }
        }

        public static int prefixSum(int[] nums, int l, int r)
        {
            int[] prefs = new int[nums.Length];

            prefs[0] = nums[0];
            for (int i = 1; i < nums.Length; i++)
            {
                prefs[i] = prefs[i - 1] + nums[i];
            }

            int res = 0;
            if (l > 0)
            {
                res = prefs[r] - prefs[l - 1];
            }
            else
            {
                res = prefs[r];
            }

            return res;
        }

        public  static int prefixXor(int[] nums, int l, int r)
        {
            int[] prefs = new int[nums.Length];

            prefs[0] = nums[0];

            for (int i = 1; i < nums.Length; i++)
            {
                prefs[i] = prefs[i - 1] ^ nums[i];
            }

            int res = 0;

            if (l > 0)
            {
                res = prefs[r] ^ prefs[l - 1];
            }
            else
            {
                res = prefs[r];
            }

            return res;
        }

        //https://codeforces.com/contest/1186/submission/56222680
        public static void solve_571C3()
        {
            string a = Console.ReadLine();
            string b = Console.ReadLine();

            int[] pref = new int[a.Length + 1];

            pref[0] = 0;

            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] == '1')
                {
                    pref[i + 1] = pref[i] + 1;
                }
                else
                {
                    pref[i + 1] = pref[i];
                }
            }

            int count = 0;

            for (int i = 0; i < b.Length; i++)
            {
                if (b[i] == '1')
                {
                    count++;
                }
            }

            int ans = 0;
            for (int i = 0; i <= a.Length - b.Length; i++)
            {
                int sum = pref[i + b.Length] - pref[i] + count;
                if (sum % 2 == 0)
                {
                    ans++;
                }
            }

            Console.WriteLine(ans);
        }

        //https://codeforces.com/contest/1186/submission/56245924
        public static void solve_571C2()
        {
            string a = Console.ReadLine();
            string b = Console.ReadLine();

            int aone = 0;
            int bone = 0;

            for (int i = 0; i < b.Length; i++)
            {
                if (a[i] == '1')
                {
                    aone++;
                }
                if (b[i] == '1')
                {
                    bone++;
                }
            }

            int ans = 0;

            if (Math.Abs(aone - bone) % 2 == 0)
            {
                ans++;
            }

            for (int i = b.Length; i < a.Length; i++)
            {
                if (a[i] == '1')
                {
                    aone++;
                }

                if (a[i - b.Length] == '1')
                {
                    aone--;
                }

                if (Math.Abs(aone - bone) % 2 == 0)
                {
                    ans++;
                }
            }

            Console.WriteLine(ans);
        }

        public static void solve_571C1()
        {
            string a = Console.ReadLine();
            string b = Console.ReadLine();

            int c1 = 0;
            for (int i = 0; i < b.Length; i++)
            {
                if (b[i] == '1')
                {
                    c1++;
                }
            }

            int sum = 0;

            for (int i = 0; i < b.Length; i++)
            {
                /*
                Here we count the sum of all ons we have in the string.
                Because it is a char type we need to convert it into int to be able
                to sum. But we can avoid conversion of types if we use the char arithmetique
                We can subtract 1 from 0 or 1 from 1 and we  will get either 1 or 0.
                Because the ascii code for 1 is 49 and ascii code for 0 is 48.
                49 - 48 = 1 (if 1 - 0)
                49 - 49 = 0 (if 1 - 1)
                */
                sum += b[i] - '0';
            }

            int ans = (sum + c1) % 2 == 0 ? 1 : 0;

            for (int i = b.Length; i < a.Length; i++)
            {
                /*
                So in the loop above we counted how many Ones we have in the string b.
                Now we just count how many Ones we have in the string a and add the number to the same
                counter Sum.
                */
                sum += a[i] - '0';

                sum -= a[i - b.Length] - '0';
                ans += (sum + c1) % 2 == 0 ? 1 : 0;
            }

            Console.WriteLine(ans);

        }

        //http://codeforces.com/contest/1186/submission/56199529
        public static void solve_571C()
        {
            string a = Console.ReadLine();
            string b = Console.ReadLine();

        }

        public static void solve_571A()
        {
            string[] nmk = Console.ReadLine().Split(' ');

            int n = Convert.ToInt32(nmk[0]);
            int m = Convert.ToInt32(nmk[1]);
            int k = Convert.ToInt32(nmk[2]);

            string answer = "YES";

            if (m < n || k < n)
            {
                answer = "NO";
            }

            Console.WriteLine(answer);
        }
    }
}


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

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();

			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			//var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();

			int x = int.Parse(input1);
			switch (x % 4)
			{
				case 1:
					Console.WriteLine("0 A");
					return;
				case 3:
					Console.WriteLine("2 A");
					return;
				case 2:
					Console.WriteLine("1 B");
					return;
				default:
					Console.WriteLine("1 A");
					return;
			}
		}

		public class Node
		{
			public int Count { get; set; }

			public int FirstIndex { get; set; } = -1;

			public int LastIndex { get; set; } = -1;
		}

		//public class Node<T>
		//{
		//	public Node<T> Left { get; set; }

		//	public Node<T> Right { get; set; }

		//	public T Value { get; set; }

		//	public Node(T value)
		//	{
		//		Value = value;
		//	}
		//}

		//public class Tree<T>
		//{
		//	public Node<T> Root { get; set; }

		//	public Tree(T value)
		//	{
		//		Root = new Node<T>(value);
		//	}
		//}

		private static long GCD(long a, long b)
		{
			long max = Math.Max(a, b);
			long min = Math.Min(a, b);

			if (min == 0)
			{
				return max;
			}

			a = min;
			b = max % min;
			return GCD(a, b);
		}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}


/*
csc -debug A.cs && mono --debug A.exe <<< "33"
*/

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

public class HelloWorld : Helpers {
    public static void SolveCodeForces() {
        var n = cin.NextInt();

        var best = 'E';
        var besti = -1;
        for (var v = 0; v <= 2; v++) {
            if (Category(v + n) < best) {
                besti = v;
                best = Category(v + n);
            }
        }

        System.Console.WriteLine("{0} {1}", besti, best);
    }

    static char Category(int n) {
        var d = n % 4;
        return (new []{'D', 'A', 'C', 'B'})[d];
    }

    static Scanner cin = new Scanner();
    static StringBuilder cout = new StringBuilder();

    static public void Main () {
        SolveCodeForces();
        // IncreaseStack(SolveCodeForces);
        // System.Console.Write(cout.ToString());
    }

    public static void IncreaseStack(ThreadStart action, int stackSize = 128000000)
    {
        var thread = new Thread(action, stackSize);
        thread.Start();
        thread.Join();
    }
}

public class Helpers {
    public static string Show<T>(IEnumerable<T> arr) {
        return string.Join(" ", arr);
    }

    public static void Swap<T>(ref T a, ref T b) {
        var tmp = a;
        a = b;
        b = tmp;
    }

    public static T[] CreateArray<T>(int length, Func<int, T> itemCreate) {
        var result = new T[length];
        for (var i = 0; i < result.Length; i++)
            result[i] = itemCreate(i);
        return result;
    }
}

public class Scanner
{
    private string[] line = new string[0];
    private int index = 0;

    public string Next() {
        if (line.Length <= index) {
            line = Console.ReadLine().Split(' ');
            index = 0;
        }
        var res = line[index];
        index++;
        return res;
    }

    public int NextInt() {
        return int.Parse(Next());
    }

    public long NextLong() {
        return long.Parse(Next());
    }

    public ulong NextUlong() {
        return ulong.Parse(Next());
    }

    public string[] Array() {
        line = Console.ReadLine().Split(' ');
        index = line.Length;
        return line;
    }

    public int[] IntArray(int emptyPrefixLen = 0) {
        var array = Array();
        var result = new int[emptyPrefixLen + array.Length];
        for (int i = 0; i < array.Length; i++)
            result[emptyPrefixLen + i] = int.Parse(array[i]);
        return result;
    }

    public long[] LongArray() {
        var array = Array();
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = long.Parse(array[i]);
        return result;
    }

    public ulong[] UlongArray() {
        var array = Array();
        var result = new ulong[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = ulong.Parse(array[i]);
        return result;
    }
}


using System;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int a = n;
            char l = ' ', ln = ' ';
            if (n % 4 == 1)
                Console.WriteLine("0 A");
            else
            {
                switch (n % 4)
                {
                    case 0: l = 'D'; break;
                    case 2: l = 'C'; break;
                    case 3: l = 'B'; break;
                }
                for (int i = 1; i < 4; i++)
                {
                    a++;
                    switch (a % 4)
                    {
                        case 0: ln = 'D';break;
                        case 1: ln = 'A'; break;
                        case 2:ln = 'C';break;
                        case 3:ln = 'B';break;
                    }
                    if (ln < l)
                        break;
                }
                Console.WriteLine((a - n) + " " + ln.ToString());
            }
        }
    }
}


using System;

namespace Task_01
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine()) % 4;
            switch (n)
            {
                case 0: Console.WriteLine("1 A"); break;
                case 1: Console.WriteLine("0 A"); break;
                case 2: Console.WriteLine("1 B"); break;
                case 3: Console.WriteLine("2 A"); break;
            }
        }
    }
}


using System;
using CompLib.Util;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        char b = 'Z';
        int a = -1;
        string s = "DACB";
        for (int i = 0; i <= 2; i++)
        {
            int tb = (n + i) % 4;
            if (s[tb] < b)
            {
                a = i;
                b = s[tb];
            }
        }
Console.WriteLine($"{a} {b}");
    }

    public static void Main(string[] args) => new Program().Solve();
}

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

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

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

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


using System;

class Program
{
    static void Main()
    {
        int x = int.Parse(Console.ReadLine());
        char[] s = { 'D', 'A', 'C', 'B' };
        int n = x / 4;
        int k = x % 4;
        int a = 0;
        switch (k)
        {
            case 0:
                a = 1;
                break;
            case 2:
                a = 1;
                break;
            case 3:
                a = 2;
                break;
        }

        Console.WriteLine($"{a} {s[(x + a) % 4]}");
    }
}


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

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            if (n % 4 == 1) Console.WriteLine(0 + " A");
            else if (n % 4 == 2) Console.WriteLine(1 + " B");
            else if (n % 4 == 3) Console.WriteLine(2 + " A");
            else if (n % 4 == 0) Console.WriteLine(1 + " A");
        }
    }
}


using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            char[] c = new char[] { 'D', 'A', 'C', 'B' };
            int[] w = new int[] { 0, 3, 1, 2 };

            int mx = 0;
            int idx = 0;
            int v = 0;
            for (int i = 0; i < 3; ++i)
            {
                if(mx < w[(n + i) % 4])
                {
                    mx = w[(n + i) % 4];
                    idx = (n + i) % 4;
                    v = n + i;
                }
            }

            Console.WriteLine(Math.Abs(n - v) + " " + c[idx]);
        }
    }
}


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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int hp = n % 4;
            if (hp == 0) Console.WriteLine(1 + " A");
            else if (hp == 1) Console.WriteLine(0 + " A");
            else if (hp == 2) Console.WriteLine(1 + " B");
            else Console.WriteLine(2 + " A");
        }
    }
}


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

namespace ConsoleApplication1
{
    class A1191_TokitsukazeAndEnhancement
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            char ch = 'x';
            int t = n % 4;
            switch(n % 4)
            {
                case 0: ch = 'A';
                        t = 1;
                    break;
                case 1: ch = 'A';
                        t = 0;
                    break;
                case 2: ch = 'B';
                        t = 1;
                    break;
                default: ch = 'A';
                         t = 2;
                    break;
            }

            Console.WriteLine("{0} {1}",t,ch);
        }
    }
}


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)
        {
            var x = int.Parse(Console.ReadLine());
            for (int i = 0; i < 3; i++)
                if ((x + i) % 4 == 1)
                {
                    Console.WriteLine("{0} A", i);
                    return;
                }

            for (int i = 0; i < 3; i++)
                if ((x + i) % 4 == 3)
                {
                    Console.WriteLine("{0} B", i);
                    return;
                }
            for (int i = 0; i < 3; i++)
                if ((x + i) % 4 == 2)
                {
                    Console.WriteLine("{0} C", i);
                    return;
                }

            for (int i = 0; i < 3; i++)
                if ((x + i) % 4 == 0)
                {
                    Console.WriteLine("{0} D", i);
                    return;
                }
        }
    }
}


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

namespace ConsoleApp37
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());
            int rem = x % 4;
            if (rem == 1)
                Console.WriteLine("0 A");
            if (rem == 2)
                Console.WriteLine("1 B");
            if (rem == 3)
                Console.WriteLine("2 A");
            if (rem==0)
                Console.WriteLine("1 A");
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using static System.Console;
using static System.Convert;
using static System.Math;
//using Debug;
//using static System.Globalization.CultureInfo;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
        //WriteLine(Solve());
    }
    static void Solve()
    {
        var num = Input.num;
        var str = new[] { "A", "A", "B", "A" };
        var a = new[] { 1, 0, 1, 2 };
        WriteLine($"{a[num%4]} {str[num % 4]}");
    }
}

public class Input
{
    public static string read => ReadLine().Trim();
    public static int[] ar => read.Split(' ').Select(int.Parse).ToArray();
    public static int num => ToInt32(read);
    public static long[] arL => read.Split(' ').Select(long.Parse).ToArray();
    public static long numL => ToInt64(read);
    public static T[] create<T>(int n, Func<int, T> f)
        => Enumerable.Repeat(0, n).Select(f).ToArray();
    public static char[][] gred(int h)
        => create(h, _ => read.ToCharArray());
    public static int[] ar1D(int n)
        => create(n, _ => num);
    public static long[] arL1D(int n)
        => create(n, _ => numL);
    public static string[] strs(int n)
        => create(n, _ => read);
    public static int[][] ar2D(int n)
        => create(n, _ => ar);
    public static long[][] arL2D(int n)
        => create(n, _ => arL);
    public static List<T>[] edge<T>(int n)
        => create(n, _ => new List<T>());
    public static T GetValue<T>(string g)
    {
        var t = typeof(T);
        if (t == typeof(int))
            return (T)(object)int.Parse(g);
        if (t == typeof(long))
            return (T)(object)long.Parse(g);
        if (t == typeof(string))
            return (T)(object)g;
        if (t == typeof(char))
            return (T)(object)char.Parse(g);
        if (t == typeof(double))
            return (T)(object)double.Parse(g);
        if (t == typeof(bool))
            return (T)(object)bool.Parse(g);
        return default(T);
    }
    public static void Make<T1, T2>(out T1 v1, out T2 v2)
    {
        v1 = Next<T1>();
        v2 = Next<T2>();
    }
    public static void Make<T1, T2, T3>(out T1 v1, out T2 v2, out T3 v3)
    {
        Make(out v1, out v2);
        v3 = Next<T3>();
    }
    public static void Make<T1, T2, T3, T4>(out T1 v1, out T2 v2, out T3 v3, out T4 v4)
    {
        Make(out v1, out v2, out v3);
        v4 = Next<T4>();
    }
    public static void Make<T1, T2, T3, T4, T5>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5)
    {
        Make(out v1, out v2, out v3, out v4);
        v5 = Next<T5>();
    }
    public static void Make<T1, T2, T3, T4, T5, T6>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6)
    {
        Make(out v1, out v2, out v3, out v4, out v5);
        v6 = Next<T6>();
    }
    private static Queue<string> sc = new Queue<string>();
    public static T Next<T>(){ if (sc.Count == 0) foreach (var item in read.Split(' ')) sc.Enqueue(item);return GetValue<T>(sc.Dequeue()); }
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public const int MOD = 1000000007;
}


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

namespace algorithms_700_01
{
    class Program
    {
        static void Main()
        {
            var healthPoints = int.Parse(Console.ReadLine());
            if (healthPoints % 4 == 1)
                Console.WriteLine("0 A");
            else if (healthPoints % 4 == 2)
                Console.WriteLine("1 B");
            else if (healthPoints % 4 == 3)
                Console.WriteLine("2 A");
            else if (healthPoints % 4 == 0)
                Console.WriteLine("1 A");
        }
    }
}


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

class Test
{
	static long gcd(long a, long b)
	{

		if (b > a)
		{
			long temp = a;
			a = b;
			b = temp;
		}

		while (true)
		{
			a = a%b;
			long temp = a;
			a = b;
			b = temp;

			if (b == 0)
				return a;
		}

	}

	static void Main(string[] args)
	{
		long[] tokens = Console.Readline().Split(' ').Select(x => long.Parse(x)).ToArray();
		long lcm = token[0]*token[1] / gcd(token[0], token[1]);

		long diff = (lcm/tokens[0]) - (lcm / tokens[1]);

		if (diff == 1 || diff == -1)
			Console.WriteLine("Equal");
		else if (diff > 0)
			Console.WriteLine("Dasha");
		else if (diff < 0)
			Console.WriteLine("Masha");
	}

}


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

class Main
{
    static long gcd(long a, long b)
    {

        if (b > a)
        {
            long temp = a;
            a = b;
            b = temp;
        }

        while (true)
        {
            a = a%b;
            long temp = a;
            a = b;
            b = temp;

            if (b == 0)
                return a;
        }

    }

    static void Main(string[] args)
    {
        long[] tokens = Console.Readline().Split(' ').Select(x => long.Parse(x)).ToArray();
        long lcm = token[0]*token[1] / gcd(token[0], token[1]);

        long diff = (lcm/tokens[0]) - (lcm / tokens[1]);

        if (diff == 1 || diff == -1)
            Console.WriteLine("Equal");
        else if (diff > 0)
            Console.WriteLine("Dasha");
        else if (diff < 0)
            Console.WriteLine("Masha");
    }

}


using System;

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

            string s = Console.ReadLine();
            Console.WriteLine(Fun(s));

        }

        static public string Fun(string s)
        {
            int a, b;
            string da = "Dasha"; int d = 0;
            string ma = "Masha"; int m = 0;
            string eq = "Equal"; int e = 0;
            string[] arr = s.Split(' ');
            a = Convert.ToInt32(arr[0]);
            b = Convert.ToInt32(arr[1]);
            int per = nok(a, b);
            if (a < b) return ma ;
            else if (b < a) return da;

        }
        static public int nok(int a, int b)
        {
            return (a / nod(a, b)) * b;
        }
        static public int nod(int a, int b)
        {
            if (a != 0) return nod(b % a, a);
            else return b;
        }
    }
}


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

class Test
{
    static long gcd(long a, long b)
    {

        if (b > a)
        {
            long temp = a;
            a = b;
            b = temp;
        }

        while (true)
        {
            a = a%b;
            long temp = a;
            a = b;
            b = temp;

            if (b == 0)
                return a;
        }

    }

    static void Main(string[] args)
    {
        long[] tokens = Console.Readline().Split(' ').Select(x => long.Parse(x)).ToArray();
        long lcm = token[0]*token[1] / gcd(token[0], token[1]);

        long diff = (lcm/tokens[0]) - (lcm / tokens[1]);

        if (diff == 1 || diff == -1)
            Console.WriteLine("Equal");
        else if (diff > 0)
            Console.WriteLine("Dasha");
        else if (diff < 0)
            Console.WriteLine("Masha");
    }

}


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

class Test
{
	static long gcd(long a, long b)
	{

		if (b > a)
		{
			long temp = a;
			a = b;
			b = temp;
		}

		while (true)
		{
			a = a%b;
			long temp = a;
			a = b;
			b = temp;

			if (b == 0)
				return a;
		}

	}

	static void Main(string[] args)
	{
		long[] tokens = Console.Readline().Split(' ').Select(x => long.Parse(x)).ToArray();
		long lcm = token[0]*token[1] / gcd(token[0], token[1]);

		long diff = (lcm/tokens[0]) - (lcm / tokens[1]);

		if (diff == 1 || diff == -1)
			Console.WriteLine("Equal");
		else if (diff > 0)
			Console.WriteLine("Dasha");
		else if (diff < 0)
			Console.WriteLine("Masha");
	}

}


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

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

        private static void Main(string[] args)
        {
            int a = Next();
            int b = Next();

            long lcm = Lcm(a, b);

            long ca = (lcm - 1)/a;
            long cb = (lcm - 1)/b;

            if (b > a)
                cb++;
            else ca++;

            if (ca == cb)
                writer.WriteLine("Equal");
            else if (ca > cb)
                writer.WriteLine("Dasha");
            else
                writer.WriteLine("Masha");

            writer.Flush();
        }

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

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

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

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

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


using System;

namespace Task3 {
    internal class Program {
        private static void Main(string[] args) {
            string s = Console.ReadLine();
            string[] ss = s.Split(' ');
            long a = int.Parse(ss[0]);
            long b = int.Parse(ss[1]);
            long t = GetLCM(a, b);
            string s1 = "Dasha";
            string s2 = "Masha";
            if (a < b) {
                string temp = s1;
                s1 = s2;
                s2 = temp;
                long tt = a;
                a = b;
                b = tt;
            }
            long first = 0;
            long previous = 0;
            long next = a;
            while (next <= t) {
                long k = (next/b)*b;
                first += k - previous;

                previous = next;
                next = next + a;
            }
            first -= b;
            long second = t - first;
            if (first < second) Console.WriteLine(s1);
            else if (second < first) Console.WriteLine(s2);
            else Console.WriteLine("Equal");
        }

        public static long GetLCM(long a, long b) {
            return Math.Abs(a*b)/GetGCD(a, b);
        }

        public static long GetGCD(long a, long b) {
            while (a != 0 && b != 0) {
                if (a >= b) a = a%b;
                else b = b%a;
            }
            return a + b;
        }
    }
}


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

namespace C
{
    class Program
    {
        static long GCD(long a, long b)
        {
            while (a != b)
            {
                if (a > b) a -= b;
                else b -= a;
            }
            return a;
        }
        static void Main(string[] args)
        {
            string[] t = Console.ReadLine().Split(' ');
            long a = long.Parse(t[0]);
            long b = long.Parse(t[1]);
            long LCM = (a * b) / GCD(a, b);
            long aLength = LCM / a;
            long bLength = LCM / b;
            long cur = 0;
            long curA = a;
            long curB = b;
            long Dasha = 0;
            long Masha = 0;
            while (cur < LCM)
            {
                if (curA < curB)
                {
                    Dasha += (curA - cur);
                    cur = curA;
                    curA += a;
                    continue;
                }
                if (curB < curA)
                {
                    Masha += (curB - cur);
                    cur = curB;
                    curB += b;
                    continue;
                }
                if (curB == curA)
                {
                    if (a < b)
                        Masha += (curB - cur);
                    if (a > b)
                        Dasha += (curB - cur);
                    cur = curA;
                    curA += a;
                    curB += b;
                }
            }
            if (Masha < Dasha) Console.WriteLine("Dasha");
            else if (Dasha < Masha) Console.WriteLine("Masha");
            else Console.WriteLine("Equal");
        }
    }
}


using System;

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

            string s = Console.ReadLine();
            Console.WriteLine(Fun(s));

        }

        static public string Fun(string s)
        {
            int a, b;
            string da = "Dasha";
            string ma = "Masha";
            string eq = "Equal";
            string[] arr = s.Split(' ');
            a = Convert.ToInt32(arr[0]);
            b = Convert.ToInt32(arr[1]);
            int per = nod(a, b);
            a /= per;
            b /= per;

            if (a - b == 1 || b - a == 1) return eq;
            else if (b < a) return ma;
            else return da;

        }
        static public int nod(int a, int b)
        {
            if (a != 0) return nod(b % a, a);
            else return b;
        }
    }
}


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

namespace T
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int m = Convert.ToInt32(s[0]);
            int n = Convert.ToInt32(s[1]);
            if (m % Math.Abs(n - m) == 0 && n % Math.Abs(n - m) == 0)
            {
                Console.WriteLine("Equal");
            }
            else
            {
                if (m < n)
                {
                    Console.WriteLine("Dasha");
                }
                else
                {
                    Console.WriteLine("Masha");
                }
            }
        }
    }
}


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

class ProblemC
{
    static long GCD(long a, long b)
    {
        if (b > a)
        {
            long temp = a;
            a = b;
            b = temp;
        }
        while (true)
        {
            a = a % b;
            long temp = a;
            a = b;
            b = temp;
            if (b == 0)
                return a;
        }
    }

    static void Main(string[] args)
    {
        long[] tokens = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        long lcm = tokens[0] * tokens[1] / GCD(tokens[0], tokens[1]);
        long diff = (lcm / tokens[0]) - (lcm / tokens[1]);
        if (diff == 1 || diff == -1)
            Console.WriteLine("Equal");
        else if (diff > 0)
            Console.WriteLine("Dasha");
        else if (diff < 0)
            Console.WriteLine("Masha");
    }
}


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

namespace ProgrammingContest.Codeforces.Round73
{
    class C
    {
        static int gcd(int n, int r) { return r == 0 ? n : gcd(r, n % r); }
        static void Main()
        {
            var xs = Array.ConvertAll(Console.ReadLine().Split(' '), sss => int.Parse(sss));
            int a = xs[0],
                b = xs[1],
                g = gcd(a,b);
            a /= g; b /= g;
            if (Math.Abs(a - b) == 1)
                Console.WriteLine("Equal");
            else
                Console.WriteLine(a<b?"Dasha":"Masha");
        }
    }
}


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

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ab = Console.ReadLine().Split(' ');
            Int64 a = Convert.ToInt64(ab[0]);
            Int64 b = Convert.ToInt64(ab[1]);
            Int64 g = gcd(a, b);
            a /= g;
            b /= g;
            if (a < b - 1) Console.Write("Dasha");
            else if (b < a - 1) Console.Write("Masha");
            else Console.Write("Equal");
        }

        static System.Int64 gcd(System.Int64 a, System.Int64 b)
        {
            if (b == 0) return a;
            else return gcd(b, a % b);
        }
    }
}


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

    namespace Codeforces
    {
        class TaskA
        {
            static void Main()
            {
                var input = Console.ReadLine().Trim().Split(' ');
                var a = Int32.Parse(input[0]);
                var b = Int32.Parse(input[1]);

                var max = Math.Max(a, b);
                var min = Math.Min(a, b);

                long lenMax = 0;
                long nok = (long)a*b;
                for (long i = 1; i <= min; i++)
                {
                    var q = (max * i) % min;
                    if (q == 0)
                    {
                        lenMax += min;
                        nok = i * max;
                    }
                    else
                        lenMax += q;
                }
                if(lenMax*2 == nok)
                    Console.WriteLine("Equal");
                else if (lenMax * 2 < nok)
                {
                    if (max == b)
                        Console.WriteLine("Dasha");
                    else
                        Console.WriteLine("Masha");
                }
                else
                {
                    if (max == a)
                        Console.WriteLine("Dasha");
                    else
                        Console.WriteLine("Masha");
                }

            }
        }
    }


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

namespace Codeforces
{
    class TaskA
    {
        static void Main()
        {
            var input = Console.ReadLine().Trim().Split(' ');
            var a = Int32.Parse(input[0]);
            var b = Int32.Parse(input[1]);

            var max = Math.Max(a, b);
            var min = Math.Min(a, b);

            long lenMax = 0;
            long nok = (long)a*b;
            for (long i = 1; i <= min; i++)
            {
                var q = (max * i) % min;
                if (q == 0)
                {
                    lenMax += min;
                    nok = i * max;
                }
                else
                    lenMax += q;
            }
            if(lenMax*2 == nok)
                Console.WriteLine("Equal");
            else if (lenMax * 2 < nok)
            {
                if (max == b)
                    Console.WriteLine("Dasha");
                else
                    Console.WriteLine("Masha");
            }
            else
            {
                if (max == a)
                    Console.WriteLine("Dasha");
                else
                    Console.WriteLine("Masha");
            }

        }
    }
}


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

class Program
{

    void solve()
    {
        long[] f = new long[] { nextLong(), nextLong() };
        long[] cur = (long[])f.Clone();
        long[] t = new long[2];
        long prev = 0;
        while (true)
        {
            int min;
            if (cur[0] < cur[1])
                min = 0;
            else if (cur[0] > cur[1])
                min = 1;
            else
            {
                if (t[0] < t[1])
                {
                    min = 0;
                }
                else
                    min = 1;
            }
            long add = cur[min] - prev;
            t[min] += add;
            prev = cur[min];
            if (cur[0] == cur[1])
                break;
            cur[min] += f[min];
        }
        if (t[0] > t[1])
            println("Dasha");
        else if (t[0] <t[1])
            println("Masha");
        else
            println("Equal");

    }

    ////////////
    private void println(int[] ar)
    {
        for (int i = 0; i < ar.Length; i++)
        {
            if (i == ar.Length - 1)
                println(ar[i]);
            else
                print(ar[i] + " ");
        }
    }
    private void println(int[] ar, bool add)
    {
        int A = 0;
        if (add)
            A++;
        for (int i = 0; i < ar.Length; i++)
        {
            if (i == ar.Length - 1)
                println(ar[i] + A);
            else
                print((ar[i] + A) + " ");
        }
    }

    private void println(string Stringst)
    {
        Console.WriteLine(Stringst);
    }
    private void println(char charnum)
    {
        Console.WriteLine(charnum);
    }
    private void println(int Intnum)
    {
        Console.WriteLine(Intnum);
    }
    private void println(long Longnum)
    {
        Console.WriteLine(Longnum);
    }
    private void println(double Doublenum)
    {
        string s = Doublenum.ToString(CultureInfo.InvariantCulture);
        Console.WriteLine(s);
    }

    private void print(string Stringst)
    {
        Console.Write(Stringst);
    }
    private void print(int Intnum)
    {
        Console.Write(Intnum);
    }
    private void print(char charnum)
    {
        Console.Write(charnum);
    }
    private void print(long Longnum)
    {
        Console.Write(Longnum);
    }
    private void print(double Doublenum)
    {
        Console.Write(Doublenum);
    }

    string[] inputLine = new string[0];
    int inputInd = 0;
    string nextLine()
    {
        return Console.ReadLine();
    }
    void readInput()
    {
        if (inputInd != inputLine.Length)
            throw new Exception();
        inputInd = 0;
        inputLine = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        if (inputLine.Length == 0)
            readInput();

    }
    int nextInt()
    {
        return int.Parse(nextString());
    }
    long nextLong()
    {
        return long.Parse(nextString());
    }
    double nextDouble()
    {
        return double.Parse(nextString());
    }
    string nextString()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return inputLine[inputInd++];
    }
    static void Main(string[] args)
    {
        Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        new Program().solve();
    }
}


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

namespace Contest.C
{
    class Program
    {
        /////////////////////

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

        public static List<T> ReadList<T>(char[] delimiters = null)
        {
            var line = Read<string>();
            var split = line.Split(delimiters ?? new[] { ' ' });
            var list = split.Select(item => (T)Convert.ChangeType(item, typeof(T))).ToList();
            return list;
        }

        ///////////////////////////////////

        static void Swap<T>(ref T lhs, ref T rhs)
        {
            T temp;
            temp = lhs;
            lhs = rhs;
            rhs = temp;
        }

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

        static void Main(string[] args)
        {
            try
            {
                List<int> readList = ReadList<int>();
                long a = readList[0];
                long b = readList[1];
                long n = (a/Gcd(a, b))*b;
                bool i = a > b;
                long x = 0, y = 0;
                if (i) Swap(ref a, ref b);

                long m = n / b;
                for (int j = 1; j <= m; j++)
                {
                    if (j != m)
                    {
                        long r = b * j;
                        long ri = r % a;
                        x += r - ri - b*(j - 1);
                        y += ri;
                    }
                    else
                    {
                        x += (n - a) - b*(j - 1);
                        y += a;
                    }
                }

                if (x == y)
                    Console.WriteLine("Equal");
                else if (x > y && !i)
                    Console.WriteLine("Dasha");
                else
                    Console.WriteLine("Masha");
            }
            catch
            {
                Console.Write("ERROR");
            }
        }
    }
}


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

class Solver
{
    public void Solve()
    {
        var ss = CF.ReadLine().Split(' ');
        int a = int.Parse(ss[0]);
        int b = int.Parse(ss[1]);

        int gcd = _gcd(a, b);
        a /= gcd;
        b /= gcd;
        if (a > b + 1)
            CF.WriteLine("Masha");
        else if (b > a + 1)
            CF.WriteLine("Dasha");
        else
            CF.WriteLine("Equal");

    }

    int _gcd(int a, int b)
    {
        int max = Math.Max(a, b);
        int min = Math.Min(a, b);
        for (; ; )
        {
            int tmp = max % min;
            if (tmp == 0)
                return min;

            max = min;
            min = tmp;
        }
    }

    //  test
    static Utils CF = new Utils(new[]{
@"
3 7
",

@"
5 3
",
@"
2 3
"

    });
    #region test

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

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

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

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

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

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

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

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

        string[] _test_input;

        List<string> _lines;

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

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

    }

    #endregion
}


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

namespace c1cs
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            Int64 a = Int64.Parse(s[0]);
            Int64 b = Int64.Parse(s[1]);
            Int64 d = 0;
            Int64 m = 0;
            Int64 lp = 0;
            Int64 dp = 0;
            Int64 mp = 0;
            while (dp < a * b)
            {
                if (dp + a < mp + b)
                {
                    dp += a;
                    d += dp - lp;
                    lp = dp;
                    continue;
                }

                if (mp + b < dp + a)
                {
                    mp += b;
                    m += mp - lp;
                    lp = mp;
                    continue;
                }

                dp += a;
                mp += b;

                if (a < b) m += mp - lp;
                else d += dp - lp;

                lp = dp;
            }
            if (d > m) Console.WriteLine("Dasha");
            if (m > d) Console.WriteLine("Masha");
            if (d == m) Console.WriteLine("Equal");
        }
    }
}


using System;

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

            string s = Console.ReadLine();
            Console.WriteLine(Fun(s));

        }

        static public string Fun(string s)
        {
            int a, b;
            string da = "Dasha"; int d = 0;
            string ma = "Masha"; int m = 0;
            string eq = "Equal"; int e = 0;
            string[] arr = s.Split(' ');
            a = Convert.ToInt32(arr[0]);
            b = Convert.ToInt32(arr[1]);
            int per = nok(a, b);
            if (a < b) return ma;
            else if (b < a) return da;
            else return eq;

        }
        static public int nok(int a, int b)
        {
            return (a / nod(a, b)) * b;
        }
        static public int nod(int a, int b)
        {
            if (a != 0) return nod(b % a, a);
            else return b;
        }
    }
}


using System;

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

            string s = Console.ReadLine();
            Console.WriteLine(Fun(s));

        }

        static public string Fun(string s)
        {
            int a, b;
            string da = "Dasha"; int d = 0;
            string ma = "Masha"; int m = 0;
            string eq = "Equal"; int e = 0;
            string[] arr = s.Split(' ');
            a = Convert.ToInt32(arr[0]);
            b = Convert.ToInt32(arr[1]);
            int per = nok(a, b);
            if (a < b) return da;
            else if (b < a) return ma;
            else return eq;

        }
        static public int nok(int a, int b)
        {
            return (a / nod(a, b)) * b;
        }
        static public int nod(int a, int b)
        {
            if (a != 0) return nod(b % a, a);
            else return b;
        }
    }
}


using System;

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

            string s = Console.ReadLine();
            Console.WriteLine(Fun(s));

        }

        static public string Fun(string s)
        {
            int a, b;
            string da = "Dasha"; int d = 0;
            string ma = "Masha"; int m = 0;
            string eq = "Equal"; int e = 0;
            string[] arr = s.Split(' ');
            a = Convert.ToInt32(arr[0]); int ta = 0;
            b = Convert.ToInt32(arr[1]); int tb = 0;
            int per = nok(a, b);
            for (int i = 1; i <= per; i++)
            {
                if (a < b)
                {
                    if (i <= a) { d++; a += a; }
                    else if (i <= b) { m++;b += b; }
                }
                else if (a > b)
                {
                    if (i <= b) { d++; b += b;}
                    else if (i <= a) { m++;a += a; }
                }
                else if (a == b) return eq;
            }
            if (m < d) return da;
            else return ma;
        }
        static public int nok(int a, int b)
        {
            return (a / nod(a, b)) * b;
        }
        static public int nod(int a, int b)
        {
            if (a != 0) return nod(b % a, a);
            else return b;
        }
    }
}


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

namespace ProgrammingContest.Codeforces.Round73
{
    class C
    {
        static void Main()
        {
            var xs = Array.ConvertAll(Console.ReadLine().Split(' '), sss => int.Parse(sss));
            int a = xs[0],
                b = xs[1];
            if (Math.Abs(a - b) == 1)
                Console.WriteLine("Equal");
            else
                Console.WriteLine(a<b?"Dasha":"Masha");
        }
    }
}


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

namespace C
{
    class Program
    {
        static long GCD(long a, long b)
        {
            while (a != b)
            {
                if (a > b) a -= b;
                else b -= a;
            }
            return a;
        }
        static void Main(string[] args)
        {
            string[] t = Console.ReadLine().Split(' ');
            long a = long.Parse(t[0]);
            long b = long.Parse(t[1]);
            long LCM = (a * b) / GCD(a, b);
            long aLength = LCM / a;
            long bLength = LCM / b;
            long cur = 0;
            long curA = 0;
            long curB = 0;
            long Dasha = 0;
            long Masha = 0;
            while (cur < LCM)
            {
                if (curA < curB)
                {
                    Dasha += (curA - cur - 1);
                    cur = curA;
                    curA += a;
                }
                if (curB < curA)
                {
                    Masha += (curB - cur - 1);
                    cur = curB;
                    curB += a;
                }
                if (curB == curA)
                {
                    if (a > b)
                        Masha += (curB - cur - 1);
                    if (a < b)
                        Dasha += (curB - cur - 1);
                    cur = curA;
                    curA += a;
                    curB += b;
                }
            }
            if (Masha < Dasha) Console.WriteLine("Dasha");
            else if (Dasha < Masha) Console.WriteLine("Masha");
            else Console.WriteLine("Equal");
        }
    }
}


using System;

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

            string s = Console.ReadLine();
            Console.WriteLine(Fun(s));

        }

        static public string Fun(string s)
        {
            int a, b;
            string da = "Dasha"; int d = 0;
            string ma = "Masha"; int m = 0;
            string eq = "Equal"; int e = 0;
            string[] arr = s.Split(' ');
            a = Convert.ToInt32(arr[0]); int ta = 0;
            b = Convert.ToInt32(arr[1]); int tb = 0;
            int per = nok(a, b);
            for (int i = 1; i <= per; i++)
            {
                if (a < b)
                {
                    if (i <= a) { d++; }
                    else if (i <= b) { m++; }
                    else { a += a; b += b; }
                }
                else if (a > b)
                {
                    if (i <= b) { d++; }
                    else if (i <= a) { m++; }
                    else { a += a; b += b; }
                }
                else if (a == b) return eq;
            }
            if (m < d) return da;
            else return ma;
        }
        static public int nok(int a, int b)
        {
            return (a / nod(a, b)) * b;
        }

        static public int nod(int a, int b)
        {
            if (a != 0) return nod(b % a, a);
            else return b;
        }
    }

}


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

namespace Contest.C
{
    class Program
    {
        /////////////////////

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

        public static List<T> ReadList<T>(char[] delimiters = null)
        {
            var line = Read<string>();
            var split = line.Split(delimiters ?? new[] { ' ' });
            var list = split.Select(item => (T)Convert.ChangeType(item, typeof(T))).ToList();
            return list;
        }

        ///////////////////////////////////

        static void Swap<T>(ref T lhs, ref T rhs)
        {
            T temp;
            temp = lhs;
            lhs = rhs;
            rhs = temp;
        }

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

        static void Main(string[] args)
        {
            try
            {
                List<int> readList = ReadList<int>();
                int a = readList[0];
                int b = readList[1];
                int n = (a/Gcd(a, b))*b;
                bool i = a > b;
                int x = 0, y = 0;
                if (i) Swap(ref a, ref b);

                int m = n / b;
                for (int j = 1; j <= m; j++)
                {
                    if (j != m)
                    {
                        int r = b*j;
                        int ri = r%a;
                        x += r - ri - b*(j - 1);
                        y += ri;
                    }
                    else
                    {
                        x += (n - a) - b*(j - 1);
                        y += a;
                    }
                }

                if (x == y)
                    Console.WriteLine("Equal");
                else if (x > y && !i)
                    Console.WriteLine("Dasha");
                else
                    Console.WriteLine("Masha");
            }
            catch
            {
                Console.Write("ERROR");
            }
        }
    }
}


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

namespace c1cs
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            Int64 a = Int64.Parse(s[0]);
            Int64 b = Int64.Parse(s[1]);
            Int64 d = 0;
            Int64 m = 0;
            Int64 lp = 0;
            Int64 dp = 0;
            Int64 mp = 0;
            while (dp < a * b)
            {
                if (dp + a < mp + b)
                {
                    dp += a;
                    d += dp - lp;
                    lp = dp;
                    continue;
                }

                if (mp + b < dp + a)
                {
                    mp += b;
                    m += mp - lp;
                    lp = mp;
                    continue;
                }

                dp += a;
                mp += b;

                if (a < b) m += mp - lp;
                else d += dp - lp;

                lp = dp;
            }
            if (d > m) Console.WriteLine("Dasha");
            if (m > d) Console.WriteLine("Masha");
            if (d == m) Console.WriteLine("equal");
        }
    }
}


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

namespace C
{
    class Program
    {
        static long GCD(long a, long b)
        {
            while (a != b)
            {
                if (a > b) a -= b;
                else b -= a;
            }
            return a;
        }
        static void Main(string[] args)
        {
            string[] t = Console.ReadLine().Split(' ');
            long a = long.Parse(t[0]);
            long b = long.Parse(t[1]);
            long LCM = (a * b) / GCD(a, b);
            long aLength = LCM / a;
            long bLength = LCM / b;
            long cur = 0;
            long curA = a;
            long curB = b;
            long Dasha = 0;
            long Masha = 0;
            while (cur < LCM)
            {
                if (curA < curB)
                {
                    Dasha += (curA - cur);
                    cur = curA;
                    curA += a;
                    continue;
                }
                if (curB < curA)
                {
                    Masha += (curB - cur);
                    cur = curB;
                    curB += b;
                    continue;
                }
                if (curB == curA)
                {
                    if (a > b)
                        Masha += (curB - cur);
                    if (a < b)
                        Dasha += (curB - cur);
                    cur = curA;
                    curA += a;
                    curB += b;
                }
            }
            if (Masha < Dasha) Console.WriteLine("Dasha");
            else if (Dasha < Masha) Console.WriteLine("Masha");
            else Console.WriteLine("Equal");
        }
    }
}


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

namespace Codeforces
{
    class TaskA
    {
        static void Main()
        {
            var input = Console.ReadLine().Trim().Split(' ');
            var a = Int32.Parse(input[0]);
            var b = Int32.Parse(input[1]);

            var max = Math.Max(a, b);
            var min = Math.Min(a, b);

            long lenMax = 0;
            long nok = a*b;
            for (int i = 1; i <= min; i++)
            {
                var q = (max * i) % min;
                if (q == 0)
                {
                    lenMax += min;
                    nok = i * max;
                }
                else
                    lenMax += q;
            }
            if(lenMax*2 == nok)
                Console.WriteLine("Equal");
            else if (lenMax * 2 < nok)
            {
                if (max == b)
                    Console.WriteLine("Dasha");
                else
                    Console.WriteLine("Masha");
            }
            else
            {
                if (max == a)
                    Console.WriteLine("Dasha");
                else
                    Console.WriteLine("Masha");
            }

        }
    }
}