#include <iostream>
#include <cmath>
using namespace std;

int main() {
	long a = 42556;
	long num;
	num=floor(log10(a))+1; 
	//cout<<num<<" "<<"\n";  //this will print the number of digits in the number
	
	cout<<"first num: "<<a/(int)pow(10,num-1)<<"\n";
	cout<<"last num: "<<a%10<<"\n";
	return 0;
}