/**
 * Author: Sergey Kopeliovich (Burunduk30@gmail.com)
 */

import java.io.*;

class MyReader {
	BufferedInputStream in;

	final int bufSize = 1 << 16;
	final byte b[] = new byte[bufSize];

	MyReader( InputStream in ) {
		this.in = new BufferedInputStream(in, bufSize);
	}

	int nextInt() throws IOException {
		int c;
		while ((c = nextChar()) <= 32)
			;
		int x = 0, sign = 1;
		if (c == '-') {
			sign = -1;
			c = nextChar();
		}
		while (c >= '0') {
			x = x * 10 + (c - '0');
			c = nextChar();
		}
		return x * sign;
	}

	StringBuilder _buf = new StringBuilder();
	String nextWord() throws IOException {
		int c;
		_buf.setLength(0);
		while ((c = nextChar()) <= 32)
			;
		while (c > 32) {
			_buf.append((char)c);
			c = nextChar();
		}
		return _buf.toString();
	}

	int bn = bufSize, k = bufSize;
	
	int nextChar() throws IOException {
		if (bn == k) {
			k = in.read(b, 0, bufSize);
				bn = 0;
		}
		return bn >= k ? -1 : b[bn++];
	}

	int nextNotSpace() throws IOException {
		int ch;
		while ((ch = nextChar()) <= 32 && ch != -1)
			;
		return ch;
	}
}

// MyReader r = new MyReader(System.in);