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.math.BigInteger;
import java.util.*;

public class Main {
	class Class {
		int from;
		int to;
		int length;

		void Class(int from, int to, int length) {
			this.from = from;
			this.to = to;
			this.length = length;
		}
	}

	static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
	private final static Random rnd = new Random();
	static final char WALL = '#';
	final static int[][] STEPS = { { -1, 0, 0 }, { 1, 0, 0 }, { 0, 1, 0 }, { 0, -1, 0 }, { 0, 0, 1 }, { 0, 0, -1 } };
	final static int DEFAULT_LENGTH = Integer.MAX_VALUE;

	boolean checkIndex(int index, int size) {
		return (0 <= index && index < size);
	}

	class Point {
		int x;
		int y;
		int from;

		void Point(int x, int y, int from) {
			this.x = x;
			this.y = y;
			this.from = from;
		}
	}

	List<Integer> graph[];
	NavigableMap<Integer, Point> matr;

	// =====================================================
	void solve() throws IOException {
		this.n = rI();
		this.graph = new ArrayList[n];
		for (int i = 0; i < n; i++) {
			graph[i] = new ArrayList<Integer>();
		}

		for (int i = 0; i < n - 1; i++) {
			int a = rI() - 1;
			int b = rI() - 1;
			graph[a].add(b);
			graph[b].add(a);
		}
		for (int i = 0; i < n; i++) {
			if (graph[i].size() > 4) {
				out.println("NO");
				return;
			}
		}
		out.println("YES");
		this.used = new boolean[n];
		// ------------------------------------------------------
		this.matr = new TreeMap<Integer, Point>();
		Point def = new Point();
		def.x = 0;
		def.y = 0;
		def.from = 0;
		matr.put(0, def);
		dfs(0, DEFAULT_LENGTH, -1);
		for (int i = 0; i < n; i++) {
			Point a = matr.get(i);
			out.println(a.x + " " + a.y);
		}

	}

	boolean[] used;

	int n;

	void dfs(int from, int length, int last) {
		used[from] = true;
		length /= 2;
		NavigableSet<Integer> set = new TreeSet<Integer>();
		for (int i = 0; i < 4; i++) {
			set.add(i);
		}
		if (last != -1) {
			if (last == 0) {
				set.remove(2);
			}
			if (last == 1) {
				set.remove(3);
			}
			if (last == 2) {
				set.remove(0);
			}
			if (last == 3) {
				set.remove(1);
			}
		}
		for (int i : graph[from]) {
			if (!used[i]) {
				Point d = new Point();
				d.from = set.pollFirst();
				if (d.from == 0) {
					d.x = matr.get(from).x + length;
					d.y = matr.get(from).y;
				}
				if (d.from == 2) {
					d.x = matr.get(from).x - length;
					d.y = matr.get(from).y;
				}
				if (d.from == 3) {
					d.y = matr.get(from).y - length;
					d.x = matr.get(from).x;
				}
				if (d.from == 1) {
					d.y = matr.get(from).y + length;
					d.x = matr.get(from).x;
				}
				matr.put(i, d);
				dfs(i, length, d.from);
			}
		}

	}

	int Min(int... values) {
		int min = Integer.MAX_VALUE;
		for (int value : values) {
			min = Math.min(min, value);
		}
		return min;
	}

	int Max(int... values) {
		int max = Integer.MIN_VALUE;
		for (int value : values) {
			max = Math.max(max, value);
		}
		return max;
	}
	// ==============================================================================
	// class DSU {
	//
	// int parent[];
	// int size;
	//
	// DSU(int size) {
	// this.size = size;
	// this.parent = new int[size];
	// for (int i = 0; i < size; i++) {
	// parent[i] = i;
	// sizes[i] = 1;
	// }
	// }
	//
	// int get(int v) {
	// int paren = parent[v];
	// if (paren == v)
	// return v;
	// return parent[v] = get(paren);
	// }
	//
	// void union(int a, int b) {
	// a = get(a);
	// b = get(b);
	// if (a != b) {
	// size--;
	// if (rnd.nextBoolean()) {
	// parent[a] = b;
	// sizes[b] += sizes[a];
	// } else {
	// parent[b] = a;
	// sizes[a] += sizes[b];
	// }
	//
	// }
	// }
	//
	// }

	public static void main(String[] args) {
		new Main().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;

	int maxA(int[] a) {
		int max = Integer.MIN_VALUE;
		for (int i = 0; i < a.length; i++) {
			if (a[i] > max) {
				max = a[i];

			}
		}
		return max;
	}

	int minA(int[] a) {
		int min = Integer.MAX_VALUE;
		for (int i = 0; i < a.length; i++) {
			if (a[i] < min) {
				min = a[i];
			}
		}
		return min;
	}

	void init() throws FileNotFoundException {

		if (ONLINE_JUDGE) {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
		} else {
			in = new BufferedReader(new FileReader("input.txt"));
			out = new PrintWriter("output.txt");
		}

		tok = new StringTokenizer("");
	}

	void run() {
		try {
			long timeStart = System.currentTimeMillis();

			init();
			solve();

			out.close();

			long timeEnd = System.currentTimeMillis();
			System.err.println("Time = " + (timeEnd - timeStart) + " COMPILED");
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}

	long memoryTotal, memoryFree;

	void memory() {
		memoryFree = Runtime.getRuntime().freeMemory();
		System.err.println("Memory = " + ((-memoryTotal + memoryFree) >> 10) + " KB");
	}

	String readLine() throws IOException {
		return in.readLine();
	}

	String delimiter = " ";

	String rS() throws IOException {
		while (!tok.hasMoreTokens()) {
			String nextLine = readLine();
			if (null == nextLine)
				return null;

			tok = new StringTokenizer(nextLine);
		}

		return tok.nextToken(delimiter);
	}

	int[] rA(int b) {
		int a[] = new int[b];
		for (int i = 0; i < b; i++) {
			try {
				a[i] = rI();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return a;
	}

	int rI() throws IOException {
		return Integer.parseInt(rS());
	}

	long rL() throws IOException {
		return Long.parseLong(rS());
	}

	void sort(int[] a) {
		Integer arr[] = new Integer[a.length];
		for (int i = 0; i < a.length; i++) {
			arr[i] = a[i];
		}
		Arrays.sort(arr);
		for (int i = 0; i < a.length; i++) {
			a[i] = arr[i];
		}
	}

}