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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskE {
        ArrayList<Integer>[] adj;
        long[] xres;
        long[] yres;
        LongLongPair ncords(long x, long y, int dir, long dist) {
            int xmul = 0;
            if (dir == 1) xmul = 1;
            if (dir == 3) xmul = -1;
            int ymul = 0;
            if (dir == 0) ymul = 1;
            if (dir == 2) ymul = -1;
            return new LongLongPair(x + xmul * dist, y + ymul * dist);
        }
        int cant(int going) {
            if (going == 0) return 2;
            if (going == 1) return 3;
            if (going == 2) return 0;
            if (going == 3) return 1;
            throw new RuntimeException();
        }
        void dfs(int idx, int previdx, long x, long y, int cant, long dist) {
            xres[idx] = x;
            yres[idx] = y;
            int dir = 0;
            for (int nxt : adj[idx]) {
                if (nxt == previdx) continue;
                if (dir == cant) dir++;
                if (dir > 3) throw new RuntimeException();
                LongLongPair ncords = ncords(x, y, dir, dist);
                dfs(nxt, idx, ncords.first, ncords.second, cant(dir), dist / 2);
                dir++;
            }
        }
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            adj = new ArrayList[n];
            xres = new long[n];
            yres = new long[n];
            for (int i = 0; i < adj.length; i++) adj[i] = new ArrayList<>();
            long cur = (long) 500 * 1000 * 1000 * 1000 * 1000 * 1000;
            for (int i = 0; i < n - 1; i++) {
                int a = in.readInt() - 1, b = in.readInt() - 1;
                adj[a].add(b);
                adj[b].add(a);
            }
            for (ArrayList<Integer> al : adj)
                if (al.size() > 4) {
                    out.printLine("NO");
                    return;
                }
            dfs(0, -1, 0, 0, -1, cur);
            out.printLine("YES");
            for (int i = 0; i < xres.length; i++) {
                out.printLine(xres[i], yres[i]);
            }
        }
    }
    static class OutputWriter {
        private final PrintWriter writer;
        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }
        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }
        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }
        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }
        public void close() {
            writer.close();
        }
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }
        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }
        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    static class LongLongPair implements Comparable<LongLongPair> {
        public final long first;
        public final long second;
        public LongLongPair(long first, long second) {
            this.first = first;
            this.second = second;
        }
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }
            LongLongPair pair = (LongLongPair) o;
            return first == pair.first && second == pair.second;
        }
        public int hashCode() {
            int result = Long.hashCode(first);
            result = 31 * result + Long.hashCode(second);
            return result;
        }
        public String toString() {
            return "(" + first + "," + second + ")";
        }
        @SuppressWarnings ({"unchecked"})
        public int compareTo(LongLongPair o) {
            int value = Long.compare(first, o.first);
            if (value != 0) {
                return value;
            }
            return Long.compare(second, o.second);
        }
    }
}