Triple Sevens

시간 제한1초메모리 제한2048 MB

요약
세 개의 슬롯 바퀴에 표시할 수 있는 숫자가 주어질 때, 모든 바퀴가 7을 표시할 수 있으면 777을, 아니면 0을 출력한다.
난이도

쉬움10점 중 2점

유형
구현, 문자열
정답자
아직 제출이 없습니다

문제

Eddy is overseeing construction of some new slot machines. His slot machines consist of three wheels, each of which can show one of several different digits. When activated, each wheel shows a random digit. The goal is for all wheels 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 if it is good or bad.

입력

The first line contains a single integer nn (1≤n≤10)(1 \leq n \leq 10), which is 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 a single integer, which is 777777 if the slot machine is good, 00 otherwise.

예제2

  1. 예제 1

    입력
    2
    0 7
    7 3
    7 0
    
    예상 출력
    777
    
  2. 예제 2

    입력
    2
    0 7
    7 3
    3 9
    
    예상 출력
    0