#include <stdio.h> const int maxn=10010; int a[maxn],b[maxn]; int m,total,s,t,aptotal,apm,aps,apt,k; int n; int ck() { int p,r; if (total > 5) return 1; p=s; r=t; for(int q=0;q<m;q++) { p=p*10+s; } for (int q ...