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

namespace dadada
{
    class Class1
    {
        static void Main(string[] args)
        {
            int B, C;
            B = Convert.ToInt32(Console.ReadLine());
            C = Convert.ToInt32(Console.ReadLine());
            if (B > 0 && C > 0)
            {
                if (B + C < 256)
                {
                    if (B < C)
                        B = C;
                    Console.WriteLine(B);
                    if (B < 256)
                        Console.WriteLine(256 - B);
                    else Console.WriteLine("0");
                }
                else Console.WriteLine("0");
            }
            else Console.WriteLine("Greska");
        }
    }
}