void out(int a) { if(a < 0) {putchar('-'); a = -a;} if(a >= 10)out(a / 10); putchar(a % 10 + '0'); } int in() { int flag = 1; char ch; int a = 0; while((ch = getchar()) == ' ' || ch == '\n'); if(ch == '-') flag = -1; else a += ch - '0'; while((ch = getchar()) != ' ' && ch != '\n') { a *= 10; a += ch - '0'; } return flag * a; }