#include <stdio.h>
#include <math.h>
#define _MAX 10000
typedef struct _x {
int x;
int y;
int z;
} X;
X num[_MAX+1];
int countlist(int i, int c)
{
if (num[i].y == 0) {
return c;
} else {
c++;
return countlist(num[i].x, c);
}
}
void printlist(int i)
{
if (num[i].y == 0) {
} else {
printlist(num[i].x);
}
}
int main()
{
int i, j, x, max = 0, c, nu;
for (i=1; i<=_MAX; i++) {
num[i].x = i; num[i].y = 0; num[i].z = 0;
}
for (i = 2; i <= _MAX; i += 2) {
if (2 != num[i].x){
num[i].x /= 2; num[i].y = 2; num[i].z++;
}
}
for (i = 3; i <= x; i++) {
if (num[i].z != 0){
continue;
}
for (j = i; j <= _MAX; j += i) {
if (i != num[j].x && num[j].z == 0) {
num[j].x /= i; num[j].y = i; num[j].z++;
}
}
}
for (i = 1; i <= _MAX; i++) {
c = countlist(i, 1);
if (max < c) {
max = c; nu = i;
}
}
printlist(nu);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgojZGVmaW5lIF9NQVggMTAwMDAKdHlwZWRlZiBzdHJ1Y3QgX3ggewppbnQgeDsKaW50IHk7CmludCB6Owp9IFg7CgpYIG51bVtfTUFYKzFdOwoKaW50IGNvdW50bGlzdChpbnQgaSwgaW50IGMpCnsKICBpZiAobnVtW2ldLnkgPT0gMCkgewogICAgcmV0dXJuIGM7CiAgfSBlbHNlIHsKICAgIGMrKzsKICAgIHJldHVybiBjb3VudGxpc3QobnVtW2ldLngsIGMpOwogIH0KfQp2b2lkIHByaW50bGlzdChpbnQgaSkKewogIGlmIChudW1baV0ueSA9PSAwKSB7CiAgICBwcmludGYoIiVkIiwgbnVtW2ldLngpOwogIH0gZWxzZSB7CiAgICBwcmludGYoIiVkICogIiwgbnVtW2ldLnkpOwogICAgcHJpbnRsaXN0KG51bVtpXS54KTsKICB9Cn0KCmludCBtYWluKCkKewogIGludCBpLCBqLCB4LCBtYXggPSAwLCBjLCBudTsKCiAgZm9yIChpPTE7IGk8PV9NQVg7IGkrKykgewogICAgbnVtW2ldLnggPSBpOyBudW1baV0ueSA9IDA7IG51bVtpXS56ID0gMDsKICB9CiAgZm9yIChpID0gMjsgaSA8PSBfTUFYOyBpICs9IDIpIHsKICAgIGlmICgyICE9IG51bVtpXS54KXsKICAgICAgbnVtW2ldLnggLz0gMjsgbnVtW2ldLnkgPSAyOyBudW1baV0ueisrOwogICAgfQogIH0KICB4ID0gc3FydChfTUFYKTsKICBmb3IgKGkgPSAzOyBpIDw9IHg7IGkrKykgewogICAgaWYgKG51bVtpXS56ICE9IDApewogICAgICBjb250aW51ZTsKICAgIH0KICAgIGZvciAoaiA9IGk7IGogPD0gX01BWDsgaiArPSBpKSB7CiAgICAgIGlmIChpICE9IG51bVtqXS54ICYmIG51bVtqXS56ID09IDApIHsKICAgICAgICBudW1bal0ueCAvPSBpOyBudW1bal0ueSA9IGk7IG51bVtqXS56Kys7CiAgICAgIH0KICAgIH0KICB9CgogIGZvciAoaSA9IDE7IGkgPD0gX01BWDsgaSsrKSB7CiAgICBjID0gY291bnRsaXN0KGksIDEpOwogICAgaWYgKG1heCA8IGMpIHsKICAgICAgbWF4ID0gYzsgbnUgPSBpOwogICAgfQogIH0KICBwcmludGYoIiVkID0gIiwgbnUpOwogIHByaW50bGlzdChudSk7CiAgcHJpbnRmKCJcbuWboOWtkOaVsO+8miVkXG4iLG1heCk7CgogIHJldHVybiAwOwp9Cg==