#include <bits/stdc++.h>
using iii = int;
using yeee = iii;
const iii DEBUG = -1;
using namespace std;
using namespace chrono;
template <typename T1>
void DOUTf(ostringstream &os, int names_i, vector<string> &names, T1 &&val) {
  os << names[names_i] << " = " << val;
}
template <typename T1, typename... Ts>
void DOUTf(ostringstream &os, int names_i, vector<string> &names, T1 &&val,
           Ts &&...vals) {
  os << names[names_i] << " = " << val << " | ";
  DOUTf(os, names_i + 1, names, vals...);
}
template <typename... Ts>
string DOUTg(string names, Ts &&...vals) {
  string special = "()[]{}<>'\"\\";
  vector<string> vnames;
  vnames.push_back("");
  vector<char> stak;
  for (char c : names) {
    bool inside_string =
        !stak.empty() && (stak.back() == '\'' || stak.back() == '\"');
    if (c == '\n') c = ' ';
    if (c == ' ' && (vnames.back().empty() ||
                     (!inside_string && vnames.back().back() == ' ')))
      continue;
    if (stak.empty() && c == ',') {
      if (!vnames.back().empty() && vnames.back().back() == ' ')
        vnames.back().pop_back();
      vnames.push_back("");
      continue;
    }
    vnames.back().push_back(c);
    if (!stak.empty() && stak.back() == '\\') {
      stak.pop_back();
      continue;
    }
    size_t p = special.find(c);
    bool closing = p < 8 && p % 2;
    if (p == string::npos) continue;
    if (p == special.size() - 1) {
      stak.push_back(c);
      continue;
    }
    if (stak.empty()) {
      if (!closing) stak.push_back(c);
      continue;
    }
    if (inside_string) {
      if (c == stak.back()) stak.pop_back();
      continue;
    }
    if (closing) {
      if (stak.back() == special[p - 1]) stak.pop_back();
      continue;
    }
    stak.push_back(c);
  }
  ostringstream os;
  DOUTf(os, 0, vnames, vals...);
  return os.str();
}
template <template <typename...> class Container, typename T, size_t DIMENSION>
struct MultiDimensional {
  using internal = MultiDimensional<Container, T, DIMENSION - 1>;
  using type = Container<typename internal::type>;
  template <typename... Args>
  static type Generate(T def, const size_t size, Args... sizes) {
    return type(size, internal::Generate(def, sizes...));
  }
};
template <template <typename...> class Container, typename T>
struct MultiDimensional<Container, T, 1> {
  using internal = T;
  using type = Container<T>;
  static type Generate(T def, const size_t size) { return type(size, def); }
};
template <typename T, typename... Args>
auto make_vector(T def, Args... sizes) ->
    typename MultiDimensional<std::vector, T, sizeof...(sizes)>::type {
  return MultiDimensional<std::vector, T, sizeof...(sizes)>::Generate(def,
                                                                      sizes...);
}
template <typename T>
T get() {
  T x;
  cin >> x;
  return x;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &cont) {
  out << "(" << cont.first << ", " << cont.second << ")";
  return out;
}
template <typename T, typename Alloc>
ostream &operator<<(ostream &out, const vector<T, Alloc> &cont) {
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : " ") << *it;
  return out;
}
template <typename T, typename Alloc>
ostream &operator<<(ostream &out, const deque<T, Alloc> &cont) {
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : " ") << *it;
  return out;
}
template <typename T, typename Compare, typename Alloc>
ostream &operator<<(ostream &out, const set<T, Compare, Alloc> &cont) {
  out << "{";
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : ", ") << *it;
  out << "}";
  return out;
}
template <typename T, typename Compare, typename Alloc>
ostream &operator<<(ostream &out, const multiset<T, Compare, Alloc> &cont) {
  out << "{";
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : ", ") << *it;
  out << "}";
  return out;
}
template <typename Key, typename T, typename Compare, typename Alloc>
ostream &operator<<(ostream &out, const map<Key, T, Compare, Alloc> &cont) {
  out << "{";
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : ", ") << it->first << ":" << it->second;
  out << "}";
  return out;
}
template <typename Key, typename T, typename Compare, typename Alloc>
ostream &operator<<(ostream &out,
                    const multimap<Key, T, Compare, Alloc> &cont) {
  out << "{";
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : ", ") << it->first << ":" << it->second;
  out << "}";
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, vector<vector<T>> cont) {
  for (auto it = cont.begin(); it != cont.end(); ++it) out << *it << "\n";
  return out;
}
using ll = long long;
using lll = long long;
using ull = unsigned long long;
using ld = long double;
using pll = pair<ll, ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vpll = vector<pll>;
using point = complex<ll>;
ld get_time() {
  return ld(duration_cast<nanoseconds>(
                high_resolution_clock::now().time_since_epoch())
                .count()) /
         1e9;
}
ll sign(ld x) { return (x > 0) - (x < 0); }
ll fmod(ll x, ll mod) {
  if (!mod) return x;
  if (abs(x) >= mod) x %= mod;
  if (x < 0) x += mod;
  return x;
}
ll pow(ll x, ll exp, ll mod) {
  ll res = 1, y = x;
  while (exp) {
    if (!mod) {
      if (exp & 1) res = res * y;
      y = y * y;
    } else {
      if (exp & 1) res = fmod(res * y, mod);
      y = fmod(y * y, mod);
    }
    exp >>= 1;
  }
  return res;
}
ld START_TIME = get_time();
mt19937_64 rand_mt64(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rand_mt(chrono::steady_clock::now().time_since_epoch().count());
const long long INFll = ll(1.1e18) - 1;
const int INFi = ll(1.1e9) - 1;
ll INF = sizeof(ll) == sizeof(int) ? ll(INFi) : ll(INFll);
char newl = '\n';
void main_init(bool fast_cio = true, string input_file = "",
               string output_file = "", pair<int, int> file_mask = {1, 1}) {
  srand(unsigned(time(0)));
  if (fast_cio) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  }
  if (input_file != "" && file_mask.first & (1 << (DEBUG < 0)))
    freopen(input_file.c_str(), "r", stdin);
  if (output_file != "" && file_mask.second & (1 << (DEBUG < 0)))
    freopen(output_file.c_str(), "w", stdout);
}
vll dfs(ll curr, ll prev, vvll &E) {
  bool leaf = true;
  bool zero = true;
  vll res = {0, 0, 0, 0};
  for (ll nex : E[curr]) {
    if (nex == prev) continue;
    vll r = dfs(nex, curr, E);
    res[0] |= r[1];
    res[1] |= r[0];
    res[2] += r[2] + 1 - r[3];
    if (zero && r[3]) {
      res[2]++;
      zero = false;
    }
    leaf = false;
  }
  if (leaf) {
    res[0] = 1;
    res[3] = 1;
  }
  return res;
}
yeee main() {
  main_init();
  ll N;
  cin >> N;
  vvll E(N);
  for (ll i = ll(0); i < ll(N - 1); ++i) {
    ll a, b;
    cin >> a >> b;
    --a, --b;
    E[a].push_back(b);
    E[b].push_back(a);
  }
  vll res = {0, 1, 1, 0};
  for (ll i = ll(0); i < ll(N); ++i) {
    if (ll((E[i]).size()) > 1) {
      res = dfs(i, -1, E);
      break;
    }
  }
  cout << (res[0] && res[1] ? 3 : 1) << " " << res[2] << endl;
}

### Prompt

Your task is to create a Cpp solution to the following problem:

You have unweighted tree of n vertices. You have to assign a positive weight to each edge so that the following condition would hold:

  * For every two different leaves v_{1} and v_{2} of this tree, [bitwise XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) of weights of all edges on the simple path between v_{1} and v_{2} has to be equal to 0. 



Note that you can put very large positive integers (like 10^{(10^{10})}).

It's guaranteed that such assignment always exists under given constraints. Now let's define f as the number of distinct weights in assignment.

<image> In this example, assignment is valid, because bitwise XOR of all edge weights between every pair of leaves is 0. f value is 2 here, because there are 2 distinct edge weights(4 and 5).

<image> In this example, assignment is invalid, because bitwise XOR of all edge weights between vertex 1 and vertex 6 (3, 4, 5, 4) is not 0. 

What are the minimum and the maximum possible values of f for the given tree? Find and print both.

Input

The first line contains integer n (3 ≤ n ≤ 10^{5}) — the number of vertices in given tree.

The i-th of the next n-1 lines contains two integers a_{i} and b_{i} (1 ≤ a_{i} < b_{i} ≤ n) — it means there is an edge between a_{i} and b_{i}. It is guaranteed that given graph forms tree of n vertices.

Output

Print two integers — the minimum and maximum possible value of f can be made from valid assignment of given tree. Note that it's always possible to make an assignment under given constraints.

Examples

Input


6
1 3
2 3
3 4
4 5
5 6


Output


1 4


Input


6
1 3
2 3
3 4
4 5
4 6


Output


3 3


Input


7
1 2
2 7
3 4
4 7
5 6
6 7


Output


1 6

Note

In the first example, possible assignments for each minimum and maximum are described in picture below. Of course, there are multiple possible assignments for each minimum and maximum. 

<image>

In the second example, possible assignments for each minimum and maximum are described in picture below. The f value of valid assignment of this tree is always 3. 

<image>

In the third example, possible assignments for each minimum and maximum are described in picture below. Of course, there are multiple possible assignments for each minimum and maximum. 

<image>

### Response

```cpp
#include <bits/stdc++.h>
using iii = int;
using yeee = iii;
const iii DEBUG = -1;
using namespace std;
using namespace chrono;
template <typename T1>
void DOUTf(ostringstream &os, int names_i, vector<string> &names, T1 &&val) {
  os << names[names_i] << " = " << val;
}
template <typename T1, typename... Ts>
void DOUTf(ostringstream &os, int names_i, vector<string> &names, T1 &&val,
           Ts &&...vals) {
  os << names[names_i] << " = " << val << " | ";
  DOUTf(os, names_i + 1, names, vals...);
}
template <typename... Ts>
string DOUTg(string names, Ts &&...vals) {
  string special = "()[]{}<>'\"\\";
  vector<string> vnames;
  vnames.push_back("");
  vector<char> stak;
  for (char c : names) {
    bool inside_string =
        !stak.empty() && (stak.back() == '\'' || stak.back() == '\"');
    if (c == '\n') c = ' ';
    if (c == ' ' && (vnames.back().empty() ||
                     (!inside_string && vnames.back().back() == ' ')))
      continue;
    if (stak.empty() && c == ',') {
      if (!vnames.back().empty() && vnames.back().back() == ' ')
        vnames.back().pop_back();
      vnames.push_back("");
      continue;
    }
    vnames.back().push_back(c);
    if (!stak.empty() && stak.back() == '\\') {
      stak.pop_back();
      continue;
    }
    size_t p = special.find(c);
    bool closing = p < 8 && p % 2;
    if (p == string::npos) continue;
    if (p == special.size() - 1) {
      stak.push_back(c);
      continue;
    }
    if (stak.empty()) {
      if (!closing) stak.push_back(c);
      continue;
    }
    if (inside_string) {
      if (c == stak.back()) stak.pop_back();
      continue;
    }
    if (closing) {
      if (stak.back() == special[p - 1]) stak.pop_back();
      continue;
    }
    stak.push_back(c);
  }
  ostringstream os;
  DOUTf(os, 0, vnames, vals...);
  return os.str();
}
template <template <typename...> class Container, typename T, size_t DIMENSION>
struct MultiDimensional {
  using internal = MultiDimensional<Container, T, DIMENSION - 1>;
  using type = Container<typename internal::type>;
  template <typename... Args>
  static type Generate(T def, const size_t size, Args... sizes) {
    return type(size, internal::Generate(def, sizes...));
  }
};
template <template <typename...> class Container, typename T>
struct MultiDimensional<Container, T, 1> {
  using internal = T;
  using type = Container<T>;
  static type Generate(T def, const size_t size) { return type(size, def); }
};
template <typename T, typename... Args>
auto make_vector(T def, Args... sizes) ->
    typename MultiDimensional<std::vector, T, sizeof...(sizes)>::type {
  return MultiDimensional<std::vector, T, sizeof...(sizes)>::Generate(def,
                                                                      sizes...);
}
template <typename T>
T get() {
  T x;
  cin >> x;
  return x;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &cont) {
  out << "(" << cont.first << ", " << cont.second << ")";
  return out;
}
template <typename T, typename Alloc>
ostream &operator<<(ostream &out, const vector<T, Alloc> &cont) {
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : " ") << *it;
  return out;
}
template <typename T, typename Alloc>
ostream &operator<<(ostream &out, const deque<T, Alloc> &cont) {
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : " ") << *it;
  return out;
}
template <typename T, typename Compare, typename Alloc>
ostream &operator<<(ostream &out, const set<T, Compare, Alloc> &cont) {
  out << "{";
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : ", ") << *it;
  out << "}";
  return out;
}
template <typename T, typename Compare, typename Alloc>
ostream &operator<<(ostream &out, const multiset<T, Compare, Alloc> &cont) {
  out << "{";
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : ", ") << *it;
  out << "}";
  return out;
}
template <typename Key, typename T, typename Compare, typename Alloc>
ostream &operator<<(ostream &out, const map<Key, T, Compare, Alloc> &cont) {
  out << "{";
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : ", ") << it->first << ":" << it->second;
  out << "}";
  return out;
}
template <typename Key, typename T, typename Compare, typename Alloc>
ostream &operator<<(ostream &out,
                    const multimap<Key, T, Compare, Alloc> &cont) {
  out << "{";
  for (auto it = cont.begin(); it != cont.end(); ++it)
    out << (it == cont.begin() ? "" : ", ") << it->first << ":" << it->second;
  out << "}";
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, vector<vector<T>> cont) {
  for (auto it = cont.begin(); it != cont.end(); ++it) out << *it << "\n";
  return out;
}
using ll = long long;
using lll = long long;
using ull = unsigned long long;
using ld = long double;
using pll = pair<ll, ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vpll = vector<pll>;
using point = complex<ll>;
ld get_time() {
  return ld(duration_cast<nanoseconds>(
                high_resolution_clock::now().time_since_epoch())
                .count()) /
         1e9;
}
ll sign(ld x) { return (x > 0) - (x < 0); }
ll fmod(ll x, ll mod) {
  if (!mod) return x;
  if (abs(x) >= mod) x %= mod;
  if (x < 0) x += mod;
  return x;
}
ll pow(ll x, ll exp, ll mod) {
  ll res = 1, y = x;
  while (exp) {
    if (!mod) {
      if (exp & 1) res = res * y;
      y = y * y;
    } else {
      if (exp & 1) res = fmod(res * y, mod);
      y = fmod(y * y, mod);
    }
    exp >>= 1;
  }
  return res;
}
ld START_TIME = get_time();
mt19937_64 rand_mt64(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rand_mt(chrono::steady_clock::now().time_since_epoch().count());
const long long INFll = ll(1.1e18) - 1;
const int INFi = ll(1.1e9) - 1;
ll INF = sizeof(ll) == sizeof(int) ? ll(INFi) : ll(INFll);
char newl = '\n';
void main_init(bool fast_cio = true, string input_file = "",
               string output_file = "", pair<int, int> file_mask = {1, 1}) {
  srand(unsigned(time(0)));
  if (fast_cio) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  }
  if (input_file != "" && file_mask.first & (1 << (DEBUG < 0)))
    freopen(input_file.c_str(), "r", stdin);
  if (output_file != "" && file_mask.second & (1 << (DEBUG < 0)))
    freopen(output_file.c_str(), "w", stdout);
}
vll dfs(ll curr, ll prev, vvll &E) {
  bool leaf = true;
  bool zero = true;
  vll res = {0, 0, 0, 0};
  for (ll nex : E[curr]) {
    if (nex == prev) continue;
    vll r = dfs(nex, curr, E);
    res[0] |= r[1];
    res[1] |= r[0];
    res[2] += r[2] + 1 - r[3];
    if (zero && r[3]) {
      res[2]++;
      zero = false;
    }
    leaf = false;
  }
  if (leaf) {
    res[0] = 1;
    res[3] = 1;
  }
  return res;
}
yeee main() {
  main_init();
  ll N;
  cin >> N;
  vvll E(N);
  for (ll i = ll(0); i < ll(N - 1); ++i) {
    ll a, b;
    cin >> a >> b;
    --a, --b;
    E[a].push_back(b);
    E[b].push_back(a);
  }
  vll res = {0, 1, 1, 0};
  for (ll i = ll(0); i < ll(N); ++i) {
    if (ll((E[i]).size()) > 1) {
      res = dfs(i, -1, E);
      break;
    }
  }
  cout << (res[0] && res[1] ? 3 : 1) << " " << res[2] << endl;
}

```