Under construction

Still being built. Things may change

Triple Sevens

Time limit1sMemory limit2048 MB

Summary
Given three wheels of digits, check whether every wheel contains the digit 7, then print 777 if so and 0 otherwise.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

Eddy is overseeing the construction of some new slot machines. Each slot machine has three wheels, and each wheel can show one of several different digits. When the machine is activated, each wheel shows a random digit. The goal is for every wheel to be able to show the digit 77.

A slot machine is good if each wheel is capable of showing the digit 77, and bad otherwise. For a given slot machine, determine whether it is good or bad.

Input

The first line contains a single integer nn (1≤n≤10)(1 \leq n \leq 10), the number of different digits on each wheel. Each wheel has the same number of digits.

Each of the next three lines contains nn distinct digits (in the range from 00 to 99). These are the digits on each of the three wheels.

Output

Output a single integer, which is 777777 if the slot machine is good, 00 otherwise.

Examples2

  1. Example 1

    Input
    2
    0 7
    7 3
    7 0
    
    Expected output
    777
    
  2. Example 2

    Input
    2
    0 7
    7 3
    3 9
    
    Expected output
    0