int x,w; char ch; int read() { x = 0; ch=getchar(); while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); } return x; }