/*
 * =====================================================================================
 *
 *       Filename:  codeforce.cpp
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  02/17/2012 10:59:16 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  ronaflx
 *        Company:  hit-ACM-Group
 *
 * =====================================================================================
 */
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <climits>
#include <algorithm>
#include <iterator>
#include <functional>
#include <limits>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <list>
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <stdexcept>
#include <utility>
#include <cassert>
#include <complex>
using namespace std;
#define LEFT(i) ((i) << 1)
#define RIGHT(i) (((i) << 1) | 1)
#define MID(i) ((l[i] + r[i]) >> 1)
#define CC(i, v) memset(i, v, sizeof(i))
#define REP(i, l, n) for(int i = l;i < int(n);++i)
#define FOREACH(con, i) for(__typeof(con.begin()) i = con.begin();i != con.end();++i)
template<class T>bool checkmax(T &a,T b){return a < b ? a = b, 1 : 0;}
template<class T>bool checkmin(T &a,T b){return a > b ? a = b, 1 : 0;}
typedef long long LL;
typedef pair<int, int> PII;
template<class T> void string_reader(string s, vector<T>& vec){
	istringstream sin(s);
	copy(istream_iterator<T>(sin), istream_iterator<T>(), back_inserter(vec));
}
const LL N = 4000000;
bool tags[N];
vector<LL> prime;
int main()
{
	memset(tags, true, sizeof(tags));
	tags[0] = tags[1] = 0;
	prime.reserve(N / 10);
	for(LL i = 2;i < N;i++)
	{
		if(!tags[i]) continue;
		for(LL j = 2;j * i < N;j++)
		{
			tags[i * j] = 0;
		}
		prime.push_back(i);
	}
	int n;
	while(cin >> n)
	{
		int now = 1, tms = 0;
		if(find(prime.begin(), prime.end(), n) != prime.end() || n == 1)
			cout << 1 << endl << 0 << endl;
		else
		{
			FOREACH(prime, i)
			{
				while(tms != 2 && n % (*i) == 0)
				{
					n /= *i;
					now *= *i;
					tms++;
				}
				if(tms == 2) break;
			}
			if(tms == 2 && n != 1)
				cout << 1 << endl << now << endl;
			else
				cout << 2 << endl;
		}
	}
	return 0;
}


/*
 * =====================================================================================
 *
 *       Filename:  codeforce.cpp
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  02/17/2012 10:59:16 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  ronaflx
 *        Company:  hit-ACM-Group
 *
 * =====================================================================================
 */
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <climits>
#include <algorithm>
#include <iterator>
#include <functional>
#include <limits>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <list>
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <stdexcept>
#include <utility>
#include <cassert>
#include <complex>
using namespace std;
#define LEFT(i) ((i) << 1)
#define RIGHT(i) (((i) << 1) | 1)
#define MID(i) ((l[i] + r[i]) >> 1)
#define CC(i, v) memset(i, v, sizeof(i))
#define REP(i, l, n) for(int i = l;i < int(n);++i)
#define FOREACH(con, i) for(__typeof(con.begin()) i = con.begin();i != con.end();++i)
template<class T>bool checkmax(T &a,T b){return a < b ? a = b, 1 : 0;}
template<class T>bool checkmin(T &a,T b){return a > b ? a = b, 1 : 0;}
typedef long long LL;
typedef pair<int, int> PII;
template<class T> void string_reader(string s, vector<T>& vec){
	istringstream sin(s);
	copy(istream_iterator<T>(sin), istream_iterator<T>(), back_inserter(vec));
}
const LL N = 4000000;
bool tags[N];
vector<LL> prime;
int main()
{
	memset(tags, true, sizeof(tags));
	tags[0] = tags[1] = 0;
	prime.reserve(N / 10);
	for(LL i = 2;i < N;i++)
	{
		if(!tags[i]) continue;
		for(LL j = 2;j * i < N;j++)
		{
			tags[i * j] = 0;
		}
		prime.push_back(i);
	}
	int n;
	while(cin >> n)
	{
		int now = 1, tms = 0;
		if(find(prime.begin(), prime.end(), n) != prime.end())
			cout << 1 << endl << 0 << endl;
		else
		{
			FOREACH(prime, i)
			{
				while(tms != 2 && n % (*i) == 0)
				{
					n /= *i;
					now *= *i;
					tms++;
				}
				if(tms == 2) break;
			}
			if(tms == 2 && n != 1)
				cout << 1 << endl << now << endl;
			else
				cout << 2 << endl;
		}
	}
	return 0;
}


/*
 * =====================================================================================
 *
 *       Filename:  codeforce.cpp
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  02/17/2012 10:59:16 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  ronaflx
 *        Company:  hit-ACM-Group
 *
 * =====================================================================================
 */
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <climits>
#include <algorithm>
#include <iterator>
#include <functional>
#include <limits>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <list>
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <stdexcept>
#include <utility>
#include <cassert>
#include <complex>
using namespace std;
#define LEFT(i) ((i) << 1)
#define RIGHT(i) (((i) << 1) | 1)
#define MID(i) ((l[i] + r[i]) >> 1)
#define CC(i, v) memset(i, v, sizeof(i))
#define REP(i, l, n) for(int i = l;i < int(n);++i)
#define FOREACH(con, i) for(__typeof(con.begin()) i = con.begin();i != con.end();++i)
template<class T>bool checkmax(T &a,T b){return a < b ? a = b, 1 : 0;}
template<class T>bool checkmin(T &a,T b){return a > b ? a = b, 1 : 0;}
typedef long long LL;
typedef pair<int, int> PII;
template<class T> void string_reader(string s, vector<T>& vec){
	istringstream sin(s);
	copy(istream_iterator<T>(sin), istream_iterator<T>(), back_inserter(vec));
}
const LL N = 4000000;
bool tags[N];
vector<LL> prime;
int main()
{
	memset(tags, true, sizeof(tags));
	tags[0] = tags[1] = 0;
	prime.reserve(N / 10);
	for(LL i = 2;i < N;i++)
	{
		if(!tags[i]) continue;
		for(LL j = 2;j * i < N;j++)
		{
			tags[i * j] = 0;
		}
		prime.push_back(i);
	}
	LL n;
	while(cin >> n)
	{
		LL now = 1, tms = 0;
		FOREACH(prime, i)
		{
			while(n % (*i) == 0)
			{
				n /= *i;
				if(tms < 2) now *= *i;
				tms++;
			}
		}
		if(n != 1)
		{
			if(tms < 2) now *= n;
			tms++;
		}
		if(tms == 0)
			cout << 1 << endl << 0 << endl;
		else if(tms == 1)
			cout << 1 << endl << 0 << endl;
		else if(tms == 2)
			cout << 2 << endl;
		else
			cout << 1 << endl << now << endl;
	}
	return 0;
}


/*
 * =====================================================================================
 *
 *       Filename:  codeforce.cpp
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  02/17/2012 10:59:16 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  ronaflx
 *        Company:  hit-ACM-Group
 *
 * =====================================================================================
 */
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <climits>
#include <algorithm>
#include <iterator>
#include <functional>
#include <limits>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <list>
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <stdexcept>
#include <utility>
#include <cassert>
#include <complex>
using namespace std;
#define LEFT(i) ((i) << 1)
#define RIGHT(i) (((i) << 1) | 1)
#define MID(i) ((l[i] + r[i]) >> 1)
#define CC(i, v) memset(i, v, sizeof(i))
#define REP(i, l, n) for(int i = l;i < int(n);++i)
#define FOREACH(con, i) for(__typeof(con.begin()) i = con.begin();i != con.end();++i)
template<class T>bool checkmax(T &a,T b){return a < b ? a = b, 1 : 0;}
template<class T>bool checkmin(T &a,T b){return a > b ? a = b, 1 : 0;}
typedef long long LL;
typedef pair<int, int> PII;
template<class T> void string_reader(string s, vector<T>& vec){
	istringstream sin(s);
	copy(istream_iterator<T>(sin), istream_iterator<T>(), back_inserter(vec));
}
const LL N = 4000000;
bool tags[N];
vector<LL> prime;
int main()
{
	memset(tags, true, sizeof(tags));
	tags[0] = tags[1] = 0;
	prime.reserve(N / 10);
	for(LL i = 2;i < N;i++)
	{
		if(!tags[i]) continue;
		for(LL j = 2;j * i < N;j++)
		{
			tags[i * j] = 0;
		}
		prime.push_back(i);
	}
	LL n;
	while(cin >> n)
	{
		LL now = 1, tms = 0;
		FOREACH(prime, i)
		{
			while(n % (*i) == 0)
			{
				n /= *i;
				if(tms < 2) now *= *i;
				tms++;
			}
		}
		if(n != 1)
		{
			if(tms < 2) now *= n;
			tms++;
		}
		if(tms == 0)
			cout << 1 << endl << 0 << endl;
		else if(tms != 2)
			cout << 1 << endl << now << endl;
		else
			cout << 2 << endl;
	}
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
long long N,aux;
int f[10000],e[10000],nrf;

inline long long Sqrt()
{
	long long st,dr,m;
	st=0LL;
	dr=3170000LL;
	while(st<=dr)
	{
		m=(st+dr)/2LL;
		if(m*m<=N && (m+1LL)*(m+1LL)>N)
			return m;
		if(m*m<=N)
			st=m+1LL;
		else
			dr=m-1LL;
	}
	return 0LL;
}

int main()
{
	int i,lim;
	cin>>N;
	aux=N;
	if(N==1)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N==2)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N%2==0)
	{
		f[++nrf]=2;
		while(N%2LL==0)
		{
			N=N/2LL;
			e[1]++;
		}
	}
	lim=(int)Sqrt();
	for(i=3;i<=lim && N>1LL;i+=2)
	{
		if(N%(long long)i==0)
		{
			f[++nrf]=i;
			while(N%(long long)i==0LL)
			{
				N=N/(long long)i;
				e[nrf]++;
			}
			lim=(int)Sqrt();
		}
	}
	if(nrf==0)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N>1LL)
	{
		nrf++;
		e[nrf]=1;
	}
	if(nrf==1 && e[1]==2)
	{
		cout<<"2\n";
		return 0;
	}
	if(nrf==2 && e[1]==1 && e[2]==1)
	{
		cout<<"2\n";
		return 0;
	}
	long long sol;
	sol=(long long)f[1];
	if(e[1]>1)
		sol*=sol;
	else
	{
		if(f[2]==0)
			sol*=N;
		else
			sol*=(long long)f[2];
	}
	cout<<"1\n"<<sol<<"\n";
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
long long N,aux;
int f[10000],e[10000],nrf;

inline long long Sqrt()
{
	long long st,dr,m;
	st=0LL;
	dr=N;
	while(st<=dr)
	{
		m=st+(dr-st)/2LL;
		if(m*m<=N && (m+1LL)*(m+1LL)>N)
			return m;
		if(m*m<=N)
			st=m+1LL;
		else
			dr=m-1LL;
	}
	return 0LL;
}

int main()
{
	int i,lim;
	cin>>N;
	aux=N;
	if(N==1)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N%2==0)
	{
		f[++nrf]=2;
		while(N%2LL==0)
		{
			N=N/2LL;
			e[1]++;
		}
	}
	lim=(int)Sqrt();
	for(i=3;i<=lim && N>1LL;i+=2)
	{
		if(N%(long long)i==0)
		{
			f[++nrf]=i;
			while(N%(long long)i==0LL)
			{
				N=N/(long long)i;
				e[nrf]++;
			}
			lim=(int)Sqrt();
		}
	}
	if(nrf==0 || (nrf==1 && e[1]==(int)aux))
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N>1LL)
	{
		nrf++;
		e[nrf]=1;
	}
	if(nrf==1 && e[1]==2)
	{
		cout<<"2\n";
		return 0;
	}
	if(nrf==2 && e[1]==1 && e[2]==1)
	{
		cout<<"2\n";
		return 0;
	}
	long long sol;
	sol=(long long)f[1];
	if(e[1]>1)
		sol*=sol;
	else
	{
		if(f[2]==0)
			sol*=N;
		else
			sol*=(long long)f[2];
	}
	cout<<"1\n"<<sol<<"\n";
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
long long N,aux;
int f[10000],e[10000],nrf;

inline long long Sqrt()
{
	long long st,dr,m;
	st=0LL;
	dr=N;
	while(st<=dr)
	{
		m=st+(dr-st)/2LL;
		if(m*m<=N && (m+1LL)*(m+1LL)>N)
			return m;
		if(m*m<=N)
			st=m+1LL;
		else
			dr=m-1LL;
	}
	return 0;
}

int main()
{
	int i,lim;
	cin>>N;
	aux=N;
	if(N==1)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N%2==0)
	{
		f[++nrf]=2;
		while(N%2LL==0)
		{
			N=N/2LL;
			e[1]++;
		}
	}
	lim=(int)Sqrt();
	for(i=3;i<=lim && N>1LL;i+=2)
	{
		if(N%(long long)i==0)
		{
			f[++nrf]=i;
			while(N%(long long)i==0LL)
			{
				N=N/(long long)i;
				e[nrf]++;
			}
			lim=(int)Sqrt();
		}
	}
	if(nrf==0 || (nrf==1 && e[1]==(int)aux))
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N>1LL)
	{
		nrf++;
		e[nrf]=1;
	}
	if(nrf==1 && e[1]==2)
	{
		cout<<"2\n";
		return 0;
	}
	if(nrf==2 && e[1]==1 && e[2]==1)
	{
		cout<<"2\n";
		return 0;
	}
	long long sol;
	sol=(long long)f[1];
	if(e[1]>1)
		sol*=sol;
	else
	{
		if(f[2]==0)
			sol*=N;
		else
			sol*=(long long)f[2];
	}
	cout<<"1\n"<<sol<<"\n";
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
long long N;
long long f[10000],e[10000],nrf;

inline long long Sqrt()
{
	long long st,dr,m;
	st=0;
	dr=N;
	while(st<=dr)
	{
		m=st+(dr-st)/2;
		if(m*m<=N && (m+1)*(m+1)>N)
			return m;
		if(m*m<=N)
			st=m+1;
		else
			dr=m-1;
	}
	return 0;
}

int main()
{
	long long i,lim;
	cin>>N;
	if(N==1)
	{
		cout<<"1\n0\n";
		return 0;
	}
	i=2;
	if(N%2==0)
	{
		f[++nrf]=i;
		while(N%i==0)
		{
			N=N/i;
			e[nrf]++;
		}
	}
	lim=Sqrt();
	for(i=3;i<=lim && N>1LL;i+=2)
	{
		if(N%i==0)
		{
			f[++nrf]=i;
			while(N%i==0)
			{
				N=N/i;
				e[nrf]++;
			}
			lim=(int)Sqrt();
		}
	}
	if(N>1LL)
	{
		nrf++;
		f[nrf]=N;
		e[nrf]=1;
	}
	if(nrf==1 && f[1]==N)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(nrf==1 && e[1]==2)
	{
		cout<<"2\n";
		return 0;
	}
	if(nrf==2 && e[1]==1 && e[2]==1)
	{
		cout<<"2\n";
		return 0;
	}
	long long sol;
	sol=f[1];
	if(e[1]>1)
		sol*=sol;
	else
	{
		sol*=f[2];
	}
	cout<<"1\n"<<sol<<"\n";
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
long long N;
int f[10000],e[10000],nrf;

inline long long Sqrt()
{
	long long st,dr,m;
	st=0;
	dr=N;
	while(st<=dr)
	{
		m=st+(dr-st)/2;
		if(m*m<=N && (m+1)*(m+1)>N)
			return m;
		if(m*m<=N)
			st=m+1;
		else
			dr=m-1;
	}
	return 0;
}

int main()
{
	int i,lim;
	cin>>N;
	if(N==1)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N%2==0)
	{
		f[++nrf]=2;
		while(N%2==0)
		{
			N=N/2;
			e[1]++;
		}
	}
	lim=(int)Sqrt();
	for(i=3;i<=lim && N>1;i+=2)
	{
		if(N%i==0)
		{
			f[++nrf]=i;
			while(N%i==0)
			{
				N=N/i;
				e[nrf]++;
			}
			lim=(int)Sqrt();
		}
	}
	if(nrf==0 || (nrf==1 && f[1]==N))
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N>1)
	{
		nrf++;
		e[nrf]=1;
	}
	if(nrf==1 && e[1]==2)
	{
		cout<<"2\n";
		return 0;
	}
	if(nrf==2 && e[1]==1 && e[2]==1)
	{
		cout<<"2\n";
		return 0;
	}
	long long sol;
	sol=(long long)f[1];
	if(e[1]>1)
		sol*=sol;
	else
	{
		if(f[2]==0)
			sol*=N;
		else
			sol*=(long long)f[2];
	}
	cout<<"1\n"<<sol<<"\n";
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
long long N,aux;
int f[10000],e[10000],nrf;

inline long long Sqrt()
{
	long long st,dr,m;
	st=0LL;
	dr=N;
	while(st<=dr)
	{
		m=st+(dr-st)/2LL;
		if(m*m<=N && (m+1LL)*(m+1LL)>N)
			return m;
		if(m*m<=N)
			st=m+1LL;
		else
			dr=m-1LL;
	}
	return 0LL;
}

int main()
{
	int i,lim;
	cin>>N;
	aux=N;
	if(N==1)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N==2)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N%2==0)
	{
		f[++nrf]=2;
		while(N%2LL==0)
		{
			N=N/2LL;
			e[1]++;
		}
	}
	lim=(int)Sqrt();
	for(i=3;i<=lim && N>1LL;i+=2)
	{
		if(N%(long long)i==0)
		{
			f[++nrf]=i;
			while(N%(long long)i==0LL)
			{
				N=N/(long long)i;
				e[nrf]++;
			}
			lim=(int)Sqrt();
		}
	}
	if(nrf==0)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N>1LL)
	{
		nrf++;
		e[nrf]=1;
	}
	if(nrf==1 && e[1]==2)
	{
		cout<<"2\n";
		return 0;
	}
	if(nrf==2 && e[1]==1 && e[2]==1)
	{
		cout<<"2\n";
		return 0;
	}
	long long sol;
	sol=(long long)f[1];
	if(e[1]>1)
		sol*=sol;
	else
	{
		if(f[2]==0)
			sol*=N;
		else
			sol*=(long long)f[2];
	}
	cout<<"1\n"<<sol<<"\n";
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
long long N,aux;
int f[10000],e[10000],nrf;

inline long long Sqrt()
{
	long long st,dr,m;
	st=0;
	dr=N;
	while(st<=dr)
	{
		m=st+(dr-st)/2;
		if(m*m<=N && (m+1)*(m+1)>N)
			return m;
		if(m*m<=N)
			st=m+1;
		else
			dr=m-1;
	}
	return 0;
}

int main()
{
	int i,lim;
	cin>>N;
	aux=N;
	if(N==1)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N%2==0)
	{
		f[++nrf]=2;
		while(N%2LL==0)
		{
			N=N/2LL;
			e[1]++;
		}
	}
	lim=(int)Sqrt();
	for(i=3;i<=lim && N>1LL;i+=2)
	{
		if(N%(long long)i==0)
		{
			f[++nrf]=i;
			while(N%(long long)i==0)
			{
				N=N/(long long)i;
				e[nrf]++;
			}
			lim=(int)Sqrt();
		}
	}
	if(nrf==0 || (nrf==1 && e[1]==(int)aux))
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N>1LL)
	{
		nrf++;
		e[nrf]=1;
	}
	if(nrf==1 && e[1]==2)
	{
		cout<<"2\n";
		return 0;
	}
	if(nrf==2 && e[1]==1 && e[2]==1)
	{
		cout<<"2\n";
		return 0;
	}
	long long sol;
	sol=(long long)f[1];
	if(e[1]>1)
		sol*=sol;
	else
	{
		if(f[2]==0)
			sol*=N;
		else
			sol*=(long long)f[2];
	}
	cout<<"1\n"<<sol<<"\n";
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
long long N;
int f[10000],e[10000],nrf;
int main()
{
	int i,lim;
	cin>>N;
	if(N==1)
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N%2==0)
	{
		f[++nrf]=2;
		while(N%2==0)
		{
			N=N/2;
			e[1]++;
		}
	}
	lim=(int)sqrt((long double)N);
	for(i=3;i<=lim && N>1;i+=2)
	{
		if(N%i==0)
		{
			f[++nrf]=i;
			while(N%i==0)
			{
				N=N/i;
				e[nrf]++;
			}
			lim=(int)sqrt((long double)N);
		}
	}
	if(nrf==0 || (nrf==1 && f[1]==N))
	{
		cout<<"1\n0\n";
		return 0;
	}
	if(N>1)
	{
		nrf++;
		e[nrf]=1;
	}
	if(nrf==1 && e[1]==2)
	{
		cout<<"2\n";
		return 0;
	}
	if(nrf==2 && e[1]==1 && e[2]==1)
	{
		cout<<"2\n";
		return 0;
	}
	long long sol;
	sol=(long long)f[1];
	if(e[1]>1)
		sol*=sol;
	else
	{
		if(f[2]==0)
			sol*=N;
		else
			sol*=(long long)f[2];
	}
	cout<<"1\n"<<sol<<"\n";
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
using namespace std;
double a;
long long int n, m1, m2, q, x;
bool b = false, bo = false, boo = false;
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>q;
	a = q;
	n = floor(sqrt(a));
	for (int i = 2; i <= n; i++)
		if (q % i == 0) { b = true; break; }
	if (b == false) {cout<<"1"<<endl<<"0"; return 0;} else
	{
		for (int i = 4; i <= n; i++)
			if (q % i == 0)
			{
				a = i;
				bo = false;
				m1 = floor(sqrt(a));
				boo = false;

			  for (int j = 2; j <= m1; j++)
			  	if (i % j == 0) { boo = true; j = m1 + 1;}

			  if (boo == true)
				for (int k = 2; k <= m1; k++)
				{
					a = k;
					for (int j = 2; j <= floor(sqrt(a)); j++)
						if (k % j == 0) {bo = true; k = m1 + 1; j = floor(sqrt(a)) + 1;}
				if (bo == false)	{ cout<<1<<endl<<i; return 0;}
				}

				a = q / i;
				m2 = floor(sqrt(a));
				bo = false;
				x = q / i;
				boo = false;

			  for (int j = 2; j <= m2; j++)
			  	if (x % j == 0) { boo = true; j = m2 + 1;}

			  if (boo == true)
				for (int k = 2; k <= m2; k++)
				{
					a = k;
					for (int j = 2; j <= floor(sqrt(a)); j++)
						if (k % j == 0) {bo = true; k = m2 + 1; j = floor(sqrt(a)) + 1;}
				if (bo == false)	{ cout<<1<<endl<<x; return 0;}
				}
			}
	}
	cout<<"2";
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
long long int q, n, m, a[10000];
double x;
bool cmp(long long int x, long long int y)
{
	return x < y;
}
bool IsPrime(long long int qwe)
{
	long long int s;
	double d;
	d = qwe;
	s = floor(sqrt(d));
	for (int i = 2; i <= s; i++)
		if (qwe % i == 0) {i = s + 1; return false;}
	return true;
}

int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	cin>>q;
	if (IsPrime(q)) cout<<1<<endl<<0; else
	{
		x = q;
		n = floor(sqrt(x));
		for (int i = 2; i <= n; i++)
		{
			if (q % i == 0)
			{
				if (IsPrime(i)) {a[m] = i; m++;}
				if (IsPrime(q / i)) {a[m] = q / i; m++;}
			}
		}
		sort(a, a + m, cmp);
		if (m == 1 && a[0] * a[0] == q) cout<<2; else
		if (m == 1 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else
		if (m == 2) cout<<2; else cout<<1<<endl<<a[0] * a[1];
	}
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
long long int q, n, m, a[1000];
double x;
bool cmp(int x, int y)
{
	return x < y;
}
bool IsPrime(int qwe)
{
	int s;
	double d;
	d = qwe;
	s = floor(sqrt(d));
	for (int i = 2; i <= s; i++)
		if (qwe % i == 0) {i = s + 1; return false;}
	return true;
}

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>q;
	if (IsPrime(q)) cout<<1<<endl<<0; else
	{
		x = q;
		n = floor(sqrt(x));
		for (int i = 2; i <= n; i++)
		{
			if (q % i == 0)
			{
				if (IsPrime(i)) {a[m] = i; m++;}
				if (IsPrime(q / i)) {a[m] = q / i; m++;}
			}
		}
		sort(a, a + m, cmp);
		if (m == 1 && a[0] * a[0] == q) cout<<2; else
		if (m == 1 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else
		if (m == 2) cout<<2; else cout<<1<<endl<<a[0] * a[1];
	}
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
long long int q, n, m, a[10000];
double x;
bool cmp(long long int x, long long int y)
{
	return x < y;
}
bool IsPrime(long long int qwe)
{
	long long int s;
	double d;
	d = qwe;
	s = floor(sqrt(d));
	for (int i = 2; i <= s; i++)
		if (qwe % i == 0) {i = s + 1; return false;}
	return true;
}

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>q;
	if (IsPrime(q)) cout<<1<<endl<<0; else
	{
		x = q;
		n = floor(sqrt(x));
		for (int i = 2; i <= n; i++)
		{
			if (q % i == 0)
			{
				if (IsPrime(i)) {a[m] = i; m++;}
				if (IsPrime(q / i)) {a[m] = q / i; m++;}
			}
		}
		sort(a, a + m, cmp);
		if (m == 1 && a[0] * a[0] == q) cout<<2; else
		if (m == 1 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else
		if (m == 2 && a[0] * a[1] == q) cout<<2; else
		if (m == 2 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else cout<<1<<endl<<a[0] * a[1];
	}
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
long long int q, n, m, a[10000];
double x;
bool cmp(long long int x, long long int y)
{
	return x < y;
}
bool IsPrime(long long int qwe)
{
	long long int s;
	double d;
	d = qwe;
	s = floor(sqrt(d));
	for (int i = 2; i <= s; i++)
		if (qwe % i == 0) {i = s + 1; return false;}
	return true;
}

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>q;
	if (IsPrime(q)) cout<<1<<endl<<0; else
	{
		x = q;
		n = floor(sqrt(x));
		for (int i = 2; i <= n; i++)
		{
			if (q % i == 0)
			{
				if (IsPrime(i)) {a[m] = i; m++;}
				if (IsPrime(q / i)) {a[m] = q / i; m++;}
			}
		}
		sort(a, a + m, cmp);
		if (m == 1 && a[0] * a[0] == q) cout<<2; else
		if (m == 1 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else
		if (m == 2 && a[0] * a[1] == q) cout<<2;
		if (m == 2 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else cout<<1<<endl<<a[0] * a[1];
	}
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
long long int q, n, m, a[10000];
double x;
bool cmp(long long int x, long long int y)
{
	return x < y;
}
bool IsPrime(long long int qwe)
{
	long long int s;
	double d;
	d = qwe;
	s = floor(sqrt(d));
	for (int i = 2; i <= s; i++)
		if (qwe % i == 0) {i = s + 1; return false;}
	return true;
}

int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	cin>>q;
	if (IsPrime(q)) cout<<1<<endl<<0; else
	{
		x = q;
		n = floor(sqrt(x));
		for (int i = 2; i <= n; i++)
		{
			if (q % i == 0)
			{
				if (IsPrime(i)) {a[m] = i; m++;}
				if (IsPrime(q / i)) {a[m] = q / i; m++;}
			}
		}
		sort(a, a + m, cmp);
		if (m == 1 && a[0] * a[0] == q) cout<<2; else
		if (m == 1 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else
		if (m == 2 && a[0] * a[1] != q && q % (a[0] * a[0]) == 0) cout<<1<<endl<<a[0] * a[0]; else
		if (m == 2 && a[0] * a[1] != q && q % (a[1] * a[1]) == 0) cout<<1<<endl<<a[1] * a[1]; else
		if (m == 2 && a[0] * a[1] == q) cout<<2; else cout<<1<<endl<<a[0] * a[1];
	}
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
long long int q, n, m, a[10000];
double x;
bool cmp(long long int x, long long int y)
{
	return x < y;
}
bool IsPrime(long long int qwe)
{
	long long int s;
	double d;
	d = qwe;
	s = floor(sqrt(d));
	for (int i = 2; i <= s; i++)
		if (qwe % i == 0) {i = s + 1; return false;}
	return true;
}

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>q;
	if (IsPrime(q)) cout<<1<<endl<<0; else
	{
		x = q;
		n = floor(sqrt(x));
		for (int i = 2; i <= n; i++)
		{
			if (q % i == 0)
			{
				if (IsPrime(i)) {a[m] = i; m++;}
				if (IsPrime(q / i)) {a[m] = q / i; m++;}
			}
		}
		sort(a, a + m, cmp);
		if (m == 1 && a[0] * a[0] == q) cout<<2; else
		if (m == 1 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else
		if (m == 2) cout<<2; else cout<<1<<endl<<a[0] * a[1];
	}
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
using namespace std;
double a;
long long int n, m1, m2, q, x;
bool b = false;
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>q;
	a = q;
	n = floor(sqrt(a));
	for (int i = 2; i <= n; i++)
		if (q % i == 0) { b = true; break; }
	if (b == false) {cout<<"1"<<endl<<"0"; return 0;} else
	{
		for (int i = 4; i <= n; i++)
			if (q % i == 0)
			{
				a = i;
				m1 = floor(sqrt(a));
				a = q / i;
				m2 = floor(sqrt(a));

				for (int j = 2; j <= m1; j++)
					if (i % j == 0){ cout<<1<<endl<<i; return 0;}
				x = q / i;
				for (int j = 2; j <= m2; j++)
					if (x % j == 0){ cout<<1<<endl<<x; return 0;}
			}
	}
	cout<<"2";
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
long long int q, n, m, a[10000];
double x;
bool cmp(long long int x, long long int y)
{
	return x < y;
}
bool IsPrime(long long int qwe)
{
	long long int s;
	double d;
	d = qwe;
	s = floor(sqrt(d));
	for (int i = 2; i <= s; i++)
		if (qwe % i == 0) {i = s + 1; return false;}
	return true;
}

int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	cin>>q;
	if (IsPrime(q)) cout<<1<<endl<<0; else
	{
		x = q;
		n = floor(sqrt(x));
		for (int i = 2; i <= n; i++)
		{
			if (q % i == 0)
			{
				if (IsPrime(i)) {a[m] = i; m++;}
				if (IsPrime(q / i)) {a[m] = q / i; m++;}
			}
		}
		sort(a, a + m, cmp);
		if (m == 1 && a[0] * a[0] == q) cout<<2; else
		if (m == 1 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else
		if (m == 2 && a[0] * a[1] == q) cout<<2;
		if (m == 2 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else cout<<1<<endl<<a[0] * a[1];
	}
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
using namespace std;
double a;
long long int n, m1, m2, q, x;
bool b = false, bo = false, boo = false;
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>q;
	a = q;
	n = floor(sqrt(a));
	for (int i = 2; i <= n; i++)
		if (q % i == 0) { b = true; break; }
	if (b == false) {cout<<"1"<<endl<<"0"; return 0;} else
	{
		for (int i = 2; i <= n; i++)
			if (q % i == 0)
			{
				a = i;
				bo = false;
				m1 = floor(sqrt(a));
				boo = false;

			  for (int j = 2; j <= m1; j++)
			  	if (i % j == 0) { boo = true; j = m1 + 1;}

			  if (boo == true)
				for (int k = 2; k <= m1; k++)
				{
					a = k;
					for (int j = 2; j <= floor(sqrt(a)); j++)
						if (k % j == 0) {bo = true; k = m1 + 1; j = floor(sqrt(a)) + 1;}
				if (bo == false)	{ cout<<1<<endl<<i; return 0;}
				}

				a = q / i;
				m2 = floor(sqrt(a));
				bo = false;
				x = q / i;
				boo = false;

			  for (int j = 2; j <= m2; j++)
			  	if (x % j == 0) { boo = true; j = m2 + 1;}

			  if (boo == true)
				for (int k = 2; k <= m2; k++)
				{
					a = k;
					for (int j = 2; j <= floor(sqrt(a)); j++)
						if (k % j == 0) {bo = true; k = m2 + 1; j = floor(sqrt(a)) + 1;}
				if (bo == false)	{ cout<<1<<endl<<x; return 0;}
				}
			}
	}
	cout<<"2";
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<set>
#include<cmath>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
long long int q, n, m, a[10000];
double x;
bool cmp(long long int x, long long int y)
{
	return x < y;
}
bool IsPrime(long long int qwe)
{
	long long int s;
	double d;
	d = qwe;
	s = floor(sqrt(d));
	for (int i = 2; i <= s; i++)
		if (qwe % i == 0) {i = s + 1; return false;}
	return true;
}

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>q;
	if (IsPrime(q)) cout<<1<<endl<<0; else
	{
		x = q;
		n = floor(sqrt(x));
		for (int i = 2; i <= n; i++)
		{
			if (q % i == 0)
			{
				if (IsPrime(i)) {a[m] = i; m++;}
				if (IsPrime(q / i)) {a[m] = q / i; m++;}
			}
		}
		sort(a, a + m, cmp);
		if (m == 1 && a[0] * a[0] == q) cout<<2; else
		if (m == 1 && a[0] * a[0] != q) cout<<1<<endl<<a[0] * a[0]; else
		if (m == 2 && a[0] * a[1] != q && q % (a[0] * a[0]) == 0) cout<<1<<endl<<a[0] * a[0]; else
		if (m == 2 && a[0] * a[1] != q && q % (a[1] * a[1]) == 0) cout<<1<<endl<<a[1] * a[1]; else
		if (m == 2 && a[0] * a[1] == q) cout<<2; else cout<<1<<endl<<a[0] * a[1];
	}
	return 0;
}


/*
Abolfazl Kazemi

BSc in Software Engineering: IAUN Iran
MSc student of Software Engineering: IUST
UVA, topcoder, codeforces, facebook account: AKJ88
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <functional>
#include <string>

using namespace std;

#define     For(i,a,b)        for (i=a; i<b; i++)
#define     Rep(i,a)          for (i=0; i<a; i++)
#define     FIT(it,v)         for (it=(v).begin(); it!=(v).end(); ++it)
#define     ALL(v)            (v).begin(),(v).end()
#define     Set(a,x)          memset((a),(x),sizeof(a))
#define     EXIST(a,b)        find(ALL(a),(b))!=(a).end()
#define     Sort(x)           sort(ALL(x))
#define     GSORT(x)          sort(ALL(x), greater<typeof(*((x).begin()))>())
#define     UNIQUE(v)         Sort(v); (v).resize(unique(ALL(v)) - (v).begin())
#define     SF                scanf
#define     PF                printf

#define     EPS         1e-8
#define     PI          acos(-1)
#define     MAXN        10000005
#define     MOD         1000000007
#define     INF         1000000000
#define     X           first
#define     Y           second

typedef pair<int, int> ii;
typedef pair<double, double> dd;
typedef long long ll;
typedef unsigned long long llu;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<dd> vdd;

vector<int> primeNumbers;
bitset<MAXN> isPrime;

void prodPrimes(){
    isPrime.set();
    ll num, i;
    primeNumbers.push_back(2);
    for (num = 3; num < MAXN; num += 2){
        if (isPrime[num]){
            for (i = num*num; i < MAXN; i += num)
                isPrime[i] = 0;
            primeNumbers.push_back(num);
        }
    }
}

ll getNum(ll n){
    if (n == 1)
        return 1;
    ll p1=0, p=2, num=n;
    int i = 1, c;

    while (n>1){
        c = 0;
        while (n%p == 0)
            c++, n/=p;
        if (c>2 || (c==2 && n>1))
            return (p*p);
        else if (c && p1 && (p1*p != num))
            return p1*p;
        else if (c)
            p1 = p;
        p = primeNumbers[i++];
    }
    if (n > 1)
        return 1;
    return 0;
}

int main(){
    ll num, res;
#ifndef ONLINE_JUDGE
    freopen("C:\\acm_inp\\107C.in", "r", stdin);
    //freopen("C:\\acm_inp\\PSEUDO.OUT", "w", stdout);
#endif
    prodPrimes();

    SF("%I64d", &num);
    res = getNum(num);
    if (res)
        PF("1\n%I64d", (res == 1 ? 0LL : res));
    else
        PF("2\n");

    return 0;
}


/*
Abolfazl Kazemi

BSc in Software Engineering: IAUN Iran
MSc student of Software Engineering: IUST
UVA, topcoder, codeforces, facebook account: AKJ88
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <functional>
#include <string>

using namespace std;

#define     For(i,a,b)        for (i=a; i<b; i++)
#define     Rep(i,a)          for (i=0; i<a; i++)
#define     FIT(it,v)         for (it=(v).begin(); it!=(v).end(); ++it)
#define     ALL(v)            (v).begin(),(v).end()
#define     Set(a,x)          memset((a),(x),sizeof(a))
#define     EXIST(a,b)        find(ALL(a),(b))!=(a).end()
#define     Sort(x)           sort(ALL(x))
#define     GSORT(x)          sort(ALL(x), greater<typeof(*((x).begin()))>())
#define     UNIQUE(v)         Sort(v); (v).resize(unique(ALL(v)) - (v).begin())
#define     SF                scanf
#define     PF                printf

#define     EPS         1e-8
#define     PI          acos(-1)
#define     MAXN        10000005
#define     MOD         1000000007
#define     INF         1000000000
#define     X           first
#define     Y           second

typedef pair<int, int> ii;
typedef pair<double, double> dd;
typedef long long ll;
typedef unsigned long long llu;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<dd> vdd;

vector<int> primeNumbers;
bitset<MAXN> isPrime;

void prodPrimes(){
    isPrime.set();
    ll num, i;
    primeNumbers.push_back(2);
    for (num = 3; num < MAXN; num += 2){
        if (isPrime[num]){
            for (i = num*num; i < MAXN; i += num)
                isPrime[i] = 0;
            primeNumbers.push_back(num);
        }
    }
}

ll getNum(ll n){
    if (n == 1)
        return 1;
    ll p1=0, p=2, num=n;
    bool isPrime = true;
    int i = 1, c;

    while (n > 1 && i<primeNumbers.size()){
        c = 0;
        while (n%p == 0){
            c++, n /= p;
            if (p1 || c>1)
                isPrime = false;
        }
        if (c>2 || (c==2 && n>1))
            return (p*p);
        else if (c && p1 && (p1*p != num))
            return p1*p;
        else if (c)
            p1 = p;
        p = primeNumbers[i++];
    }
    if ((!p1 && n > 1) || isPrime)
        return 1;
    return 0;
}

int main(){
    ll num, res;
#ifndef ONLINE_JUDGE
    freopen("C:\\acm_inp\\107C.in", "r", stdin);
    //freopen("C:\\acm_inp\\PSEUDO.OUT", "w", stdout);
#endif
    prodPrimes();

    SF("%I64d", &num);
    res = getNum(num);
    if (res)
        PF("1\n%I64d", (res == 1 ? 0LL : res));
    else
        PF("2\n");

    return 0;
}


/*
Abolfazl Kazemi

BSc in Software Engineering: IAUN Iran
MSc student of Software Engineering: IUST
UVA, topcoder, codeforces, facebook account: AKJ88
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <functional>
#include <string>

using namespace std;

#define     For(i,a,b)        for (i=a; i<b; i++)
#define     Rep(i,a)          for (i=0; i<a; i++)
#define     FIT(it,v)         for (it=(v).begin(); it!=(v).end(); ++it)
#define     ALL(v)            (v).begin(),(v).end()
#define     Set(a,x)          memset((a),(x),sizeof(a))
#define     EXIST(a,b)        find(ALL(a),(b))!=(a).end()
#define     Sort(x)           sort(ALL(x))
#define     GSORT(x)          sort(ALL(x), greater<typeof(*((x).begin()))>())
#define     UNIQUE(v)         Sort(v); (v).resize(unique(ALL(v)) - (v).begin())
#define     SF                scanf
#define     PF                printf

#define     EPS         1e-8
#define     PI          acos(-1)
#define     MAXN        10000005
#define     MOD         1000000007
#define     INF         1000000000
#define     X           first
#define     Y           second

typedef pair<int, int> ii;
typedef pair<double, double> dd;
typedef long long ll;
typedef unsigned long long llu;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<dd> vdd;

vector<int> primeNumbers;
bitset<MAXN> isPrime;

void prodPrimes(){
    isPrime.set();
    ll num, i;
    primeNumbers.push_back(2);
    for (num = 3; num < MAXN; num += 2){
        if (isPrime[num]){
            for (i = num*num; i < MAXN; i += num)
                isPrime[i] = 0;
            primeNumbers.push_back(num);
        }
    }
}

ll getNum(ll n){
    if (n == 1)
        return 1;
    ll p1 = 0, p = 2, num = n;
    bool isPrime = true;
    int i = 1, c;

    while (n > 1 && i<primeNumbers.size()){
        c = 0;
        while (n%p == 0){
            c++, n /= p;
            if (p1 || c>1)
                isPrime = false;
        }
        if (c > 2 || (c == 2 && n > 1))
            return (p*p);
        else if (c && p1 && (p1*p != num))
            return p1*p;
        else if (c)
            p1 = p;
        p = primeNumbers[i++];
    }
    if ((!p1 && n > 1) || (n == 1 && isPrime))
        return 1;
    return 0;
}

ll firstFactor(ll n){
    for (ll i = 2; i*i <= n; i++)
    if (n%i == 0)
        return i;
    return n;
}

int main(){
    ll num, f1, res;
#ifndef ONLINE_JUDGE
    freopen("C:\\acm_inp\\107C.in", "r", stdin);
    //freopen("C:\\acm_inp\\PSEUDO.OUT", "w", stdout);
#endif

    SF("%I64d", &num);
    f1 = firstFactor(num);
    if (f1 == num)
        PF("1\n0\n");
    else{
        res = f1*firstFactor(num / f1);
        if (res != num)
            PF("1\n%I64d\n", res);
        else
            PF("2\n");
    }

    //prodPrimes();

    //SF("%I64d", &num);
    //res = getNum(num);
    //if (res)
    //  PF("1\n%I64d", (res == 1 ? 0LL : res));
    //else
    //  PF("2\n");

    return 0;
}


/*
Abolfazl Kazemi

BSc in Software Engineering: IAUN Iran
MSc student of Software Engineering: IUST
UVA, topcoder, codeforces, facebook account: AKJ88
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <functional>
#include <string>

using namespace std;

#define     For(i,a,b)        for (i=a; i<b; i++)
#define     Rep(i,a)          for (i=0; i<a; i++)
#define     FIT(it,v)         for (it=(v).begin(); it!=(v).end(); ++it)
#define     ALL(v)            (v).begin(),(v).end()
#define     Set(a,x)          memset((a),(x),sizeof(a))
#define     EXIST(a,b)        find(ALL(a),(b))!=(a).end()
#define     Sort(x)           sort(ALL(x))
#define     GSORT(x)          sort(ALL(x), greater<typeof(*((x).begin()))>())
#define     UNIQUE(v)         Sort(v); (v).resize(unique(ALL(v)) - (v).begin())
#define     SF                scanf
#define     PF                printf

#define     EPS         1e-8
#define     PI          acos(-1)
#define     MAXN        10000005
#define     MOD         1000000007
#define     INF         1000000000
#define     X           first
#define     Y           second

typedef pair<int, int> ii;
typedef pair<double, double> dd;
typedef long long ll;
typedef unsigned long long llu;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<dd> vdd;

vector<int> primeNumbers;
bitset<MAXN> isPrime;

void prodPrimes(){
    isPrime.set();
    ll num, i;
    primeNumbers.push_back(2);
    for (num = 3; num < MAXN; num += 2){
        if (isPrime[num]){
            for (i = num*num; i < MAXN; i += num)
                isPrime[i] = 0;
            primeNumbers.push_back(num);
        }
    }
}

ll getNum(ll n){
    if (n == 1)
        return 1;
    ll p1=0, p=2, num=n;
    bool isPrime = true;
    int i = 1, c;

    while (n > 1 && i<primeNumbers.size()){
        c = 0;
        while (n%p == 0){
            c++, n /= p;
            if (p1 || c>1)
                isPrime = false;
        }
        if (c>2 || (c==2 && n>1))
            return (p*p);
        else if (c && p1 && (p1*p != num))
            return p1*p;
        else if (c)
            p1 = p;
        p = primeNumbers[i++];
    }
    if ((!p1 && n > 1) || (n==1 && isPrime))
        return 1;
    return 0;
}

int main(){
    ll num, res;
#ifndef ONLINE_JUDGE
    freopen("C:\\acm_inp\\107C.in", "r", stdin);
    //freopen("C:\\acm_inp\\PSEUDO.OUT", "w", stdout);
#endif
    prodPrimes();

    SF("%I64d", &num);
    res = getNum(num);
    if (res)
        PF("1\n%I64d", (res == 1 ? 0LL : res));
    else
        PF("2\n");

    return 0;
}


/*
Abolfazl Kazemi

BSc in Software Engineering: IAUN Iran
MSc student of Software Engineering: IUST
UVA, topcoder, codeforces, facebook account: AKJ88
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <functional>
#include <string>

using namespace std;

#define     For(i,a,b)        for (i=a; i<b; i++)
#define     Rep(i,a)          for (i=0; i<a; i++)
#define     FIT(it,v)         for (it=(v).begin(); it!=(v).end(); ++it)
#define     ALL(v)            (v).begin(),(v).end()
#define     Set(a,x)          memset((a),(x),sizeof(a))
#define     EXIST(a,b)        find(ALL(a),(b))!=(a).end()
#define     Sort(x)           sort(ALL(x))
#define     GSORT(x)          sort(ALL(x), greater<typeof(*((x).begin()))>())
#define     UNIQUE(v)         Sort(v); (v).resize(unique(ALL(v)) - (v).begin())
#define     SF                scanf
#define     PF                printf

#define     EPS         1e-8
#define     PI          acos(-1)
#define     MAXN        10000005
#define     MOD         1000000007
#define     INF         1000000000
#define     X           first
#define     Y           second

typedef pair<int, int> ii;
typedef pair<double, double> dd;
typedef long long ll;
typedef unsigned long long llu;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<dd> vdd;

vector<int> primeNumbers;
bitset<MAXN> isPrime;

void prodPrimes(){
    isPrime.set();
    ll num, i;
    primeNumbers.push_back(2);
    for (num = 3; num < MAXN; num += 2){
        if (isPrime[num]){
            for (i = num*num; i < MAXN; i += num)
                isPrime[i] = 0;
            primeNumbers.push_back(num);
        }
    }
}

ll getNum(ll n){
    if (n == 1)
        return 1;
    ll p1=0, p=2, num=n;
    bool isPrime = true;
    int i = 1, c;

    while (n > 1 && i<primeNumbers.size()){
        c = 0;
        while (n%p == 0){
            c++, n /= p;
            if (p1 || c>1)
                isPrime = false;
        }
        if (c>2 || (c==2 && n>1))
            return (p*p);
        else if (c && p1 && (p1*p != num))
            return p1*p;
        else if (c)
            p1 = p;
        p = primeNumbers[i++];
    }
    if (n > 1 || isPrime)
        return 1;
    return 0;
}

int main(){
    ll num, res;
#ifndef ONLINE_JUDGE
    freopen("C:\\acm_inp\\107C.in", "r", stdin);
    //freopen("C:\\acm_inp\\PSEUDO.OUT", "w", stdout);
#endif
    prodPrimes();

    SF("%I64d", &num);
    res = getNum(num);
    if (res)
        PF("1\n%I64d", (res == 1 ? 0LL : res));
    else
        PF("2\n");

    return 0;
}


/*
Abolfazl Kazemi

BSc in Software Engineering: IAUN Iran
MSc student of Software Engineering: IUST
UVA, topcoder, codeforces, facebook account: AKJ88
*/

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <functional>
#include <string>

using namespace std;

#define     For(i,a,b)        for (i=a; i<b; i++)
#define     Rep(i,a)          for (i=0; i<a; i++)
#define     FIT(it,v)         for (it=(v).begin(); it!=(v).end(); ++it)
#define     ALL(v)            (v).begin(),(v).end()
#define     Set(a,x)          memset((a),(x),sizeof(a))
#define     EXIST(a,b)        find(ALL(a),(b))!=(a).end()
#define     Sort(x)           sort(ALL(x))
#define     GSORT(x)          sort(ALL(x), greater<typeof(*((x).begin()))>())
#define     UNIQUE(v)         Sort(v); (v).resize(unique(ALL(v)) - (v).begin())
#define     SF                scanf
#define     PF                printf

#define     EPS         1e-8
#define     PI          acos(-1)
#define     MAXN        10000005
#define     MOD         1000000007
#define     INF         1000000000
#define     X           first
#define     Y           second

typedef pair<int, int> ii;
typedef pair<double, double> dd;
typedef long long ll;
typedef unsigned long long llu;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<dd> vdd;

vector<int> primeNumbers;
bitset<MAXN> isPrime;

void prodPrimes(){
    isPrime.set();
    ll num, i;
    primeNumbers.push_back(2);
    for (num = 3; num < MAXN; num += 2){
        if (isPrime[num]){
            for (i = num*num; i < MAXN; i += num)
                isPrime[i] = 0;
            primeNumbers.push_back(num);
        }
    }
}

ll getNum(ll n){
    if (n == 1)
        return 1;
    ll p1=0, p=2, num=n;
    bool isPrime = true;
    int i = 1, c;

    while (n>1){
        c = 0;
        while (n%p == 0){
            c++, n /= p;
            if (p1 || c>1)
                isPrime = false;
        }
        if (c>2 || (c==2 && n>1))
            return (p*p);
        else if (c && p1 && (p1*p != num))
            return p1*p;
        else if (c)
            p1 = p;
        p = primeNumbers[i++];
    }
    if (n > 1 || isPrime)
        return 1;
    return 0;
}

int main(){
    ll num, res;
#ifndef ONLINE_JUDGE
    freopen("C:\\acm_inp\\107C.in", "r", stdin);
    //freopen("C:\\acm_inp\\PSEUDO.OUT", "w", stdout);
#endif
    prodPrimes();

    SF("%I64d", &num);
    res = getNum(num);
    if (res)
        PF("1\n%I64d", (res == 1 ? 0LL : res));
    else
        PF("2\n");

    return 0;
}


//C
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
//C++
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <list>
using namespace std;

//start
//C
typedef long long LL;

#define INF 0x7F7F7F7F
#define HEAD 100
#define EDGE 10000
#define eps 1e-8

#define CLEAR(a,b) memset ( a , b , sizeof ( a ) )
#define CLEARN(a,b,s,size) memset ( a + s , b , sizeof size )

#define FOR(a,b,i) for ( i = a ; i < b ; i++ )
#define FORB(b,a,i) for ( i = b ; i > a ; i-- )
#define FORE(a,b,i) for ( i = a ; i <= b ; i++ )
#define FOREB(b,a,i) for ( i = b ; i >= a ; i-- )
#define FORN(a,b,i,nc) for ( i = a ; i < b ; i += nc )
#define FORNB(b,a,i,nc) for ( i = b ; i > a ; i -= nc )
#define FOREN(a,b,i,nc) for ( i = a ; i <= b ; i += nc )
#define FORENB(b,a,i,nc) for ( i = b ; i >= a ; i -= nc )

#define COPY(a,b,lt,rt,i) for ( i = lt ; i <= rt ; i++ ) a[i] = b[i];

#define sqr(a,b) sqrt ( (double) a * a + (double) b * b )

//c++
template <class T> inline T INT_LEN( T v ) { int len = 1 ; while ( v /= 10 ) ++len; return len; }

//#define LocalHost

//end

#define le 4000000

LL q;

bool isprime[le];

LL prime[le / 10];

int k;

LL ar[20] , br[20];

void prime_table (){
    int i , j , p = ( int ) ( sqrt ( 1. * le ) + 0.5 );
    CLEAR ( isprime , true );
    isprime[0] = isprime[1] = false;
    FORE ( 0 , p , i )
        if ( isprime[i] )
            FORN ( i + i , le , j , i )
            isprime[j] = false;
    k = 0;
    FOR ( 2 , le , i )
        if ( isprime[i] )
            prime[k++] = i;
}

int init ( LL num ){
    int i , L = 0 , p = ( int ) ( sqrt ( 1. * num ) + 0.5 );
    for ( i = 0 ; i < k && prime[i] <= p && prime[i] <= num ; i++ ){
        int c = 0;
        while ( num % prime[i] == 0 ){
            num /= prime[i];
            c++;
        }
        if ( c ) ar[L] = prime[i] , br[L++] = c;
    }
    if ( num > 1 ) ar[L] = num , br[L++] = 1;
    return L;
}

int get_num ( int num ){
    int i , sum = 0;
    FOR ( 0 , num , i )
        sum += br[i];
    return sum;
}

void solve (){
    int id = init ( q );
    int num = get_num ( id );
    if ( id < 1 ) puts ( "1\n0" );
    else if ( id == 1 ){
        if ( num == 1 )  puts ( "1\n0" );
        else if ( num == 2 ) puts ( "2" );
        else {
            printf ( "%d\n%I64d\n" , 1 , (LL) ar[0] * (LL) ar[0] );
        }
    }
    else {
        if ( num <= 2 ) puts ( "2" );
        else printf ( "%d\n%I64d\n" , 1 , (LL) ar[0] * (LL) ar[1] );
    }
}

int main (void){
#ifdef LocalHost
    freopen ( "in.in" , "r" , stdin );
    freopen ( "in.out" , "w" , stdout );
#endif
    prime_table ();
    while ( ~scanf ( "%I64d" , &q ) ){
        solve ();
    }
#ifdef LocalHost
    cout << endl << endl << "Time:  " << clock() << endl;
#endif
    return 0;
}


//C
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
//C++
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <list>
using namespace std;

//start
//C
typedef long long LL;

#define INF 0x7F7F7F7F
#define HEAD 100
#define EDGE 10000
#define eps 1e-8

#define CLEAR(a,b) memset ( a , b , sizeof ( a ) )
#define CLEARN(a,b,s,size) memset ( a + s , b , sizeof size )

#define FOR(a,b,i) for ( i = a ; i < b ; i++ )
#define FORB(b,a,i) for ( i = b ; i > a ; i-- )
#define FORE(a,b,i) for ( i = a ; i <= b ; i++ )
#define FOREB(b,a,i) for ( i = b ; i >= a ; i-- )
#define FORN(a,b,i,nc) for ( i = a ; i < b ; i += nc )
#define FORNB(b,a,i,nc) for ( i = b ; i > a ; i -= nc )
#define FOREN(a,b,i,nc) for ( i = a ; i <= b ; i += nc )
#define FORENB(b,a,i,nc) for ( i = b ; i >= a ; i -= nc )

#define COPY(a,b,lt,rt,i) for ( i = lt ; i <= rt ; i++ ) a[i] = b[i];

#define sqr(a,b) sqrt ( (double) a * a + (double) b * b )

//c++
template <class T> inline T INT_LEN( T v ) { int len = 1 ; while ( v /= 10 ) ++len; return len; }

//#define LocalHost

//end

#define le 4000000

LL q;

bool isprime[le];

int prime[le / 10];

int k;

int ar[20] , br[20];

void prime_table (){
	int i , j , p = ( int ) ( sqrt ( 1. * le ) + 0.5 );
	CLEAR ( isprime , true );
	isprime[0] = isprime[1] = false;
	FORE ( 0 , p , i )
		if ( isprime[i] )
			FORN ( i + i , le , j , i )
			isprime[j] = false;
	k = 0;
	FOR ( 2 , le , i )
		if ( isprime[i] )
			prime[k++] = i;
}

int init ( LL num ){
	int i , L = 0 , p = ( int ) ( sqrt ( 1. * num ) + 0.5 );
	for ( i = 0 ; i < k && prime[i] <= p && prime[i] <= num ; i++ ){
		int c = 0;
		while ( num % prime[i] == 0 ){
			num /= prime[i];
			c++;
		}
		if ( c ) ar[L] = prime[i] , br[L++] = c;
	}
	if ( num > 1 ) ar[L] = num , br[L++] = 1;
	return L;
}

int get_num ( int num ){
	int i , sum = 0;
	FOR ( 0 , num , i )
		sum += br[i];
	return sum;
}

void solve (){
	int id = init ( q );
	int num = get_num ( id );
	if ( id < 1 ) puts ( "1\n0" );
	else if ( id == 1 ){
		if ( num <= 2 )  puts ( "1\n0" );
		else if ( num == 3 ) puts ( "2" );
		else {
			printf ( "%d\n%I64d\n" , 1 , (LL) prime[0] * (LL) prime[0] * (LL) prime[0] );
		}
	}
	else {
		if ( num <= 2 ) puts ( "2" );
		else printf ( "%d\n%I64d\n" , 1 , (LL) prime[0] * (LL) prime[1] );
	}
}

int main (void){
#ifdef LocalHost
	freopen ( "in.in" , "r" , stdin );
	freopen ( "in.out" , "w" , stdout );
#endif
	prime_table ();
	while ( ~scanf ( "%I64d" , &q ) ){
		solve ();
	}
#ifdef LocalHost
	cout << endl << endl << "Time:	" << clock() << endl;
#endif
	return 0;
}


//C
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
//C++
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <list>
using namespace std;

//start
//C
typedef long long LL;

#define INF 0x7F7F7F7F
#define HEAD 100
#define EDGE 10000
#define eps 1e-8

#define CLEAR(a,b) memset ( a , b , sizeof ( a ) )
#define CLEARN(a,b,s,size) memset ( a + s , b , sizeof size )

#define FOR(a,b,i) for ( i = a ; i < b ; i++ )
#define FORB(b,a,i) for ( i = b ; i > a ; i-- )
#define FORE(a,b,i) for ( i = a ; i <= b ; i++ )
#define FOREB(b,a,i) for ( i = b ; i >= a ; i-- )
#define FORN(a,b,i,nc) for ( i = a ; i < b ; i += nc )
#define FORNB(b,a,i,nc) for ( i = b ; i > a ; i -= nc )
#define FOREN(a,b,i,nc) for ( i = a ; i <= b ; i += nc )
#define FORENB(b,a,i,nc) for ( i = b ; i >= a ; i -= nc )

#define COPY(a,b,lt,rt,i) for ( i = lt ; i <= rt ; i++ ) a[i] = b[i];

#define sqr(a,b) sqrt ( (double) a * a + (double) b * b )

//c++
template <class T> inline T INT_LEN( T v ) { int len = 1 ; while ( v /= 10 ) ++len; return len; }

//#define LocalHost

//end

#define le 4000000

LL q;

bool isprime[le];

LL prime[le / 10];

int k;

LL ar[20] , br[20];

void prime_table (){
    int i , j , p = ( int ) ( sqrt ( 1. * le ) + 0.5 );
    CLEAR ( isprime , true );
    isprime[0] = isprime[1] = false;
    FORE ( 0 , p , i )
        if ( isprime[i] )
            FORN ( i + i , le , j , i )
            isprime[j] = false;
    k = 0;
    FOR ( 2 , le , i )
        if ( isprime[i] )
            prime[k++] = i;
}

int init ( LL num ){
    int i , L = 0 , p = ( int ) ( sqrt ( 1. * num ) + 0.5 );
    for ( i = 0 ; i < k && prime[i] <= p && prime[i] <= num ; i++ ){
        int c = 0;
        while ( num % prime[i] == 0 ){
            num /= prime[i];
            c++;
        }
        if ( c ) ar[L] = prime[i] , br[L++] = c;
    }
    if ( num > 1 ) ar[L] = (int) num , br[L++] = 1;
    return L;
}

int get_num ( int num ){
    int i , sum = 0;
    FOR ( 0 , num , i )
        sum += br[i];
    return sum;
}

void solve (){
    int id = init ( q );
    int num = get_num ( id );
    if ( id < 1 ) puts ( "1\n0" );
    else if ( id == 1 ){
        if ( num == 1 )  puts ( "1\n0" );
        else if ( num == 2 ) puts ( "2" );
        else {
            printf ( "%d\n%I64d\n" , 1 , (LL) ar[0] * (LL) ar[0] );
        }
    }
    else {
        if ( num <= 2 ) puts ( "2" );
        else printf ( "%d\n%I64d\n" , 1 , (LL) ar[0] * (LL) ar[1] );
    }
}

int main (void){
#ifdef LocalHost
    freopen ( "in.in" , "r" , stdin );
    freopen ( "in.out" , "w" , stdout );
#endif
    prime_table ();
    while ( ~scanf ( "%I64d" , &q ) ){
        solve ();
    }
#ifdef LocalHost
    cout << endl << endl << "Time:  " << clock() << endl;
#endif
    return 0;
}


//C
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
//C++
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <list>
using namespace std;

//start
//C
typedef long long LL;

#define INF 0x7F7F7F7F
#define HEAD 100
#define EDGE 10000
#define eps 1e-8

#define CLEAR(a,b) memset ( a , b , sizeof ( a ) )
#define CLEARN(a,b,s,size) memset ( a + s , b , sizeof size )

#define FOR(a,b,i) for ( i = a ; i < b ; i++ )
#define FORB(b,a,i) for ( i = b ; i > a ; i-- )
#define FORE(a,b,i) for ( i = a ; i <= b ; i++ )
#define FOREB(b,a,i) for ( i = b ; i >= a ; i-- )
#define FORN(a,b,i,nc) for ( i = a ; i < b ; i += nc )
#define FORNB(b,a,i,nc) for ( i = b ; i > a ; i -= nc )
#define FOREN(a,b,i,nc) for ( i = a ; i <= b ; i += nc )
#define FORENB(b,a,i,nc) for ( i = b ; i >= a ; i -= nc )

#define COPY(a,b,lt,rt,i) for ( i = lt ; i <= rt ; i++ ) a[i] = b[i];

#define sqr(a,b) sqrt ( (double) a * a + (double) b * b )

//c++
template <class T> inline T INT_LEN( T v ) { int len = 1 ; while ( v /= 10 ) ++len; return len; }

//#define LocalHost

//end

#define le 4000000

LL q;

bool isprime[le];

int prime[le / 10];

int k;

int ar[20] , br[20];

void prime_table (){
    int i , j , p = ( int ) ( sqrt ( 1. * le ) + 0.5 );
    CLEAR ( isprime , true );
    isprime[0] = isprime[1] = false;
    FORE ( 0 , p , i )
        if ( isprime[i] )
            FORN ( i + i , le , j , i )
            isprime[j] = false;
    k = 0;
    FOR ( 2 , le , i )
        if ( isprime[i] )
            prime[k++] = i;
}

int init ( LL num ){
    int i , L = 0 , p = ( int ) ( sqrt ( 1. * num ) + 0.5 );
    for ( i = 0 ; i < k && prime[i] <= p && prime[i] <= num ; i++ ){
        int c = 0;
        while ( num % prime[i] == 0 ){
            num /= prime[i];
            c++;
        }
        if ( c ) ar[L] = prime[i] , br[L++] = c;
    }
    if ( num > 1 ) ar[L] = num , br[L++] = 1;
    return L;
}

int get_num ( int num ){
    int i , sum = 0;
    FOR ( 0 , num , i )
        sum += br[i];
    return sum;
}

void solve (){
    int id = init ( q );
    int num = get_num ( id );
    if ( id < 1 ) puts ( "1\n0" );
    else if ( id == 1 ){
        if ( num == 1 )  puts ( "1\n0" );
        else if ( num == 2 ) puts ( "2" );
        else {
            printf ( "%d\n%I64d\n" , 1 , (LL) prime[0] * (LL) prime[0] );
        }
    }
    else {
        if ( num <= 2 ) puts ( "2" );
        else printf ( "%d\n%I64d\n" , 1 , (LL) prime[0] * (LL) prime[1] );
    }
}

int main (void){
#ifdef LocalHost
    freopen ( "in.in" , "r" , stdin );
    freopen ( "in.out" , "w" , stdout );
#endif
    prime_table ();
    while ( ~scanf ( "%I64d" , &q ) ){
        solve ();
    }
#ifdef LocalHost
    cout << endl << endl << "Time:  " << clock() << endl;
#endif
    return 0;
}


//C
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
//C++
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <list>
using namespace std;

//start
//C
typedef long long LL;

#define INF 0x7F7F7F7F
#define HEAD 100
#define EDGE 10000
#define eps 1e-8

#define CLEAR(a,b) memset ( a , b , sizeof ( a ) )
#define CLEARN(a,b,s,size) memset ( a + s , b , sizeof size )

#define FOR(a,b,i) for ( i = a ; i < b ; i++ )
#define FORB(b,a,i) for ( i = b ; i > a ; i-- )
#define FORE(a,b,i) for ( i = a ; i <= b ; i++ )
#define FOREB(b,a,i) for ( i = b ; i >= a ; i-- )
#define FORN(a,b,i,nc) for ( i = a ; i < b ; i += nc )
#define FORNB(b,a,i,nc) for ( i = b ; i > a ; i -= nc )
#define FOREN(a,b,i,nc) for ( i = a ; i <= b ; i += nc )
#define FORENB(b,a,i,nc) for ( i = b ; i >= a ; i -= nc )

#define COPY(a,b,lt,rt,i) for ( i = lt ; i <= rt ; i++ ) a[i] = b[i];

#define sqr(a,b) sqrt ( (double) a * a + (double) b * b )

//c++
template <class T> inline T INT_LEN( T v ) { int len = 1 ; while ( v /= 10 ) ++len; return len; }

//#define LocalHost

//end

#define le 4000000

LL q;

bool isprime[le];

LL prime[le / 10];

int k;

int ar[20] , br[20];

void prime_table (){
    int i , j , p = ( int ) ( sqrt ( 1. * le ) + 0.5 );
    CLEAR ( isprime , true );
    isprime[0] = isprime[1] = false;
    FORE ( 0 , p , i )
        if ( isprime[i] )
            FORN ( i + i , le , j , i )
            isprime[j] = false;
    k = 0;
    FOR ( 2 , le , i )
        if ( isprime[i] )
            prime[k++] = i;
}

int init ( LL num ){
    int i , L = 0 , p = ( int ) ( sqrt ( 1. * num ) + 0.5 );
    for ( i = 0 ; i < k && prime[i] <= p && prime[i] <= num ; i++ ){
        int c = 0;
        while ( num % prime[i] == 0 ){
            num /= prime[i];
            c++;
        }
        if ( c ) ar[L] = prime[i] , br[L++] = c;
    }
    if ( num > 1 ) ar[L] = (int) num , br[L++] = 1;
    return L;
}

int get_num ( int num ){
    int i , sum = 0;
    FOR ( 0 , num , i )
        sum += br[i];
    return sum;
}

void solve (){
    int id = init ( q );
    int num = get_num ( id );
    if ( id < 1 ) puts ( "1\n0" );
    else if ( id == 1 ){
        if ( num == 1 )  puts ( "1\n0" );
        else if ( num == 2 ) puts ( "2" );
        else {
            printf ( "%d\n%I64d\n" , 1 , (LL) ar[0] * (LL) ar[0] );
        }
    }
    else {
        if ( num <= 2 ) puts ( "2" );
        else printf ( "%d\n%I64d\n" , 1 , (LL) ar[0] * (LL) ar[1] );
    }
}

int main (void){
#ifdef LocalHost
    freopen ( "in.in" , "r" , stdin );
    freopen ( "in.out" , "w" , stdout );
#endif
    prime_table ();
    while ( ~scanf ( "%I64d" , &q ) ){
        solve ();
    }
#ifdef LocalHost
    cout << endl << endl << "Time:  " << clock() << endl;
#endif
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef pair<int,long long> pii;
bool no[30000005];
int p[5000005],cnt;
pii Div(long long x)
{
	long long xx = x;
	bool flag = 1;
	for(int i = 1;1ll * p[i] * p[i] <= x;i ++)if(x % p[i] == 0){flag = 0;break;}
	if(flag)return pii(1,0);
	long long ans = 1;
	int cp = 0;
	for(int i = 1;i <= cnt && cp < 2;i ++)
	{
		bool fl = 0;
		if(1ll * p[i] * p[i] == xx && cp == 0)return pii(2,0);
		if(x % p[i] == 0)x /= p[i],fl = 1;
		if(fl)ans *= p[i],cp ++;
	}
	if(x == 1)return pii(2,0);
	if(cp == 1)
	{
		flag = 1;
		for(int i = 1;1ll * p[i] * p[i] <= x;i ++)if(x % p[i] == 0){flag = 0;break;}
		if(flag)return pii(2,0);
		else return pii(1,ans);
	}
	if(cp == 2)return pii(1,ans);
}
void Get()
{
	for(int i = 2;i <= 10000000;i ++)
	{
		if(!no[i])p[++ cnt] = i;
		for(int j = 1;j <= cnt && i * p[j] <= 10000000;j ++)
		{	no[i * p[j]] = 1;
			if(i % p[j] == 0)break;
		}
	}
}
int main ()
{
	long long x;
	scanf("%lld",&x);
	Get();
	pii w = Div(x);
	int xx = w.first;
	long long y = w.second;
	if(xx == 2)return printf("%d\n",2),0;
	else printf("%d\n%I64d\n",1,y);
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef pair<int,long long> pii;
bool no[10000005];
int p[5000005],cnt;
pii Div(long long x)
{
	bool flag = 1;
	for(int i = 2;i * i <= x;i ++)if(x % i == 0)flag = 0;
	if(flag)return pii(1,0);
	long long ans = 1;
	int cp = 0;
	for(int i = 1;i <= cnt && cp < 2;i ++)
	{
		bool fl = 0;
		if(x % p[i] == 0)x /= p[i],fl = 1;
		if(fl)ans *= p[i],cp ++;
	}
	if(x == 1)return pii(2,0);
	return pii(1,ans);
}
void Get()
{
	for(int i = 2;i <= 10000000;i ++)
	{
		if(!no[i])p[++ cnt] = i;
		for(int j = 1;j <= cnt && i * p[j] <= 10000000;j ++)
		{	no[i * p[j]] = 1;
			if(i % p[j] == 0)break;
		}
	}
}
int main ()
{
	long long x;
	scanf("%lld",&x);
	Get();
	pii w = Div(x);
	int xx = w.first;
	long long y = w.second;
	if(xx == 2)return printf("%d\n",2),0;
	else printf("%d\n%I64d\n",xx,y);
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef pair<int,long long> pii;
bool no[10000005];
int p[5000005],cnt;
pii Div(long long x)
{
	bool flag = 1;
	for(int i = 2;1ll * i * i <= x;i ++)if(x % i == 0){flag = 0;break;}
	if(flag)return pii(1,0);
	long long ans = 1;
	int cp = 0;
	for(int i = 1;i <= cnt && cp < 2;i ++)
	{
		bool fl = 0;
		if(x % p[i] == 0)x /= p[i],fl = 1;
		if(fl)ans *= p[i],cp ++;
	}
	if(x == 1)return pii(2,0);
	return pii(1,ans);
}
void Get()
{
	for(int i = 2;i <= 10000000;i ++)
	{
		if(!no[i])p[++ cnt] = i;
		for(int j = 1;j <= cnt && i * p[j] <= 10000000;j ++)
		{	no[i * p[j]] = 1;
			if(i % p[j] == 0)break;
		}
	}
}
int main ()
{
	long long x;
	scanf("%lld",&x);
	Get();
	pii w = Div(x);
	int xx = w.first;
	long long y = w.second;
	if(xx == 2)return printf("%d\n",2),0;
	else printf("%d\n%I64d\n",1,y);
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef pair<int,long long> pii;
bool no[30000005];
int p[5000005],cnt;
pii Div(long long x)
{
	long long xx = x;
	bool flag = 1;
	for(int i = 1;1ll * p[i] * p[i] <= x;i ++)if(x % p[i] == 0){flag = 0;break;}
	if(flag)return pii(1,0);
	long long ans = 1;
	int cp = 0;
	for(int i = 1;i <= cnt && cp < 2;i ++)
	{
		bool fl = 0;
		if(1ll * p[i] * p[i] == xx && cp == 0)return pii(2,0);
		if(x % p[i] == 0)x /= p[i],fl = 1;
		if(fl)ans *= p[i],cp ++;
	}
	if(x == 1)return pii(2,0);
	return pii(1,ans);
}
void Get()
{
	for(int i = 2;i <= 10000000;i ++)
	{
		if(!no[i])p[++ cnt] = i;
		for(int j = 1;j <= cnt && i * p[j] <= 10000000;j ++)
		{	no[i * p[j]] = 1;
			if(i % p[j] == 0)break;
		}
	}
}
int main ()
{
	long long x;
	scanf("%lld",&x);
	Get();
	pii w = Div(x);
	int xx = w.first;
	long long y = w.second;
	if(xx == 2)return printf("%d\n",2),0;
	else printf("%d\n%I64d\n",1,y);
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef pair<int,long long> pii;
bool no[1000005];
int p[500005],cnt;
pii Div(long long x)
{
	bool flag = 1;
	for(int i = 2;1ll * i * i <= x;i ++)if(x % i == 0){flag = 0;break;}
	if(flag)return pii(1,0);
	long long ans = 1;
	int cp = 0;
	for(int i = 1;i <= cnt && cp < 2;i ++)
	{
		bool fl = 0;
		if(x % p[i] == 0)x /= p[i],fl = 1;
		if(fl)ans *= p[i],cp ++;
	}
	if(x == 1)return pii(2,0);
	return pii(1,ans);
}
void Get()
{
	for(int i = 2;i <= 1000000;i ++)
	{
		if(!no[i])p[++ cnt] = i;
		for(int j = 1;j <= cnt && i * p[j] <= 1000000;j ++)
		{	no[i * p[j]] = 1;
			if(i % p[j] == 0)break;
		}
	}
}
int main ()
{
	long long x;
	scanf("%lld",&x);
	Get();
	pii w = Div(x);
	int xx = w.first;
	long long y = w.second;
	if(xx == 2)return printf("%d\n",2),0;
	else printf("%d\n%I64d\n",xx,y);
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef pair<int,long long> pii;
bool no[30000005];
int p[5000005],cnt;
pii Div(long long x)
{
	long long xx = x;
	bool flag = 1;
	for(int i = 1;1ll * p[i] * p[i] <= x;i ++)if(x % p[i] == 0){flag = 0;break;}
	if(flag)return pii(1,0);
	long long ans = 1;
	int cp = 0;
	for(int i = 1;i <= cnt && cp < 2;i ++)
	{
		bool fl = 0;
		if(1ll * p[i] * p[i] == xx && cp == 0)return pii(2,0);
		if(x % p[i] == 0)x /= p[i],fl = 1;
		if(fl)ans *= p[i],cp ++;
	}
	if(x == 1)return pii(2,0);
	if(cp == 1)
	{
		flag = 1;
		for(int i = 1;1ll * p[i] * p[i] <= x;i ++)if(x % p[i] == 0){flag = 0;ans *= p[i];break;}
		if(flag)return pii(2,0);
		else return pii(1,ans);
	}
	if(cp == 2)return pii(1,ans);
}
void Get()
{
	for(int i = 2;i <= 10000000;i ++)
	{
		if(!no[i])p[++ cnt] = i;
		for(int j = 1;j <= cnt && i * p[j] <= 10000000;j ++)
		{	no[i * p[j]] = 1;
			if(i % p[j] == 0)break;
		}
	}
}
int main ()
{
	long long x;
	scanf("%lld",&x);
	Get();
	pii w = Div(x);
	int xx = w.first;
	long long y = w.second;
	if(xx == 2)return printf("%d\n",2),0;
	else printf("%d\n%I64d\n",1,y);
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef pair<int,long long> pii;
bool no[1000005];
int p[500005],cnt;
pii Div(long long x)
{
	bool flag = 1;
	for(int i = 2;i * i <= x;i ++)if(x % i == 0)flag = 0;
	if(flag)return pii(1,0);
	long long ans = 1;
	int cp = 0;
	for(int i = 1;i <= cnt && cp < 2;i ++)
	{
		bool fl = 0;
		if(x % p[i] == 0)x /= p[i],fl = 1;
		if(fl)ans *= p[i],cp ++;
	}
	if(x == 1)return pii(2,0);
	return pii(1,ans);
}
void Get()
{
	for(int i = 2;i <= 10000000;i ++)
	{
		if(!no[i])p[++ cnt] = i;
		for(int j = 1;j <= cnt && i * p[j] <= 10000000;j ++)
		{	no[i * p[j]] = 1;
			if(i % p[j] == 0)break;
		}
	}
}
int main ()
{
	long long x;
	scanf("%lld",&x);
	Get();
	pii w = Div(x);
	int xx = w.first;
	long long y = w.second;
	if(xx == 2)return printf("%d\n",2),0;
	else printf("%d\n%I64d\n",xx,y);
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef pair<int,long long> pii;
bool no[1000005];
int p[500005],cnt;
pii Div(long long x)
{
	bool flag = 1;
	for(int i = 2;i * i <= x;i ++)if(x % i == 0)flag = 0;
	if(flag)return pii(1,0);
	long long ans = 1;
	int cp = 0;
	for(int i = 1;i <= cnt && cp < 2;i ++)
	{
		bool fl = 0;
		if(x % p[i] == 0)x /= p[i],fl = 1;
		if(fl)ans *= p[i],cp ++;
	}
	if(x == 1)return pii(2,0);
	return pii(1,ans);
}
void Get()
{
	for(int i = 2;i <= 1000000;i ++)
	{
		if(!no[i])p[++ cnt] = i;
		for(int j = 1;j <= cnt && i * p[j] <= 1000000;j ++)
		{	no[i * p[j]] = 1;
			if(i % p[j] == 0)break;
		}
	}
}
int main ()
{
	long long x;
	scanf("%lld",&x);
	Get();
	pii w = Div(x);
	int xx = w.first;
	long long y = w.second;
	if(xx == 2)return printf("%d\n",2),0;
	else printf("%d\n%I64d\n",xx,y);
	return 0;
}


#include <iostream>
#include <string>
#include <cstdio>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <cctype>
#include <cstdlib>
#include <bitset>
#include <utility>
#include <string.h>

using namespace std;

const long double EPS = 1e-8;
const long double PI = 3.1415926535897932384626433832795;
const long double E = 2.7182818284;
const int INF = 1000000000;

typedef long long ll;
typedef long double ld;

#define forn(i,n) for (int i = 0; i < int(n); i++)
#define pb push_back
#define all(a) a.begin(), a.end()
#define mp make_pair;

int prost(long long x)
{
    long long i, k = max(llround(sqrt(x)) + 1, x);
    for (i = 2; i < k; i++)
        if (!(x %i))
            return 1;
    return 0;
}

int main(void)
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    long long q, i, j, a, b;
    cin >> q;
    int flag = 0;
    for (i = 2; i <= llround(sqrt(q)); i++)
    {
        if (i > 1000000)
        {
            printf("2");
            return 0;
        }
        if (!(q %i ))
        {
            a = q / i;
            b = i;
            flag = 1;
            if (prost(a))
            {
                for (j = 2; j<= llround(sqrt(a)); j++)
                {
                    if (!(a % j))
                    {
                        if (!(prost(j))&& !(prost(a/j)))
                        {
                            cout<<1<<'\n'<<a;
                            return 0;
                        }
                    }
                }
            }
             if (prost(b))
            {
                for (j = 2; j<= llround(sqrt(b)); j++)
                {
                    if (!(b % j))
                    {
                        if (!(prost(j))&& !(prost(b/j)))
                        {
                            cout<<1<<'\n'<<i;
                            return 0;
                        }
                    }
                }
            }
        }
    }
    if (!flag)
    {
        printf("1\n0");
        return 0;
    }
    if (a == b)
    {
        printf("2");
        return 0;
    }
    flag = 0;
    cout << 2;
    return 0;
}


#include <iostream>
#include <string>
#include <cstdio>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <cctype>
#include <cstdlib>
#include <bitset>
#include <utility>
#include <string.h>

using namespace std;

const long double EPS = 1e-8;
const long double PI = 3.1415926535897932384626433832795;
const long double E = 2.7182818284;
const int INF = 1000000000;

typedef long long ll;
typedef long double ld;

#define forn(i,n) for (int i = 0; i < int(n); i++)
#define pb push_back
#define all(a) a.begin(), a.end()
#define mp make_pair;

int main(void)
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    long long q, i, j;
    cin >> q;
    int flag = 0;
    if (q == 2)
    {
        printf("1");
        printf("\n0");
        return 0;
    }
    for (i = 2; i <= llround(sqrt(q)) + 1, i < q; i++)
    {
        if (i > 10000000)
        {
            printf("1");
        printf("\n0");
        return 0;
        }
        if (!(q % i))
        {
            flag = 1;
        for (j = 2; j <= llround(sqrt(i)) + 1, j < i; j++)
        {
            if (i == 2)
                break;
            if (!(i % j))
            {
                //if (!(tab[j]))
                //{
                    cout << 1 << '\n' << i;
                    return 0;
                //}
                /*else if (!(tab[i / j]))
                {
                    cout << 1 << '\n' << i / j;
                    return 0;
                }
                else
                    flag = 1;*/
            }
        }
        }
        else
            continue;
    }
    if (!flag)
        {
            cout << 1 << '\n' << 0;
            return 0;
        }
    else
        cout << 2;
    /*for (i = 5; i < q - 1; i++)
    {
        flag = 0;
        for (j = 2; j <= llround(sqrt(i)); j++)
        {
            if (!(i % j))
            {
                if (!(tab[j]))
                {
                    tab[i] = 1;
                    break;
                }
                else if (!(tab[i / j]))
                {
                    tab[i] = 1;
                    break;
                }
                else
                    flag = 1;
            }
        }
        if (!flag)
        {
            tab[i] = 1;
        }
        else
            tab[i] = 0;
    }
    flag = 0;
        for (j = 2; j <= llround(sqrt(q)); j ++)
        {
            if (!(q % j))
            {
                if (!(tab[j]))
                {
                    cout << 1;
                    cout << '\n' << j;
                    return 0;
                }
                else if (!(tab[q / j]))
                {
                    cout << 1;
                    cout << '\n' << q/j;
                    return 0;
                }
                else
                    flag = 1;
            }
        }
        if (!flag)
        {
            cout << 1;
            cout << '\n' << 0;
        }
        else
            cout << 2;*/
    return 0;
}


#include <iostream>
#include <string>
#include <cstdio>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <cctype>
#include <cstdlib>
#include <bitset>
#include <utility>
#include <string.h>

using namespace std;

const long double EPS = 1e-8;
const long double PI = 3.1415926535897932384626433832795;
const long double E = 2.7182818284;
const int INF = 1000000000;

typedef long long ll;
typedef long double ld;

#define forn(i,n) for (int i = 0; i < int(n); i++)
#define pb push_back
#define all(a) a.begin(), a.end()
#define mp make_pair;

int main(void)
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    long long q, i, j;
    cin >> q;
    int flag = 0;
    /*if (q == 2)
    {
        printf("1");
        printf("\n0");
        return 0;
    }*/
    long long k = min(llround(sqrt(q)) + 2, q);
    for (i = 2; i < k ; i++)
    {
        /*if (i > 10000000)
        {
            printf("1");
        printf("\n0");
        return 0;
        }*/
        if (!(q % i))
        {
            flag = 1;
        long long w = min(llround(sqrt(i)) + 2, i);
        for (j = 2; j < w; j++)
        {
            if (i == 2)
                break;
            if (!(i % j))
            {
                //if (!(tab[j]))
                //{
                    cout << 1 << '\n' << i;
                    return 0;
                //}
                /*else if (!(tab[i / j]))
                {
                    cout << 1 << '\n' << i / j;
                    return 0;
                }
                else
                    flag = 1;*/
            }
        }
        }
        else
            continue;
    }
    if (!flag)
        {
            cout << 1 << '\n' << 0;
            return 0;
        }
    else
        cout << 2;
    /*for (i = 5; i < q - 1; i++)
    {
        flag = 0;
        for (j = 2; j <= llround(sqrt(i)); j++)
        {
            if (!(i % j))
            {
                if (!(tab[j]))
                {
                    tab[i] = 1;
                    break;
                }
                else if (!(tab[i / j]))
                {
                    tab[i] = 1;
                    break;
                }
                else
                    flag = 1;
            }
        }
        if (!flag)
        {
            tab[i] = 1;
        }
        else
            tab[i] = 0;
    }
    flag = 0;
        for (j = 2; j <= llround(sqrt(q)); j ++)
        {
            if (!(q % j))
            {
                if (!(tab[j]))
                {
                    cout << 1;
                    cout << '\n' << j;
                    return 0;
                }
                else if (!(tab[q / j]))
                {
                    cout << 1;
                    cout << '\n' << q/j;
                    return 0;
                }
                else
                    flag = 1;
            }
        }
        if (!flag)
        {
            cout << 1;
            cout << '\n' << 0;
        }
        else
            cout << 2;*/
    return 0;
}


#include <iostream>
#include <string>
#include <cstdio>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <cctype>
#include <cstdlib>
#include <bitset>
#include <utility>
#include <string.h>

using namespace std;

const long double EPS = 1e-8;
const long double PI = 3.1415926535897932384626433832795;
const long double E = 2.7182818284;
const int INF = 1000000000;

typedef long long ll;
typedef long double ld;

#define forn(i,n) for (int i = 0; i < int(n); i++)
#define pb push_back
#define all(a) a.begin(), a.end()
#define mp make_pair;

int main(void)
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    long long q, i, j;
    cin >> q;
    int flag = 0;
    /*if (q == 2)
    {
        printf("1");
        printf("\n0");
        return 0;
    }*/
    long long k = min(llround(sqrt(q)) + 2, q);
    for (i = 2; i < k ; i++)
    {
        if (i > 100000000)
        {
            printf("1");
        printf("\n0");
        return 0;
        }
        if (!(q % i))
        {
            flag = 1;
        long long w = min(llround(sqrt(i)) + 2, i);
        for (j = 2; j < w; j++)
        {
            if (!(i % j))
            {
                //if (!(tab[j]))
                //{
                    cout << 1 << '\n' << i;
                    return 0;
                //}
                /*else if (!(tab[i / j]))
                {
                    cout << 1 << '\n' << i / j;
                    return 0;
                }
                else
                    flag = 1;*/
            }
        }
        }
        else
            continue;
    }
    if (!flag)
        {
            cout << 1 << '\n' << 0;
            return 0;
        }
    else
        cout << 2;
    /*for (i = 5; i < q - 1; i++)
    {
        flag = 0;
        for (j = 2; j <= llround(sqrt(i)); j++)
        {
            if (!(i % j))
            {
                if (!(tab[j]))
                {
                    tab[i] = 1;
                    break;
                }
                else if (!(tab[i / j]))
                {
                    tab[i] = 1;
                    break;
                }
                else
                    flag = 1;
            }
        }
        if (!flag)
        {
            tab[i] = 1;
        }
        else
            tab[i] = 0;
    }
    flag = 0;
        for (j = 2; j <= llround(sqrt(q)); j ++)
        {
            if (!(q % j))
            {
                if (!(tab[j]))
                {
                    cout << 1;
                    cout << '\n' << j;
                    return 0;
                }
                else if (!(tab[q / j]))
                {
                    cout << 1;
                    cout << '\n' << q/j;
                    return 0;
                }
                else
                    flag = 1;
            }
        }
        if (!flag)
        {
            cout << 1;
            cout << '\n' << 0;
        }
        else
            cout << 2;*/
    return 0;
}


#include <iostream>
#include <string>
#include <cstdio>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <cctype>
#include <cstdlib>
#include <bitset>
#include <utility>
#include <string.h>

using namespace std;

const long double EPS = 1e-8;
const long double PI = 3.1415926535897932384626433832795;
const long double E = 2.7182818284;
const int INF = 1000000000;

typedef long long ll;
typedef long double ld;

#define forn(i,n) for (int i = 0; i < int(n); i++)
#define pb push_back
#define all(a) a.begin(), a.end()
#define mp make_pair;

int main(void)
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    long long q, i, j;
    cin >> q;
    int flag = 0;
    if (q == 2)
    {
        printf("1");
        printf("\n0");
        return 0;
    }
    for (i = 2; i <= llround(sqrt(q)) + 1, i < q; i++)
    {
        if (i > 100000)
        {
            printf("1");
        printf("\n0");
        return 0;
        }
        if (!(q % i))
        {
            flag = 1;
        for (j = 2; j <= llround(sqrt(i)) + 1, j < i; j++)
        {
            if (i == 2)
                break;
            if (!(i % j))
            {
                //if (!(tab[j]))
                //{
                    cout << 1 << '\n' << i;
                    return 0;
                //}
                /*else if (!(tab[i / j]))
                {
                    cout << 1 << '\n' << i / j;
                    return 0;
                }
                else
                    flag = 1;*/
            }
        }
        }
        else
            continue;
    }
    if (!flag)
        {
            cout << 1 << '\n' << 0;
            return 0;
        }
    else
        cout << 2;
    /*for (i = 5; i < q - 1; i++)
    {
        flag = 0;
        for (j = 2; j <= llround(sqrt(i)); j++)
        {
            if (!(i % j))
            {
                if (!(tab[j]))
                {
                    tab[i] = 1;
                    break;
                }
                else if (!(tab[i / j]))
                {
                    tab[i] = 1;
                    break;
                }
                else
                    flag = 1;
            }
        }
        if (!flag)
        {
            tab[i] = 1;
        }
        else
            tab[i] = 0;
    }
    flag = 0;
        for (j = 2; j <= llround(sqrt(q)); j ++)
        {
            if (!(q % j))
            {
                if (!(tab[j]))
                {
                    cout << 1;
                    cout << '\n' << j;
                    return 0;
                }
                else if (!(tab[q / j]))
                {
                    cout << 1;
                    cout << '\n' << q/j;
                    return 0;
                }
                else
                    flag = 1;
            }
        }
        if (!flag)
        {
            cout << 1;
            cout << '\n' << 0;
        }
        else
            cout << 2;*/
    return 0;
}


#include<iostream>
#include <algorithm>
#include <memory.h>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <ctime>
#include <random>
#include <bitset>
#include <cstring>
#include <string>
#include <cassert>
using namespace std;
int main() {
	long long t;
	cin >> t;
	while (t--) {
		long long  i5 = 0;
		long long n, p, k;
		cin >> n >> p >> k;
		vector <long long> sum(k,0);
		vector <int> ch(n);
		for (int i = 0; i < n; i++) {
			cin >> ch[i];
		}
		sort(ch.rbegin(), ch.rend());
		for (int i = 0; i < n; i++) {
			sum[i%k]+= ch[i];
		}
		for (int i = 0; i < n-k+1; i++) {
			if(sum[i%k]<=p){
				cout << n - i <<"\n";
				break;
			}
			else {
				sum[i % k] -= ch[i];
			}
			if (i == n-k) {
				i5 = 1;
			}
		}
		if (n - k < 0) {
			i5 = 1;
		}
		if (i5 == 1) {
			i5=0;
			for (int i = n - 1; i >= 0; i--) {
				if (ch[i] <= p) {
					p -= ch[i];
					i5++;
				}
				else { break; }
			}
			cout << i5<<"\n";
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
	int t;
	cin >> t;
	while (t--) {
		int n,p, k;
		cin >> n >>p>> k;
		int pref=0, ans=0;
		vector<int> a(n);
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
		}
		sort(a.begin(), a.end());
		for (int i = 0; i <= k; i++) {
			int sum = pref;
			if (sum > p)break;
			int cnk = i;
			for (int j = i + k - 1; j < n; j++) {
				if (sum + a[j] <= p) {
					sum += a[j];
					cnk += k;
				}
				else {
					break;
				}
			}
			pref += a[i];
			ans = max(ans, cnk);
		}
		cout << ans << endl;
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
	int t;
	cin >> t;
	while (t--) {
		int n,p, k;
		cin >> n >>p>> k;
		int pref=0, ans=0;
		vector<int> a(n);
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
		}
		sort(a.begin(), a.end());
		for (int i = 0; i <= k; i++) {
			int sum = pref;
			if (sum > p)break;
			int cnk = i;
			for (int j = i + k - 1; j < n; j+=k) {
				if (sum + a[j] <= p) {
					sum += a[j];
					cnk += k;
				}
				else {
					break;
				}
			}
			pref += a[i];
			ans = max(ans, cnk);
		}
		cout << ans << endl;
	}
	return 0;
}


#include<iostream>
#include <algorithm>
#include <memory.h>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <ctime>
#include <random>
#include <bitset>
#include <cstring>
#include <string>
#include <cassert>
using namespace std;
int main() {
	int t;
	cin >> t;
	while (t--) {
		int  i5=0;
		int n, p, k;
		cin >> n >> p >> k;
		vector <int> sum(k);
		vector <int> ch(n);
		for (int i = 0; i < n; i++) {
			cin >> ch[i];
		}
		sort(ch.rbegin(), ch.rend());
		for (int i = 0; i < n; i++) {
			sum[i%k]+= ch[i];
		}
		for (int i = 0; i < n-k+1; i++) {
			if(sum[i%k]<=p){
				cout << n - i <<"\n";
				break;
			}
			else {
				sum[i % k] -= ch[i];
			}
			if (i == n-k) {
				i5 = 1;
			}
		}
		if (n - k < 0) {
			i5 = 1;
		}
		if (i5 == 1) {
			i5--;
			for (int i = n - 1; i >= 0; i--) {
				if (ch[i] <= p) {
					p -= ch[i];
					i5++;
				}
				else { break; }
			}
			cout << i5<<"\n";
		}
	}
	return 0;
}


#include <iostream>
#include <set>
#include <map>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <climits>
#include <math.h>
using namespace std;
#pragma warning(disable : 4996)

int main() {
#ifdef _DEBUG
	freopen("input1.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int q;
	cin >> q;
	while (q--) {
		int n, p, k;
		cin >> n >> p >> k;
		vector<int> a(n), dp(n + 1, INT32_MIN);
		for (int i = 0; i < n; i++)cin >> a[i];
		sort(a.begin(), a.end());
		dp[0] = p;
		int ans = 0;
		bool flag = true;
		for (int i = 1; i <= n; i++) {
			if (i >= k) {
				dp[i] = max(dp[i - k] - a[i - 1], dp[i]);
			}
			dp[i] = max(dp[i], dp[i - 1] - a[i - 1]);
			if (dp[i] >= 0) {
				ans = max(ans, i);
			}
		}
		cout << ans << "\n";
	}
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<algorithm>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 6;
const int inf = 0x3f3f3f3f;
int t, n, p, k;
ll dp[MAXN], a[MAXN];
int main()
{
	scanf("%d", &t);
	while (t--)
	{
		scanf("%d%d%d", &n, &p, &k);
		for (int i = 1; i <= n; i++)
			scanf("%lld", &a[i]);
		sort(a + 1, a + n + 1);
		int ans = 0;
		for (int i = 1; i <= n; i++)
		{
			dp[i] = dp[i - 1] + a[i];
			if (i >= k)
				dp[i] = min(dp[i], dp[i - k] + a[i]);
			if (dp[i] <= p)
				ans = max(ans, i);
		}
		printf("%d\n", ans);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<algorithm>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 6;
const int inf = 0x3f3f3f3f;
int t, n, p, k;
ll dp[MAXN], a[MAXN];
int main()
{
	scanf("%d", &t);
	while (t--)
	{
		scanf("%d%d%d", &n, &p, &k);
		for (int i = 1; i <= n; i++)
			scanf("%lld", &a[i]);
		sort(a + 1, a + n + 1);
		int ans = 0;
		for (int i = 1; i <= n; i++)
		{
			dp[i] = dp[i - 1] + a[i];
			if (i >= k)
				dp[i] = min(dp[i], dp[i - k] + a[i]);
			if (dp[i] <= p)
				ans = max(ans, i);
		}
		printf("%d\n", ans);
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <map>
using namespace std;
using ll = long long;
using vl = vector <ll>;
using vi = vector <int>;
using pi = pair <int, int>;
using pl = pair <ll, ll>;
using pli = pair <ll, int>;
using pil = pair <int, ll>;
using ppii = pair <pi, int>;
using vvi = vector <vi>;
using vpi = vector <pi>;
using vpl = vector <pl>;
using vpil = vector <pil>;
using vpli = vector <pli>;
using vppii = vector <ppii>;
using si = set<int>;
using sl = set<ll>;
using spi = set<pi>;
using spli = set<pli>;

//int mx = (int)1e9;
#define forn(i, n)  for (int i = 0; i != n; ++i)
#define wl(t) while (t--)
#define co cout <<
#define ci cin >>
#define ret return 0;
#define re return;
#define con continue;

int main() {
	int t;
	ci t;
	wl(t) {
		int n, p, k;
		ci n >> p >> k;
		vi a(n);
		forn(i, n) {
			ci a[i];
		}
		sort(a.begin(), a.end());
		vi f(k);
		f[0] = 0;
		for (int i = 1; i != k; ++i) {
			f[i] = f[i - 1] + a[i - 1];
		}
		int ans = 0;
		forn(i, k) {
			int g = i;
			int h = f[i];
			int d = i + k - 1;
			while (d < n) {
				if (h + a[d] <= p) {
					h += a[d];
					g += k;
				}
				d += k;
			}
			if (h <= p) {
				ans = max(ans, g);
			}
		}
		co ans << endl;
	}
}


#include <stdio.h>
#include <algorithm>
using namespace std;
const int N = 2e5 + 7;
typedef long long LL;

int a[N];

int main ()
{
	int T;
	scanf ("%d", &T);
	while (T -- )
	{
		int n, m, k;
		scanf ("%d%d%d", &n, &m, &k);
		for (int i = 0 ; i< n; i ++ )
			scanf ("%d", &a[i]);
		sort(a, a + n);
		int ans = 0, pre = 0;
		for (int i = 0; i <= k; i++ )
		{
			int sum = pre;
			if (sum > m) break;
			int cnt = i;
			for (int j = i + k - 1; j < n;  j += k )
			{
				if (sum + a[j] <= m)
				{
					cnt +=k;
					sum += a[j];
				}
				else break;
			}
			pre += a[i];
			ans =max(ans, cnt);
		}
		printf ("%d\n", ans);
	}
	return 0;
}


#include<cstdio>
#include<queue>
#include<algorithm>

using namespace std;

priority_queue<int> pq;

int arr[200000];
int money[200000];

int main(){
	int t,n,p,k,ans;
	scanf("%d",&t);
	for(int i=0;i<t;++i){
		scanf("%d %d %d",&n,&p,&k);
		for(int j=0;j<n;++j)scanf("%d",arr+j);
		sort(arr,arr+n);
		for(int j=0;j<n;++j){
			if(j<k){
				if(p-arr[j]<0){ans=!!j;break;}
				else money[j]=p-arr[j];
			}
			else{
				money[j]=max(money[j-1]-arr[j],money[j-k+1]-arr[j]);
				if(money[j]<0){ans=j;break;}
			}
			if(j==n-1&&money[j]>=0)ans=n;
		}
		printf("%d\n",ans);
	}
}


#include<cstdio>
#include<queue>
#include<algorithm>

using namespace std;

priority_queue<int> pq;

int arr[200000];
int money[200000];

int main(){
	int t,n,p,k,ans=0;
	scanf("%d",&t);
	for(int i=0;i<t;++i){
		ans=0;
		scanf("%d %d %d",&n,&p,&k);
		for(int j=0;j<n;++j)scanf("%d",arr+j);
		sort(arr,arr+n);
		for(int j=0;j<n;++j){
			if(j%k==k-1){
				if(j==k-1)money[j]=p-arr[j];
				else money[j]=money[j-k]-arr[j];
				if(money[j]<0)break;
				ans=(j/k+1)*k;
			}
			else{
				if(!(j/k)){
					if(!j){
						money[j]=p-arr[j];
						if(money[j]<0){ans=0;break;}
						++ans;
					}
					else{
						money[j]=money[j-1]-arr[j];
						if(money[j]<0){j=(j/k)*k+k-2;continue;}
						++ans;
					}
				}
				else{
					money[j]=money[j-k]-arr[j];
					if(money[j]<0){j=(j/k)*k+k-2;continue;}
					++ans;
				}
			}
		}
		printf("%d\n",ans);
	}
}


#include<cstdio>
#include<queue>
#include<algorithm>

using namespace std;

priority_queue<int> pq;

int arr[200000];
int money[200000];

int main(){
	int t,n,p,k,ans;
	scanf("%d",&t);
	for(int i=0;i<t;++i){
		scanf("%d %d %d",&n,&p,&k);
		for(int j=0;j<n;++j)scanf("%d",arr+j);
		sort(arr,arr+n);
		for(int j=0;j<n;++j){
			if(j<k){
				if(p-arr[j]<0){ans=!!j;break;}
				else money[j]=p-arr[j];
			}
			else{
				money[j]=max(money[j-1]-arr[j],money[j-k]-arr[j]);
				if(money[j]<0){ans=j;break;}
			}
			if(j==n-1&&money[j]>=0)ans=n;
		}
		printf("%d\n",ans);
	}
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <math.h>
#include <stack>
#include <string>
#include <set>

using namespace std;

typedef long long ll;

int tcase, n, p , k;
int a[200001];

int main()
{
	cin >> tcase;
	while (tcase--)
	{
		scanf_s("%d %d %d", &n, &p, &k);
		for (int i = 0; i < n; i++)
		{
			scanf_s("%d", &a[i]);
		}

		sort(a, a + n);

		for (int i = k; i < n; i++)
		{
			a[i] += a[i - k];
		}

		int ans = upper_bound(a, a + n, p) - a;

		if (ans < k)
		{
			for (int i = 0; i < n; i++)
			{
				p -= a[i];
				if (p < 0)
				{
					ans = i;
					break;
				}
			}
		}

		cout << ans << '\n';
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <math.h>
#include <stack>
#include <string>
#include <set>

using namespace std;

typedef long long ll;

int tcase, n, p , k;
int d[200002];

int main()
{
	cin >> tcase;
	while (tcase--)
	{
		scanf_s("%d %d %d", &n, &p, &k);
		for (int i = 1; i <= n; i++)
		{
			scanf_s("%d", &d[i]);
		}

		sort(d, d + n);

		for (int i = 1; i <= n; i++)
		{
			if (i >= k) d[i] += d[i - k];
			else d[i] += d[i - 1];
		}

		int ans = (upper_bound(d, d + n + 1, p) - d) - 1;

		cout << ans << '\n';
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <math.h>
#include <stack>
#include <string>
#include <set>

using namespace std;

typedef long long ll;

int tcase, n, p , k;
int a[200001];

int main()
{
	cin >> tcase;
	while (tcase--)
	{
		scanf_s("%d %d %d", &n, &p, &k);
		for (int i = 0; i < n; i++)
		{
			scanf_s("%d", &a[i]);
		}

		sort(a, a + n);

		for (int i = k; i < n; i++)
		{
			a[i] += a[i - k];
		}

		int ans = upper_bound(a, a + n, p) - a;
		cout << ans << '\n';
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <math.h>
#include <stack>
#include <string>
#include <set>

using namespace std;

typedef long long ll;

int tcase, n, p , k;
int d[200002];

int main()
{
	cin >> tcase;
	while (tcase--)
	{
		scanf_s("%d %d %d", &n, &p, &k);
		for (int i = 1; i <= n; i++)
		{
			scanf_s("%d", &d[i]);
		}

		sort(d, d + n + 1);

		for (int i = 1; i <= n; i++)
		{
			if (i >= k) d[i] += d[i - k];
			else d[i] += d[i - 1];
		}

		int ans = (upper_bound(d, d + n + 1, p) - d) - 1;

		cout << ans << '\n';
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <math.h>
#include <stack>
#include <string>
#include <set>

using namespace std;

typedef long long ll;

int tcase, n, p , k;
int d[200002];

int main()
{
	cin >> tcase;
	while (tcase--)
	{
		scanf_s("%d %d %d", &n, &p, &k);
		for (int i = 1; i <= n; i++)
		{
			scanf_s("%d", &d[i]);
		}

		sort(d, d + n + 1);

		int ans = 0;
		for (int i = 1; i <= n; i++)
		{
			if (i >= k) d[i] += d[i - k];
			else d[i] += d[i - 1];

			if (d[i] <= p) ans = i;
		}

		cout << ans << '\n';
	}
	return 0;
}


#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>

using namespace std;

void solve() {
	int n, p, k;
	cin >> n >> p >> k;
	vector<int> a(n);
	for (int i = 0; i < n; ++i)
		cin >> a[i];
	sort(a.begin(), a.end());

	vector<int> dp(n + 1);
	dp[0] = p;
	for (int i = 1; i < k; ++i)
		dp[i] = dp[i - 1] - a[i - 1];
	for (int i = k; i <= n; ++i)
		dp[i] = max(dp[i - 1], dp[i - k]) - a[i - 1];

	int ans = 0;
	for (int i = 0; i <= n; ++i)
		if (dp[i] >= 0)
			ans = i;
	cout << ans << endl;
}

int main() {
	int t;
	cin >> t;
	for (int i = 0; i < t; ++i)
		solve();
	return 0;
}


#include <iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include <iomanip>
#include <stack>
#include <cmath>

#define maxn 2000002
#define LL long long
#define inf 1000000000
#define mod 1000000007
using namespace std;
int dx[9] = { 1,0,-1,0,1,1,-1,-1 };
int dy[9] = { 0,1,0,-1,1,-1,1,-1 };

struct edge {
	int st, ed;
	char col;
	//bool operator <(const edge &a)const {}
};

LL gcd(LL a, LL b) {
	if (a > b) swap(a, b);
	if (a == 0)return b;
	return gcd(b%a, a);
}

LL n, m, k;
LL seg[maxn * 4];
LL lazy[maxn * 4];
vector<vector<int>>vi;
LL dfsNum = 0;
vector<pair<int, int>> vp;
void dfs(int v,int p,int l) {
	vp[v].first = ++dfsNum;

	for (int nv : vi[v]) {
		if (nv == p)continue;
		dfs(nv, v, l);
	}

	vp[v].second = dfsNum;
}
void sl(int ptr, int s, int e) {
	auto val = lazy[ptr];
	lazy[ptr] = 0;
	if (val == -1)
		seg[ptr] = 0;
	else
		seg[ptr] = (e - s + 1)*val;
	if (s != e) {
		lazy[ptr * 2] = val;
		lazy[ptr * 2 + 1] = val;
	}
}
void update(int ptr, int s, int e, int l, int r, LL val) {
	if (lazy[ptr])sl(ptr, s, e);
	if (r < s || e < l)return;
	if (l <= s && e <= r) {
		if (val == -1)
			seg[ptr] = 0;
		else
			seg[ptr] = (e - s + 1)*val;
		if (s != e) {
			lazy[ptr * 2] = val;
			lazy[ptr * 2 + 1] = val;
		}
		return;
	}
	update(ptr * 2, s, (s + e) / 2, l, r, val);
	update(ptr * 2 + 1, (s + e) / 2 + 1, e, l, r, val);
	seg[ptr] = seg[ptr * 2] + seg[ptr * 2 + 1];
}

LL getVal(int ptr, int s, int e, int l,int r) {
	if (lazy[ptr])sl(ptr, s, e);
	if (r < s || e < l)return 0;
	if (l<=s && e<=r) {
		return seg[ptr];
	}

	return getVal(ptr * 2, s, (s + e) / 2, l,r) + getVal(ptr * 2 + 1, (s + e) / 2 + 1, e, l,r);
}

int arr[maxn];
int arr2[maxn];
int visit[maxn];
int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	cin >> t;

	//int t = 1;
	for (int test_case = 0; test_case < t; ++test_case) {
		int n, p, k;
		cin >> n >> p >> k;
		vector<int>vi;
		for (int i = 1; i <=n; ++i) {
			cin >> arr[i];
		}
		sort(arr+1, arr + n+1);
		int ans = 0;
		for (int i = 1; i <= n; ++i) {
			visit[i] = visit[i - 1] + arr[i];
			if (i - k >= 0)visit[i] = min(visit[i - k] + arr[i], visit[i]);
			if (visit[i] <= p)ans = i;
		}

		cout << ans << '\n';
	}
}