Problem: Dasha decided to have a rest after solving the problem. She had been ready to start her favourite activity — origami, but remembered the puzzle that she could not solve. 

<image>

The tree is a non-oriented connected graph without cycles. In particular, there always are n - 1 edges in a tree with n vertices.

The puzzle is to position the vertices at the points of the Cartesian plane with integral coordinates, so that the segments between the vertices connected by edges are parallel to the coordinate axes. Also, the intersection of segments is allowed only at their ends. Distinct vertices should be placed at different points. 

Help Dasha to find any suitable way to position the tree vertices on the plane.

It is guaranteed that if it is possible to position the tree vertices on the plane without violating the condition which is given above, then you can do it by using points with integral coordinates which don't exceed 1018 in absolute value.

Input

The first line contains single integer n (1 ≤ n ≤ 30) — the number of vertices in the tree. 

Each of next n - 1 lines contains two integers ui, vi (1 ≤ ui, vi ≤ n) that mean that the i-th edge of the tree connects vertices ui and vi.

It is guaranteed that the described graph is a tree.

Output

If the puzzle doesn't have a solution then in the only line print "NO".

Otherwise, the first line should contain "YES". The next n lines should contain the pair of integers xi, yi (|xi|, |yi| ≤ 1018) — the coordinates of the point which corresponds to the i-th vertex of the tree.

If there are several solutions, print any of them. 

Examples

Input

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

Output

YES
0 0
1 0
0 1
2 0
1 -1
-1 1
0 2

Input

6
1 2
2 3
2 4
2 5
2 6


Output

NO


Input

4
1 2
2 3
3 4

Output

YES
3 3
4 3
5 3
6 3

Note

In the first sample one of the possible positions of tree is: <image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
vector<long long> ed[35];
vector<pair<long long, long long> > cld[35];
long long par[35], tot_cn[35];
long long dir[4][4] = {{0, 1, 2, 3}, {1, 0, 3, 2}, {2, 0, 3, 1}, {3, 2, 1, 0}};
pair<long long, long long> an[35];
long long go_deep(long long nd, long long pr, long long lv) {
  par[nd] = pr;
  long long i, z, x, cn = lv;
  z = ed[nd].size();
  for (i = 0; i <= z - 1; i++) {
    if (ed[nd][i] == pr) continue;
    x = go_deep(ed[nd][i], nd, lv + 1);
    cld[nd].push_back(make_pair(x, ed[nd][i]));
    cn = max(cn, x);
  }
  sort(cld[nd].begin(), cld[nd].end());
  reverse(cld[nd].begin(), cld[nd].end());
  return tot_cn[nd] = cn;
}
void set_ans(long long nd, long long val, long long ori, long long pr) {
  if (ori == 0 || ori == 3) {
    an[nd].first = an[pr].first;
  } else
    an[nd].second = an[pr].second;
  if (ori == 0)
    an[nd].second = an[pr].second - val;
  else if (ori == 3)
    an[nd].second = an[pr].second + val;
  else if (ori == 1)
    an[nd].first = an[pr].first + val;
  else if (ori == 2)
    an[nd].first = an[pr].first - val;
}
long long go_and_do_shit(long long nd, long long val, long long ori,
                         long long pr) {
  long long i, z, x;
  z = cld[nd].size();
  if (val) {
    set_ans(nd, val, ori, pr);
  } else if (z == 0) {
    an[nd].first = an[nd].second = 0;
    return 3;
  }
  for (i = 0; i <= z - 1; i++) {
    long long nvl = val / 3;
    x = go_and_do_shit(cld[nd][i].second, nvl, dir[ori][i], nd);
    if (!val) {
      val = x;
      an[nd].first = 0;
      an[nd].second = an[cld[nd][i].second].second + val / 3;
    }
  }
  return val * 3;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, j, x, y, n, m, cnt = 0, k, g, flg, t, a, b;
  cin >> n;
  for (i = 1; i <= n - 1; i++) {
    cin >> x >> y;
    ed[x].push_back(y);
    ed[y].push_back(x);
  }
  for (i = 1; i <= n; i++) {
    if (ed[i].size() > 4) {
      cout << "NO" << endl;
      return 0;
    }
  }
  go_deep(1, 1, 0);
  go_and_do_shit(1, 0, 0, 1);
  cout << "YES" << endl;
  for (i = 1; i <= n; i++) {
    cout << an[i].first << " " << an[i].second << endl;
  }
}