#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
 

 
template <typename T>
void unique_elements(std::vector<T>& vec)
{
  
 
  std::map<T, int> m;
 
  for(auto p=vec.begin(); p!=vec.end(); ++p) 
    m[*p]++;
 
  vec.clear();
 
  for(auto p=m.begin(); p!=m.end(); ++p) 
    if (p->second == 1) vec.push_back(p->first);
}
 
int main()
{
  using std::vector;
  using std::string;
 
  vector<string> v{"b","a","x","y","z","a","a","z"};
 
  unique_elements(v);
 
  for(auto p=v.begin(); p!=v.end(); ++p)
  {
    std::cout << *p << std::endl;
  }
  
}