#include <iostream>
#include <vector>
#include <algorithm>
struct Character {
int attack;
int defense;
int power;
Character(int atk, int def) : attack(atk), defense(def) {
power = attack * attack + defense * defense;
}
};
bool comparePower(const Character &a, const Character &b) {
return a.power > b.power;
}
int main() {
int n;
std::cin >> n;
std::vector<Character> characters;
for (int i = 0; i < n; ++i) {
int attack, defense;
std::cin >> attack >> defense;
characters.emplace_back(attack, defense);
}
std::sort(characters.begin(), characters.end(), comparePower);
std::cout << characters[1].attack << " " << characters[1].defense << std::endl;
return 0;
}