#include using namespace std; typedef long long ll; typedef long double ld; #define rep(i,n) for (int i = 0; i < (n); ++i) templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b mem(200001,-1); int f(int x){ if(mem[x]!=-1){ return mem[x]; } if(x<10){ return mem[x]=x; } int sum=0; while(x){ sum+=x%10; x/=10; } return mem[x]=f(sum); } int main(){ cin.tie(0); ios::sync_with_stdio(false); int k,n;cin >> k >> n; vector p(n+1,true); p[0]=p[1]=false; for(int i=2;i*i<=n;i++){ if(p[i]){ for(int j=2;j*i<=n;j++){ p[i*j]=false; } } } vector v,h; for(int i=k;i<=n;i++){ if(p[i]){ v.push_back(i); h.push_back(f(i)); } } int r=0; int x=h.size(); int len=0; int ans; vector c(10); for(int i=0;i