#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

vector<string> make_list(stringstream& ss, char listnum) {
    vector<string> students;
    string student;
    if (listnum == 1) {
        while ((ss >> student) && (student != "==="))
            students.push_back(student);
    } else if (listnum == 2) {
        while ((ss >> student) && (student != "==="));
        while (ss >> student) students.push_back(student);
    }
    return students;
}

vector<string> make_pairs(vector<string> students) {
    vector<string> pairs;
    while (students.size() > 1) {
        int index = random() % students.size();
        string student1 = students[index];
        students.erase(students.begin() + index);
        index = random() % students.size();
        string student2 = students[index];
        students.erase(students.begin() + index);
        string pair = student1;
        pair.append(" will pair with ");
        pair.append(student2);
        pairs.push_back(pair);
    }
    return pairs;
}
