#include <iostream>
#include <fstream>
#include <string>
using namespace std;

// Define new type "mid"
struct mid
{
  int alpha;
  string first, last;
};

int main()
{
  // Create and array of 41 Mids
  mid *A = new mid[41];

  // Open file
  ifstream fin("Mids.txt");

  // Read in mids
  for(int i = 0; i < 41; i++)
    fin >> A[i].alpha >> A[i].last >> A[i].first;

  // Get alpha from user
  cout << "Enter alpha: ";
  int a;
  cin >> a;
  
  // search for alpha a
  int k = 0;
  while(k < 41 && A[k].alpha != a)
    k++;

  // print result of search
  if (k == 41)
    cout << "No Mid with that alpha was found!" << endl;
  else
    cout << A[k].first << " " << A[k].last << endl;

  delete [] A;
  return 0;
}