import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val map = mutableMapOf<String, Int>()

    val N = scanner.nextInt()
    for (i in 1..N) {
        val str = scanner.next()
        map[str] = map.getOrElse(str, {0}) + 1
    }

    val M = scanner.nextInt()
    for (i in 1..M) {
        val str = scanner.next()
        map[str] = map.getOrElse(str, {0}) - 1
    }

    val list = map.toList()
    val sorted = list.sortedBy { (_, value) -> value }
    println(list.first().first)