#include <iostream>
#include <string>
#include<stack>
#include<unordered_set>
#include<queue>
#include<deque>
#include<algorithm>
#include <cmath>
#include<ctime>
#include<map>
#include<set>
#include<vector>
#include<iomanip> // setprecision(number) cout << fixed << setprecision(6);
#include<ctype.h> // towlower toupper
#define sa(a,n) sort(a,a+n)
#define endl "\n"
#define ll long long
#define tt int
#define str string
#define fs(n) fixed<<setprecision(n)
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define leadzero(a) __builtin_clz(a) // count leading zeroes
#define trailzero(a) __builtin_ctz(a) // count trailing zeroes
#define bitcount(a) __builtin_popcount(a) // count set bits
using namespace std;
ll prime[10000005];
void sieve() {
for (ll x = 2; x < 1e7; x++)
{
if(x!=2&&x%2!=0)
prime[x] = 1;
}
for (ll x = 3; x * x < 1e7; x += 2)
{
if (prime[x])
{
for (int j = x * x; j < 1e7; j += x + x)
prime[j] = 0;
}
}
}
bool isPrime(ll n)
{
if (n <= 1)
return false;
if (n <= 3)
return true;
if (n % 2 == 0 || n % 3 == 0)
return false;
for (ll i = 5; i * i <= n; i = i + 6)
if (n % i == 0 || n % (i + 2) == 0)
return false;
return true;
}
ll lcm(ll x,ll y)
{
return x * y / __gcd(x, y);
}
bool cm (pair< int,string>p1 ,pair< int,string>p2)
{
if(p1.first==p2.first)
return p1.second<p2.second;
return p1.first>p2.first;
}
// auto it = maxx.end(); it--; k=*it erase(it) ,, set<ll,greater<>>s;
//getline(cin, s1)
//auto it=upper_bound(v.begin(),v.end(),m);
int main() {
fast;
sieve();
ll n,con=1;
cin>>n;
vector<ll>v(n+1,0);
for(ll x=2;x<=n;x++)
{
if(v[x]==0)
{
for(ll i=x;i<=n;i+=x)
v[i]=con;
con++;
}
}
for(ll x=2;x<=n;x++)
cout << v[x] << " ";
}
1004B - Sonya and Exhibition | 1397A - Juggling Letters |
985C - Liebig's Barrels | 115A - Party |
746B - Decoding | 1424G - Years |
1663A - Who Tested | 1073B - Vasya and Books |
195B - After Training | 455A - Boredom |
1099A - Snowball | 1651D - Nearest Excluded Points |
599A - Patrick and Shopping | 237A - Free Cash |
1615B - And It's Non-Zero | 1619E - MEX and Increments |
34B - Sale | 1436A - Reorder |
1363C - Game On Leaves | 1373C - Pluses and Minuses |
1173B - Nauuo and Chess | 318B - Strings of Power |
1625A - Ancient Civilization | 864A - Fair Game |
1663B - Mike's Sequence | 448A - Rewards |
1622A - Construct a Rectangle | 1620A - Equal or Not Equal |
1517A - Sum of 2050 | 620A - Professor GukiZ's Robot |