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

namespace AtCoder.C
{
    public class Program
    {
        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var N = ReadLong();
            var x = new long[N];
            var y = new long[N];
            var h = new long[N];
            var inputs = new List<Input>();
            for (int i = 0; i < N; i++)
            {
                (x[i], y[i], h[i]) = Read3Longs();
                inputs.Add(new Input
                {
                    x = x[i],
                    y = y[i],
                    h = h[i],
                });
            }

            inputs = inputs.OrderByDescending(a => a.h).ToList();

            for (int C_x = 0; C_x <= 100; C_x++)
            {
                for (int C_y = 0; C_y <= 100; C_y++)
                {
                    var ansH = GetH(inputs, C_x, C_y);
                    if (ansH != 0) return $"{C_x} {C_y} {ansH}";
                }
            }

            return null;
        }

        private static long GetH(List<Input> inputs, int C_x, int C_y)
        {
            var H = -1L;
            foreach (var item in inputs)
            {
                if (item.h != 0)
                {
                    if (H == -1)
                    {
                        H = item.h + Math.Abs(item.x - C_x) + Math.Abs(item.y - C_y);
                    }
                    else
                    {
                        // 異なる高さになる場合は次の候補に
                        if (H != item.h + Math.Abs(item.x - C_x) + Math.Abs(item.y - C_y))
                        {
                            return 0;
                        }
                    }
                }
                else
                {
                    // Max関数が破綻している場合はNG
                    if (H - Math.Abs(item.x - C_x) - Math.Abs(item.y - C_y) > 0)
                    {
                        return 0;
                    }
                }
            }

            return H;
        }

        class Input
        {
            public long x { get; set; }
            public long y { get; set; }
            public long h { get; set; }
        }
        #region Console.Read

        public static string ReadText() { return Console.ReadLine(); }
        public static List<string> ReadTexts() { return Console.ReadLine().Split(' ').ToList(); }
        public static long ReadLong() { return long.Parse(Console.ReadLine()); }
        public static (long, long) Read2Longs() { var ls = ReadLongs(); return (ls[0], ls[1]); }
        public static (long, long, long) Read3Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2]); }
        public static (long, long, long, long) Read4Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3]); }
        public static (long, long, long, long, long) Read5Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3], ls[4]); }
        public static List<long> ReadLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }

        #endregion
    }
}


Measured memory_bytes: 27856