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

import sun.security.krb5.internal.crypto.dk.ArcFourCrypto;

public class E
{
	String line;
	StringTokenizer inputParser;
	BufferedReader is;
	FileInputStream fstream;
	DataInputStream in;
	
	void openInput(String file)
	{

		if(file==null)is = new BufferedReader(new InputStreamReader(System.in));//stdin
		else
		{
			try{
		
				
			fstream = new FileInputStream(file);
			in = new DataInputStream(fstream);
			is = new BufferedReader(new InputStreamReader(in));
			}catch(Exception e)
			{
				System.err.println(e);
			}
		}

	}
	
	void readNextLine()
	{
		try {
			line = is.readLine();
			inputParser = new StringTokenizer(line, " ");
			//System.err.println("Input: " + line);
		} catch (IOException e) {
			System.err.println("Unexpected IO ERROR: " + e);
		}	
		
	}
	
	int NextInt()
	{
		String n = inputParser.nextToken();
		int val = Integer.parseInt(n);
		
		//System.out.println("I read this number: " + val);
		return val;
	}

    double NextDouble()
    {
            String n = inputParser.nextToken();
            double val = Double.parseDouble(n);
            
            //System.out.println("I read this number: " + val);
            return val;
    }
	
	String NextString()
	{
		String n = inputParser.nextToken();
		return n;
	}
	
	void closeInput()
	{
		try {
			is.close();
		} catch (IOException e) {
			System.err.println("Unexpected IO ERROR: " + e);
		}
			
	}
	
	public static void main(String [] argv)
	{
		String filePath=null;
		if(argv.length>0)filePath=argv[0];
		new E(filePath);
	}

	public E(String inputFile) 
	{
		openInput(inputFile);
		//readNextLine();
		int T=1;//NextInt();
		StringBuilder sb = new StringBuilder();
		for(int t=1; t<=T; t++)
		{
			readNextLine();
			int N=NextInt();
			Graph g = new Graph(N);
			for(int i=0; i<N-1; i++)
			{
				readNextLine();
				g.join(NextInt()-1, NextInt()-1);
			}
			if(!g.isOk())
			{
				sb.append("NO");
				System.out.print(sb);
				return;
			}
			sb.append("YES\n");
			g.resetNodes();
			
			for(int i=0; i<N; i++)
				sb.append(g.nodes[i].x+" "+g.nodes[i].y+"\n");
		}
		System.out.print(sb);
		
		closeInput();		
	}

	private class Graph
	{
		int N;
		Node [] nodes;
		Graph (int N)
		{
			nodes = new Node[N];
			this.N = N;
			for(int i=0 ;i<N; i++)
				nodes[i] = new Node(i);
		}
		
		public void resetNodes() {
			nodes[0].resetPosition(0,0, -1);
			long m = (long) Math.pow(2, 31);
			for(int i=0; i<N; i++)
			{
				for(int j=0; j<N; j++)
				{
					if(nodes[j].posSet == true && nodes[j].nghPosSet == false)
					{
						nodes[j].resetNghPositions(m);
						m/=2;
					}
				}
			}
		}
		
		public void join(int a, int b)
		{
			nodes[a].ngh.add(nodes[b]);
			nodes[b].ngh.add(nodes[a]);
		}
		
		public boolean isOk()
		{
			for(Node x:nodes)
			{
				if(x.ngh.size()>4)return false;
			}
			return true;
		}
	}
	
	private class Node
	{
		ArrayList<Node> ngh = new ArrayList<E.Node>();
		long x=-3333,y=-3333;
		int id;
		int skipId = -1;
		boolean posSet = false, nghPosSet = false;
		
		Node (int id)
		{
			this.id = id;
		}

		public void resetPosition(long x, long y, int skipId) {
			posSet = true;
			this.x = x;
			this.y = y;
			this.skipId = skipId;
		}
		
		public void resetNghPositions(long m)
		{
			nghPosSet = true;
			int id=0;
			int [] dx = { 0, 1, 0, -1};
			int [] dy = { 1, 0, -1, 0};
			int [] si = { 2, 3, 0, 1};
			
			
			
			for(Node o:ngh)
			{
				if(o.posSet)continue;
				if(id==skipId)
				{
					id++;
				}
				o.resetPosition(x + dx[id]*m, y + dy[id]*m, si[id]);
				
				
				id++;
			}
		}
	}
}