template<typename T>
void Scanf(T &x) {
x = 0;
char c = getchar();
while(!isdigit(c))
c = getchar();
while(isdigit(c)) {
x = x * 10 + (c - '0');
c = getchar();
}
}
template<typename T1, typename T2>
void Scanf(T1 &x1, T2 &x2) {
Scanf(x1);
Scanf(x2);
}
template<typename T1, typename T2, typename T3>
void Scanf(T1 &x1, T2 &x2, T3 &x3) {
Scanf(x1);
Scanf(x2);
Scanf(x3);
}
template<typename T1, typename T2, typename T3, typename T4>
void Scanf(T1 &x1, T2 &x2, T3 &x3, T4 &x4) {
Scanf(x1);
Scanf(x2);
Scanf(x3);
Scanf(x4);
}
template<typename T>
void Scanf(T* a, int n) {
for(int i = 1; i <= n; ++i)
Scanf(a[i]);
}
template<typename T>
void _Printf(T x) {
if(x >= 10)
_Printf(x / 10);
putchar('0' + x % 10);
}
template<typename T>
void Printf(T x, const char& c = '
') {
_Printf(x);
putchar(c);
}
template<typename T1, typename T2>
void Printf(T1 &x1, T2 &x2) {
Printf(x1, ' ');
Printf(x2, '
');
}
template<typename T1, typename T2, typename T3>
void Printf(T1 &x1, T2 &x2, T3 &x3) {
Printf(x1, ' ');
Printf(x2, ' ');
Printf(x3, '
');
}
template<typename T1, typename T2, typename T3, typename T4>
void Printf(T1 &x1, T2 &x2, T3 &x3, T4 &x4) {
Printf(x1, ' ');
Printf(x2, ' ');
Printf(x3, ' ');
Printf(x4, '
');
}
template<typename T>
void Printf(T* a, int n) {
for(int i = 1; i < n; ++i)
Printf(a[i], ' ');
Printf(a[n], '
');
}
void YES() {
puts("YES");
}
void NO() {
puts("NO");
}