| CodeRams Practice Problem Archive |
|---|
| Finished |
You're eating at a continental breakfast in a hotel, and there are two menu options. Each menu option consists of several food items. You want to find how many food items are contained in both menus.
The first line of input consists of a single positive integer $$$n1$$$: the number of food items on the first menu. The second line of input consists of $$$n1$$$ space-separated strings: the food items on the first menu.
The third line of input consists of a single positive integer $$$n2$$$: the number of food items on the second menu. The fourth line of input consists of $$$n2$$$ space-separated strings: the food items on the second menu.
Output a single positive integer $$$n$$$: the number of food items that are contained on both menus. Then, output $$$n$$$ lines: each food item which is contained on both menus, in alphabetical order.
3 Pastries Waffles Eggs 4 Waffles FrenchToast Eggs Cereal
2 Eggs Waffles
3 Eggs Waffles Pastries 2 FrenchToast Cereal
0
| Name |
|---|


