#include<iostream> 
using namespace std; 
int main() { 
	int first3, middle3, last3; 
	int original, temp, first, second,third, fourth, first1, second1, third1, fourth1;
	cout<<"enter a 7-9 digit number"<<endl;
	cin>>original;
	temp=original/1000;
	cout <<"temp= "<< temp<< endl;
	 last3=original%1000;
	 cout << "last3= "<< last3 << endl;
	 first=last3/10;
	 cout <<"first= "<< first << endl;
	 second=last3%10;
	 cout <<"second= " <<second << endl;
	 third=first/10;
	 cout <<"third= "<< third << endl;
	 fourth=first%10;
	 cout <<"fourth= "<< fourth << endl;
	 first3=temp/1000;
	 cout <<"first3= "<< first3 << endl;
	 middle3=temp%1000;
	 cout <<"middle3= "<< middle3 << endl;
	 first1=middle3/10;
	 cout <<"first1= "<< first1 << endl;
	 second1=middle3%10;
	 cout <<"second1= "<< second1 << endl;
	 third1=first1/10;
	 cout <<"third1= "<< third1 << endl;
	 fourth1=first1%10;
	 cout <<"fourth1= "<< fourth1 << endl;
	 cout<<"the number with a comma is "<<endl;
	 cout<<first3<<","<<first1<<second1<<third1<<","<<first<<second<<third<<endl;
	 cout<<first3<< ","<<middle3<<","<< last3<< endl;
	 return 0;
	 }