#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int i,n,sum=9;
scanf("%d",&n);
for(i=1;i<10;i++){
if(sum%n==0){
break;
}else{
sum=sum*10+9;
}
}
printf("%d %d ",sum,i);
return 0;
}