#include #include #include #include using namespace std; void read(vector & s) { int n; cin >> n >> ws; s.resize(n); for (int i = 0; i < n; ++i) getline(cin, s[i]); } void write(const vector & s) { cout << s.size() << "\n"; for (int i = 0; i < s.size(); ++i) cout << s[i] << "\n"; } int main() { vector s1, s2; read(s1); read(s2); random_shuffle(s1.begin(), s1.end()); random_shuffle(s2.begin(), s2.end()); write(s1); write(s2); return 0; }