// Remember to put your name and student number here.

#include <vector>
#include <list>
#include <map>
#include <iostream>
#include <string>
#include <cstdlib>

// Use the std namespace, so we don't have to say std::vector<Elt>
using namespace std;




// Displays a random sequence of 50 integers i, 0 <= i <= 4,
// then a mimicking version using a window size of 2.
//
// Your code should work if test() is called.
// DON'T ALTER test()!

void test() {

  typedef Special<int> Elt;

  list<Elt> ints;

  // Make a special window at the beginning.
  // See below for why this is useful.
  ints.push_back(Elt());
  ints.push_back(Elt());

  for (int i = 0; i != 50; ++i) {
    int e = rand() % 5;
    cout << e;
    ints.push_back(Elt(e));
  }
  cout << endl;
  ints.push_back(Elt());

  map< list<Elt>, vector<Elt> > m;
  // Record in m information about what comes after pairs in ints.
  chop(ints.begin(), ints.end(), 2, m);

  // An elegant way not to treat the first 2 random digits separately.
  ints.clear();
  ints.push_back(Elt());
  ints.push_back(Elt());

  // choose preserves ints' length.
  Elt n = choose(ints, m);
  while (!n.is_special()) {
    cout << n.value();
    n = choose(ints, m);
  }
  cout << endl;

}


int main(int argc, char** argv) {

  // Get the first command line argument as the window size.
  int window_size = 1;
  if (argc < 2) {
    cerr << "Usage: " << argv[0] << " window_size" << endl;
    return 1;
  } else {
    window_size = atoi(argv[1]);
  }




  // Here is how we read the sequence of words
  string word;
  while (cin >> word) {

  }






  return 0;
}








