import java.io.*;

public class IO {
	static StreamTokenizer in;
	
	static {
		in = new StreamTokenizer(
		         new BufferedReader(
		             new InputStreamReader(System.in)));
		in.resetSyntax();             
      	in.wordChars('a', 'z');
      	in.wordChars('A', 'Z');
      	in.wordChars('0', '9');        
      	in.wordChars(128 + 32, 255);
      	in.whitespaceChars(0, ' ');
      	in.wordChars('+', '+');
      	in.wordChars('-', '-');
      	in.wordChars('.', '.');
   	}
   	
   	private static String formatDouble(double d, int n, int w) {
   		if (Double.isNaN(d) || 
   			d == Double.POSITIVE_INFINITY || d == Double.NEGATIVE_INFINITY)
   			return Double.toString(d);
		double wholePart = d >= 0 ? Math.floor(d) : Math.ceil(d);
		StringBuffer s1 = new StringBuffer(formatLong((long) wholePart, w-n-1));
		double decimalPart = (int) Math.round((d - wholePart)*Math.pow(10, n));
		if (decimalPart < 0) decimalPart = -decimalPart;
		StringBuffer s2 = new StringBuffer(Long.toString((long) decimalPart));
		if (s2.length() > n)
			s2.setLength(n);
		else
			while (s2.length() < n)
				s2.append('0');
		return s1.toString() + "." + s2.toString(); 
   	} 
   	
   	private static String formatReal(double d, int n, int w, int e) {
   		if (Double.isNaN(d) || 
   			d == Double.POSITIVE_INFINITY || d == Double.NEGATIVE_INFINITY)
   			return Double.toString(d);
   		if (n <= 1)
   			n = 1;
		double p = d == 0 ? 0 : (int) (Math.log(Math.abs(d))/Math.log(10));
		d /= Math.pow(10, p);
		if (Math.abs(d) < 1) { d *= 10; p--; }
		double wholePart = d >= 0 ? Math.floor(d) : Math.ceil(d);
		StringBuffer s1 = new StringBuffer(formatLong((long) wholePart, w-n-3-e));
		double decimalPart = (int) Math.round((d - wholePart)*Math.pow(10, n-1));
		if (decimalPart < 0) decimalPart = -decimalPart;
		StringBuffer s2 = new StringBuffer(Long.toString((long) decimalPart));
		if (s2.length() > n-1)
			s2.setLength(n);
		else
			while (s2.length() < n-1)
				s2.append('0');
		StringBuffer s3 = new StringBuffer(Long.toString((long) Math.abs(p)));
		while (s3.length() < e)
			s3.insert(0, '0');
		s3.insert(0, p >= 0 ? '+' : '-');
		return s1.toString() + "." + s2.toString() + "e" + s3 ;
   	} 
   	
   	public static boolean eof() {
   		try {
	   		in.nextToken();
	    	in.pushBack();
	    	return in.ttype == in.TT_EOF;
   		}
		catch (EOFException e) { return true; }
   		catch (IOException e) { return true; }
   	}
   	
   	public static boolean readBoolean() {
   		try {
			in.nextToken();
			if (in.ttype == in.TT_EOF)
				throw new EOFException();
		}
		catch (EOFException e) { eofError(); }
		catch (IOException e) { readError("readBoolean"); }
		return Boolean.valueOf(in.sval).booleanValue();	
	}
	
	public static double readDouble() {
		try {
			in.nextToken();
			if (in.ttype == in.TT_EOF)
				throw new EOFException();
		}
		catch (EOFException e) { eofError(); }
		catch (IOException e) { readError("readDouble"); }
		return Double.valueOf(in.sval).doubleValue();
	}
	
	public static float readFloat() {
		try {
			in.nextToken();
			if (in.ttype == in.TT_EOF)
				throw new EOFException();
		}
		catch (EOFException e) { eofError(); }
		catch (IOException e) { readError("readFloat"); }
		return Double.valueOf(in.sval).floatValue();
	}	
	
	public static int readInt() {
		try {
			in.nextToken();
			if (in.ttype == in.TT_EOF)
				throw new EOFException();
		}
		catch (EOFException e) { eofError(); }	
		catch (IOException e) { readError("readInt"); }
		return Integer.valueOf(in.sval).intValue();
	}
	
	public static String readLine()  {
		try {
			return new BufferedReader(
			           new InputStreamReader(
			               new DataInputStream(System.in))).
				               readLine();
		}
		catch (EOFException e) { eofError(); }	
		catch (IOException e) { readError("readInt"); }
		return "@";
	}
	
	
	public static long readLong() {
		try {
			in.nextToken();
			if (in.ttype == in.TT_EOF)
				throw new EOFException();
		}
		catch (EOFException e) { eofError(); }
		catch (IOException e) { readError("readLong"); }
		return Long.valueOf(in.sval).longValue();
	}
	
	public static String readToken() {
		try {
			in.nextToken();
			if (in.ttype == in.TT_EOF)
				throw new EOFException();
		}
		catch (EOFException e) { eofError(); }
		catch (IOException e) { readError("readToken"); }
		return in.sval;
	}
	
	public static void print(Object obj) { System.out.print(obj); }
	public static void print(String s) { System.out.print(s); }
	public static void print(char[] s) { System.out.print(s); }
	public static void print(char c) { System.out.print(c); }
	public static void print(int i) { System.out.print(i); }
	public static void print(long l) { System.out.print(l); }
	public static void print(float f) { System.out.print(f); }
	public static void print(double d) { System.out.print(d); }	
	public static void print(boolean b) { System.out.print(b); }	
	public static void println() { System.out.println(); }
	public static void println(Object obj) { System.out.println(obj); }
	public static void println(String s) { System.out.println(s); }
	public static void println(char[] s) { System.out.println(s); }
	public static void println(char c) { System.out.println(c); }
	public static void println(int i) { System.out.println(i); }
	public static void println(long l) { System.out.println(l); }
	public static void println(float f) { System.out.println(f); }
	public static void println(double d) { System.out.println(d); }	
	public static void println(boolean b) { System.out.println(b); }	
	
	public static void print(int i, int w)
		{ System.out.print(formatLong((long) i, w)); }
	public static void print(long l, int w) 
		{ System.out.print(formatLong(l, w)); }
	public static void print(float f, int n, int w)
		{ System.out.print(formatDouble((float) f, n, w)); } 
	public static void print(double d, int n, int w) 
		{ System.out.print(formatDouble(d, n, w)); } 	
	public static void println(int i, int w) 
		{ System.out.println(formatLong((long) i, w)); }
	public static void println(long l, int w) 
		{ System.out.println(formatLong(l, w)); }
	public static void println(float f, int n, int w) 
		{ System.out.println(formatDouble((float) f, n, w)); } 
	public static void println(double d, int n, int w) 
		{ System.out.println(formatDouble(d, n, w)); }
	public static void printReal(float f, int n, int w)
		{ System.out.print(formatReal((double) f, n, w, 2)); } 
	public static void printReal(double d, int n, int w) 
		{ System.out.print(formatReal(d, n, w, 3)); } 	
	public static void printlnReal(float f, int n, int w) 
		{ System.out.println(formatReal((double) f, n, w, 2)); } 
	public static void printlnReal(double d, int n, int w) 
		{ System.out.println(formatReal(d, n, w, 3)); }
		
	public static void flush() { System.out.flush(); } 
		
	private static void eofError() 
   		{ throw new RuntimeException("Attempt to read past end of file"); }
   	
   	private static void readError(String method) 
   		{ throw new RuntimeException(method + ": read error"); }
   	
   	private static String formatLong(long l, int w) {
		StringBuffer s = new StringBuffer(Long.toString(l));
		while (s.length() < w)
			s.insert(0, ' ');
		return s.toString();
   	}
}
