Language: C++

//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

using i8 = ::std::int_least8_t;
using i32 = ::std::int_least32_t;
using i64 = ::std::int_least64_t;
using u8 = ::std::uint_least8_t;
using u32 = ::std::uint_least32_t;
using u64 = ::std::uint_least64_t;
using isize = ::std::ptrdiff_t;
using usize = ::std::size_t;

class rep {
	const usize f, l;

public:
	class itr {
		friend rep;
		usize i;
		itr(usize x) noexcept : i(x) {}

	public:
		void operator++() noexcept { ++i; }
		usize operator*() const noexcept { return i; }
		bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	rep(usize first, usize last) noexcept : f(first), l(last) {}
	itr begin() const noexcept { return itr(f); }
	itr end() const noexcept { return itr(l); }
};
class revrep {
	const usize f, l;

public:
	class itr {
		friend revrep;
		usize i;
		itr(usize x) noexcept : i(x) {}

	public:
		void operator++() noexcept { --i; }
		usize operator*() const noexcept { return i; }
		bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	revrep(usize first, usize last) noexcept : f(first), l(last) {}
	itr begin() const noexcept { return itr(l - 1); }
	itr end() const noexcept { return itr(f - 1); }
};
template <class T> bool maxi(T &a, const T &b) {
	return a <= b ? (a = b, 1) : 0;
}
template <class T> bool mini(T &a, const T &b) {
	return b <= a ? (a = b, 1) : 0;
}
template <class T> bool smaxi(T &a, const T &b) {
	return b <= a ? 0 : (a = b, 1);
}
template <class T> bool smini(T &a, const T &b) {
	return a <= b ? 0 : (a = b, 1);
}
template <class T> using vec_alias = ::std::vector<T>;
template <class T> auto md_vec(usize n, const T &value) {
	return ::std::vector<T>(n, value);
}
template <class... Args> auto md_vec(usize n, Args... args) {
	return ::std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> const T &as_const(const T &v) noexcept { return v; }

#include <algorithm>
#include <iostream>
#include <utility>

template <class T> T difference(const T &a, const T &b) {
	return a <= b ? b - a : a - b;
}

class pos {
public:
	u32 x, y, h;
};

u32 is_valid(const pos &p, const pos &c) {
	const u32 dx = difference(p.x, c.x), dy = difference(p.y, c.y);
	if (p.h < dx + dy)
		return !c.h;
	else
		return c.h == p.h - dx - dy;
}

int main() {
	usize n;
	::std::cin >> n;
	::std::vector<pos> a(n);
	for (auto &e : a)
		::std::cin >> e.x >> e.y >> e.h;
	::std::sort(a.begin(),a.end(),
		[](const pos &l,const pos &r){
		return l.h > r.h;});

	for (const auto x : rep(0, 101)) {
		for (const auto y : rep(0, 101)) {
			const pos p = {
				x,
				y,
				a[0].h + difference(a[0].x,x) + difference(a[0].y,y)
			};
			if (::std::all_of(a.cbegin(), a.cend(),
				[p](const pos &c) {return is_valid(p, c);}))
				return ::std::cout << p.x << " " << p.y << " "
				<< p.h << ::std::endl, 0;
		}
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:108:52: error: no matching function for call to 'difference(u32&, const long unsigned int&)'
  108 |                                 a[0].h + difference(a[0].x,x) + difference(a[0].y,y)
      |                                          ~~~~~~~~~~^~~~~~~~~~
a.cc:76:22: note: candidate: 'template<class T> T difference(const T&, const T&)'
   76 | template <class T> T difference(const T &a, const T &b) {
      |                      ^~~~~~~~~~
a.cc:76:22: note:   template argument deduction/substitution failed:
a.cc:108:52: note:   deduced conflicting types for parameter 'const T' ('unsigned int' and 'long unsigned int')
  108 |                                 a[0].h + difference(a[0].x,x) + difference(a[0].y,y)
      |                                          ~~~~~~~~~~^~~~~~~~~~
a.cc:108:75: error: no matching function for call to 'difference(u32&, const long unsigned int&)'
  108 |                                 a[0].h + difference(a[0].x,x) + difference(a[0].y,y)
      |                                                                 ~~~~~~~~~~^~~~~~~~~~
a.cc:76:22: note: candidate: 'template<class T> T difference(const T&, const T&)'
   76 | template <class T> T difference(const T &a, const T &b) {
      |                      ^~~~~~~~~~
a.cc:76:22: note:   template argument deduction/substitution failed:
a.cc:108:75: note:   deduced conflicting types for parameter 'const T' ('unsigned int' and 'long unsigned int')
  108 |                                 a[0].h + difference(a[0].x,x) + difference(a[0].y,y)
      |                                                                 ~~~~~~~~~~^~~~~~~~~~