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 com.sun.org.apache.xpath.internal.operations.Bool;

import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.io.IOException;
import java.io.InputStream;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {

        File file = new File("in.txt");
        File fileOut = new File("out.txt");
        InputStream inputStream = null;
        OutputStream outputStream = null;
        // try {inputStream= new FileInputStream(file);} catch (FileNotFoundException ex){return;};
//        try {outputStream= new FileOutputStream(fileOut);} catch (FileNotFoundException ex){return;};
        inputStream = System.in;
        outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}





class TaskB {



    Integer nodes;
    Map<Integer, Set<Integer>> edges;
    Map<Integer, Pair<Long,Long>> coords;
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        nodes = in.nextInt();
        edges = new HashMap<>();
        coords = new HashMap<>();
        for(int i=1; i<=nodes; i++){
            edges.put(i, new HashSet<>());
        }
        for(int i=0; i<nodes-1; i++){
            Integer source = in.nextInt(), target = in.nextInt();
            edges.get(source).add(target);
            edges.get(target).add(source);
        }

        for(int i=1; i<=nodes; i++){
            if(edges.get(i).size()>4){
                out.println("NO");
                return;
            }
        }

        coords.put(1,new Pair<>(0l,0l));

        Integer dir = 0;
        for(Integer target : edges.get(1)){
            dfs(target, 1, dir, nodes);
            dir++;
        }
        out.println("YES");
        for(int i=1; i<=nodes; i++){
            Pair<Long, Long> p = coords.get(i);
            out.println(p.first + " " + p.second);
        }












    }


    public void dfs(Integer target, Integer parent,  Integer incomingDir, Integer exponent){
        coords.put(target, updateCoord(incomingDir,exponent, parent));
        Integer dir =0;
        for(Integer i : edges.get(target)){
            if(!i.equals(parent)) {
                if(dir == oppositeDir(incomingDir)){
                    dir++;
                }
                dfs(i, target, dir, exponent - 1);
                dir++;
            }
        }
    }

    public Pair<Long, Long> updateCoord(Integer direction, Integer exponent, Integer parent){
        Long x = coords.get(parent).first;
        Long y = coords.get(parent).second;

        switch (direction){
            case 0 : x += (long) Math.pow(2l,exponent); break;
            case 1 : y -= (long) Math.pow(2l,exponent); break;
            case 2 : x -= (long) Math.pow(2l,exponent); break;
            case 3 : y += (long) Math.pow(2l,exponent); break;
        }
        return new Pair<>(x,y);
    }

    public Integer oppositeDir(Integer dir){
        switch (dir){
            case 0: return 2;
            case 1: return 3;
            case 2: return 0;
            case 3: return 1;
        }
        return null;
    }














}





class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine(){
        try {
            return reader.readLine();
        } catch (IOException e){
            throw new RuntimeException(e);
        }
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() { return Long.parseLong(next()); }

}



class Pair<F, S> {
    public final F first;
    public final S second;




    public Pair(F first, S second) {
        this.first = first;
        this.second = second;
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof Pair)) {
            return false;
        }
        Pair<?, ?> p = (Pair<?, ?>) o;
        return Objects.equals(p.first, first) && Objects.equals(p.second, second);
    }

    @Override
    public int hashCode() {
        return (first == null ? 0 : first.hashCode()) ^ (second == null ? 0 : second.hashCode());
    }

    @Override
    public String toString() {
        return "(" + first + ", " + second + ')';
    }
}