#include <iostream>

using namespace std;


class crew{
	public:
		// int year;
		// void add_people();

		int id;
		int primary_specialty;
		int secondary_specialty;
		int rank;
};

class specialist : public crew{
	public:
		int id;
};

// void crew :: add_people(){
// 	crew people[10];

// }
int make_people(crew people[], int c, int n, int s, int ss, int r){
	int ii;

	for(int i=c; i<c+n; i++){
		people[i].id = i;
		people[i].primary_specialty = s;
		people[i].secondary_specialty = ss;
		people[i].rank = r;
		// cout<<people[i].id<<endl;

		ii=i;
	}
	// cout<<"jjjjjjjjjjjjjjjjjj"<<endl;
	
	return ii+1;
}

// void find_onOrder(crew people[], crew onOrder[], int a1){
// 	for(int i=0; i<1100; i++){
// 		if(people[i].primary_specialty==a1){
// 			onOrder[i]  = people[i];
// 			// break;
// 			return;

// 		}
// 		// return;

// 	}
// }

void promptt(crew people[], crew onOrder[], int aa, int a1, int oa){

	

	cout << "1. Enter mission" << endl;
	cout << "2. Display away teams" << endl;
	cout << "3. Reset all away teams" << endl;
	cout << "4. Exit" << endl;
	cin >> aa;
	// cin.ignore();
	if(aa == 1){
		cout << "Enter mission eg. 2 3 4 5" << endl;

		while(cin>>a1){
			// cout << a1;
			for(int i=0; i<1100; i++){
				if(people[i].primary_specialty==a1){
					onOrder[oa]  = people[i];
					oa++;
					// break;
					// cin.ignore();
					// return;
					// cin.ignore();
					// promptt(people,onOrder);
					break;
				}
				// return;

			}
			promptt(people, onOrder, aa, a1, oa);

			// cin.ignore();
			// cin.clear();
		}
// cout<<4<<endl;
	


	}else if(aa == 2){
		cout << "Away teams;" << endl;
		for(int i=0; i<oa; i++){
			cout<<onOrder[i].id<<endl;
		}
		promptt(people, onOrder, aa, a1, oa);

	}else if(aa == 3){
		promptt(people, onOrder, aa, a1, 0);
		// cout <<(sizeof(people)/sizeof(*people))<<endl;
	}else if(aa == 4){
	}

}


int main(){
	int c = 0;
	// crew obj1;
	// obj1.year = 1990;

	// cout << obj1.year << endl;
	crew people[1100];
	crew onOrder[1100];
	// // int arr1[10];


	// c=make_people(people,c,1,5,15);
	// c=make_people(people,c,2,5,14);
	// c=make_people(people,c,4,5,13);
	// c=make_people(people,c,8,5,12);
	// c=make_people(people,c,16,5,11);
	// c=make_people(people,c,32,5,10);


	for(int i=1; i<9; i++){
		c=make_people(people,c,1,i,0,9);
		c=make_people(people,c,2,i,0,8);
		c=make_people(people,c,2,i,0,7);
		c=make_people(people,c,4,i,0,6);
		c=make_people(people,c,4,i,0,5);
		c=make_people(people,c,8,i,0,4);
		c=make_people(people,c,16,i,0,3);
		c=make_people(people,c,32,i,0,2);
		c=make_people(people,c,64,i,0,1);
	}
	int aa, a1, oa=0;
	promptt(people, onOrder, aa, a1, oa);

	for(int i=0; i<600; i++){
		// if(onOrder)
	}
}