One day Vasya decided to have a look at the results of Berland 1910 Football Championship’s finals. Unfortunately he didn't find the overall score of the match; however, he got hold of a profound description of the match's process. On the whole there are n lines in that description each of which described one goal. Every goal was marked with the name of the team that had scored it. Help Vasya, learn the name of the team that won the finals. It is guaranteed that the match did not end in a tie.

Input

The first line contains an integer n (1 ≤ n ≤ 100) — the number of lines in the description. Then follow n lines — for each goal the names of the teams that scored it. The names are non-empty lines consisting of uppercase Latin letters whose lengths do not exceed 10 symbols. It is guaranteed that the match did not end in a tie and the description contains no more than two different teams.

Output

Print the name of the winning team. We remind you that in football the team that scores more goals is considered the winner.

Examples

Input

1
ABC


Output

ABC


Input

5
A
ABA
ABA
A
A


Output

A
#include <bits/stdc++.h>
using namespace std;
bool files = true;
bool testing = false;
template <class T>
void prAr(T ar[], int len) {
  cout << "Printing array:"
       << "\n";
  for (int i = 0; i < len; i++) {
    cout << *(ar + i) << "\n";
  }
}
template <class T>
void prV(vector<T> v) {
  cout << "Printing vector:"
       << "\n";
  for (T i : v) {
    cout << i << "\n";
  }
}
template <class T>
void pr2V(vector<vector<T>> v) {
  cout << "Printing vector:"
       << "\n";
  for (vector<T> x : v) {
    for (int i = 0; i < x.size(); i++) {
      cout << x[i] << " ";
    }
    cout << "\n";
  }
}
template <class T>
vector<T> duplicates(vector<T> v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  return v;
}
template <class T>
bool isIn(T x, vector<T> v) {
  return find(v.begin(), v.end(), x) != v.end();
}
template <class T>
long long binSearch(vector<T> v, T x) {
  long long min = 0, max = (long long)(v.size() - 1);
  if (min == max) {
    if (x == v[min]) {
      return min;
    } else {
      return -1;
    }
  }
  long long mid = (min + max) / 2;
  T test;
  while (max - min != 1) {
    test = v[mid];
    if (test > x) {
      max = mid;
    } else if (test < x) {
      min = mid;
    } else {
      return mid;
    }
    mid = (min + max) / 2;
  }
  if (v[max] == x) {
    return max;
  }
  if (v[min] == x) {
    return min;
  }
  return -1;
}
template <class T>
vector<long long> binSearchApprox(vector<T> v, T x) {
  long long min = 0, max = (long long)(v.size() - 1);
  if (min == max) {
    if (x == v[min]) {
      return {min};
    } else {
      return {min, max};
    }
  }
  long long mid = (min + max) / 2;
  T test;
  while (max - min != 1) {
    test = v[mid];
    if (test > x) {
      max = mid;
    } else if (test < x) {
      min = mid;
    } else {
      return {mid};
    }
    mid = (min + max) / 2;
  }
  if (v[max] == x) {
    return {max};
  }
  if (v[min] == x) {
    return {min};
  }
  return {min, max};
}
template <class T>
vector<long long> findSubSum(vector<T> v, long long k, bool max) {
  vector<long long> ans;
  if (k > v.size()) {
    ans.push_back(-1);
    ans.push_back(-1);
    return ans;
  }
  long long sum = 0;
  long long optSum;
  long long optInd = 0;
  for (int i = 0; i < k; i++) {
    sum += v[i];
  }
  optSum = sum;
  for (int i = 1; i < v.size() - k + 1; i++) {
    sum -= v[i - 1];
    sum += v[i + k - 1];
    if (max) {
      if (sum > optSum) {
        optSum = sum;
        optInd = i;
      }
    } else {
      if (sum < optSum) {
        optSum = sum;
        optInd = i;
      }
    }
  }
  ans.push_back(optInd);
  ans.push_back(optSum);
  return ans;
}
template <class T>
vector<long long> binSearchInRange(vector<T> v, T a, T b) {
  if (v[0] > b || v[v.size() - 1] < a) {
    return {};
  }
  long long min, max;
  vector<long long> searchA = binSearchApprox(v, a),
                    searchB = binSearchApprox(v, b);
  if (searchA.size() == 1) {
    min = searchA[0];
  } else {
    if (v[searchA[0]] < a) {
      min = searchA[1];
    } else {
      min = searchA[0];
    }
  }
  if (searchB.size() == 1) {
    max = searchB[0];
  } else {
    if (v[searchB[1]] > b) {
      max = searchB[0];
    } else {
      max = searchB[1];
    }
  }
  vector<long long> ans(v.begin() + min, v.begin() + max + 1);
  return ans;
}
template <class T>
vector<T> mSMerge(vector<T> a, vector<T> b) {
  vector<T> ans;
  while (a.size() != 0 && b.size() != 0) {
    if (a[0] < b[0]) {
      ans.push_back(a[0]);
      a.erase(a.begin());
    } else {
      ans.push_back(b[0]);
      b.erase(b.begin());
    }
  }
  if (a.size() > 0) {
    for (int i = 0; i < a.size(); i++) {
      ans.push_back(a[i]);
    }
  } else if (b.size() > 0) {
    for (int i = 0; i < b.size(); i++) {
      ans.push_back(b[i]);
    }
  }
  return ans;
}
template <class T>
vector<vector<T>> mSStep(vector<vector<T>> v) {
  vector<vector<T>> ans;
  long long n = v.size();
  if (n == 1) {
    return v;
  }
  long long half = n / 2;
  for (int i = 0; i < half; i++) {
    ans.push_back(mSMerge(v[2 * i], v[2 * i + 1]));
  }
  if (n % 2 == 1) {
    vector<T> a = ans[ans.size() - 1];
    ans.pop_back();
    ans.push_back(mSMerge(a, v[n - 1]));
  }
  return ans;
}
template <class T>
vector<T> mergeSort(vector<T> v) {
  vector<vector<T>> temp;
  for (int i = 0; i < v.size(); i++) {
    temp.push_back({v[i]});
  }
  while (temp.size() != 1) {
    temp = mSStep(temp);
  }
  return temp[0];
}
long long toBin(long long n) {
  long long ans = 0, r;
  long long i = 0;
  while (n != 0) {
    r = n % 2;
    ans += (long long)r * pow(10, i);
    n = (n - r) / 2;
    i++;
  }
  return ans;
}
int binDigs(long long n) {
  if (n == 1) {
    return 1;
  }
  int ans = 0;
  long long temp = 1;
  while (temp <= n) {
    temp *= 2;
    ans++;
  }
  return ans;
}
int fromBin(int n) {
  int ans = 0, r;
  int i = 0;
  while (n != 0) {
    r = n % 2;
    ans += (int)r * pow(2, i);
    n = (n - r) / 10;
    i++;
  }
  return ans;
}
int ones(long long n) {
  int ans = 0;
  for (int i = 0; i < 32; i++) {
    if (n & (1 << i)) {
      ans++;
    }
  }
  return ans;
}
int lZeros(int n) {
  if (n == 0) {
    return 32;
  }
  int ans = 0;
  int i = 31;
  while (!(n & (1 << i))) {
    ans++;
    i--;
  }
  return ans;
}
int tZeros(int n) {
  if (n == 0) {
    return 32;
  }
  int ans = 0;
  int i = 0;
  while (!(n & (1 << i))) {
    ans++;
    i++;
  }
  return ans;
}
vector<int> digits(long long n) {
  vector<int> ans;
  if (n == 0) {
    ans = {0};
    return ans;
  }
  int len = (int)log10(n) + 1;
  int r;
  for (int i = 0; i < len; i++) {
    r = n % 10;
    ans.push_back(r);
    n = (n - r) / 10;
  }
  reverse(ans.begin(), ans.end());
  return ans;
}
long long fromDigits(vector<int> v) {
  reverse(v.begin(), v.end());
  long long ans = 0;
  for (int i = 0; i < v.size(); i++) {
    ans += v[i] * (long long)pow(10, i);
  }
  return ans;
}
string rnConvertSingle(int n, int e) {
  string ans;
  char one[4] = {'I', 'X', 'C', 'M'};
  char five[3] = {'V', 'L', 'D'};
  switch (n) {
    case 1:
      ans.push_back(one[e]);
      break;
    case 2:
      ans.push_back(one[e]);
      ans.push_back(one[e]);
      break;
    case 3:
      ans.push_back(one[e]);
      ans.push_back(one[e]);
      ans.push_back(one[e]);
      break;
    case 4:
      ans.push_back(one[e]);
      ans.push_back(five[e]);
      break;
    case 5:
      ans.push_back(five[e]);
      break;
    case 6:
      ans.push_back(five[e]);
      ans.push_back(one[e]);
      break;
    case 7:
      ans.push_back(five[e]);
      ans.push_back(one[e]);
      ans.push_back(one[e]);
      break;
    case 8:
      ans.push_back(five[e]);
      ans.push_back(one[e]);
      ans.push_back(one[e]);
      ans.push_back(one[e]);
      break;
    case 9:
      ans.push_back(one[e]);
      ans.push_back(one[e + 1]);
      break;
    case 0:
      ans = "";
      break;
    default:
      break;
  }
  return ans;
}
string rnConvert(int n) {
  vector<int> digs = digits(n);
  string ans;
  for (int i = 0; i < digs.size(); i++) {
    string s = rnConvertSingle(digs[i], (int)digs.size() - 1 - i);
    ans.append(s);
  }
  return ans;
}
bool isPalindrome(string s) {
  string c = s;
  reverse(s.begin(), s.end());
  return c == s;
}
int square(int n) { return (int)pow(n, 2); }
bool between(int x, int a, int b) { return x >= a && x <= b; }
vector<long long> primes(long long n) {
  vector<long long> ans;
  vector<bool> composite;
  composite.resize(n + 1);
  composite[0] = composite[1] = true;
  long long lim = sqrt(n) + 1;
  long long mult;
  long long i = 2;
  while (i < lim) {
    if (!composite[i]) {
      mult = n / i;
      for (int j = 2; j < mult + 1; j++) {
        composite[j * i] = true;
      }
    }
    i++;
  }
  for (int i = 2; i < n + 1; i++) {
    if (!composite[i]) {
      ans.push_back(i);
    }
  }
  return ans;
}
bool isPrime(long long n) {
  long long lim = (long long)sqrt(n) + 1;
  for (int i = 2; i < lim; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
vector<vector<long long>> factor(long long n) {
  long long orig = n;
  vector<vector<long long>> ans;
  long long temp = 1;
  if (n == 1) {
    return {{1, 1}};
  }
  vector<long long> ps = primes((long long)sqrt(n));
  long long count;
  for (int i = 0; i < ps.size(); i++) {
    if (n % ps[i] == 0) {
      count = 0;
      while (n % ps[i] == 0) {
        n = n / (ps[i]);
        count++;
        temp *= ps[i];
      }
      ans.push_back({ps[i], count});
    }
  }
  if (temp != orig) {
    ans.push_back({orig / temp, 1});
  }
  return ans;
}
int gcd(int a, int b) {
  int big = max(a, b);
  int small = min(a, b);
  while (big * small != 0) {
    big -= (big / small) * small;
    swap(big, small);
  }
  return big;
}
vector<vector<int>> perms(int n) {
  vector<vector<int>> ans;
  vector<int> start;
  for (int j = 0; j < n; j++) {
    start.push_back(j);
  }
  do {
    ans.push_back(start);
  } while (next_permutation(start.begin(), start.end()));
  return ans;
}
vector<vector<int>> combos(int n, int k) {
  vector<vector<int>> ans;
  vector<int> v;
  for (int i = 0; i < n; i++) v.push_back(i);
  if (k == 1) {
    for (int i = 0; i < n; i++) {
      ans.push_back({i});
    }
    return ans;
  }
  if (n == k) {
    ans.push_back(v);
    return ans;
  }
  vector<vector<int>> otherAns = combos(n - 1, k - 1);
  vector<int> temp;
  ans = combos(n - 1, k);
  for (int i = 0; i < otherAns.size(); i++) {
    temp = otherAns[i];
    temp.push_back(n - 1);
    ans.push_back(temp);
  }
  sort(ans.begin(), ans.end());
  return ans;
}
vector<vector<int>> subsets(int n) {
  vector<vector<int>> ans;
  vector<int> subset;
  for (int i = 0; i < (int)pow(2, n); i++) {
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        subset.push_back(j);
      }
    }
    ans.push_back(subset);
    subset.clear();
  }
  return ans;
}
long long fact(int n) {
  long long ar[n + 1];
  ar[0] = 1;
  for (int i = 0; i < n; i++) {
    ar[i + 1] = (i + 1) * ar[i];
  }
  return ar[n];
}
long long nCr(int n, int r) { return fact(n) / (fact(n - r) * fact(r)); }
long long bnCr(int n, int r) {
  long long val[n + 1][n + 1];
  for (int i = 0; i < n + 1; i++) {
    val[i][0] = 1;
    val[i][i] = 1;
  }
  for (int i = 1; i < n + 1; i++) {
    for (int j = 1; j < i; j++) {
      val[i][j] = val[i - 1][j - 1] + val[i - 1][j];
    }
  }
  return val[n][r];
}
long long nPr(int n, int r) { return fact(n) / fact(n - r); }
ifstream in;
ofstream out;
void read() {
  int n;
  cin >> n;
  vector<string> teams;
  vector<int> cts;
  string s;
  int ind;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (isIn(s, teams)) {
      for (int j = 0; j < teams.size(); j++) {
        if (teams[j] == s) {
          ind = j;
        }
      }
      cts[ind]++;
    } else {
      teams.push_back(s);
      cts.push_back(1);
    }
  }
  int mx = 0;
  int mxInd = 0;
  for (int i = 0; i < cts.size(); i++) {
    if (cts[i] > mx) {
      mx = cts[i];
      mxInd = i;
    }
  }
  cout << teams[mxInd] << "\n";
}
int main() {
  if (files) {
    if (testing) {
      in.open("input");
      out.open("output");
    } else {
      in.open("input.txt");
      out.open("output.txt");
    }
  }
  read();
  string s = "abcdabcdabcdabcd";
  out.close();
  in.close();
  return 0;
}
