#include <iostream>
#include <vector>
using namespace std;

string printOrder(vector <string> v)
{
	
	// create graph
	unordered_map <char, vector<char> > graph;
	
	// set of chars
	unordered_set <char> nodes;
	for(string s : v)
	{
		char prev = s[0];
		nodes.insert(s[0]);
		for(int i = 1; i < s.length(); i++)
		{
			graph[prev].push_back(s[i])
			prev = s[i];
			nodes.insert(s[i]);
		}
	}
	
	
	unordered_set <char> vis;
	
	// 1 a 0 t
	// 5 a 2 0 t

		

	// p 0
	
	// z q p a
	
	// 1 -> a
	// 
	
	string ans = "";
	for(char c : nodes)
	{
		string dfsResult = "";
		if (vis.find(c) == vis.end())
		{
			dfsResult = dfs(c, graph, vis);
		}
		
		ans = dfsResult + ans;
	}
	
}


int main() {
	// your code goes here
	return 0;
}