using System; class K { static int[] Read() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse); static (int, int, int) Read3() { var a = Read(); return (a[0], a[1], a[2]); } static void Main() => Console.WriteLine(Solve()); static object Solve() { var (y, n, d) = Read3(); var min = Math.Max(0, n - d); var max = Math.Min(n, 365 - d); return $"{min} {max}"; } }