fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
   ///println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
   ///println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")
	//
	/*var i = 0
    while (i < args.size)
        println(args[i++]) */

   	var x = 1

    var countUnique = 0

    var isUnique = true

	//println("${vals1.size} ")
    for (i in vals1)
    {
        isUnique = true;
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals2)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               isUnique = false
                break
            }

        }
        if (isUnique === true)
        {
            countUnique++
        }

		//print("${i} ")
    }

    for (i in vals2)
    {
        isUnique = true;
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals1)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               isUnique = false
                break
            }

        }
        if (isUnique === true)
        {
            countUnique++
        }

    }

    print("${countUnique} ")

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
    println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
    println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")

   	val x : Int = 1

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("i: ${i} -> ${vals1[i]}, ")
    }

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    println("${n}")
    println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    println("${m}")
    println("${vals2}")

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")

	/*println("${vals1.size} ")
    for (i in vals1)
    {
		print("${vals1[i]} ")
    }*/

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
   ///println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
   ///println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")
	//
	/*var i = 0
    while (i < args.size)
        println(args[i++]) */

   	var x = 1

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("${vals1[i]}\n ")
    }

    x = 1

	for (j in vals2)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("${vals1[j]} ")
    }
	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    println(1);
    //val n = args[0].toInt()
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	//val m = args[n + 1].toInt()
	//val vals2 = readLine()!!.split(' ').map(String::toInt)
	//println("Hello, ${n}!")
	//println("Hello, ${m}!")

	/*println("${vals1.size} ")
    for (i in vals1)
    {
		print("${vals1[i]} ")
    }*/

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
    println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
    println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")

   	val x : Int = 1

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (x === 1)
        {
           // x = 0
            continue
        }
		print("i: ${i} -> ${vals1[i]}, ")
    }

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
   ///println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
   ///println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")
	//
	/*var i = 0
    while (i < args.size)
        println(args[i++]) */

   	var x = 0

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("i: ${i} -> ${vals1[i]}, ")
    }

    x = 1

	for (j in vals2)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("i: ${j} -> ${vals1[j]}, ")
    }
	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
   ///println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
   ///println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")
	//
	/*var i = 0
    while (i < args.size)
        println(args[i++]) */

   	var x = 1

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("${i}\n ")
    }

    x = 1

	/*for (j in vals2)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("${vals2[j]} ")
    }*/
	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
   ///println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
   ///println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")
	//
	/*var i = 0
    while (i < args.size)
        println(args[i++]) */

   	var x = 1

    var countUnique = 0

    var isUnique = true

	//println("${vals1.size} ")
    for (i in vals1)
    {
        isUnique = true;
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals2)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               isUnique = false
                break
            }

        }
        if (isUnique === true)
        {
            countUnique++
        }

		//print("${i} ")
    }

    x = 1

    for (i in vals2)
    {
        isUnique = true;
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals1)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               isUnique = false
                break
            }

        }
        if (isUnique === true)
        {
            countUnique++
        }

    }

    x = 1

    print("${countUnique} ")

    for (i in vals1)
    {
        isUnique = true;
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals2)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               isUnique = false
                break
            }

        }
        if (isUnique === true)
        {
            print("${i} ")
        }

		//print("${i} ")
    }

    x = 1

    for (i in vals2)
    {
        isUnique = true;
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals1)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               isUnique = false
                break
            }

        }
        if (isUnique === true)
        {
            print("${i} ")
        }

    }

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

   val n = args[0].toInt()
   val vals1 = Array(n, { i -> (i * i).toInt() })
   val m = args[n].toInt()
   val vals2 = Array(m, { i -> (i * i).toInt() })
   println("${args[0]}")
   //intln("Hello, ${args[0]}!")
   //

	for (i in vals1)
    {
        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                println("${vals1[i]}")
            }
        }
    }
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
   ///println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
   ///println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")
	//
	/*var i = 0
    while (i < args.size)
        println(args[i++]) */

   	var x = 1

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals2)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               print("${j} ")
            }

        }
		//print("${i} ")
    }

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
   ///println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
   ///println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")
	//
	/*var i = 0
    while (i < args.size)
        println(args[i++]) */

   	var x = 1

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("${vals1[i]}\n ")
    }

    x = 1

	for (j in vals2)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("${vals2[j]} ")
    }
	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
   ///println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
   ///println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")
	//
	/*var i = 0
    while (i < args.size)
        println(args[i++]) */

   	var x = 1

    var countUnique = 0

    var isUnique = true

	//println("${vals1.size} ")
    for (i in vals1)
    {
        isUnique = true;
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals2)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               isUnique = false
                break
            }

        }
        if (isUnique === true)
        {
            countUnique++
        }

		//print("${i} ")
    }

    for (i in vals2)
    {
        isUnique = true;
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals1)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               isUnique = false
                break
            }

        }
        if (isUnique === true)
        {
            countUnique++
        }

    }

    print("${countUnique} ")

    for (i in vals1)
    {
        isUnique = true;
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals2)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               isUnique = false
                break
            }

        }
        if (isUnique === true)
        {
            print("${i} ")
        }

		//print("${i} ")
    }

    for (i in vals2)
    {
        isUnique = true;
        if (x === 1)
        {
            x = 0
            continue
        }
        var skip = 1
        for (j in vals1)
        {
            if (skip === 1)
            {
                skip = 0
                continue
            }
            if (j === i)
            {
               isUnique = false
                break
            }

        }
        if (isUnique === true)
        {
            print("${i} ")
        }

    }

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    println("${n}")
    println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    println("${m}")
    println("${vals2}")

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (i == 0)
        {
            continue
        }
		print("${vals1[i]} ye ")
    }

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    val n = args[0].toInt()
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	val vals1 = readLine()!!.split(' ').map(String::toInt)
	val m = args[n + 1].toInt()
	val vals2 = readLine()!!.split(' ').map(String::toInt)
	println("Hello, ${n}!")
	println("Hello, ${m}!")

	println("${vals1.size} ")
    for (i in vals1)
    {
		print("${vals1[i]} ")
    }

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val arr = readLine()!!.split(' ').map(String::toInt)
    val n = arr[0]
    println("${n}")
    println("${arr}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	//val m = args[n + 1].toInt()
	//val vals2 = readLine()!!.split(' ').map(String::toInt)
	//println("Hello, ${n}!")
	//println("Hello, ${m}!")

	/*println("${vals1.size} ")
    for (i in vals1)
    {
		print("${vals1[i]} ")
    }*/

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
    println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
    println("${vals2}")

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (i == 0)
        {
            continue
        }
		print("i: ${i} -> ${vals1[i]}, ")
    }

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    val n = args[0].toInt()
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val m = args[n + 1].toInt()
	//val vals2 = readLine()!!.split(' ').map(String::toInt)
	println("Hello, ${n}!")
	println("Hello, ${m}!")

	/*println("${vals1.size} ")
    for (i in vals1)
    {
		print("${vals1[i]} ")
    }*/

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
   ///println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
   ///println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")
	//
	/*var i = 0
    while (i < args.size)
        println(args[i++]) */

   	var x = 1

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("${i} ")
    }

    x = 1

	for (j in vals2)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("${j} ")
    }
	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    val input1 = readLine()!!.split(' ').map(String::toInt)
    val input2 = readLine()!!.split(' ').map(String::toInt)

    var set1 = input1.drop(1)
    var set2 = input2.drop(1)

    val lst = arrayListOf<Int>()

    for (value in set1) {
        if( false == set2.contains( value )
                && false == lst.contains( value ) ) {
            lst.add( value )
        }
    }
    for (value in set2) {
        if( false == set1.contains( value )
                && false == lst.contains( value ) ) {
            lst.add( value )
        }
    }

    lst.sort()

    var ans = ""

    lst.forEach {
        if( ans != "" ) ans += " "
        ans += "${it}"
    }

    println("${lst.size} ${ans}")
}


fun main(args: Array<String>) {
    val setFirst = readLine()!!.split(" ").map(String::toInt).drop(1);
    val setSecond = readLine()!!.split(" ").map(String::toInt);
    var answer = setFirst.union(setSecond) - setFirst.intersect(setSecond);
    print(answer.size);
    print(' ');
    for (i in answer) {
        print(i);
        print(' ');
    }

}


fun main(args: Array<String>) {
    val setFirst = readLine()!!.split(" ").map(String::toInt).drop(1).toSet();
    val setSecond = readLine()!!.split(" ").map(String::toInt).drop(1).toSet();
    var answer = setFirst.union(setSecond) - setFirst.intersect(setSecond);
    print(answer.size);
    print(' ');
    for (i in answer) {
        print(i);
        print(' ');
    }

}


fun main(args: Array<String>) {
    var a: Set<Int> = (readLine() ?: "").split(" ").drop(1).map { it.toInt() }.toHashSet();
    var b: Set<Int> = (readLine() ?: "").split(" ").drop(1).map { it.toInt() }.toHashSet();
    var c: List<Int> = a.filter { !b.contains(it) }
    var d: List<Int> = b.filter { !a.contains(it) }
    println(a);
    println(b);
    println(c);
    println(d);
    print(c.size + d.size)
    for (x in c) {
        print(" ");
        print(x);
    }
    for (x in d) {
        print(" ");
        print(x);
    }
    println()
}


fun main(args: Array<String>) {
    var a: Set<Int> = (readLine() ?: "").split(" ").drop(1).map { it.toInt() }.toHashSet();
    var b: Set<Int> = (readLine() ?: "").split(" ").drop(1).map { it.toInt() }.toHashSet();
    var c: List<Int> = a.filter { !b.contains(it) }
    var d: List<Int> = b.filter { !a.contains(it) }
    /*println(a);
    println(b);
    println(c);
    println(d);*/
    print(c.size + d.size)
    for (x in c) {
        print(" ");
        print(x);
    }
    for (x in d) {
        print(" ");
        print(x);
    }
    println()
}


/**
 * Created by qiuwenda on 6/16.
 */
import java.util.Scanner
import java.util.Arrays
import java.util.*

fun main(args: Array<String>) {
    val sa = readLine()!!.split(' ').map(String::toInt)
    val sb = readLine()!!.split(' ').map(String::toInt)
    val answer = ArrayList<Int>()
    for (i in sa)
    {
        var flag = true
        for (j in sb)
        {
            if (i == j)
            {
                flag = false
                break
            }
        }
        if (flag)
            answer.add(i)
    }
    for (i in sb)
    {
        var flag = true
        for (j in sa)
        {
            if (i == j)
            {
                flag = false
                break
            }
        }
        if (flag)
            answer.add(i)
    }
    print(answer.size)
    for (i in answer)
        print(" " + i.toString())
    println()
}


/**
 * Created by qiuwenda on 6/16.
 */
import java.util.Scanner
import java.util.Arrays
import java.util.*

fun main(args: Array<String>) {
    val A = readLine()!!.split(' ').map(String::toInt)
    val B = readLine()!!.split(' ').map(String::toInt)
    val sa = ArrayList<Int>()
    val sb = ArrayList<Int>()
    val answer = ArrayList<Int>()
    for (i in 1..A.size-1) sa.add(A[i])
    for (i in 1..B.size-1) sb.add(B[i])
    for (i in sa)
    {
        var flag = true
        for (j in sb)
        {
            if (i == j)
            {
                flag = false
                break
            }
        }
        if (flag)
            answer.add(i)
    }
    for (i in sb)
    {
        var flag = true
        for (j in sa)
        {
            if (i == j)
            {
                flag = false
                break
            }
        }
        if (flag)
            answer.add(i)
    }
    print(answer.size)
    for (i in answer)
        print(" " + i.toString())
    println()
}


/**
 * Created by gotzillaz on 6/16/2016 AD.
 */
import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    val l1 = readLine()!!.split(' ').map(String::toInt)
    val l2 = readLine()!!.split(' ').map(String::toInt)
    var c = IntArray(5000)
    for(i in 1..l1[0])
    {
        c[l1[i]+2000]++
    }
    for(i in 1..l2[0])
    {
        c[l2[i]+2000]++
    }
    var np = 0
    for(i in c)
    {
        if(i == 1) np++
    }
    print("$np ")
    for(i in 0..3000)
    {
        if(c[i] == 1) {print(i-2000);print(" ")}
    }
}


/**
 * Created by gotzillaz on 6/16/2016 AD.
 */
import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    val l1 = readLine()!!.split(' ').map(String::toInt)
    val l2 = readLine()!!.split(' ').map(String::toInt)
    var c = IntArray(2000)
    for(i in 1..l1[0])
    {
        c[l1[i]]++
    }
    for(i in 1..l2[0])
    {
        c[l2[i]]++
    }
    var np = 0
    for(i in c)
    {
        if(i == 1) np++
    }
    print("$np ")
    for(i in 0..1999)
    {
        if(c[i] == 1) print("$i ")
    }
}


/**
 * Created by gotzillaz on 6/16/2016 AD.
 */
import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    val l1 = readLine()!!.split(' ').map(String::toInt)
    val l2 = readLine()!!.split(' ').map(String::toInt)
    var c = IntArray(5000)
    for(i in 1..l1[0])
    {
        c[l1[i]+2000]++
    }
    for(i in 1..l2[0])
    {
        c[l2[i]+2000]++
    }
    var np = 0
    for(i in c)
    {
        if(i == 1) np++
    }
    print("$np ")
    for(i in 2000..4100)
    {
        if(c[i] == 1) print("${i-2000} ")
    }
}


import java.io.InputStream
import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {

    var cnt = IntArray(3000)
    for (tt in 0..1) {
        var str : String
        str = readLine()!!
        var x = 0
        var first = true
        var negative = false
        for (j in str) {
            if (j == ' ') {
                if (first) {
                    first = false
                } else {
                    if (negative) {
                        x *= -1
                    }
                    cnt[x + 1050] += 1
                }
                x = 0
                negative = false
            } else {
                if (j == '-') {
                    negative = true
                } else {

                x *= 10
                x += j.toInt() - '0'.toInt()
                }
            }
        }
        if (negative) {
                        x *= -1
                    }
        cnt[x + 1050] += 1
    }
    var ans = 0
    for (i in 0 ..2999) {
        if (cnt[i] == 1) {
            ans += 1
        }
    }
    print(ans)
    for (i in 0..2999) {
        if (cnt[i] == 1) {
            print(' ')
            print(i - 1050)
        }
    }
    println()
}


import java.io.InputStream
import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {

    var cnt = IntArray(3000)
    for (tt in 0..1) {
        var str : String
        str = readLine()!!
        var x = 0
        var first = true
        for (j in str) {
            if (j == ' ') {
                if (first) {
                    first = false
                } else {
                    cnt[x + 1000] += 1
                }
                x = 0
            } else {
                x *= 10
                x += j.toInt() - '0'.toInt()
            }
        }
        cnt[x + 1000] += 1
    }
    var ans = 0
    for (i in 0 ..2999) {
        if (cnt[i] == 1) {
            ans += 1
        }
    }
    print(ans)
    for (i in 0..2999) {
        if (cnt[i] == 1) {
            print(' ')
            print(i - 1000)
        }
    }
    println()
}


fun find(a: List<Int> , q:Int):Int{
    var i= 1
    while ( i < a.size ){
        if( a[i] == q)
            return 1
        i=i+1
    }
    return 0
}

fun tfind(a: MutableList<Int> , q:Int):Int{
    var i= 0
    while ( i < a.size ){
        if( a[i] == q)
            return 1
        i=i+1
    }
    return 0
}

fun main(args: Array<String>) {
    var z  : MutableList<Int> = mutableListOf()
    var y  : List<Int> = listOf()
    var x  : List<Int> = listOf()

    var t : List<Int> = readLine()!!.split(' ').map(String::toInt)
    var n : Int = t[0]

    x = t

    t = readLine()!!.split(' ').map(String::toInt)
    n= t[0]
    y = t

    var i : Int =-1000
    while(i<=1000)
    {
        if ( find(x ,i ) + find(y,i) == 1)
            z.add(i)
        i=i+1
    }

    print( z.size)

    i=-1000
    while(i<=1000){
        if ( tfind(z ,i ) == 1){
            print(" ")
            print(i)

            }

        i+=1
    }

}


fun find(a: List<Int> , q:Int):Int{
    var i= 1
    while ( i < a.size ){
        if( a[i] == q)
            return 1
        i=i+1
    }
    return 0
}

fun tfind(a: MutableList<Int> , q:Int):Int{
    var i= 0
    while ( i < a.size ){
        if( a[i] == q)
            return 1
        i=i+1
    }
    return 0
}

fun main(args: Array<String>) {
    var z  : MutableList<Int> = mutableListOf()
    var y  : List<Int> = listOf()
    var x  : List<Int> = listOf()

    var t : List<Int> = readLine()!!.split(' ').map(String::toInt)
    var n : Int = t[0]

    x = t.filter { it != 0 }

    t = readLine()!!.split(' ').map(String::toInt)
    n= t[0]
    y = t.filter { it != 0 }

    var i : Int =-1000
    while(i<=1000)
    {
        if ( find(x ,i ) + find(y,i) == 1)
            z.add(i)
        i=i+1
    }

    print( z.size)

    i=-1000
    while(i<=1000){
        if ( tfind(z ,i ) == 1){
            print(" ")
            print(i)

            }

        i+=1
    }

}


fun readset():List<Int> = readLine()!!.split(' ').map(String::toInt).drop(1)

fun main(args: Array<String>) {
	val a=readset()
	val b=readset()
	val c=a.union(b).minus(a.intersect(b))
	print(c.size)
	for(x in c.sorted()) print(" $x")
	println()
}


/**
 * We declare a package-level function main which returns Unit and takes
 * an Array of strings as a parameter. Note that semicolons are optional.
 */

import kotlin.collections.*;
import kotlin.comparisons.*;

fun main(args: Array<String>) {
    /*
    val names: MutableList<Pair<Int, String> > = mutableListOf(
Pair(150, "Ivan"),
Pair(215, "Igor"),
Pair(158, "Dasha"),
Pair(150, "Katya"))
*/
    //val n = 4
    //val a, b: MutableList<Pair<Int, String> > = mutableListOf()
    val aa: MutableList<Int> = mutableListOf()
    val bb: MutableList<Int> = mutableListOf()
    val cc: MutableList<Int> = mutableListOf()
    //val a = "5 1 4 8 9 10".split(' ')
	//val b = "4 1 2 8 10".split(' ')
    val a = readLine()!!.split(' ')
    val b = readLine()!!.split(' ')
    for (x in 1..a.get(0).toInt()) {
        aa.add(0, a.get(x).toInt())
    }
    for (x in 1..b.get(0).toInt()) {
        bb.add(0, b.get(x).toInt())
    }

    for (x in aa) {
        if (!bb.contains(x))
	        cc.add(0, x)
    }
    for (x in bb) {
        if (!aa.contains(x))
	        cc.add(0, x)
    }
    val d = cc.count()
    print("${d} ")
    cc.forEach { print("${it} ") }
    println()
}


/**
 * We declare a package-level function main which returns Unit and takes
 * an Array of strings as a parameter. Note that semicolons are optional.
 */

import kotlin.collections.*;
import kotlin.comparisons.*;

fun main(args: Array<String>) {
    /*
    val names: MutableList<Pair<Int, String> > = mutableListOf(
Pair(150, "Ivan"),
Pair(215, "Igor"),
Pair(158, "Dasha"),
Pair(150, "Katya"))
*/
    //val n = 4
    //val a, b: MutableList<Pair<Int, String> > = mutableListOf()
    val aa: MutableList<Int> = mutableListOf()
    val bb: MutableList<Int> = mutableListOf()
    val cc: MutableList<Int> = mutableListOf()
    val a = readLine()!!.split(' ')
    val b = readLine()!!.split(' ')
    for (x in 1..a.get(0).toInt()) {
        aa.add(0, a.get(x - 1).toInt())
    }
    for (x in 1..b.get(0).toInt()) {
        bb.add(0, b.get(x - 1).toInt())
    }

    for (x in aa) {
        if (!bb.contains(x))
	        cc.add(0, x)
    }
    for (x in bb) {
        if (!aa.contains(x))
	        cc.add(0, x)
    }
    val d = cc.count()
    print("${d} ")
    cc.forEach { print("${it} ") }
    println()
}


/**
 * We declare a package-level function main which returns Unit and takes
 * an Array of strings as a parameter. Note that semicolons are optional.
 */

import kotlin.collections.*;
import kotlin.comparisons.*;

fun main(args: Array<String>) {
    /*
    val names: MutableList<Pair<Int, String> > = mutableListOf(
Pair(150, "Ivan"),
Pair(215, "Igor"),
Pair(158, "Dasha"),
Pair(150, "Katya"))
*/
    //val n = 4
    //val a, b: MutableList<Pair<Int, String> > = mutableListOf()
    val aa: MutableList<Int> = mutableListOf()
    val bb: MutableList<Int> = mutableListOf()
    val cc: MutableList<Int> = mutableListOf()
    // val a = "3 1 2 3".split(' ')
	// val b = "3 2 3 4".split(' ')
    val a = readLine()!!.split(' ')
    val b = readLine()!!.split(' ')
    for (x in 0..a.get(0).toInt()) {
        aa.add(0, a.get(x).toInt())
    }
    for (x in 0..b.get(0).toInt()) {
        bb.add(0, b.get(x).toInt())
    }

    for (x in aa) {
        if (!bb.contains(x))
	        cc.add(0, x)
    }
    for (x in bb) {
        if (!aa.contains(x))
	        cc.add(0, x)
    }
    val d = cc.count()
    print("${d} ")
    cc.forEach { print("${it} ") }
    println()
}


import java.util.Scanner

fun main(args: Array<String>) {
	val input = Scanner(System.`in`)

	val numbers1: MutableList<Int> = mutableListOf()
	val numbers2: MutableList<Int> = mutableListOf()
	val numbers3: MutableList<Int> = mutableListOf()

	var a = input.nextInt()

	for (i in 1..a) {
		val b = input.nextInt()
		numbers1.add(b)
	}

	a = input.nextInt()

	for (i in 1..a) {
		val b = input.nextInt()
		numbers2.add(b)
	}

	for (item in numbers1) {
		var ta = 0
		for (item1 in numbers2) {
			if (item1 == item) {
				ta = 1
				break
			}
		}

		if (ta == 0) {
			numbers3.add(item)
		}
	}

	for (item in numbers2) {
		var ta = 0
		for (item1 in numbers1) {
			if (item1 == item) {
				ta = 1
				break
			}
		}

		if (ta == 0) {
			numbers3.add(item)
		}
	}

	print(numbers3.size)
	print(' ')
	for (item in numbers3) {
		print(item)
		print(' ')
	}
}


import java.util.*

fun main(args: Array<String>) {
    val a = readLine()!!.split(' ').map(String::toInt).sorted()
    val b = readLine()!!.split(' ').map(String::toInt).sorted()
    val ans = ArrayList<Int>()
    for (e in a) {
        if (b.binarySearch(e) < 0) {
            ans.add(e)
        }
    }
    for (e in b) {
        if (a.binarySearch(e) < 0 && ans.binarySearch(e) < 0) {
            ans.add(e)
        }
    }
    print(ans.size)
    ans.forEach { it -> print(" " + it) }
    println()
}


import java.util.*

fun main(args: Array<String>) {
    val a = readLine()!!.split(' ').map(String::toInt)
    val b = readLine()!!.split(' ').map(String::toInt)
    val aa = a.subList(1, a.size)
    val bb = b.subList(1, b.size)
    val amb = aa.subtract(bb)
    val bma = bb.subtract(aa)
    val ans = amb.union(bma)
    print(ans.size)
    ans.forEach { it -> print(" " + it) }
    println()
}


import java.util.*

fun main(args: Array<String>) {
    val setaTemp = readLine()!!.trim().split(' ').map(String::toInt)
    val seta: HashSet<Int> = HashSet<Int>(setaTemp.subList(1,setaTemp.count()-1))

    val setbTemp = readLine()!!.trim().split(' ').map(String::toInt)
    val setb: HashSet<Int> = HashSet<Int>(setbTemp.subList(1,setbTemp.count()-1))

    val resultSet = seta.union(setb) - seta.intersect(setb)
    println("${resultSet.count()} ${resultSet.joinToString(" ")}")
}


import java.util.*

fun main(args: Array<String>) {
    val setaTemp = readLine()!!.trim()
    val seta: HashSet<Int> = if(setaTemp.length>0) HashSet<Int>(setaTemp.split(' ').map(String::toInt)) else HashSet<Int>()
    val setbTemp = readLine()!!.trim()
    val setb: HashSet<Int> = if(setbTemp.length>0) HashSet<Int>(setbTemp.split(' ').map(String::toInt)) else HashSet<Int>()

    val resultSet = seta.union(setb) - seta.intersect(setb)
    println("${resultSet.count()} ${resultSet.joinToString(" ")}")
}


import java.util.*

fun main(args: Array<String>) {
    val seta: HashSet<Int> = HashSet<Int>(readLine()!!.split(' ').map(String::toInt))
    val setb: HashSet<Int> = HashSet<Int>(readLine()!!.split(' ').map(String::toInt))

    val resultSet = seta.union(setb) - seta.intersect(setb)
    println("${resultSet.count()} ${resultSet.joinToString(" ")}")
}


import java.util.*

fun main(args: Array<String>) {
    val setaTemp = readLine()!!.trim().split(' ').map(String::toInt)
    val seta: HashSet<Int> = HashSet<Int>(setaTemp.subList(1,setaTemp.count()))

    val setbTemp = readLine()!!.trim().split(' ').map(String::toInt)
    val setb: HashSet<Int> = HashSet<Int>(setbTemp.subList(1,setbTemp.count()))

    val resultSet = seta.union(setb) - seta.intersect(setb)
    println("${resultSet.count()} ${resultSet.joinToString(" ")}")
}


fun main(args: Array<String>) {
    var arr = Array<Int>(2000, {i -> 0})
    for (i in 0..1999)
        arr[i] = 0
    var inp = readLine()!!.split(' ').map(String::toInt)
    for (i in 1..inp[0])
        arr[inp[i] + 1000] += 1
    inp = readLine()!!.split(' ').map(String::toInt)
    for (i in 1..inp[0])
        arr[inp[i] + 1000] += 1
    var arr2 = arrayListOf<Int>()
    for (i in 0..1999)
        if(arr[i] == 1)
            arr2.add(i - 1000)
    print("${arr2.size}")
    for (i in arr2)
        print(" $i")
}


fun main(args: Array<String>) {
    var arr = Array<Int>(2001, {i -> 0})
    for (i in 0..2000)
        arr[i] = 0
    var inp = readLine()!!.split(' ').map(String::toInt)
    for (i in 1..inp[0])
        arr[inp[i] + 1000] += 1
    inp = readLine()!!.split(' ').map(String::toInt)
    for (i in 1..inp[0])
        arr[inp[i] + 1000] += 1
    var arr2 = arrayListOf<Int>()
    for (i in 0..2000)
        if(arr[i] == 1)
            arr2.add(i - 1000)
    print("${arr2.size}")
    for (i in arr2)
        print(" $i")
}


import java.util.*

fun main(args: Array<String>) {
    val input = Scanner(System.`in`)
    val n = input.nextInt()
    val a = IntArray(1007)
    val b = IntArray(1007)
    for (i in 1..n) {
        a[i] = input.nextInt()
    }
    val m = input.nextInt()
    for (i in 1..m)
    {
        b[i] = input.nextInt()
    }
    val ans = IntArray(1007)
    ans[0] = 0
    for (i in 1..n) {
        var q = 0
        for (j in 1..m)
            if (b[j] == a[i])
                q = 1
        if (q == 0)
        {
            ans[0] = ans[0] + 1
            ans[ans[0]] = a[i]
        }
    }
    for (i in 1..m) {
        var q = 0
        for (j in 1..n)
            if (b[i] == a[j])
                q = 1
        if (q == 0)
        {
            ans[0] = ans[0] + 1
            ans[ans[0]] = b[i]
        }
    }
    print(ans[0])
    print(' ')
    for (i in 1..ans[0]) {
        print(ans[i])
        print(' ')
    }
}


import java.util.*

fun main(args: Array<String>) {
    val input = Scanner(System.`in`)
    val n = input.nextInt()
    val a = IntArray(1007)
    val b = IntArray(1007)
    for (i in 1..n) {
        a[i] = input.nextInt()
    }
    val m = input.nextInt()
    for (i in 1..m)
    {
        b[i] = input.nextInt()
    }
    val ans = IntArray(3007)
    ans[0] = 0
    for (i in 1..n) {
        var q = 0
        for (j in 1..m)
            if (b[j] == a[i])
                q = 1
        if (q == 0)
        {
            ans[0] = ans[0] + 1
            ans[ans[0]] = a[i]
        }
    }
    for (i in 1..m) {
        var q = 0
        for (j in 1..n)
            if (b[i] == a[j])
                q = 1
        if (q == 0)
        {
            ans[0] = ans[0] + 1
            ans[ans[0]] = b[i]
        }
    }
    print(ans[0])
    print(' ')
    for (i in 1..ans[0]) {
        print(ans[i])
        print(' ')
    }
}


import java.io.*;
import java.util.*;

fun readSet(inp: InputReader): HashSet<Int> {
    val res = HashSet<Int>()
    val n = inp.nextInt()
    for (idx in 1..n)
        res.add(inp.nextInt())
    return res
}

fun solve(inp: InputReader, out: PrintWriter) {
    val s1 = readSet(inp)
    val s2 = readSet(inp)
    val sum = s1.union(s2)
    val res = HashSet<Int>()
    for (e in sum)
        if (!s1.contains(e) || !s2.contains(e))
            res.add(e)
    out.print(res.size)
    out.print(" ")
    for (e in res) {
        out.print(e)
        out.print(" ")
    }
}

fun main(args: Array<String>) {
    val inp = InputReader(if (args.size > 0) "c.in" else null)
    val out = PrintWriter(BufferedOutputStream(System.out))
    solve(inp, out)
    out.close();
}

class InputReader constructor(fileName: String?){
    internal var br: BufferedReader
    internal var st: StringTokenizer? = null

    init {
        br = if (fileName != null) BufferedReader(FileReader(fileName)) else BufferedReader(InputStreamReader(System.`in`))
    }

    fun next(): String {
        while (st == null || !st!!.hasMoreElements()) {
            try {
                st = StringTokenizer(br.readLine())
            } catch (e: IOException) {
                e.printStackTrace()
            }
        }
        return st!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextDouble(): Double {
        return java.lang.Double.parseDouble(next())
    }

    fun nextLine(): String {
        var str = ""
        try {
            str = br.readLine()
        } catch (e: IOException) {
            e.printStackTrace()
        }
        return str
    }
}


import java.io.*
import java.math.BigInteger
import java.util.*

val inputFile : String? = null
val outputFile : String? = null
val inputType : Int = 0
val tests = arrayOf(
        "4\nIvan 150\nIgor 215\nDasha 158\nKatya 150", "Ivan\nKatya\nDasha\nIgor",
        "2\nSASHA 180\nSASHA 170", "SASHA\nSASHA"
)

fun solve(inp: InputReader, out: OutputWriter, testNumber: Int) {
    var n = inp.readInt()
    var students = Array<Student>(n,
        { var name = inp.readString()
            var height = inp.readInt()
            return@Array Student(name, height)
        })
    Arrays.sort(students, Comparator { a, b -> a.height - b.height })
    for (student in students) {
        out.printLine(student.name)
    }
}

data class Student(val name: String, val height: Int)

fun check(input: String, answer: String, output: String): String {
    var expected = InputReader(StringBufferInputStream(answer))
    var actual = InputReader(StringBufferInputStream(output))

    while (true) {
        if (expected.isExhausted()) {
            if (actual.isExhausted())
                return "OK"
            return "PE, excessive tokens"
        }
        if (actual.isExhausted())
            return "PE, not enough tokens"
        val expectedToken = expected.readString()
        val actualToken = actual.readString()
        if (!expectedToken.equals(actualToken))
            return "WA, " + expectedToken + " != " + actualToken
    }
}

fun main(args: Array<String>) {
    Locale.setDefault(Locale.US)
    if (args.size != 0 && "Test".equals(args[0])) {
        test()
    } else {
        var inp: InputReader
        if (inputFile == null)
            inp = InputReader(System.`in`)
        else
            inp = InputReader(FileInputStream(inputFile))
        var out: OutputWriter
        if (outputFile == null)
            out = OutputWriter(PrintWriter(System.out))
        else
            out = OutputWriter.init(FileOutputStream(outputFile))
        run(inp, out)
    }
}

fun test() {
    Thread.sleep(100)
    var i = 0
    var maxTime: Long = 0
    var ok = -1
    while (i < tests.size) {
        var input = tests[i]
        var answer = tests[i + 1]
        i += 2
        var testNumber = i / 2
        var inp = InputReader(StringBufferInputStream(input))
        var sw = StringWriter()
        var out = OutputWriter(PrintWriter(sw))
        println("Test #" + testNumber)
        println("Input:")
        println(input)
        println()
        println("Answer:")
        println(answer)
        println()
        println("Output:")
        var time = System.currentTimeMillis()
        var verdict: String
        try {
            run(inp, out)
            time = System.currentTimeMillis() - time
            var output = sw.toString()
            println(output)
            verdict = check(input, answer, output)
        } catch (e: Throwable) {
            verdict = "Runtime Error (" + e.javaClass.getSimpleName() + ")"
            println(e.message)
            e.printStackTrace()
        }
        println("Verdict = " + verdict)
        if (!verdict.equals("OK"))
            ok = testNumber
        println(java.lang.String.format("Time = %.3f\n", time / 1000.0))
        maxTime = Math.max(maxTime, time)
        println("----------------------------------------------------------")
    }
    if (ok == -1)
        println("All test passed")
    else
        println("First failed test = " + ok)
    println(java.lang.String.format("Maximal time = %.3f\n", maxTime / 1000.0))
}

fun run(inp: InputReader, out: OutputWriter) {
    if (inputType == 0)
        solve(inp, out, 1)
    else if (inputType == 1) {
        var testCount = inp.readInt()
        for (i in 1..testCount) {
            solve(inp, out, i)
        }
    } else if (inputType == 2) {
        try {
            var test = 1
            while (true) {
                solve(inp, out, test++)
            }
        } catch (e: UnknownError) {
        }
    }
    out.close()
}

open class InputReader(val stream: InputStream) {
    private var finished: Boolean = false
    private var buf: ByteArray = ByteArray(1024)
    private var curChar: Int = 0
    private var numChars: Int = 0
    private var filter: SpaceCharFilter? = null

    public open fun read(): Int {
        if (numChars == -1)
            throw InputMismatchException()

        if (curChar >= numChars)
        {
            curChar = 0
            try
            {
                numChars = stream.read(buf)
            }
            catch (e: IOException) {
                throw InputMismatchException()
            }

            if (numChars <= 0)
                return -1

        }

        return buf[curChar++].toInt()
    }
    public open fun peek(): Int {
        if (numChars == -1)
            return -1

        if (curChar >= numChars)
        {
            curChar = 0
            try
            {
                numChars = stream.read(buf)
            }
            catch (e: IOException) {
                return -1
            }

            if (numChars <= 0)
                return -1

        }

        return buf[curChar].toInt()
    }
    public open fun readInt(): Int {
        var c: Int = read()
        while (isSpaceChar(c))
            c = read()
        var sgn: Int = 1
        if (c == '-'.toInt())
        {
            sgn = -1
            c = read()
        }

        var res: Int = 0
        do
        {
            if (c.toInt() < '0'.toInt() || c.toInt() > '9'.toInt())
                throw InputMismatchException()

            res *= 10
            res += c.toInt() - '0'.toInt()
            c = read()
        }
        while (!isSpaceChar(c))
        return res * sgn
    }
    public open fun readLong(): Long {
        var c: Int = read()
        while (isSpaceChar(c))
            c = read()
        var sgn: Int = 1
        if (c == '-'.toInt())
        {
            sgn = -1
            c = read()
        }

        var res: Long = 0
        do
        {
            if (c.toInt() < '0'.toInt() || c.toInt() > '9'.toInt())
                throw InputMismatchException()

            res *= 10
            res += c.toInt() - '0'.toInt()
            c = read()
        }
        while (!isSpaceChar(c))
        return res * sgn
    }
    public open fun readString(): String {
        var c: Int = read()
        while (isSpaceChar(c))
            c = read()
        var res: StringBuilder = StringBuilder()
        do
        {
            res.appendCodePoint(c)
            c = read()
        }
        while (!isSpaceChar(c))
        return res.toString()
    }
    public open fun isSpaceChar(c: Int): Boolean {
        if (filter != null)
            return filter?.isSpaceChar(c)!!

        return isWhitespace(c)
    }
    private fun readLine0(): String {
        var buf: StringBuilder = StringBuilder()
        var c: Int = read()
        while (c != '\n'.toInt() && c != -1)
        {
            if (c != '\r'.toInt())
                buf.appendCodePoint(c)

            c = read()
        }
        return buf.toString()
    }
    public open fun readLine(): String {
        var s: String = readLine0()
        while ((s.trim().length) == 0)
            s = readLine0()
        return s
    }
    public open fun readLine(ignoreEmptyLines: Boolean): String {
        if (ignoreEmptyLines)
            return readLine()
        else
            return readLine0()
    }
    public open fun readBigInteger(): BigInteger {
        try
        {
            return BigInteger(readString())
        }
        catch (e: NumberFormatException) {
            throw InputMismatchException()
        }

    }
    public open fun readCharacter(): Char {
        var c: Int = read()
        while (isSpaceChar(c))
            c = read()
        return c.toChar()
    }
    public open fun readDouble(): Double {
        var c: Int = read()
        while (isSpaceChar(c))
            c = read()
        var sgn: Int = 1
        if (c == '-'.toInt())
        {
            sgn = -1
            c = read()
        }

        var res: Double = 0.0
        while (!isSpaceChar(c) && c != '.'.toInt())
        {
            if (c == 'e'.toInt() || c == 'E'.toInt())
                return res * Math.pow((10).toDouble(), (readInt()).toDouble())

            if (c.toInt() < '0'.toInt() || c.toInt() > '9'.toInt())
                throw InputMismatchException()

            res *= 10
            res += c.toInt() - '0'.toInt()
            c = read()
        }
        if (c == '.'.toInt())
        {
            c = read()
            var m: Double = 1.0
            while (!isSpaceChar(c))
            {
                if (c == 'e'.toInt() || c == 'E'.toInt())
                    return res * Math.pow((10).toDouble(), (readInt()).toDouble())

                if (c.toInt() < '0'.toInt() || c.toInt() > '9'.toInt())
                    throw InputMismatchException()

                m /= 10
                res += (c.toInt() - '0'.toInt()) * m
                c = read()
            }
        }

        return res * sgn
    }
    public open fun isExhausted(): Boolean {
        var value: Int
        while (true) {
            value = peek()
            if (!isSpaceChar(value) || value == -1)
                break
            read()
        }
        return value == -1
    }
    public open fun next(): String {
        return readString()
    }
    companion object {
        public open fun isWhitespace(c: Int): Boolean {
            return c == ' '.toInt() || c == '\n'.toInt() || c == '\r'.toInt() || c == '\t'.toInt() || c == -1
        }
        public interface SpaceCharFilter {
            public open fun isSpaceChar(ch: Int): Boolean
        }
    }
}

public open class OutputWriter(val writer: PrintWriter) {
    public open fun print(array: CharArray): Unit {
        writer.print(array)
    }
    public open fun print(vararg objects: Any): Unit {
        for (i in 0..objects.size - 1) {
            if (i != 0)
                writer.print(' ')

            writer.print(objects[i])
        }
    }
    public open fun print(array: IntArray): Unit {
        for (i in 0..array.size - 1) {
            if (i != 0)
                writer.print(' ')

            writer.print(array[i])
        }
    }
    public open fun print(array: LongArray): Unit {
        for (i in 0..array.size - 1) {
            if (i != 0)
                writer.print(' ')

            writer.print(array[i])
        }
    }
    public open fun printLine(array: IntArray): Unit {
        print(array)
        writer.println()
    }
    public open fun printLine(array: LongArray): Unit {
        print(array)
        writer.println()
    }
    public open fun printLine(): Unit {
        writer.println()
    }
    public open fun printLine(vararg objects: Any): Unit {
        print(*objects)
        writer.println()
    }
    public open fun print(i: Char): Unit {
        writer.print(i)
    }
    public open fun printLine(i: Char): Unit {
        writer.println(i)
    }
    public open fun printLine(array: CharArray): Unit {
        writer.println(array)
    }
    public open fun printFormat(format: String, vararg objects: Any): Unit {
        writer.printf(format, objects)
    }
    public open fun close(): Unit {
        writer.close()
    }
    public open fun flush(): Unit {
        writer.flush()
    }
    public open fun print(i: Long): Unit {
        writer.print(i)
    }
    public open fun printLine(i: Long): Unit {
        writer.println(i)
    }
    public open fun print(i: Int): Unit {
        writer.print(i)
    }
    public open fun printLine(i: Int): Unit {
        writer.println(i)
    }
    companion object {
        public open fun init(outputStream: OutputStream): OutputWriter {
            val __1 = OutputWriter(PrintWriter(BufferedWriter(OutputStreamWriter(outputStream))))
            return __1
        }
        public open fun init(writer: Writer): OutputWriter {
            val __1 = OutputWriter(PrintWriter(writer))
            return __1
        }
    }
}

public open class IntegerUtils() {
    companion object {
        public open fun gcd(_a: Long, _b: Long): Long {
            var a = _a
            var b = _b
            a = Math.abs(a)
            b = Math.abs(b)
            while (b != 0.toLong())
            {
                var temp: Long = a % b
                a = b
                b = temp
            }
            return a
        }
        public open fun gcd(_a: Int, _b: Int): Int {
            var a = _a
            var b = _b
            a = Math.abs(a)
            b = Math.abs(b)
            while (b != 0)
            {
                var temp: Int = a % b
                a = b
                b = temp
            }
            return a
        }
        public open fun generatePrimes(upTo: Int): IntArray {
            var isPrime: BooleanArray = generatePrimalityTable(upTo)
            var primes: MutableList<Int>? = ArrayList()
            for (i in 0..upTo - 1) {
                if (isPrime[i])
                    primes?.add(i)

            }
            return primes?.toIntArray()!!
        }
        public open fun generatePrimalityTable(upTo: Int): BooleanArray {
            var isPrime: BooleanArray = BooleanArray(upTo)
            if (upTo < 2)
                return isPrime

            Arrays.fill(isPrime, true)
            isPrime[0] = false
            isPrime[1] = false
            for (i in 2..upTo - 1) {
                if (isPrime[i])
                {
                    var j: Int = i * i
                    while (j < upTo)
                    {
                        isPrime[j] = false
                        j += i
                    }
                }
                if (i * i >= upTo)
                    break
            }
            return isPrime
        }
        public open fun generateDivisorTable(upTo: Int): IntArray {
            var divisor: IntArray = IntArray(upTo)
            for (i in 1..upTo - 1) divisor[i] = i
            for (i in 2..upTo - 1) {
                if (divisor[i] == i)
                {
                    var j: Int = i * i
                    while (j < upTo)
                    {
                        divisor[j] = i
                        j += i
                    }
                }

            }
            return divisor
        }
        public open fun powerInFactorial(_n: Long, p: Long): Long {
            var n = _n
            var result: Long = 0
            while (n != 0.toLong())
            {
                n /= p
                result += n
            }
            return result
        }
        public open fun sumDigits(number: CharSequence): Int {
            var result: Int = 0
            var i: Int = (number.length) - 1
            while (i >= 0)
            {
                result += digitValue((number[i]))
                i--
            }
            return result
        }
        public open fun digitValue(digit: Char): Int {
            if (Character.isDigit(digit))
                return digit - '0'

            if (Character.isUpperCase(digit))
                return digit + 10 - 'A'

            return digit + 10 - 'a'
        }
        public open fun longCompare(a: Long, b: Long): Int {
            if (a < b)
                return -1

            if (a > b)
                return 1

            return 0
        }
        public open fun generateBinomialCoefficients(n: Int): Array<LongArray> {
            var result: Array<LongArray> = Array<LongArray>(n + 1, { LongArray(n + 1) })
            for (i in 0..n) {
                result[i][0] = 1
                for (j in 1..i) result[i][j] = result[i - 1][j - 1] + result[i - 1][j]
            }
            return result
        }
        public open fun generateBinomialCoefficients(n: Int, module: Long): Array<LongArray> {
            var result: Array<LongArray> = Array<LongArray>(n + 1, { LongArray(n + 1) })
            if (module == 1.toLong())
                return result

            for (i in 0..n) {
                result[i][0] = 1
                for (j in 1..i) {
                    result[i][j] = result[i - 1][j - 1] + result[i - 1][j]
                    if (result[i][j] >= module)
                        result[i][j] -= module

                }
            }
            return result
        }
        public open fun generateBinomialRow(n: Int, module: Long): LongArray {
            var result: LongArray = generateReverse(n + 1, module)
            result[0] = 1
            for (i in 1..n) result[i] = result[i - 1] * (n - i + 1) % module * result[i] % module
            return result
        }
        public open fun representationInBase(_number: Long, base: Int): IntArray {
            var number = _number
            var basePower: Long = base.toLong()
            var exponent: Int = 1
            while (number >= basePower)
            {
                basePower *= base
                exponent++
            }
            var representation: IntArray = IntArray(exponent)
            for (i in 0..exponent - 1) {
                basePower /= base
                representation[i] = ((number / basePower).toInt())
                number %= basePower
            }
            return representation
        }
        public open fun trueDivide(a: Int, b: Int): Int {
            return (a - trueMod(a, b)) / b
        }
        public open fun trueMod(_a: Int, b: Int): Int {
            var a = _a
            a %= b
            a += b
            a %= b
            return a
        }
        public open fun trueMod(_a: Long, b: Long): Long {
            var a = _a
            a %= b
            a += b
            a %= b
            return a
        }
        public open fun factorial(n: Int): Long {
            var result: Long = 1
            for (i in 2..n) result *= i
            return result
        }
        public open fun factorial(n: Int, mod: Long): Long {
            var result: Long = 1
            for (i in 2..n) result = result * i % mod
            return result % mod
        }
        public open fun factorize(_number: Long): List<Pair<Long, Int>> {
            var number = _number
            var result: MutableList<Pair<Long, Int>> = ArrayList<Pair<Long, Int>>()
            for (i in 2..number) {
                if (number % i == 0.toLong())
                {
                    var power: Int = 0
                    do
                    {
                        power++
                        number /= i
                    }
                    while (number % i == 0.toLong())
                    result.add(Pair(i, power))
                }

            }
            if (number != 1.toLong())
                result.plus(Pair(number, 1))

            return result
        }
        public open fun getDivisors(number: Long): List<Long?>? {
            var primeDivisors: List<Pair<Long?, Int?>?>? = factorize(number)
            return getDivisorsImpl(primeDivisors, 0, (1).toLong(), ArrayList<Long?>())
        }
        private fun getDivisorsImpl(primeDivisors: List<Pair<Long?, Int?>?>?, index: Int, current_: Long,
                                         result: MutableList<Long?>?): List<Long?>? {
            var current = current_
            if (index == (primeDivisors?.size)!!)
            {
                result?.add(current)
                return result
            }

            var p: Long = primeDivisors?.get(index)?.first!!
            var power: Int = primeDivisors?.get(index)?.second!!
            for (i in 0..power) {
                getDivisorsImpl(primeDivisors, index + 1, current, result)
                current *= p
            }
            return result
        }
        public open fun power(base: Long, exponent: Long): Long {
            if (exponent == 0.toLong())
                return 1

            var result: Long = power(base, exponent shr 1)
            result = result * result
            if ((exponent and 1) != 0.toLong())
                result = result * base

            return result
        }
        public open fun power(base_: Long, exponent: Long, mod: Long): Long {
            var base = base_
            if (base >= mod)
                base %= mod

            if (exponent == 0.toLong())
                return 1 % mod

            var result: Long = power(base, exponent shr 1, mod)
            result = result * result % mod
            if ((exponent and 1) != 0.toLong())
                result = result * base % mod

            return result
        }
        public open fun lcm(a: Long, b: Long): Long {
            return a / gcd(a, b) * b
        }
        public open fun generateFibonacci(upTo: Long): LongArray? {
            var count: Int = 0
            var last: Long = 0
            var current: Long = 1
            while (current <= upTo)
            {
                var next: Long = last + current
                last = current
                current = next
                count++
            }
            return generateFibonacci(count, (-1).toLong())
        }
        public open fun generateFibonacci(count: Int, module: Long): LongArray {
            var result: LongArray = LongArray(count)
            if (module == -1.toLong())
            {
                if (count != 0)
                    result[0] = 1

                if (count > 1)
                    result[1] = 1

                for (i in 2..count - 1) result[i] = result[i - 1] + result[i - 2]
            }
            else
            {
                if (count != 0)
                    result[0] = 1 % module

                if (count > 1)
                    result[1] = 1 % module

                for (i in 2..count - 1) result[i] = (result[i - 1] + result[i - 2]) % module
            }
            return result
        }
        public open fun generateHappy(digits: Int): LongArray {
            var happy: LongArray = LongArray((1 shl (digits + 1)) - 2)
            happy[0] = 4
            happy[1] = 7
            var first: Int = 0
            var last: Int = 2
            for (i in 2..digits) {
                for (j in 0..last - first - 1) {
                    happy[last + 2 * j] = 10 * happy[first + j] + 4
                    happy[last + 2 * j + 1] = 10 * happy[first + j] + 7
                }
                var next: Int = last + 2 * (last - first)
                first = last
                last = next
            }
            return happy
        }
        public open fun generateFactorial(count: Int, module: Long): LongArray {
            var result: LongArray = LongArray(count)
            if (module == -1.toLong())
            {
                if (count != 0)
                    result[0] = 1

                for (i in 1..count - 1) result[i] = result[i - 1] * i
            }
            else
            {
                if (count != 0)
                    result[0] = 1 % module

                for (i in 1..count - 1) result[i] = (result[i - 1] * i) % module
            }
            return result
        }
        public open fun reverse(number: Long, module: Long): Long {
            return power(number, module - 2, module)
        }
        public open fun isPrime(number: Long): Boolean {
            if (number < 2)
                return false

            for (i in 2..number) {
                if (number % i.toLong() == 0.toLong())
                    return false

            }
            return true
        }
        public open fun generateReverse(upTo: Int, module: Long): LongArray {
            var result: LongArray = LongArray(upTo)
            if (upTo > 1)
                result[1] = 1

            for (i in 2..upTo - 1) result[i] = (module - module / i * result[(((module % i) as Int))] % module) % module
            return result
        }
        public open fun generateReverseFactorials(upTo: Int, module: Long): LongArray {
            var result: LongArray = generateReverse(upTo, module)
            if (upTo > 0)
                result[0] = 1

            for (i in 1..upTo - 1) result[i] = result[i] * result[i - 1] % module
            return result
        }
        public open fun generatePowers(base: Long, count: Int, mod: Long): LongArray {
            var result: LongArray = LongArray(count)
            if (count != 0)
                result[0] = 1 % mod

            for (i in 1..count - 1) result[i] = result[i - 1] * base % mod
            return result
        }
        public open fun nextPrime(from_: Long): Long {
            var from = from_
            if (from <= 2)
                return 2

            from += 1 - (from and 1)
            while (!isPrime(from))
                from += 2
            return from
        }
        public open fun binomialCoefficient(n: Int, m_: Int, mod: Long): Long {
            var m = m_
            if (m < 0 || m > n)
                return 0

            if (2 * m > n)
                m = n - m

            var result: Long = 1
            for (i in n - m + 1..n) result = result * i % mod
            return result * (BigInteger.valueOf(factorial(m, mod))?.modInverse(BigInteger.valueOf(mod)))!!.toLong() %
                    mod
        }
        public open fun isSquare(number: Long): Boolean {
            var sqrt: Long = Math.round(Math.sqrt((number).toDouble()))
            return sqrt * sqrt == number
        }
        public open fun findCommon(aRemainder_: Long, aMod_: Long, bRemainder_: Long, bMod_: Long): Long {
            var aRemainder = aRemainder_
            var aMod = aMod_
            var bRemainder = bRemainder_
            var bMod = bMod_
            var modGCD: Long = gcd(aMod, bMod)
            var gcdRemainder: Long = aRemainder % modGCD
            if (gcdRemainder != bRemainder % modGCD)
                return -1

            aMod /= modGCD
            aRemainder /= modGCD
            bMod /= modGCD
            bRemainder /= modGCD
            var aReverse: Long = BigInteger.valueOf(aMod)?.modInverse(BigInteger.valueOf(bMod))?.toLong()!!
            var bReverse: Long = BigInteger.valueOf(bMod)?.modInverse(BigInteger.valueOf(aMod))?.toLong()!!
            var mod: Long = aMod * bMod
            return (bReverse * aRemainder % mod * bMod + aReverse * bRemainder % mod * aMod) % mod * modGCD + gcdRemainder
        }
        public open fun generatePowers(base: Long, maxValue: Long): LongArray? {
            if (maxValue <= 0)
                return LongArray(0)

            var size: Int = 1
            var current: Long = 1
            while (maxValue / base >= current)
            {
                current *= base
                size++
            }
            return generatePowers(base, size, Long.MAX_VALUE)
        }
    }
}


fun main(args: Array<String>) {
    val ma = 5000
    val arr = Array(ma, { i -> 0 })
    for(rep in 0..1) {
        var (s) = readLine()!!.split('#')
        for(j in 0..s.length-1) if(s[j] == ' ') {
            var tmp = ""
            loop@ for(k in (j+1)..(j+10)) {
                if(k == s.length) break@loop
                if(s[k] == ' ') break@loop
                tmp = tmp + s[k]
            }
            var liczba = tmp.toInt()
            arr[liczba] = arr[liczba] + 1
        }
    }
    var cnt = 0
        for(i in 0..(ma-1))
        if(arr[i] == 1) {
        cnt = cnt + 1
        }
        print(cnt)
        print(" ")
    for(i in 0..(ma-1))
        if(arr[i] == 1) {
            print(i)
            print(" ")
        }
}


fun main(args: Array<String>) {
    val ma = 5000
    val arr = Array(ma, { i -> 0 })
    for(rep in 0..1) {
        var (s) = readLine()!!.split('#')
        for(j in 0..s.length-1) if(s[j] == ' ') {
            var tmp = ""
            loop@ for(k in (j+1)..(j+10)) {
                if(k == s.length) break@loop
                if(s[k] == ' ') break@loop
                tmp = tmp + s[k]
            }
            var liczba = tmp.toInt()
            arr[liczba+ma/2] = arr[liczba+ma/2] + 1
        }
    }
    var cnt = 0
        for(i in 0..(ma-1))
        if(arr[i] == 1) {
        cnt = cnt + 1
        }
        print(cnt)
        print(" ")
    for(i in 0..(ma-1))
        if(arr[i] == 1) {
            print(i-ma/2)
            print(" ")
        }
}


fun main(args: Array<String>)
{

    var x = readLine()!!.split(' ')
    var y = readLine()!!.split(' ')

    var tx = x.size
    var ty = y.size

    var num1 = IntArray(4000)
    var num2 = IntArray(4000)

    for(i in 0..3999)
    {
    	num1[i] = 0 ;
    	num2[i] = 0 ;
    }

    for(i in 1..tx)
    {
    	var tmp1 = 1000 + x[i-1].toInt() ;

    	num1[tmp1] = 1 ;
    }

    for(i in 1..ty)
    {
    	var tmp2 = 1000 + y[i-1].toInt() ;

    	num2[tmp2] = 1 ;
    }

    var sum = 0

    for(i in 0..2000)
    {
    	if(num1[i]==1 && num2[i]==1)
    	{

    	}
    	else
    	{
    		sum=sum+1
    	}
    }

    print(sum)
    print(" ")

    for(i in 0..2000)
    {
    	if(num1[i]==1 && num2[i]==1)
    	{

    	}
    	else
    	{
    		var p = i - 1000
    		print(p)
            print(" ")
    	}
    }

}


fun main(args: Array<String>)
{

    var x = readLine()!!.split(' ')
    var y = readLine()!!.split(' ')

    var tx = x.size
    var ty = y.size

    var num1 = IntArray(4000)
    var num2 = IntArray(4000)

    for(i in 0..3999)
    {
    	num1[i] = 0 ;
    	num2[i] = 0 ;
    }

    for(i in 1..tx)
    {
    	var tmp1 = 1000 + x[i-1].toInt() ;

    	num1[tmp1] = 1 ;
    }

    for(i in 1..ty)
    {
    	var tmp2 = 1000 + y[i-1].toInt() ;

    	num2[tmp2] = 1 ;
    }

    var sum = 0

    for(i in 0..2000)
    {
    	if((num1[i]==1 && num2[i]==0) || (num1[i]==0 && num2[i]==1))
    	{
    		sum=sum+1
    	}
    }

    print(sum)
    print(" ")

    for(i in 0..2000)
    {
    	if((num1[i]==1 && num2[i]==0) || (num1[i]==0 && num2[i]==1))
    	{
    		var p = i - 1000
    		print(p)
            print(" ")
    	}
    }

}


fun main(args: Array<String>)
{

    var x = readLine()!!.split(' ').map(String::toInt)
    var y = readLine()!!.split(' ').map(String::toInt)

    var tx = x.size
    var ty = y.size

    var num1 = IntArray(4000)
    var num2 = IntArray(4000)

    for(i in 0..3999)
    {
    	num1[i] = 0 ;
    	num2[i] = 0 ;
    }

    for(i in 2..tx)
    {
    	var tmp1 = 1000 + x[i-1] ;

    	num1[tmp1] = 1 ;
    }

    for(i in 2..ty)
    {
    	var tmp2 = 1000 + y[i-1] ;

    	num2[tmp2] = 1 ;
    }

    var sum = 0

    for(i in 0..2000)
    {
    	if((num1[i]==1 && num2[i]==0) || (num1[i]==0 && num2[i]==1))
    	{
    		sum=sum+1
    	}
    }

    print(sum)
    print(" ")

    for(i in 0..2000)
    {
    	if((num1[i]==1 && num2[i]==0) || (num1[i]==0 && num2[i]==1))
    	{
    		var p = i - 1000
    		print(p)
            print(" ")
    	}
    }

}


fun main(args: Array<String>)
{

    var x = readLine()!!.split(' ').map(String::toInt)
    var y = readLine()!!.split(' ').map(String::toInt)

    var tx = x.size
    var ty = y.size

    var num1 = IntArray(4000)
    var num2 = IntArray(4000)

    for(i in 0..3999)
    {
    	num1[i] = 0 ;
    	num2[i] = 0 ;
    }

    for(i in 1..tx)
    {
    	var tmp1 = 1000 + x[i-1] ;

    	num1[tmp1] = 1 ;
    }

    for(i in 1..ty)
    {
    	var tmp2 = 1000 + y[i-1] ;

    	num2[tmp2] = 1 ;
    }

    var sum = 0

    for(i in 0..2000)
    {
    	if((num1[i]==1 && num2[i]==0) || (num1[i]==0 && num2[i]==1))
    	{
    		sum=sum+1
    	}
    }

    print(sum)
    print(" ")

    for(i in 0..2000)
    {
    	if((num1[i]==1 && num2[i]==0) || (num1[i]==0 && num2[i]==1))
    	{
    		var p = i - 1000
    		print(p)
            print(" ")
    	}
    }

}


fun main(args: Array<String>) {
    var (s1) = readLine()!!.split('&')
    var (s2) = readLine()!!.split('&')
    s1 += 'd'
    s2 += 'd'
    val n = Array(1001, {i -> 0})
    val m = Array(1001, {i -> 0})

    var i = 0
    var put = 0
    var curr = ""
    while (s1[i] != 'd')
    {
        if (s1[i] == ' ')
        {
            if (curr != "")
            {
                n[put] = curr.toInt()
                curr = ""
                put += 1
            }
        }
        else
            curr += s1[i]
        i += 1
    }
    if (curr != "")
        n[put] = curr.toInt()

    i = 0
    put = 0
    curr = ""
    while (s2[i] != 'd')
    {
        if (s2[i] == ' ')
        {
            if (curr != "")
            {
                m[put] = curr.toInt()
                curr = ""
                put += 1
            }
        }
        else
            curr += s2[i]
        i += 1
    }
    if (curr != "")
        m[put] = curr.toInt()

    var ans = ""
    var found = 0
    i = -1000
    while (i <= 1000)
    {
        var res = 0
        var j1 = 1
        while (j1 <= n[0])
        {
            if (n[j1] == i)
                res += 1
            j1 += 1
        }
        j1 = 1
        while (j1 <= m[0])
        {
            if (m[j1] == i)
                res += 1
            j1 += 1
        }
        if (res == 1)
        {
            found += 1
            ans += ' '
            ans += i.toString()
        }
        i += 1
    }
    print(found)
    print(ans)
}


fun main(args: Array<String>) {
    var (s1) = readLine()!!.split('&')
    var (s2) = readLine()!!.split('&')
    s1 += 'd'
    s2 += 'd'
    val n = Array(1000, {i -> 0})
    val m = Array(1000, {i -> 0})

    var i = 0
    var put = 0
    var curr = ""
    while (s1[i] != 'd')
    {
        if (s1[i] == ' ')
        {
            if (curr != "")
            {
                n[put] = curr.toInt()
                curr = ""
                put += 1
            }
        }
        else
            curr += s1[i]
        i += 1
    }
    if (curr != "")
        n[put] = curr.toInt()

    i = 0
    put = 0
    curr = ""
    while (s2[i] != 'd')
    {
        if (s2[i] == ' ')
        {
            if (curr != "")
            {
                m[put] = curr.toInt()
                curr = ""
                put += 1
            }
        }
        else
            curr += s2[i]
        i += 1
    }
    if (curr != "")
        m[put] = curr.toInt()

    var ans = ""
    var found = 0
    i = -1000
    while (i <= 1000)
    {
        var res = 0
        var j1 = 1
        while (j1 <= n[0])
        {
            if (n[j1] == i)
                res += 1
            j1 += 1
        }
        j1 = 1
        while (j1 <= m[0])
        {
            if (m[j1] == i)
                res += 1
            j1 += 1
        }
        if (res == 1)
        {
            found += 1
            ans += ' '
            ans += i.toString()
        }
        i += 1
    }
    print(found)
    print(ans)
}


import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {
    val reader = BufferedReader(InputStreamReader(System.`in`))
    val s1 = reader.readLine().split(' ')
    val s2 = reader.readLine().split(' ')
    var cnt = 0
    for (e1 in s1) {
        var f = 0
        for (e2 in s2)
            if (e2 == e1)
                f = 1
        if (f == 0)
            cnt = cnt + 1
    }
    for (e2 in s2) {
        var f = 0
        for (e1 in s1)
            if (e2 == e1)
                f = 1
        if (f == 0)
            cnt = cnt + 1
    }
    print(cnt)
    print(' ')
    for (e1 in s1) {
        var f = 0
        for (e2 in s2)
            if (e2 == e1)
                f = 1
        if (f == 0) {
            print(e1)
            print(' ')
        }
    }
    for (e2 in s2) {
        var f = 0
        for (e1 in s1)
            if (e2 == e1)
                f = 1
        if (f == 0) {
            print(e2)
            print(' ')
        }
    }
}


import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {
    val reader = BufferedReader(InputStreamReader(System.`in`))
    val s1 = reader.readLine().split(' ')
    val s2 = reader.readLine().split(' ')
    var cnt = 0
    for (i in 1..s1[0].toInt()) {
        var f = 0
        for (j in 1..s2[0].toInt())
            if (s1[i] == s2[j])
                f = 1
        if (f == 0)
            cnt = cnt + 1
    }
    for (i in 1..s2[0].toInt()) {
        var f = 0
        for (j in 1..s1[0].toInt())
            if (s2[i] == s1[j])
                f = 1
        if (f == 0)
            cnt = cnt + 1
    }
    print(cnt)
    print(' ')
    for (i in 1..s1[0].toInt()) {
        var f = 0
        for (j in 1..s2[0].toInt())
            if (s1[i] == s2[j])
                f = 1
        if (f == 0)
            print(s1[i]+' ')
    }
    for (i in 1..s2[0].toInt()) {
        var f = 0
        for (j in 1..s1[0].toInt())
            if (s2[i] == s1[j])
                f = 1
        if (f == 0)
            print(s2[i]+' ')
    }
}


import java.util.Arrays
import java.util.*
import java.util.Comparator
import kotlin.comparisons.*
import kotlin.collections.*

data class Point(val i: Int, val j: String)

class Foo(val a: String, val b: Int) : Comparable<Foo> {
    override fun compareTo(other: Foo)
            = compareValuesBy(this, other, { it.b }, { it.a })
}

fun main(args: Array<String>) {
       val a = readLine()!!.split(' ').map(String::toInt);
       val b = readLine()!!.split(' ').map(String::toInt);
       var l1 = a[0];
       var l2 = b[0];
       val result = arrayListOf<Int>()
       for(i in  1..l1){
         var f = 0;
         for(j in 1..l2){
            if(a[i] == b[j]){
               f = 1;
               break;
            }
         }
         if(f == 0){
            result.add(a[i]);
         }
       }
       for(i in  1..l2){
         var f = 0;
         for(j in 1..l1){
            if(a[j] == b[i]){
               f = 1;
               break;
            }
         }
         if(f == 0){
            result.add(b[i]);
         }
       }
       var l = 0;
         val sortedList = result.sorted().toMutableSet()
       for(i in sortedList){
        ++l;
       }
       print(l);
       print(" ");
       for(i in sortedList){
         print(i);
         print(" ");
       }
       println("");
}


import java.util.Arrays
import java.util.*
import java.util.Comparator
import kotlin.comparisons.*
import kotlin.collections.*

data class Point(val i: Int, val j: String)

class Foo(val a: String, val b: Int) : Comparable<Foo> {
    override fun compareTo(other: Foo)
            = compareValuesBy(this, other, { it.b }, { it.a })
}

fun main(args: Array<String>) {
       val a = readLine()!!.split(' ').map(String::toInt);
       val b = readLine()!!.split(' ').map(String::toInt);
       var l1 = 0;
       var l2 = 0;
       for(i in 1..1005){
       try {
            val tmp = a[i];
            ++l1;
        }
        catch (e : java.lang.IndexOutOfBoundsException) {
            break;
        }
       }

       for(i in 1..1005){
       try {
            val tmp = b[i];
            ++l2;
        }
        catch (e : java.lang.IndexOutOfBoundsException) {
            break;
        }
       }
       val result = arrayListOf<Int>()
       for(i in  1..l1){
         var f = 0;
         for(j in 1..l2){
            if(a[i] == b[j]){
               f = 1;
               break;
            }
         }
         if(f == 0){
            result.add(a[i]);
         }
       }
       for(i in  1..l2){
         var f = 0;
         for(j in 1..l1){
            if(a[j] == b[i]){
               f = 1;
               break;
            }
         }
         if(f == 0){
            result.add(b[i]);
         }
       }
       var l = 0;
         val sortedList = result.sorted()
       for(i in 0..1005){
       try {
            val tmp = sortedList[i];
            ++l;
        }
        catch (e : java.lang.IndexOutOfBoundsException) {
            break;
        }
       }
       print(l);
       print(" ");
       for(i in sortedList){
         print(i);
         print(" ");
       }
       println("");
}


import kotlin.collections.MutableList
import kotlin.comparisons.compareBy

fun main(args: Array<String>) {
    val a = readLine()!!.split(' ').map(String::toInt)
    val b = readLine()!!.split(' ').map(String::toInt)

    val a1 = a.drop(1)
    val b1 = b.drop(1)

    val ans: MutableList<Int> = mutableListOf()
    for (i in a1) {
        if (i !in b1)
            ans.add(i)
    }
    for (i in b1) {
        if (i !in a1)
            ans.add(i)
    }

    val ans2 = ans.sortedWith(compareBy({it}))

    print(ans2.size)
    print(' ')
    for (i in ans2) {
        print(i)
        print(' ')
    }
}


import kotlin.collections.MutableList
import kotlin.comparisons.compareBy

fun main(args: Array<String>) {
    val a = readLine()!!.split(' ').map(String::toInt)
    val b = readLine()!!.split(' ').map(String::toInt)

    val a1 = a.drop(1)
    val b1 = b.drop(1)

    val ans: MutableList<Int> = mutableListOf()
    for (i in a) {
        if (i !in b)
            ans.add(i)
    }
    for (i in b) {
        if (i !in a)
            ans.add(i)
    }

    val ans2 = ans.sortedWith(compareBy({it}))

    print(ans2.size)
    print(' ')
    for (i in ans2) {
        print(i)
        print(' ')
    }
}


/*
 * Language = Kotlin 0.7.270
 */

import java.io.*;
import java.util.*;

var LOCAL = File("input.txt").exists();

var _reader = when {
    LOCAL -> BufferedReader(FileReader("input.txt"));
    else -> BufferedReader(InputStreamReader(System.`in`));
}
var out = when {
    LOCAL -> PrintWriter("output.txt");
    else -> PrintWriter(System.`out`);
};
var _tokenizer = StringTokenizer("");

fun readString(): String {
    while (!_tokenizer.hasMoreTokens()) {
        _tokenizer = StringTokenizer(_reader.readLine()!!);
    }
    return _tokenizer.nextToken();
}

fun readInt(): Int {
    return java.lang.Integer.parseInt(readString());
}

fun readLong(): Long {
    return java.lang.Long.parseLong(readString());
}

fun readDouble(): Double {
    return java.lang.Double.parseDouble(readString());
}

fun debug(o: Any) {
    if (LOCAL) {
        System.`err`.println(o);
    }
}

fun main(args: Array<String>) {
    var t1: Long = 0;
    var t2: Long;
    if (LOCAL) {
        t1 = System.currentTimeMillis();
    };
    Locale.setDefault(Locale.US);
    solve();
    _reader.close();
    out.close();
    if (LOCAL) {
        t2 = System.currentTimeMillis();
        debug("Time = " + (t2 - t1));
    };
}

fun dfs(x: Int, p: Int, a: Array<ArrayList<Int>>, dp: IntArray, sumChildren: IntArray) {
    var cnt = 0;
    sumChildren[x] = 1;
    for (y in a[x]) {
        if (y != p) {
            cnt++;
            dfs(y, x, a, dp, sumChildren);
            sumChildren[x] += sumChildren[y];
        }
    }
    if (cnt == 0) {
        dp[x] = 0;
        return;
    }
    if (cnt == 1) {
        dp[x] = sumChildren[x] - 1;
        return;
    }
    var max1 = -100500;
    var max2 = -100500;
    var maxID1 = -1;
    var maxID2 = -1;
    for (y in a[x]) {
        if (y != p) {
            var t = sumChildren[y] - dp[y];
            if (t >= max1) {
                max2 = max1;
                max1 = t;
                maxID2 = maxID1;
                maxID1 = y;
            } else if (t >= max2) {
                max2 = t;
                maxID2 = y;
            }
        }
    }
    dp[x] = 0;
    for (y in a[x]) {
        if (y != p) {
            if (y == maxID1 || y == maxID2) {
                dp[x] += dp[y];
            } else {
                dp[x] += sumChildren[y];
            }
        }
    }
}

class Person(var name: String, var height: Int) : Comparable<Person> {
    override fun compareTo(other: Person): Int {
        return this.height - other.height;
    }
}

fun solve() {
    var n1 = readInt();
    var s = TreeSet<Int>();
    var s1 = TreeSet<Int>();
    for (i in 1 .. n1) {
        val x = readInt();
        s1.add(x);
        s.add(x);
    }
    var n2 = readInt();
    var s2 = TreeSet<Int>();
    for (i in 1 .. n2) {
        val x = readInt();
        s2.add(x);
        s.add(x);
    }
    for (x in s1) {
        if (x in s2) {
            s.remove(x);
        }
    }
    out.print(s.size);
    for (x in s) {
        out.print(" ");
        out.print(x);
    }
//    var n = readInt();
//    var a = Array<Person>(n) {i -> Person(readString(), readInt())};
//    a.sort();
//    for (p in a) {
//        out.println(p.name);
//    }
//    var tests = readInt()
//    for (test in 1 .. tests) {
//        out.print("Case #${test}: ");
//        var n = readInt();
//        var a = Array<ArrayList<Int>>(n) { ArrayList() };
//        for (i in 1 .. n-1) {
//            var x = readInt() - 1;
//            var y = readInt() - 1;
//            a[x].add(y);
//            a[y].add(x);
//        }
//        var best = 100500;
//        var dp = IntArray(n);
//        var sumChildren = IntArray(n);
//        for (root in 0..n-1) {
//            dp.fill(100500);
//            sumChildren.fill(0);
//            dfs(root, -1, a, dp, sumChildren);
////            for (i in 0 .. n-1) {
////                if (dp[i] >= sumChildren[i]) {
////                    throw RuntimeException();
////                }
////            }
//            //debug(Arrays.toString(dp));
//            best = Math.min(best, dp[root]);
//        }
//        out.println(best);
//        System.`err`.println("Test ${test} completed");
//    }
}


fun main(args: Array<String>) {
    val set1: List<Int> = readLine()!!.split(' ').map(String::toInt).drop(1)
    val set2: List<Int> = readLine()!!.split(' ').map(String::toInt).drop(1)

    val d1 = set1.minus(set2)
    val d2 = set2.minus(set1)

    print(d1.size + d2.size)
    print(" ")

    for (i in d1) {
        print(i)
        print(" ")
    }

    for (i in d2) {
        print(i)
        print(" ")
    }

}


import java.util.*

fun main(args: Array<String>) {
    var line1 = readLine()!!.split(' ')
	var line2 = readLine()!!.split(' ')

	var v1 : Array<Int> = arrayOf()
	var v2 : Array<Int> = arrayOf()

    var st : Array<Int> = arrayOf()

	var len1 = Integer.parseInt(line1[0])
	var len2 = Integer.parseInt(line2[0])

	for (x in 1..len1) {
		v1 = v1.plus(Integer.parseInt(line1[x]))
	}

	for (x in 1..len2) {
		v2 = v2.plus(Integer.parseInt(line2[x]))
	}

    for (x in -1000..1000) {
		var s = 0

			if (v1.contains(x)) s += 1;
		if (v2.contains(x)) s += 1;

		if (s == 1) {
			st = st.plus(x)
		}
    }

	println(st.size)

	for (x in 1..st.size) {
		println(st.get(x - 1))
	}
}


import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    val n = readLine()!!.split(' ').map(String::toInt)
    val m = readLine()!!.split(' ').map(String::toInt)
    var i=0
    val a=IntArray(1004,{0})
    val b=IntArray(1004,{0})
    for (i in 1..n[0]) a[n[i]]++
    for (i in 1..m[0]) a[m[i]]++
    var sum=0
    for (i in 1..1000)
        if (a[i]==1) b[sum++]=i
    print(sum)
    for (i in 0..sum-1) {
        print(' ')
        print(b[i])
    }
}


import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    val n = readLine()!!.split(' ').map(String::toInt)
    val m = readLine()!!.split(' ').map(String::toInt)
    var i=0
    val a=IntArray(2004,{0})
    val b=IntArray(2004,{0})
    for (i in 1..n[0]) a[n[i]+1000]++
    for (i in 1..m[0]) a[m[i]+1000]++
    var sum=0
    for (i in 0..2000)
        if (a[i]==1) b[sum++]=i-1000
    print(sum)
    for (i in 0..sum-1) {
        print(' ')
        print(b[i])
    }
}


import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    val n = readLine()!!.split(' ').map(String::toInt)
    val m = readLine()!!.split(' ').map(String::toInt)
    var i=0
    val a=IntArray(1004,{0})
    val b=IntArray(1004,{0})
    for (i in 1..n[0]) a[n[i]]++
    for (i in 1..m[0]) a[m[i]]++
    var sum=0
    for (i in 1..1000)
        if (a[i]==1) b[sum++]=i
    println(sum)
    for (i in 0..sum-1) println(b[i])
}


fun main(args: Array<String>) {
    //var ar = Array(5000, {0})
    //var ar1 = Array(5000, {0})
    var ar2 = Array(5000, {0})
    var ar = readLine()!!.split(' ').map(String::toInt)
    var ar1 = readLine()!!.split(' ').map(String::toInt)
    var i = 2
    var j = 2
    var k = 0
    var t = 0
    while (i <= ar[1]){
        j = 1
        t = 0
        while (j <= ar1[1]){
        	if (ar[i] == ar1[j]) t = 1
        	j++
    	}
    	if (t == 0){
            k++
            ar2[k] = ar[i]
        }
    	i++
	}
	i = 2
    j = 2
    k = 0
    t = 0
	while (i <= ar1[1]){
        j = 1
        t = 0
        while (j <= ar[1]){
        	if (ar1[i] == ar[j]) t = 1
        	j++
    	}
    	if (t == 0){
            k++
            ar2[k] = ar1[i]
        }
    	i++
	}
	i = 1
    print(k.toString())
    print(" ")
	while (i <= k) {
	    print(ar2[i])
	    print(" ")
	}
}


fun main(args: Array<String>) {
    //var ar = Array(10000, {0})
    //var ar1 = Array(10000, {0})
    var ar2 = Array(11000, {0})
    var ar = readLine()!!.split(' ').map(String::toInt)
    var ar1 = readLine()!!.split(' ').map(String::toInt)
    var i = 1
    var j = 1
    var k = 0
    var t = 0
    while (i <= ar[0]){
        j = 1
        t = 0
        while (j <= ar1[0]){
        	if (ar[i] == ar1[j]) t = 1
        	j++
    	}
    	if (t == 0){
            k++
            ar2[k] = ar[i]
        }
    	i++
	}
	i = 1
    j = 1
    t = 0
	while (i <= ar1[0]){
        j = 1
        t = 0
        while (j <= ar[0]){
        	if (ar1[i] == ar[j]) t = 1
        	j++
    	}
    	if (t == 0){
            k++
            ar2[k] = ar1[i]
        }
    	i++
	}
	i = 1
    print(k.toString())
    print(" ")
	while (i <= k) {
	    print(ar2[i])
	    print(" ")
	    i++
	}
}


import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    val freq = Array(2005, {i -> 0})
    val ar1 = readLine()!!.split(' ').map(String::toInt)
    val ar2 = readLine()!!.split(' ').map(String::toInt)

    for (i in ar1.indices) {
        if (i > 0) {
            freq[ar1[i] + 1000]++
        }
    }

    for (i in ar2.indices) {
        if (i > 0) {
            freq[ar2[i] + 1000]++
        }
    }

    val ar = IntArray(0)

    for (i in freq.indices) {
        if (freq[i] == 2) {
            ar.add(i - 1000)
        }
    }

    print(ar.size())
    for (i in ar) print(i)
}


import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    val freq = Array(2005, {i -> 0})
    val ar1 = readLine()!!.split(' ').map(String::toInt)
    val ar2 = readLine()!!.split(' ').map(String::toInt)

    for (i in ar1.indices) {
        if (i > 0) {
            freq[ar1[i] + 1000]++
        }
    }

    for (i in ar2.indices) {
        if (i > 0) {
            freq[ar2[i] + 1000]++
        }
    }

    val ar = IntArray(0)

    for (i in freq.indices) {
        if (freq[i] == 2) {
            ar = ar.plus(i - 1000)
        }
    }

    print(ar.size)
    for (i in ar) print(i)
}


import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    val freq = Array(2005, {i -> 0})
    val ar1 = readLine()!!.split(' ').map(String::toInt)
    val ar2 = readLine()!!.split(' ').map(String::toInt)

    for (i in ar1.indices) {
        if (i > 0) {
            freq[ar1[i] + 1000]++
        }
    }

    for (i in ar2.indices) {
        if (i > 0) {
            freq[ar2[i] + 1000]++
        }
    }

    val cnt = 0
    for (i in freq.indices) {
        if (freq[i] == 2) cnt++
    }

    val ar = IntArray(cnt)
    val cur = 0

    for (i in freq.indices) {
        if (freq[i] == 2) {
            ar[cur] = i - 1000
            cur++
        }
    }

    print(ar.size)
    for (i in ar) print(i)
}


import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    var freq = Array(2005, {i -> 0})
    var ar1 = readLine()!!.split(' ').map(String::toInt)
    var ar2 = readLine()!!.split(' ').map(String::toInt)

    for (i in ar1.indices) {
        if (i > 0) {
            freq[ar1[i] + 1000]++
        }
    }

    for (i in ar2.indices) {
        if (i > 0) {
            freq[ar2[i] + 1000]++
        }
    }

    var cnt = 0
    for (i in freq.indices) {
        if (freq[i] == 1) cnt++
    }

    var ar = IntArray(cnt)
    var cur = 0

    for (i in freq.indices) {
        if (freq[i] == 1) {
            ar[cur] = i - 1000
            cur++
        }
    }

    print(ar.size)
    for (i in ar) print(i)
}


import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    var freq = Array(2005, {i -> 0})
    var ar1 = readLine()!!.split(' ').map(String::toInt)
    var ar2 = readLine()!!.split(' ').map(String::toInt)

    for (i in ar1.indices) {
        if (i > 0) {
            freq[ar1[i] + 1000]++
        }
    }

    for (i in ar2.indices) {
        if (i > 0) {
            freq[ar2[i] + 1000]++
        }
    }

    var cnt = 0
    for (i in freq.indices) {
        if (freq[i] == 2) cnt++
    }

    var ar = IntArray(cnt)
    var cur = 0

    for (i in freq.indices) {
        if (freq[i] == 2) {
            ar[cur] = i - 1000
            cur++
        }
    }

    print(ar.size)
    for (i in ar) print(i)
}


import java.util.Scanner
import java.util.Arrays

fun main(args: Array<String>) {
    var freq = IntArray(2005, {i -> 0})
    var ar1 = readLine()!!.split(' ').map(String::toInt)
    var ar2 = readLine()!!.split(' ').map(String::toInt)

    for (i in ar1.indices) {
        if (i > 0) {
            freq[ar1[i] + 1000]++
        }
    }

    for (i in ar2.indices) {
        if (i > 0) {
            freq[ar2[i] + 1000]++
        }
    }

    var cnt = 0
    for (i in freq.indices) {
        if (freq[i] == 1) cnt++
    }

    var ar = IntArray(cnt)
    var cur = 0

    for (i in freq.indices) {
        if (freq[i] == 1) {
            ar[cur] = i - 1000
            cur++
        }
    }

    print(ar.size)
    print(' ')
    for (i in ar) {
        print(i)
        print(' ')
    }
}