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 JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.math.*;

public class Sss {

    InputStream is;
    PrintWriter out;
    
    class pair{
        long x,y;
        pair(long x1,long y1){
            x=x1;
            y=y1;
        }
    }
    
    ArrayList<Integer> a[];
    long max=123456789987654321L;
    pair p[];
    
    void solve(){
        //Enter code here utkarsh
        int i,j,k,n;
    long dp=10000000000000000L;
        n=ni();
        a=new ArrayList[n];
        for(i=0;i<n;i++)    a[i]=new ArrayList<>();
        for(i=1;i<n;i++){
            j=ni()-1;
            k=ni()-1;
            a[j].add(k);
            a[k].add(j);
        }
        for(i=0;i<n;i++){
            if(a[i].size()>4){
                out.println("NO");
                return;
            }
        }
        out.println("YES");
        p=new pair[n];
        p[0]=new pair(0L,0L);
        for(i=1;i<n;i++)    p[i]=new pair(max,max);
        v=new boolean[n][4];
        dfs(0,dp);
        //out.println(n);
        for(i=0;i<n;i++){
            out.println(p[i].x+" "+p[i].y);
        }
    }
    boolean v[][];
    void dfs(int s,long dp){
        int i,j,k,ii;
        k=a[s].size();
        long x[]=new long[4];
        long y[]=new long[4];
        x[0]=p[s].x+dp;
        x[3]=p[s].x-dp;
        x[2]=x[1]=p[s].x;
        y[0]=y[3]=p[s].y;
        y[1]=p[s].y+dp;
        y[2]=p[s].y-dp;
        for(i=0;i<k;i++){
            j=a[s].get(i);
            if(p[j].x==max && p[j].y==max){
                for(ii=0;ii<4;ii++){
                    if(!v[s][ii]){
                        p[j].x=x[ii];
                        p[j].y=y[ii];
                        v[s][ii]=true;
                        v[j][3-ii]=true;
                        dfs(j,dp/2L);
                        break;
                    }
                }
            }
        }
    }
    
    public static void main(String[] args) {
        Sss play=new Sss();
        play.run();
    }
    void run(){
        is=System.in;
        out=new PrintWriter(System.out);
        solve();
        out.flush();
    }
    
    byte input[]=new byte[1024];
    int len=0,ptr=0;
    int readByte(){
        if(ptr>=len){
            ptr=0;
            try{
                len=is.read(input);
            }catch(IOException e){
                throw new InputMismatchException();
            }
            if(len<=0){
                return -1;
            }
        }
        return input[ptr++];
    }
    boolean isSpaceChar(int c){
        return !( c >= 33 && c <= 126 );
    }
    int skip(){
        int b=readByte();
        while(b!=-1 && isSpaceChar(b)){
            b=readByte();
        }
        return b;
    }
    
    char nc(){
        return (char)skip();
    }
    String ns(){
        int b=skip();
        StringBuilder sb=new StringBuilder();
        while(!isSpaceChar(b)){
            sb.appendCodePoint(b);
            b=readByte();
        }
        return sb.toString();
    }
    int ni(){
        int n=0,b=readByte();
        boolean minus=false;
        while(b!=-1 && !( (b>='0' && b<='9') || b=='-')){
            b=readByte();
        }
        if(b=='-'){
            minus=true;
            b=readByte();
        }
        while(b>='0' && b<='9'){
            n=n*10 + (b - '0');
            b=readByte();
        }
        return minus ? -n : n;
    }
    long nl(){
        long n=0L;
        int b=readByte();
        boolean minus=false;
        while(b!=-1 && !( (b>='0' && b<='9') || b=='-')){
            b=readByte();
        }
        if(b=='-'){
            minus=true;
            b=readByte();
        }
        while(b>='0' && b<='9'){
            n=n*10 + (b - '0');
            b=readByte();
        }
        return minus ? -n : n;
    }
    double nd(){
        return Double.parseDouble(ns());
    }
    float nf(){
        return Float.parseFloat(ns());
    }
    int[] na(int n){
        int a[]=new int[n];
        for(int i=0;i<n;i++){
            a[i]=ni();
        }
        return a;
    }
    char[] ns(int n){
        char c[]=new char[n];
        int i,b=skip();
        for(i=0;i<n;i++){
            if(isSpaceChar(b)){
                break;
            }
            c[i]=(char)b;
            b=readByte();
        }
        return i==n ? c : Arrays.copyOf(c,i);
    }
}