import * as fs from 'fs';

// main
function main(input: string[]) {
    // param
    var n: number;
    var an: number[] = [];
    var q: number;
    var bq: number[] = [];
    var cq: number[] = [];
    var ans: number;
    // init
    n = Number(input.shift());
    an = input.shift().split(" ").map(x => Number(x));
    q = Number(input.shift());
    for (var qx = 0; qx < q; qx++) {
        [bq[qx], cq[qx]] = input[qx].split(" ").map(x => Number(x));
    }
    // solve
    ans = an.reduce((x, y) => x + y);
    for (var qx = 0; qx < q; qx++) {
        for (var nx = 0; nx < n; nx++) {
            if (an[nx] == bq[qx]) {
                an[nx] = cq[qx];
                ans -= bq[qx];
                ans += cq[qx];
            }
        }
        // answer
        console.log(ans);
    }
}

// graph lib
/*
function GRAPH_enumPattern(cur: number[], pat: number[][]): number[][] {
    var arr = [];
    for (var patx = 0; patx < pat.length; patx++) {
        var pos = [cur[0] + pat[patx][0], cur[1] + pat[patx][1]];
        arr.push(pos);
    }
    return arr;
}
*/

// math lib
/*
function Math_max(arr: number[]): number { return arr.reduce((x, y) => Math.max(x, y)); }
function Math_min(arr: number[]): number { return arr.reduce((x, y) => Math.min(x, y)); }
function Math_gcd(): number {
    var ans = arguments[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < arguments.length; i++) {
        ans = f(ans, arguments[i]);
    }
    return ans
};
function Math_gcdArray(values: number[]): number {
    var ans = values[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < values.length; i++) {
        ans = f(ans, values[i]);
    }
    return ans
};
function Math_lcm(): number {
    var a = arguments
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_lcmArray(values: number[]): number {
    var a = values
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_primeList(value: number): number[] {
    var ans = [];
    var arr = new Array(value).fill(0);
    for (var i = 2; i < value; i++) {
        if (arr[i] == 0) {
            for (var j = i; j < value; j += i) {
                if (arr[j] == 0) arr[j] = i;
            }
        }
    }
    for (var i = 2; i < value; i++) {
        if (arr[i] == i) ans.push(i);
    }
    return ans;
}
function Math_primeFactor(p: number[], value: number): number[][] {
    var ans: number[][] = [];
    var valmax = value / 2;;
    for (var i = 0; i < p.length; i++) {
        var prime = p[i];
        if (valmax < prime) break;
        var count = 0;
        while (value % prime == 0) {
            value /= prime;
            count++;
        }
        if (count != 0) {
            ans.push([prime, count]);
        }
        if (value == 1) break;
    }
    return ans;
}
*/

// union-find lib
/*
var g_uf_root: number[];
var g_uf_count: number[];
function UF_initRoot(num: number) {
    g_uf_root = new Array(num).fill(-1);
    g_uf_count = new Array(num).fill(1);
}
function UF_getRoot(index: number) {
    if (g_uf_root[index] < 0) {
        return index;
    } else {
        var work0: number = UF_getRoot(g_uf_root[index]);
        g_uf_root[index] = work0;
        return work0
    }
}
function UF_mergeRoot(a: number, b: number) {
    var root0: number = UF_getRoot(a);
    var root1: number = UF_getRoot(b);
    if (root0 == root1) return;
    if (root0 > root1) [root0, root1] = [root1, root0];
    g_uf_count[root0] += g_uf_count[root1];
    g_uf_count[root1] = 0;
    g_uf_root[root1] = root0;
}
*/

// entrypoint
function entrypoint() {
    try {
        // linux
        var input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            input = lines;
            main(input);
        });
    }
}
entrypoint();


import * as fs from 'fs';

// main
function main(input: string[]) {
    // param
    var n: number;
    var an: number[] = [];
    var q: number;
    var bq: number[] = [];
    var cq: number[] = [];
    var ans: number;
    // init
    n = Number(input.shift());
    an = input.shift().split(" ").map(x => Number(x));
    q = Number(input.shift());
    for (var qx = 0; qx < q; qx++) {
        [bq[qx], cq[qx]] = input[qx].split(" ").map(x => Number(x));
    }
    // solve
    for (var qx = 0; qx < q; qx++) {
        ans = 0;
        for (var nx = 0; nx < n; nx++) {
            if (an[nx] == bq[qx]) an[nx] = cq[qx];
        }
        ans = an.reduce((x, y) => x + y);
        // answer
        console.log(ans);
    }
}

// graph lib
/*
function GRAPH_enumPattern(cur: number[], pat: number[][]): number[][] {
    var arr = [];
    for (var patx = 0; patx < pat.length; patx++) {
        var pos = [cur[0] + pat[patx][0], cur[1] + pat[patx][1]];
        arr.push(pos);
    }
    return arr;
}
*/

// math lib
/*
function Math_max(arr: number[]): number { return arr.reduce((x, y) => Math.max(x, y)); }
function Math_min(arr: number[]): number { return arr.reduce((x, y) => Math.min(x, y)); }
function Math_gcd(): number {
    var ans = arguments[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < arguments.length; i++) {
        ans = f(ans, arguments[i]);
    }
    return ans
};
function Math_gcdArray(values: number[]): number {
    var ans = values[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < values.length; i++) {
        ans = f(ans, values[i]);
    }
    return ans
};
function Math_lcm(): number {
    var a = arguments
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_lcmArray(values: number[]): number {
    var a = values
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_primeList(value: number): number[] {
    var ans = [];
    var arr = new Array(value).fill(0);
    for (var i = 2; i < value; i++) {
        if (arr[i] == 0) {
            for (var j = i; j < value; j += i) {
                if (arr[j] == 0) arr[j] = i;
            }
        }
    }
    for (var i = 2; i < value; i++) {
        if (arr[i] == i) ans.push(i);
    }
    return ans;
}
function Math_primeFactor(p: number[], value: number): number[][] {
    var ans: number[][] = [];
    var valmax = value / 2;;
    for (var i = 0; i < p.length; i++) {
        var prime = p[i];
        if (valmax < prime) break;
        var count = 0;
        while (value % prime == 0) {
            value /= prime;
            count++;
        }
        if (count != 0) {
            ans.push([prime, count]);
        }
        if (value == 1) break;
    }
    return ans;
}
*/

// union-find lib
/*
var g_uf_root: number[];
var g_uf_count: number[];
function UF_initRoot(num: number) {
    g_uf_root = new Array(num).fill(-1);
    g_uf_count = new Array(num).fill(1);
}
function UF_getRoot(index: number) {
    if (g_uf_root[index] < 0) {
        return index;
    } else {
        var work0: number = UF_getRoot(g_uf_root[index]);
        g_uf_root[index] = work0;
        return work0
    }
}
function UF_mergeRoot(a: number, b: number) {
    var root0: number = UF_getRoot(a);
    var root1: number = UF_getRoot(b);
    if (root0 == root1) return;
    if (root0 > root1) [root0, root1] = [root1, root0];
    g_uf_count[root0] += g_uf_count[root1];
    g_uf_count[root1] = 0;
    g_uf_root[root1] = root0;
}
*/

// entrypoint
function entrypoint() {
    try {
        // linux
        var input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            input = lines;
            main(input);
        });
    }
}
entrypoint();


L=list(map(int,input().split()))
K=sorted(L)
print(K[0]+K[1])


# A - ringring
a,b,c=list(map(int,input().split()))
print(sum([a,b,c])-max([a,b,c]))


l=list(map(int,input().split()))

print(sum(sorted(l)[:-1]))


a,b,c＝map(int,input().split())
print(a+b+c-max(a,b,c))


import sys
S = input()

for i in range(1, len(S)):
  s = S[:-i]
  l = len(s) // 2
  if s[:l] == s[l:]:
    print(len(s))
    sys.exit()


import sys
S = input()

for i in range(1, len(S)):
  s = S[:-i]
  l = len(s) // 2
  if s[:l] == s[l:]:
    print(len(s))


import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		sc.fill(a);

		Arrays.sort(a);

		System.out.println(a[0] + a[1]);
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    String s;
    String sl[];
    s = r.readLine();
    sl = s.split(" ");

    int a = Integer.parseInt(sl[0]);
    int b = Integer.parseInt(sl[1]);
    int c = Integer.parseInt(sl[2]);

    System.out.println((a <= c && b <= c) ? (a + b) : ((b <= a && c <= a) ? (b + c) : (a + c)));

  }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    String str = br.readLine();

    StringTokenizer st = new StringTokenizer(str);

    int a = Integer.parseInt(st.nextToken());
    int b = Integer.parseInt(st.nextToken());
    int c = Integer.parseInt(st.nextToken());

    int max = Integer.max(a, b);
    max = Integer.max(max, c);

    System.out.println(a+b+c-max);
  }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class MAin {
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int a = Integer.parseInt(chr[0]);
			int b = Integer.parseInt(chr[1]);
			int c = Integer.parseInt(chr[2]);
			System.out.println(a+b+c-(Math.max(a, Math.max(b, c))));

		}
	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];
		for (int i=0;i<3;i++) {
			A[i]= sc.nextInt();
		}
		System.out.println(A[0]+A[1]);
	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		String S = scanner.nextLine();
		int length = S.length();

		while(true) {
			if ((S.length() -1) % 2 == 0) {
				String sub1 = S.substring(0, S.length() / 2);
//				System.out.println("sub1:" + sub1);
				String sub2 = S.substring(S.length() / 2, S.length() -1);
//				System.out.println("sub2:" + sub2);
				if (sub1.equals(sub2)) {
					System.out.println(S.length()-1);
					return;
				} else {
					S = S.substring(0, (S.length()-1));
				}
			} else {
				S = S.substring(0, (S.length()-1));
			}
//			System.out.println(S);
		}
	}
}


#include <cstdio>
#include <cstdlib>

int main() {
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	if (a >= b && a >= c) printf("%d\n", b + c);
	else if (b >= a && b >= c) printf("%d\n", a + c);
	else if (c >= a && c >= b) printf("%d\n", a + b);
	return 0;
}


#include<stdio.h>

int main()
{
	int a, b, c,d;
	scanf("%d %d %d",&a,&b,&c);
	if (a >= b) {
		d = a;
		a = b;
		b = d;
	}
	if (b >= c) {
		d = b;
		b = c;
		c = d;
	}
	printf("%d", a + b);
    return 0;
}


#include <stdio.h>
int main(void){
int a,b,c,d;
scanf("%d %d %d",&a,&b,&c);
d = a+b;
if(d >=a+c){
	d = a+c;
}
if(d>=c+b){
	d = b+c;
}
printf("%d",d);
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <numeric>
#include <bitset>
#include <math.h>
#include <iomanip>
#include <sstream>
#include <cstdlib>

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
#define PI 3.14159265359 //πの値
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define C(x) cout << x << endl //テスト出力

//DP処理用
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

//関数
//nCkの計算の関数(呼び出しは[cbn])
ll cbn(ll n, ll k) {
    ll r = 1;
    for (ll d = 1; d <= k; ++d) {
        r *= n--;
        r /= d;
    }
    return r;
}
// a^n mod を計算する
ll powmod(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}
//２つの最大公約数
int gcb(int a, int b){
    if(a < b){
        int x = a;
        a = b;
        b = x;
    }
    int amari = a % b;
    if(amari == 0) return b;

    return gcb(b, amari);
}
//３つの最大公約数
int gcb_3(int a, int b, int c){
    return gcb(gcb(a, b), c);
}

/*map<Keyの型, Valueの型> 変数名;
queue<型> 変数名;
priority_queue<型> 変数名;
priority_queue<型, vector<型>, greater<型>> 変数名;
vector<vector<要素の型>> 変数名(要素数1, vector<要素の型>(要素数2, 初期値))
sort(変数名.begin(), 変数名.end());*/

/*-----------------------------ここから-----------------------------*/

int main() {
cin.tie(0);
ios::sync_with_stdio(false);]
ll data[3];
REP(i,3) cin>>data[i];
sort(data.begin(),data.end());
cout<<data[0]+data[1];
}


#include <bits/stdc++.h>
using namespace std;

int main() {
      string s;
      cin >>s;
      s.pop_back();
      for(int i=0;i<200;i++){
        int n=s.size();
        if(n%2==1){
            s.pop_back();
            continue;
        }
        string a=s.substr(0,n/2) , b = s.substr(n/2,n/2);
        if(a==b){
            cout<<s.size()<<endl;
            return 0;
        }
        else{
            s.pop_back();
        }
     }
}


#include<bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    cout << min(a+b, max(a+c, b+c)) << endl;
}


#include <stdio.h>

int main(){
  int a[3];

  for(int i=0; i<3; i++)  scanf("%d", a+i);

  for(int i=0; i<2; i++)
    for(int j=i+1; j<3; j++)
      if(a[i] > a[j]){
	a[i] ^= a[j];
	a[j] ^= a[i];
	a[i] ^= a[j];
      }

  printf("%d\n", a[0]+a[1]);

  return 0;
}


#include<stdio.h>
int main(void){
    int a,b,c,ab,bc,ca;
    scanf("%d %d %d",&a,&b,&c);
    ab=a+b;
    bc=b+c;
    ca=c+a;
    if(ab<bc && ab<ca){
        printf("%d\n",ab);
    }else if(bc<ca){
        printf("%d\n",bc);
    }else{
        printf("%d\n",ca);
    }
    return 0;
}


#include <stdio.h>
int main(){

    int a,b,c,sum;
    scanf("%d %d %d",&a,&b,&c);
    sum=a+b;
    if(sum>a+c)sum=a+c;
    if(sum>b+c)sum=c+b;

    printf("%d\n",sum);

    return 0;
}


#include <stdio.h>
int main()
{
    int a, b, c, ab, ac, bc;
    scanf("%d %d %d", &a, &b, &c);
    ab = a+b;
    ac = a+c;
    bc = b+c;
    if(ab<ac && ab<bc)
    {
        printf("%d", ab);
    }
    else if(ac<ab && ac<bc)
    {
        printf("%d", ac);
    }
    else
    {
        printf("%d", bc);
    }
    return 0;


#include <stdio.h>

int main()
{
    int a, b, c, ab, ac, bc;
    scanf("%d %d %d", &a, &b, &c);

    ab = a+b;
    ac = a+c;
    bc = b+c;

    if(ab>ac && ab>bc)
    {
        printf("%d", ab);
    }
    else if(ac>ab && ac>bc)
    {
        printf("%d", ac);
    }
    else
    {
        printf("%d", bc);
    }

    return 0;
}


#include<stdio.h>
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if((a>=1 && a<=1000) && (b>=1 && b<=1000) && (c>=1 && c<=1000))
{
    if((a+b)<(a+c)&& (a+b)<(b+c)){
        printf("%d",(a+b));
    }
    else if((b+c)<(a+c)&& (b+c)<(a+b)){
        printf("%d",(b+c));
    }
    else{
        printf("%d",(a+c));
    }
}
return 0;
}


var input = require('fs').readFileSync('/dev/stdin', 'utf8');
(function Main(input) {
  var money = input.split(/\s+/);
  for(var i = 0; i < money.length; i++) {
  money[i] = parseInt(money[i], 10);
  }
  var max = Math.max(money[0], money[1], money[2]);
  var min = Math.min(money[0], money[1], money[2]);
  var average = (money[0] + money[1] + money[2]) - max - min;
  console.log('%d', min + average);
})(input);


var input = require('fs').readFileSync('/dev/stdin', 'utf8');
(function Main(input) {
  var money = input.split(/\s+/);
  for(var i = 0; i < money.length; i++) {
  money[i] = parseInt(money[i], 10);
  }
  var max = Math.max(money[0], money[1], money[2]);
  console.log('%d', money[0]+money[1]+money[2] - max);
})(input);


function Main(input) {
  const numbers = input.split(' ').map(n => Number(n));
  const a = numbers[0];
  const b = numbers[1];
  const c = numbers[2];
  console.log(a + b + c - Math.max(...numbers))

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


"use strict";
const main = (input) => {
  const [a, b, c] = input.trim().split(" ").map(Number).sort();
  return a + b;
};
console.log(main(require("fs").readFileSync("/dev/stdin", "utf8")));


function main(input) {
   input = input.trim();
  const a = input.split(" ").map(Number);
  a.sort();
 console.log(a[0]+a[1]);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


var input = require('fs').readFileSync('/dev/stdin', 'utf8');
(function Main(input) {
  var money = input.split(/\s+/);
  for(var i = 0; i < money.length; i++) {
  money[i] = parseInt(money[i], 10);
  }
  var max = Math.max(money[0], money[1], money[2]);
  console.log('%d', money[1]+money[2]+money[3] - max);
})(input);


package main

import (
	"fmt"
	"sort"
)

func main() {
	nums := make([]int, 3)
	fmt.Scan(&nums[0], &nums[1], &nums[2])
	sort.IntSlice(nums).Sort()
	fmt.Println(nums[0] + nums[1])
}


package main

import "fmt"

func max(x ...int) int {
	mv := x[0]
	for _, v := range x[1:] {
		if v > mv {
			mv = v
		}
	}
	return mv
}

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)

	fmt.Println(a + b + c - max(a, b, c))
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func min(a, b int) int {
	if a > b {
		return b
	}
	return a
}

func main() {
	sc.Split(bufio.ScanWords)

	a, b, c := getInt(), getInt(), getInt()

	out(min(a+b, min(a+c, b+c)))
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	a := getInt()
	b := getInt()
	c := getInt()

	fmt.Println(sum(a, b, c) - min(a, b, c))
}

// -----------------------------------------

var scanner = wordScanner()

func wordScanner() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}

func getInt() int {
	scanner.Scan()
	i, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func getString() string {
	scanner.Scan()
	s := scanner.Text()
	return s
}

func sum(ns ...int) int {
	var sum int
	for _, n := range ns {
		sum += n
	}
	return sum
}

func min(ns ...int) int {
	var min int
	min = ns[0]
	for _, n := range ns {
		if min > n {
			min = n
		}
	}
	return min
}


package main

import(
	"bufio"
	"os"
	"strings"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	prices := strings.Split(sc.Text(), " ")
 	for i := 0;i < len(prices) - 1;i++ {
		for j := len(prices) - 1; j > 0; j-- {
			fastPrice,_ := strconv.Atoi(prices[i])
			lastPrice,_ := strconv.Atoi(prices[j])
			if fastPrice > lastPrice{
				t := prices[i]
				prices[i] = prices[j]
				prices[j] = t
			}
		}
	}
	fastPrice,_ := strconv.Atoi(prices[0])
	lastPrice,_ := strconv.Atoi(prices[1])
	println(fastPrice + lastPrice)
}


package main

import(
	"bufio"
	"os"
	"strings"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	prices := strings.Split(sc.Text(), " ")
 	for i := 0;i < len(prices);i++ {
		for j := len(prices) - 1; j > 0; j-- {
			fastPrice,_ := strconv.Atoi(prices[i])
			lastPrice,_ := strconv.Atoi(prices[j])
			if(i == j) {
				break
			}
			if fastPrice > lastPrice{
				t := prices[i]
				prices[i] = prices[j]
				prices[j] = t
			}
		}
	}
	fastPrice,_ := strconv.Atoi(prices[0])
	lastPrice,_ := strconv.Atoi(prices[1])
	println(fastPrice + lastPrice)
}


puts gets.split.map(&:to_i).sort.take(2).reduce(:+)


a=gets.split.map(&:to_i).sort;puts a[0] + a[1]


def sum(arr)
  ans = 0
  for i in arr
    ans += i
  end
  return ans
end
a = gets.split(" ").map(&:to_i)
p(sum(a) - a.max())


arr = gets.chomp.split.map(&:to_i)
arrays = arr.combination(2).to_a
s = arrays.map {|a| a.sum}
a = s.sort.first
puts a


arr = gets.chomp.split.map(&:to_i)
arrays = arr.combination(2).to_a
s = arrays.map {|a| a.sum}
puts s.sort.first


def sum(arr)
  ans = 0
  for i in arr
    ans += i
  end
end
a = gets.split(" ").map(&:to_i)
p(sum(a) - a.max())


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::cmp::max;

fn main() {
    let a: i64 = read();
    let b: i64 = read();
    let c: i64 = read();
    println!("{}", a + b+ c - max(a, max(b, c)));
}


use std::io;
use std::cmp::min;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let a = v[0];
	let b = v[1];
	let c = v[2];
	println!("{}", min(min(a+b, a+c), b+c));
}


macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let mut aa = get!(String).split_whitespace().map(|i| i.parse::<i32>().unwrap()).collect::<Vec<_>>();
    aa.sort();
    println!("{}", aa[0] + aa[1]);
}


#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<usize>();
    let (n, m) = (v[0], v[1]);
    let mut edges = vec![vec![]; n];
    for i in 0..m {
        let v = read_vec::<usize>();
        let (s, t) = (v[0] - 1, v[1] - 1);
        edges[s].push(t);
    }
    let mut dp = vec![0.0; n];
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


use std::io::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let a: i64 = input();
    let b: i64 = input();
    let c: i64 = input();
    println!("{}", (a + b).min(b + c).min(c + a));
}


use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let w = read::<i32>();
    let h = read::<i32>();
    let n = read::<usize>();
    let mut ps = vec![(0, 0); 2 * n];
    let mut online_ps = vec![];
    let mut online_cnt = vec![0; n];
    for i in 0..n {
        for j in 0..2 {
            let x = read::<i32>();
            let y = read::<i32>();
            ps[i * 2 + j] = (x, y);
            if x == 0 || y == 0 || x == w || y == h {
                let mut d = 0;
                if y == 0 {
                    d = x;
                } else if x == w {
                    d = w + y;
                } else if y == h {
                    d = w + h + (w - x);
                } else if x == 0 {
                    d = w + h + w + (h - y);
                }
                online_ps.push((d, i, x, y));
                online_cnt[i] += 1;
            }
        }
    }
    online_ps.sort();
    let mut stack = vec![];
    for &(_d, index, _x, _y) in online_ps.iter() {
        if online_cnt[index] == 1 {
            continue;
        }
        if let Some(&last_index) = stack.last() {
            if last_index == index {
                stack.pop();
                continue;
            }
        }
        stack.push(index);
    }
    println!("{}", if stack.len() == 0 { "YES" } else { "NO" });
}


let i=readLine()!.characters.split(" ").map{Int(String($0))!}.sort();print(i[0]+i[1])


let i=readLine()!.characters.split(" ").map{Int(String($0))!}.sort;print(i[0]+i[1])


const t={input:require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/),n:(arg:number=0):any=>{if(arg){const a:number[]=[];for(let i=0;i<arg;i++) {a.push(t.n());}return a;}else{const a = t.input[0];t.input.shift();return Number(a);}},s:(arg:number=0):any=>{if(arg){const a:string[]=[];for(let i=0;i<arg;i++){a.push(t.s());}return a;}else{const a=t.input[0];t.input.shift();return String(a);}},c:(arg:number=0):any=>{if(arg) {const a:string[]=[];for(let i=0;i<arg;i++) {a.push(t.c());}return a;}else{let a=t.input[0].split('');const b=a[0];a.shift();if(a.length>0){t.input[0]=a.join('');}else{t.input.shift();}return String(b);}},o: (...arg)=>{console.log(...arg);},abs:(a)=>{return Math.abs(a);},min:(...a)=>{return Math.min(...a);},max:(...a)=>{return Math.max(...a);},floor:(a)=>{return Math.floor(a);},asc:(ar:number[])=>{return ar.sort((a,b)=>{return a-b});},desc:(ar:number[])=>{ return ar.sort((a,b)=>{return b-a});},sw:(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1]}return arr[arr.length-1];}}
const main = ()=>{
  let [a,b,c] = t.n(3)
  t.o(t.min(a+b,b+c,a+c))
}
main()


const main = (input) => {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  const c = parseInt(input[2], 10);
  const result = [a,b,c];

  console.log(a+b+c-Math.max.apply(null, result));

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [a, b, c] = stdin.split('\n')[0].split(' ').map(Number)

const sorted = [a, b, c].sort((a, b)=> a-b)

console.log(sorted[0] + sorted[1])


const main = (input) => {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  const c = parseInt(input[1], 10);
  const result = [a,b,c];

  console.log(a+b+c-Math.max.apply(null, result));

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


const main = (input) => {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  const c = parseInt(input[1], 10);

  console.log(a+b+c-Math.max.apply(null,[a,b,c]));

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


const main = (input) => {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  const c = parseInt(input[1], 10);

  console.log(a+b+c-Math.max(a,b,c));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline

def main():
    A1 = [int(x) for x in input().split()]
    A2 = [int(x) for x in input().split()]
    A3 = [int(x) for x in input().split()]
    N = int(input())
    A = set([int(input()) for _ in range(N)])
    f = False
    if A1[0] in A and A1[1] in A and A1[2] in A:
        print("Yes")
        return
    if A2[0] in A and A2[1] in A and A2[2] in A:
        print("Yes")
        return
    if A3[0] in A and A3[1] in A and A3[2] in A:
        print("Yes")
        return
    if A1[0] in A and A2[0] in A and A3[0] in A:
        print("Yes")
        return
    if A1[1] in A and A2[1] in A and A3[1] in A:
        print("Yes")
        return
    if A1[2] in A and A2[2] in A and A3[2] in A:
        print("Yes")
        return
    if A1[0] in A and A2[1] in A and A3[2] in A:
        print("Yes")
        return
    if A1[2] in A and A2[1] in A and A3[0] in A:
        print("Yes")
        return
    print("No")

if __name__ == '__main__':
    main()


A = [list(map(int,input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]

c = [[0]*3 for _ in range(3)]
for b in B:
    for i in range(3):
        for j in range(3):
            if A[i][j] == b:
                c[i][j] = 1

for i in range(3):
    if c[i][0] and c[i][1] and c[i][2]:
        print('Yes')
        exit()
    if c[0][i] and c[1][i] and c[2][i]:
        print('Yes')
        exit()
if c[0][0] and c[1][1] and c[2][2]:
    print('Yes')
    exit()
if c[0][2] and c[1][1] and c[2][0]:
    print('Yes')
    exit()
print('No')


# coding: utf-8
# Your code here!

a = []
a.append(list(input().split()))
a.append(list(input().split()))
a.append(list(input().split()))

def kezuru(b):
    for i in range(len(a)):
        for j in range(len(a[i])):
            if b == a[i][j]:
                a[i][j] = '*'

n = int(input())
for i in range(n):
    b = input()
    kezuru(b)

def check():
    for i in range(3):
        if a[i][0] == a[i][1] and a[i][0] == a[i][2]:
            return 'Yes'
    for i in range(3):
        if a[0][i] == a[1][i] and a[0][i] == a[2][i]:
            return 'Yes'
    if a[0][0] == a[1][1] and a[0][0] == a[2][2]:
        return 'Yes'
    if a[0][2] == a[1][1] and a[0][2] == a[2][0]:
        return 'Yes'
    return 'No'

print(check())


def Judge(a):
  col=[]
  diag1=0
  diag2=0

  for i in range(3):
    if(a[i].count(0)==3):
      return 1
      break
    if(a[0][i]==0):
      col.append(0)
    if(a[1][i]==0):
      col.append(1)
    if(a[2][i]==0):
      col.append(2)
    if(a[i][i]==0):
      diag1+=1
    if(a[i][-(i+1)]==0):
      diag2+=1
  if(diag1==3 or diag2==3):
    return 1
  if(col.count(0)==3 or col.count(1)==3 or col.count(2)==3):
    return 1
  return 0

a=[]
for i in range(3):
  a.append(list(map(int,input().split())))
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(3):
    for k in range(3):
      if(b==a[j][k]):
        a[j][k]=0
judge=Judge(a)
if(judge==1):
  print("Yes")
else:
  print("No")


lst = [ [ int(i) for i in input().split() ] for j in range(3) ]

n = int(input())

for _ in range(n):
  x = int(input())
  for d in lst:
    if d[0] == x:
      d[0] = -1
    elif d[1] == x:
      d[1] = -1
    elif d[2] == x:
      d[2] = -1
print(lst)
for d in lst:
  if d[0] == d[1] == d[2] == -1:
    print('Yes')
    exit()
for i in range(3):
  if lst[0][i] == lst[1][i] == lst[2][i] == -1:
    print('Yes')
    exit()
for i in range(3):
  if lst[i][0] == lst[i][1] == lst[i][2] == -1:
    print('Yes')
    exit()
if lst[0][0] == lst[1][1] == lst[2][2] == -1:
  print('Yes')
  exit()
if lst[0][2] == lst[1][1] == lst[2][0] == -1:
  print('Yes')
  exit()
print('No')


lst = [ [ int(i) for i in input().split() ] for j in range(3) ]

n = int(input())

for _ in range(n):
  x = int(input())
  for d in lst:
    if d[0] == x:
      d[0] = -1
    elif d[1] == x:
      d[1] = -1
    elif d[2] == x:
      d[2] = -1
for d in lst:
  if d[0] == d[1] == d[2] == -1:
    print('Yes')
    exit()

for i in range(3):
  if lst[i][0] == lst[i][1] == lst[i][2] == -1:
    print('Yes')
    exit()
if lst[0][0] == lst[1][1] == lst[2][2] == -1:
  print('Yes')
  exit()
if lst[0][2] == lst[1][1] == lst[2][0] == -1:
  print('Yes')
  exit()
print('No')


import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.IntStream;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	private void solve() {
		Scanner sc = new Scanner(System.in);
		int[][] A = new int[3][3];
		for (int r = 0; r < 3; r++) {
			for (int c = 0; c < 3; c++) {
				A[r][c] = sc.nextInt();
			}
		}
		int N = sc.nextInt();
		for (int i = 0; i < N; i++) {
			int b = sc.nextInt();
			for (int r = 0; r < 3; r++) {
				for (int c = 0; c < 3; c++) {
					if (A[r][c] == b) {
						A[r][c] = -1;
					}
				}
			}
		}
		for (int r = 0; r < 3; r++) {
			boolean isOK = true;
			for (int c = 0; c < 3; c++) {
				if (A[r][c] != -1) {
					isOK = false;
				}
			}
			if (isOK) {
				System.out.println("Yes");
				return;
			}
		}
		for (int c = 0; c < 3; c++) {
			boolean isOK = true;
			for (int r = 0; r < 3; r++) {
				if (A[r][c] != -1) {
					isOK = false;
				}
			}
			if (isOK) {
				System.out.println("Yes");
				return;
			}
		}
		{
			boolean isOK = true;
			for (int i = 0; i < 3; i++) {
				if (A[i][i] != -1) {
					isOK = false;
				}
			}
			if (isOK) {
				System.out.println("Yes");
				return;
			}
		}
		{
			boolean isOK = true;
			for (int i = 0; i < 3; i++) {
				if (A[i][2-i] != -1) {
					isOK = false;
				}
			}
			if (isOK) {
				System.out.println("Yes");
				return;
			}
		}
		System.out.println("No");
	}

	class Scanner {
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int index;
		private int length;

		public Scanner(InputStream in) {
			this.in = in;
		}

		private boolean isPrintableChar(int c) {
			return '!' <= c && c <= '~';
		}

		private boolean isDigit(int c) {
			return '0' <= c && c <= '9';
		}

		private boolean hasNextByte() {
			if (index < length) {
				return true;
			} else {
				try {
					length = in.read(buffer);
					index = 0;
				} catch (IOException e) {
					e.printStackTrace();
				}
				return length > 0;
			}
		}

		private boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[index])) {
				index++;
			}
			return hasNextByte();
		}

		private int readByte() {
			return hasNextByte() ? buffer[index++] : -1;
		}

		public String next() {
			if (!hasNext()) {
				throw new RuntimeException("no input");
			}
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext()) {
				throw new RuntimeException("no input");
			}
			long value = 0L;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			while (isPrintableChar(b)) {
				if (isDigit(b)) {
					value = value * 10 + (b - '0');
				}
				b = readByte();
			}
			return minus ? -value : value;
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}
	}

	interface CombCalculator {
		long comb(int n, int m);
	}

	interface MobiusFunction {
		int get(int n);
	}

	/**
	 * メビウス関数をエラトステネスの篩っぽく前計算するクラスです。
	 * 計算量はO(1)で、前計算でO(N logN)です。
	 */
	class SieveMobiusFunction implements MobiusFunction {
		int size;
		int[] mobiusFunctionValues;

		public SieveMobiusFunction(int size) {
			this.size = size;
			mobiusFunctionValues = new int[size];

			mobiusFunctionValues[0] = 0;
			mobiusFunctionValues[1] = 1;
			for (int i = 2; i < size; i++) {
				mobiusFunctionValues[i] = 1;
			}
			for (int i = 2; i * i < size; i++) {
				for (int k = 1; i * i * k < size; k++) {
					mobiusFunctionValues[i * i * k] *= 0;
				}
			}

			for (int i = 2; i < size; i++) {
				if (mobiusFunctionValues[i] == 1) {
					for (int k = 1; i * k < size; k++) {
						mobiusFunctionValues[i * k] *= -2;
					}
				}
				if (mobiusFunctionValues[i] > 1) {
					mobiusFunctionValues[i] = 1;
				}
				if (mobiusFunctionValues[i] < -1) {
					mobiusFunctionValues[i] = -1;
				}
			}
		}

		@Override
		public int get(int n) {
			if (n > size) {
				throw new RuntimeException("n is greater than size.");
			}
			if (n < 0) {
				return 0;
			}
			return mobiusFunctionValues[n];
		}
	}

	/**
	 * メビウス関数を定義通り計算するクラスです。
	 * 計算量はO(logN)です。
	 */
	class PrimeFactorizationMobiusFunction implements MobiusFunction {
		@Override
		public int get(int n) {
			if (n <= 0) {
				return 0;
			}
			if (n == 1) {
				return 1;
			}
			int num = 0;
			for (int i = 2; i < n; i++) {
				if (n % i == 0) {
					n /= i;
					num++;
					if (n % i == 0) {
						return 0;
					}
				}
			}
			return num % 2 == 0 ? -1 : 1;
		}
	}

	/**
	 * 組み合わせ計算を階乗の値で行うクラスです(MOD対応)
	 * 階乗とその逆元は前計算してテーブルに格納します。
	 * C(N, N) % M の計算量は O(1)、 前計算でO(max(N, logM))です。
	 * sizeを1e8より大きい値で実行するとMLEの危険性があります。
	 * また素数以外のMODには対応していません(逆元の計算に素数の剰余環の性質を利用しているため)。
	 */
	class FactorialTableCombCalculator implements CombCalculator {
		int size;
		long[] factorialTable;
		long[] inverseFactorialTable;
		long mod;

		public FactorialTableCombCalculator(int size, long mod) {
			this.size = size;
			factorialTable = new long[size + 1];
			inverseFactorialTable = new long[size + 1];
			this.mod = mod;

			factorialTable[0] = 1L;
			for (int i = 1; i <= size; i++) {
				factorialTable[i] = (factorialTable[i - 1] * i) % mod;
			}
			inverseFactorialTable[size] = inverse(factorialTable[size], mod);
			for (int i = size - 1; i >= 0; i--) {
				inverseFactorialTable[i] = (inverseFactorialTable[i + 1] * (i + 1)) % mod;
			}
		}

		private long inverse(long n, long mod) {
			return pow(n, mod - 2, mod);
		}

		private long pow(long n, long p, long mod) {
			if (p == 0) {
				return 1L;
			}
			long half = pow(n, p / 2, mod);
			long ret = (half * half) % mod;
			if (p % 2 == 1) {
				ret = (ret * n) % mod;
			}
			return ret;
		}

		@Override
		public long comb(int n, int m) {
			if (n > size) {
				throw new RuntimeException("n is greater than size.");
			}
			if (n < 0 || m < 0 || n < m) {
				return 0L;
			}
			return (((factorialTable[n] * inverseFactorialTable[m]) % mod) * inverseFactorialTable[n - m]) % mod;
		}
	}

	/**
	 * 組み合わせ計算をテーブルで実装したクラスです(MOD対応)
	 * 前計算でO(N^2), combはO(1)で実行できます
	 * sizeを2 * 1e4より大きい値で実行するとMLEの危険性があります
	 */
	class TableCombCalculator implements CombCalculator {
		long[][] table;
		int size;

		public TableCombCalculator(int size, long mod) {
			this.size = size;
			table = new long[size + 1][];

			table[0] = new long[1];
			table[0][0] = 1L;
			for (int n = 1; n <= size; n++) {
				table[n] = new long[n + 1];
				table[n][0] = 1L;
				for (int m = 1; m < n; m++) {
					table[n][m] = (table[n - 1][m - 1] + table[n - 1][m]) % mod;
				}
				table[n][n] = 1L;
			}
		}

		@Override
		public long comb(int n, int m) {
			if (n > size) {
				throw new RuntimeException("n is greater than size.");
			}
			if (n < 0 || m < 0 || n < m) {
				return 0L;
			}
			return table[n][m];
		}
	}

	interface Graph {
		void link(int from, int to, long cost);
		Optional<Long> getCost(int from, int to);
		int getVertexNum();
	}

	interface FlowResolver {
		long maxFlow(int from, int to);
	}

	/**
	 * グラフの行列による実装
	 * 接点数の大きいグラフで使うとMLEで死にそう
	 */
	class ArrayGraph implements Graph {
		private Long[][] costArray;
		private int vertexNum;

		public ArrayGraph(int n) {
			costArray = new Long[n][];
			for (int i = 0; i < n; i++) {
				costArray[i] = new Long[n];
			}
			vertexNum = n;
		}

		@Override
		public void link(int from, int to, long cost) {
			costArray[from][to] = new Long(cost);
		}

		@Override
		public Optional<Long> getCost(int from, int to) {
			return Optional.ofNullable(costArray[from][to]);
		}

		@Override
		public int getVertexNum() {
			return vertexNum;
		}
	}

	/**
	 * DFS(深さ優先探索)による実装
	 * 計算量はO(E*MaxFlow)のはず (E:辺の数, MaxFlow:最大フロー)
	 */
	class DfsFlowResolver implements FlowResolver {
		private Graph graph;
		public DfsFlowResolver(Graph graph) {
			this.graph = graph;
		}

		/**
		 * 最大フロー(最小カット)を求める
		 * @param from 始点(source)のID
		 * @param to 終点(target)のID
		 * @return 最大フロー(最小カット)
		 */
		public long maxFlow(int from, int to) {
			long sum = 0L;
			long currentFlow;
			do {
				currentFlow = flow(from, to, Long.MAX_VALUE / 3, new boolean[graph.getVertexNum()]);
				sum += currentFlow;
			} while (currentFlow > 0);
			return sum;
		}

		/**
		 * フローの実行 グラフの更新も行う
		 * @param from 現在いる節点のID
		 * @param to 終点(target)のID
		 * @param current_flow ここまでの流量
		 * @param passed 既に通った節点か否かを格納した配列
		 * @return 終点(target)に流した流量/戻りのグラフの流量
		 */
		private long flow(int from, int to, long current_flow, boolean[] passed) {
			passed[from] = true;
			if (from == to) {
				return current_flow;
			}
			for (int id = 0; id < graph.getVertexNum(); id++) {
				if (passed[id]) {
					continue;
				}
				Optional<Long> cost = graph.getCost(from, id);
				if (cost.orElse(0L) > 0) {
					long nextFlow = current_flow < cost.get() ? current_flow : cost.get();
					long returnFlow = flow(id, to, nextFlow, passed);
					if (returnFlow > 0) {
						graph.link(from, id, cost.get() - returnFlow);
						graph.link(id, from, graph.getCost(id, from).orElse(0L) + returnFlow);
						return returnFlow;
					}
				}
			}
			return 0L;
		}
	}

	/**
	 * 1-indexedのBIT配列
	 */
	class BinaryIndexedTree {
		private long[] array;

		public BinaryIndexedTree(int size) {
			this.array = new long[size + 1];
		}

		/**
		 * 指定した要素に値を加算する
		 * 計算量はO(logN)
		 * @param index 加算する要素の添字
		 * @param value 加算する量
		 */
		public void add(int index, long value) {
			for (int i = index; i < array.length; i += (i & -i)) {
				array[i] += value;
			}
		}

		/**
		 * 1〜指定した要素までの和を取得する
		 * 計算量はO(logN)
		 * @param index 和の終端となる要素の添字
		 * @return 1〜indexまでの和
		 */
		public long getSum(int index) {
			long sum = 0L;
			for (int i = index; i > 0; i -= (i & -i)) {
				sum += array[i];
			}
			return sum;
		}
	}

	/**
	 * 1-indexedの2次元BIT配列
	 */
	class BinaryIndexedTree2D {
		private long[][] array;

		public BinaryIndexedTree2D(int size1, int size2) {
			this.array = new long[size1 + 1][];
			for (int i = 1; i <= size1; i++) {
				this.array[i] = new long[size2 + 1];
			}
		}

		/**
		 * 指定した要素に値を加算する
		 * 計算量はO(logN * logN)
		 * @param index1 加算する要素の1次元目の添字
		 * @param index2 加算する要素の2次元目の添字
		 * @param value 加算する量
		 */
		public void add(int index1, int index2, long value) {
			for (int i1 = index1; i1 < array.length; i1 += (i1 & -i1)) {
				for (int i2 = index2; i2 < array.length; i2 += (i2 & -i2)) {
					array[i1][i2] += value;
				}
			}
		}

		/**
		 * (1,1)〜指定した要素までの矩形和を取得する
		 * 計算量はO(logN * logN)
		 * @param index1 和の終端となる要素の1次元目の添字
		 * @param index2 和の終端となる要素の2次元目の添字
		 * @return (1,1)〜(index1,index2)までの矩形和
		 */
		public long getSum(int index1, int index2) {
			long sum = 0L;
			for (int i1 = index1; i1 > 0; i1 -= (i1 & -i1)) {
				for (int i2 = index2; i2 > 0; i2 -= (i2 & -i2)) {
					sum += array[i1][i2];
				}
			}
			return sum;
		}
	}

	interface UnionFind {
		void union(int A, int B);
		boolean judge(int A, int B);
		Set<Integer> getSet(int id);
	}

	/**
	 * ArrayUnionFindの拡張
	 * MapSetで根の添字から根にぶら下がる頂点の集合が取得できるようにした
	 * getSetメソッドをO(logN * logN)に落とせているはず
	 * ただしunionメソッドは2倍の計算量になっているので注意(オーダーは変わらないはず)
	 */
	class SetUnionFind extends ArrayUnionFind {
		Map<Integer, Set<Integer>> map;
		public SetUnionFind(int size) {
			super(size);
			map = new HashMap<>();
			for (int i = 0; i < size; i++) {
				map.put(i, new HashSet<>());
				map.get(i).add(i);
			}
		}

		@Override
		protected void unionTo(int source, int dest) {
			super.unionTo(source, dest);
			map.get(dest).addAll(map.get(source));
		}

		@Override
		public Set<Integer> getSet(int id) {
			return map.get(root(id));
		}
	}

	/**
	 * 配列によるUnionFindの実装
	 * getSetメソッドはO(NlogN)なのでTLEに注意
	 */
	class ArrayUnionFind implements UnionFind {
		int[] parent;
		int[] rank;
		int size;
		public ArrayUnionFind(int size) {
			parent = new int[size];
			for (int i = 0; i < size; i++) {
				parent[i] = i;
			}
			rank = new int[size];
			this.size = size;
		}

		@Override
		public void union(int A, int B) {
			int rootA = root(A);
			int rootB = root(B);
			if (rootA != rootB) {
				if (rank[rootA] < rank[rootB]) {
					unionTo(rootA, rootB);
				} else {
					unionTo(rootB, rootA);
					if (rank[rootA] == rank[rootB]) {
						rank[rootA]++;
					}
				}
			}
		}

		protected void unionTo(int source, int dest) {
			parent[source] = dest;
		}

		@Override
		public boolean judge(int A, int B) {
			return root(A) == root(B);
		}

		@Override
		public Set<Integer> getSet(int id) {
			Set<Integer> set = new HashSet<>();
			IntStream.range(0, size).filter(i -> judge(i, id)).forEach(set::add);
			return set;
		}

		protected int root(int id) {
			if (parent[id] == id) {
				return id;
			}
			parent[id] = root(parent[id]);
			return parent[id];
		}
	}

	/**
	 * 素数のユーティリティ
	 */
	class PrimeNumberUtils {
		boolean[] isPrimeArray;
		List<Integer> primes;

		/**
		 * 素数判定の上限となる値を指定してユーティリティを初期化
		 * @param limit 素数判定の上限(この値以上が素数であるか判定しない)
		 */
		public PrimeNumberUtils(int limit) {
			if (limit > 10000000) {
				System.err.println("上限の値が高すぎるため素数ユーティリティの初期化でTLEする可能性が大変高いです");
			}
			primes = new ArrayList<>();
			isPrimeArray = new boolean[limit];
			if (limit > 2) {
				primes.add(2);
				isPrimeArray[2] = true;
			}

			for (int i = 3; i < limit; i += 2) {
				if (isPrime(i, primes)) {
					primes.add(i);
					isPrimeArray[i] = true;
				}
			}
		}

		public List<Integer> getPrimeNumberList() {
			return primes;
		}

		public boolean isPrime(int n) {
			return isPrimeArray[n];
		}

		private boolean isPrime(int n, List<Integer> primes) {
			for (int prime : primes) {
				if (n % prime == 0) {
					return false;
				}
				if (prime > Math.sqrt(n)) {
					break;
				}
			}
			return true;
		}
	}

	interface BitSet {
		void set(int index, boolean bit);
		boolean get(int index);
		void shiftRight(int num);
		void shiftLeft(int num);
		void or(BitSet bitset);
		void and(BitSet bitset);
	}

	/**
	 * Longの配列によるBitSetの実装
	 * get/setはO(1)
	 * shift/or/andはO(size / 64)
	 */
	class LongBit implements BitSet {
		long[] bitArray;

		public LongBit(int size) {
			bitArray = new long[((size + 63) / 64)];
		}

		@Override
		public void set(int index, boolean bit) {
			int segment = index / 64;
			int inIndex = index % 64;
			if (bit) {
				bitArray[segment] |= 1L << inIndex;
			} else {
				bitArray[segment] &= ~(1L << inIndex);
			}
		}

		@Override
		public boolean get(int index) {
			int segment = index / 64;
			int inIndex = index % 64;
			return (bitArray[segment] & (1L << inIndex)) != 0L;
		}

		@Override
		public void shiftRight(int num) {
			int shiftSeg = num / 64;
			int shiftInI = num % 64;
			for (int segment = 0; segment < bitArray.length; segment++) {
				int sourceSeg = segment + shiftSeg;
				if (sourceSeg < bitArray.length) {
					bitArray[segment] = bitArray[sourceSeg] >>> shiftInI;
					if (shiftInI > 0 && sourceSeg + 1 < bitArray.length) {
						bitArray[segment] |= bitArray[sourceSeg + 1] << (64 - shiftInI);
					}
				} else {
					bitArray[segment] = 0L;
				}
			}
		}

		@Override
		public void shiftLeft(int num) {
			int shiftSeg = num / 64;
			int shiftInI = num % 64;
			for (int segment = bitArray.length - 1; segment >= 0; segment--) {
				int sourceSeg = segment - shiftSeg;
				if (sourceSeg >= 0) {
					bitArray[segment] = bitArray[sourceSeg] << shiftInI;
					if (shiftInI > 0 && sourceSeg > 0) {
						bitArray[segment] |= bitArray[sourceSeg - 1] >>> (64 - shiftInI);
					}
				} else {
					bitArray[segment] = 0L;
				}
			}
		}

		public long getLong(int segment) {
			return bitArray[segment];
		}

		@Override
		public void or(BitSet bitset) {
			if (!(bitset instanceof LongBit)) {
				return;
			}
			for (int segment = 0; segment < bitArray.length; segment++) {
				bitArray[segment] |= ((LongBit)bitset).getLong(segment);
			}
		}

		@Override
		public void and(BitSet bitset) {
			if (!(bitset instanceof LongBit)) {
				return;
			}
			for (int segment = 0; segment < bitArray.length; segment++) {
				bitArray[segment] &= ((LongBit)bitset).getLong(segment);
			}
		}
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.NoSuchElementException;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		FastScanner sc=new FastScanner();
		int[][] A=new int[3][3];
		for(int i=0;i<3;++i)for(int j=0;j<3;++j)A[i][j]=sc.nextInt();
		int n=sc.nextInt();
		int[] b=new int[n];
		HashSet<Integer> set=new HashSet<>();
		for(int i=0;i<n;++i) {
			b[i]=sc.nextInt();
			set.add(b[i]);
		}
		boolean[][] a=new boolean[3][3];
		for(int i=0;i<3;++i)
			for(int j=0;j<3;++j) a[i][j]|=set.contains(A[i][j]);
		boolean ans=false;
		for(int i=0;i<3;++i) {
			ans|=a[i][0]&&a[i][1]&&a[i][2];
		}
		for(int i=0;i<3;++i) {
			ans|=a[0][i]&&a[1][i]&&a[2][i];
		}
		ans|=a[0][0]&&a[1][1]&&a[2][2];
		ans|=a[2][0]&&a[1][1]&&a[0][2];
		System.out.println(ans?"Yes":"No");
	}

	static void tr(Object... objects) {
	}

}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
        main.out.close();
    }
    // ======================================================================
    public void solve() {
    	int[][] A = ni(3,3);
    	int N = ni();
    	int b;
    	for (int i = 0; i < N; i++) {
			b = ni();
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 3; j2++) {
					if(A[j][j2] == b)	A[j][j2] = -1;
				}
			}
		}
    	boolean ans = false;
    	if(A[0][0] == -1 && A[0][1] == -1 && A[0][2] == -1) { out.println("Yes"); return; }
    	if(A[1][0] == -1 && A[1][1] == -1 && A[1][2] == -1) { out.println("Yes"); return; }
    	if(A[2][0] == -1 && A[2][1] == -1 && A[2][2] == -1) { out.println("Yes"); return; }

    	if(A[0][0] == -1 && A[1][0] == -1 && A[2][0] == -1) { out.println("Yes"); return; }
    	if(A[0][1] == -1 && A[1][1] == -1 && A[2][1] == -1) { out.println("Yes"); return; }
    	if(A[0][2] == -1 && A[1][2] == -1 && A[2][2] == -1) { out.println("Yes"); return; }

    	if(A[0][0] == -1 && A[1][1] == -1 && A[2][2] == -1) { out.println("Yes"); return; }
    	if(A[0][2] == -1 && A[1][1] == -1 && A[2][0] == -1) { out.println("Yes"); return; }
    	out.println("No");
    }
    // ------------------------------------------
    // ライブラリ
    // ------------------------------------------
    // Print
	private PrintWriter out = new PrintWriter(System.out);

    // Scanner
    private FastScanner scan = new FastScanner();
    int ni(){ return scan.nextInt();}
    int[] ni(int n){int[] a = new int[n]; for(int i = 0; i < n; i++){a[i] = ni();} return a;}
    int[][] ni(int y, int x){int[][] a = new int[y][x];
        for(int i = 0; i < y; i++){for(int j = 0; j < x; j++){a[i][j] = ni();}} return a;}
    long nl(){return scan.nextLong();}
    long[] nl(int n){long[] a = new long[n]; for(int i = 0; i < n; i++){a[i] = nl();} return a;}
    long[][] nl(int y, int x){long[][] a = new long[y][x];
        for(int i = 0; i < y; i++){for(int j = 0; j < x; j++){a[i][j] = nl();}} return a;}
    String ns(){return scan.next();}
    String[] ns(int n){String[] a = new String[n]; for(int i = 0; i < n; i++){a[i] = ns();} return a;}
    String[][] ns(int y, int x){String[][] a = new String[y][x];
        for(int i = 0; i < y; i++){for(int j = 0; j < x; j++){a[i][j] = ns();}} return a;}
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int[][] a = new int[3][3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				a[i][j] = sc.nextInt();
			}
		}

		int n = sc.nextInt();
		int[] b = new int[n];
		for (int i = 0; i < n; i++) {
			b[i] = sc.nextInt();
		}

		boolean[][] c = new boolean[3][3];

		for (int i = 0; i < n; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 3; k++) {
					if (b[i] == a[j][k]) {
						c[j][k] = true;
						break;
					}
				}
			}
		}

		boolean k = false;
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (!c[i][j]) {
					k = false;
					break;
				} else {
					k = true;
				}
			}
		}
		if (k) {
			System.out.println("Yes");
			return;
		}

		for (int j = 0; j < 3; j++) {
			for (int i = 0; i < 3; i++) {
				if (!c[i][j]) {
					k = false;
					break;
				} else {
					k = true;
				}
			}
		}

		if ( (c[0][0] && c[1][1] && c[2][2]) || c[0][2] && c[1][1] && c[2][0] ) {
			System.out.println("Yes");
			return;
		}

		System.out.println("No");
		return;

	}

}


import java.util.LinkedHashSet;
import java.util.LinkedHashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    private static final int TOTAL_NUM = 13;

    private static final String HEART = "H";
    private static final String DIAMOND = "D";
    private static final String SPADE = "S";
    private static final String CLUB = "C";

    private static Set mapCardHeart = new LinkedHashSet();
    private static Set mapCardDiamond = new LinkedHashSet();
    private static Set mapCardSpade = new LinkedHashSet();
    private static Set mapCardClub = new LinkedHashSet();

    // Mapだと上書きされちゃう！！
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int iCardNum = Integer.parseInt(sc.next());
        readCard(iCardNum);
        output();
    }

    private static void readCard(final int iCardNum) {
        final Scanner sc = new Scanner(System.in);
        for (int i = 0; i < iCardNum; i++) {
            final String sCardType = sc.next();
            final int iCardVal = Integer.parseInt(sc.next());
            procSelectCardType(sCardType, iCardVal);
        }
    }

    private static String convOutput(final String sCardType, final int iCardVal) {
        final StringBuilder sb = new StringBuilder();
        sb.append(sCardType);
        sb.append(" ");
        sb.append(iCardVal);
        return sb.toString();
    }

    private final static void procSelectCardType(final String sCardType, final int iCardVal) {
        switch (sCardType) {
            case HEART:
                setHeart(iCardVal);
                break;

            case DIAMOND:
                setDiamond(iCardVal);
                break;

            case SPADE:
                setSpade(iCardVal);
                break;

            case CLUB:
                setClub(iCardVal);
                break;

            default:
                break;
        }
    }

    private static void output() {
        String sOut = "";
        if (!mapCardHeart.isEmpty()) {
            final int iNotCnt = TOTAL_NUM - mapCardHeart.size();
            sOut += convOutput(HEART, iNotCnt);
        }
        if (!mapCardDiamond.isEmpty()) {
            final int iNotCnt = TOTAL_NUM - mapCardDiamond.size();
            sOut += convOutput(DIAMOND, iNotCnt);
        }

        if (!mapCardSpade.isEmpty()) {
            final int iNotCnt = TOTAL_NUM - mapCardSpade.size();
            sOut += convOutput(SPADE, iNotCnt);
        }

        if (!mapCardClub.isEmpty()) {
            final int iNotCnt = TOTAL_NUM - mapCardClub.size();
            sOut += convOutput(CLUB, iNotCnt);
        }
        System.out.println(sOut);
    }

    private static void setHeart(final int iCardVal) {
        mapCardHeart.add(iCardVal);
    }

    private static void setDiamond(final int iCardVal) {
        mapCardDiamond.add(iCardVal)
    }

    private static void setSpade(final int iCardVal) {
        mapCardSpade.add(iCardVal);
    }

    private static void setClub(final int iCardVal) {
        mapCardClub.add(iCardVal);
    }

}


import java.util.Scanner;

// 7
public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] a = new int[3][3];
        for(int i = 0; i < 3; i++)
            for(int j = 0; j < 3; j++)
                a[i][j] = sc.nextInt();
        int N = sc.nextInt();
        int[] b = new int[N];
        for(int i = 0; i < N; i++)
            b[i] = sc.nextInt();

        int count = 0;
        //if count >= 6 then break
        int i, j, k = 0;
        for(i = 0; i < 3; i++)
            for(j = 0; j < 3; j++) {
                for(k = 0; k < N; k++) {
                    if(b[k] == a[i][j]) {
                        a[i][j] = -1;
                        ++count;
                        if(count == 6) {
                            i = j = k = 10;
                            System.out.println("Yes");
                        }
                    }
                }
            }

        String ans = "No";
        if(i != 3) {
            for(int ii = 0; ii < 3; ii++)
                if(a[ii][0] == -1 && a[ii][1] == -1 && a[ii][2] == -1) {
                    ans = "Yes";
                    break;
                }
            for(int jj = 0; jj < 3; jj++)
                if(a[0][jj] == -1 && a[1][jj] == -1 && a[2][jj] == -1) {
                    ans = "Yes";
                    break;
                }

            if(a[0][0] == -1 && a[1][1] == -1 && a[2][2] == -1) {
                ans = "Yes";
            }
            if(a[2][0] == -1 && a[1][1] == -1 && a[0][2] == -1) {
                ans = "Yes";
            }
            System.out.println(ans);
        }
    }

}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING
#include "bits/stdc++.h"
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define rrep(i, n) for(int i=(n)-1; i>=0; --i)
#define rfor(i, m, n) for(int i=(m); i>=(n); --i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define range_it(a, l, r) (a).begin() + (l), (a).begin() + (r)

using namespace std;
using LL = long long;		using ld = long double;
using VB = vector<bool>;	using VVB = vector<VB>;
using VI = vector<int>;		using VVI = vector<VI>;
using VL = vector<LL>;		using VVL = vector<VL>;
using VS = vector<string>;	using VD = vector<double>;
using PII = pair<int, int>;	using VP = vector<PII>;
using PLL = pair<LL, LL>;	using VPL = vector<PLL>;
template<class T>using Grid = vector<vector<T>>;
template<class T>using PQ = priority_queue<T>;
template<class T>using PQS = priority_queue<T, vector<T>, greater<T>>;
constexpr int inf = (int)1e9;
constexpr LL inf_ll = (LL)1e18, MOD = 1000000007;
constexpr ld PI = M_PI, EPS = 1e-12;

template<class T>inline void Sort(T& a)noexcept { sort(all(a)); }
template<class T>inline void RSort(T& a)noexcept { sort(rall(a)); }
template<class T>inline void Reverse(T& a)noexcept { reverse(all(a)); }
template<class T>inline void Unique(T& a)noexcept { a.erase(unique(all(a)), a.end()); }
template<class T>inline T Sorted(T a)noexcept { Sort(a); return a; }
template<class T>inline T RSorted(T a)noexcept { RSort(a); return a; }
template<class T>inline T Reversed(T a)noexcept { Reverse(a); return a; }
template<class T>inline T Uniqued(T a)noexcept { Unique(a); return a; }
template<class T>inline auto Max(const T& a)noexcept { return *max_element(all(a)); }
template<class T>inline auto Min(const T& a)noexcept { return *min_element(all(a)); }
template<class T>inline int MaxPos(const T& a)noexcept { return max_element(all(a)) - a.begin(); }
template<class T>inline int MinPos(const T& a)noexcept { return min_element(all(a)) - a.begin(); }
template<class T, class U>inline int Count(const T& a, const  U& v)noexcept { return count(all(a), v); }
template<class T, class U>inline int Find(const T& a, const U& v)noexcept { auto pos = find(all(a), v); return pos == a.end() ? -1 : pos - a.begin(); }
template<class T, class U>inline U Sum(const T& a, const U& v)noexcept { return accumulate(all(a), v); }
template<class T, class U>inline int Lower(const T& a, const U& v)noexcept { return lower_bound(all(a), v) - a.begin(); }
template<class T, class U>inline int Upper(const T& a, const U& v)noexcept { return upper_bound(all(a), v) - a.begin(); }
template<class T, class P>inline void RemoveIf(T& a, P f)noexcept { a.erase(remove_if(all(a), f), a.end()); }
template<class T>inline T Age(T n, T m)noexcept { return (n + m - 1) / m; }
template<class T>inline T Age2(T n, T m)noexcept { return Age(n, m) * m; }
template<class T>inline T Tri(T n)noexcept { return (n & 1) ? (n + 1) / 2 * n : n / 2 * (n + 1); }
template<class T = long long>inline T BIT(int b)noexcept { return T{ 1 } << b; }
template<class T>inline T Gcd(T n, T m)noexcept { return m ? Gcd(m, n % m) : n; }
template<class T>inline T Lcm(T n, T m)noexcept { return n / Gcd(n, m) * m; }
template<class T>inline T Pow(T a, T n)noexcept { T r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n /= 2; }return r; }
template<class T>inline T Powmod(T a, T n, T m = MOD)noexcept { T r = 1; while (n > 0) { if (n & 1)r = r * a % m, n--; else a = a * a % m, n /= 2; }return r; }
template<class T>inline bool chmax(T& a, const T& b)noexcept { if (a < b) { a = b; return true; } return false; }
template<class T>inline bool chmin(T& a, const T& b)noexcept { if (a > b) { a = b; return true; } return false; }
template<class T>inline bool inRange(const T& v, const T& min, const T& max)noexcept { return min <= v && v <= max; }
inline string operator*(string s, int n)noexcept { string ret; rep(i, n)ret += s; return ret; }

// --- input --- //
#if defined(_WIN32) || defined(ONLINE_JUDGE)
#define getchar_unlocked _getchar_nolock
#define putchar_unlocked _putchar_nolock
#endif
inline int gc()noexcept { return getchar_unlocked(); }
template<class T>inline void InputF(T& v)noexcept { cin >> v; }
inline void InputF(char& v)noexcept { while (isspace(v = gc())); }
inline void InputF(string& v)noexcept {
	char c; for (InputF(c); !isspace(c); c = gc())v += c;
}
inline void InputF(int& v)noexcept {
	bool neg = false; v = 0; char c; InputF(c);
	if (c == '-') { neg = true; c = gc(); }
	for (; isdigit(c); c = gc())v = v * 10 + (c - '0');
	if (neg)v = -v;
}
inline void InputF(long long& v)noexcept {
	bool neg = false; v = 0; char c; InputF(c);
	if (c == '-') { neg = true; c = gc(); }
	for (; isdigit(c); c = gc())v = v * 10 + (LL)(c - '0');
	if (neg)v = -v;
}
inline void InputF(double& v)noexcept {
	double dp = 1; bool neg = false, adp = false; v = 0; char c; InputF(c);
	if (c == '-') { neg = true; c = gc(); }
	for (; isdigit(c) || c == '.'; c = gc()) {
		if (c == '.')adp = true;
		else if (adp)v += (c - '0') * (dp *= 0.1);
		else v = v * 10 + (c - '0');
	}
	if (neg)v = -v;
}
template<class T, class U>inline void InputF(pair<T, U>& v)noexcept {
	InputF(v.first); InputF(v.second);
}
template<class T>inline void InputF(vector<T>& v)noexcept {
	for (auto& e : v)InputF(e);
}
template<class T>inline T InputF() { T v; InputF(v); return v; }
struct InputV {
	int n, m;
	InputV(int N) :n(N), m(0) {}
	InputV(pair<int, int> N) :n(N.first), m(N.second) {}
	template<class T>operator vector<T>()noexcept {
		vector<T> v(n); InputF(v); return v;
	}
	template<class T>operator vector<vector<T>>()noexcept {
		vector<vector<T>> v(n, vector<T>(m)); InputF(v); return v;
	}
};
struct Input {
	template<class T>operator T()noexcept { return InputF<T>(); }
	int operator--(int) { int v; InputF(v); v--; return v; }
	InputV operator[](int n)noexcept { return InputV(n); }
	InputV operator[](pair<int, int> n)noexcept { return InputV(n); }
	void operator()() {}
	template<class H, class...T>void operator()(H&& h, T&& ...t) {
		InputF(h); operator()(forward<T>(t)...);
	}
	template<class T, size_t W>array<vector<T>, W> get(int H) {
		array<vector<T>, W> ret;
		rep(i, H)rep(j, W) { T x = *this; ret[j].push_back(x); }
		return ret;
	}
}in;
#define input(type) InputF<type>()

// --- output --- //
struct BoolStr {
	const char* t, * f; BoolStr(const char* _t, const char* _f) :t(_t), f(_f) {}
}Yes("Yes", "No"), yes("yes", "no"), YES("YES", "NO"), Int("1", "0");
struct DivStr {
	const char* d, * l; DivStr(const char* _d, const char* _l) :d(_d), l(_l) {}
}spc(" ", "\n"), no_spc("", "\n"), end_line("\n", "\n"), comma(",", "\n"), no_endl(" ", "");
class Output {
	BoolStr B{ Yes }; DivStr D{ spc }; bool isPrint = true;
	void p(double v) { printf("%.20f", v); } void p(long double v) { printf("%.20Lf", v); }
	void p(int v) { printf("%d", v); }	void p(LL v) { printf("%lld", v); }
	void p(char v) { putchar(v); }		void p(bool v) { printf("%s", v ? B.t : B.f); }
	template<class T>void p(const T& v) { cout << v; }
	template<class T, class U>void p(const pair<T, U>& v) { p(v.first); printf("%s", D.d); p(v.second); }
	template<class T>void p(const vector<T>& v) { rep(i, sz(v)) { if (i)printf("%s", D.d); p(v[i]); } }
	template<class T>void p(const vector<vector<T>>& v) { rep(i, sz(v)) { if (i)printf("%s", D.l); p(v[i]); } }
	void p(const BoolStr& v) { B = v; isPrint = false; } void p(const DivStr& v) { D = v; isPrint = false; }
public:
	void operator()() { printf("%s", D.l); }
	template<class H>void operator()(H&& h) {
		p(h); if (isPrint)printf("%s", D.l); isPrint = true;
	}
	template<class H, class...T>void operator()(H&& h, T&& ...t) {
		p(h); if (isPrint)printf("%s", D.d); isPrint = true; operator()(forward<T>(t)...);
	}
	template<class...T>void exit(T&& ...t) {
		operator()(forward<T>(t)...); std::exit(EXIT_SUCCESS);
	}
}out;

// --- dump --- //
#if __has_include("dump.hpp")
#include "dump.hpp"
#else
#define dump(...) (void(0))
#endif

template<class F>auto MakeVector(size_t size, F f) {
	vector<decay_t<result_of_t<F(size_t)>>> res(size);
	for (size_t i = 0; i < size; ++i)res[i] = f(i);
	return res;
}
template<class T>vector<T> Slice(const vector<T>& v, size_t i, size_t len) {
	return i < v.size() ? vector<T>(v.begin() + i, v.begin() + min(i + len, v.size())) : vector<T>();
}
template<class T, class F>void Each(T& v, F f) {
	for (auto& e : v)f(e);
}
template<class T, class F>auto Map(const vector<T>& v, F f) {
	vector<decay_t<result_of_t<F(T)>>> res(v.size());
	size_t i = 0; for (const auto& e : v)res[i++] = f(e);
	return res;
}
template<class T, class F>auto MapIndex(const vector<T>& v, F f) {
	vector<decay_t<result_of_t<F(size_t, T)>>> res(v.size());
	for (size_t i = 0; i < v.size(); ++i)res[i] = f(i, v[i]);
	return res;
}
template<class T, class F>vector<T> Select(const vector<T>& v, F f) {
	vector<T> res;
	for (const auto& e : v)if (f(e))res.push_back(e);
	return res;
}

// ---------------------------------------------------------------- //

int main() {
	VVI a = in[{3, 3}];
	VVB flag(3, VB(3));
	int n = in;
	rep(i, n) {
		int b = in;
		rep(j, 3)rep(k, 3)if (a[j][k] == b) {
			flag[j][k] = true;
		}
	}

	bool ans = false;
	rep(i, 3) {
		int cnt = 0;
		rep(j, 3)cnt += flag[i][j];
		if (cnt == 3)ans = true;
	}
	rep(j, 3) {
		int cnt = 0;
		rep(i, 3)cnt += flag[i][j];
		if (cnt == 3) {
			ans = true;
		}
	}

	if (flag[0][0] && flag[1][1] && flag[2][2]) {
		ans = true;
	}
	if (flag[0][2] && flag[1][1] && flag[2][0]) {
		ans = true;
	}
	out(ans);
}


#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <stack>
#include <set>
#include <bitset>
using namespace std;
#define fast_io ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()

typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

ll mpow(ll a, ll b){
  if(b==0) return 1;
  else if(b%2==0){ll memo = mpow(a,b/2); return memo*memo%MOD;}
  else return mpow(a,b-1) * a % MOD;
}
ll lpow(ll a, ll b){
  if(b==0) return 1;
  else if(b%2==0){ll memo = lpow(a,b/2); return memo*memo;}
  else return lpow(a,b-1) * a;
}
ll gcd(ll a, ll b){
  if(b==0) return a;
  else return gcd(b, a%b);
}
vector<ll> kaijo_memo;
ll kaijo(ll n){
  if(kaijo_memo.size() > n) return kaijo_memo[n];
  if(kaijo_memo.size() == 0) kaijo_memo.push_back(1);
  while(kaijo_memo.size() <= n) kaijo_memo.push_back(kaijo_memo[kaijo_memo.size()-1] * kaijo_memo.size() % MOD);
  return kaijo_memo[n];
}
vector<ll> gyaku_kaijo_memo;
ll gyaku_kaijo(ll n){
  if(gyaku_kaijo_memo.size() > n) return gyaku_kaijo_memo[n];
  if(gyaku_kaijo_memo.size() == 0) gyaku_kaijo_memo.push_back(1);
  while(gyaku_kaijo_memo.size() <= n) gyaku_kaijo_memo.push_back(gyaku_kaijo_memo[gyaku_kaijo_memo.size()-1] * mpow(gyaku_kaijo_memo.size(), MOD-2) % MOD);
  return gyaku_kaijo_memo[n];
}

ll nCr(ll n, ll r){
  if(n == r) return 1;//0個の丸と-1個の棒みたいな時に時に効く？不安.
  if(n < r || r < 0) return 0;
  ll ret = 1;
  if(n <= 1e7){
    ret *= kaijo(n); ret %= MOD;
    ret *= gyaku_kaijo(r); ret %= MOD;
    ret *= gyaku_kaijo(n-r); ret %= MOD;
  }else{
    rep(i,r){
      ret *= n-i; ret %= MOD;
      ret *= mpow(r-i, MOD-2); ret %= MOD;
    }
  }
  return ret;
}

int main(void){
  fast_io
  cout<<fixed<<setprecision(15);

  ll ans[3][3], memo[3][3];
  rep(i,3){
    rep(j,3){
      cin>>ans[i][j];
      memo[i][j] = 0;
    }
  }
  ll n;cin>>n;
  rep(i,n){
    ll b;cin>>b;
    rep(y,3){
      rep(x,3){
        if(ans[y][x] == b){
          memo[y][x] = 1;
        }
      }
    }
  }

  rep(i,3){
    if(memo[i][0] && memo[i][1] && memo[i][2]){
      cout<<"Yes"<<endl;
      return 0;
    }
    if(memo[0][i] && memo[1][i] && memo[2][i]){
      cout<<"Yes"<<endl;
      return 0;
    }
  }
  if(memo[0][0] && memo[1][1] && memo[2][2]){
    cout<<"Yes"<<endl;
    return 0;
  }
  if(memo[0][2] && memo[1][1] && memo[2][0]){
    cout<<"Yes"<<endl;
    return 0;
  }
  cout<<"No"<<endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

int A[3][3];
int N;
bool done[3][3];

int main() {
	REP(i, 3) REP(j, 3) cin >> A[i][j];
	cin >> N;
	REP(i, N) {
		int b;
		cin >> b;
		REP(j, N) REP(k, N) if (A[j][k] == b) done[j][k] = true;
	}

	bool ans = false;
	REP(i, 3) {
		bool cur = true;
		REP(j, 3) if (!done[i][j]) cur = false;
		ans |= cur;

		cur = true;
		REP(j, 3) if (!done[j][i]) cur = false;
		ans |= cur;
	}

	bool cur = true;
	REP(i, 3) {
		if (!done[i][i]) cur = false;
	}
	ans |= cur;

	cur = true;
	REP(i, 3) if (!done[i][2 - i]) cur = false;
	ans |= cur;

	puts([&] {
		return ans;
	}() ? "Yes": "No");

	return 0;
}


#include <bits/stdc++.h>

const int INF = 1e9;
const int MOD = 1e9 + 7;

using namespace std;

typedef long long ll;

#define REP(i, n) for (int i = 0; i < int(n); i++)
#define REPD(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < int(b); i++)
#define FORD(i, a, b) for (int i = b - 1; i >= int(a); i--)
#define WRAP(y, x, h, w) (0 <= y && y < h && 0 <= x && x < w)

#define ALL(x) (x).begin(), (x).end()

int dx[4] = { 1, 0, -1, 0 };
int dy[4] = { 0, 1, 0, -1 };

int main()
{
    int a[3][3];
    bool b[3][3];
    REP(i, 3)
    {
        REP(j, 3)
        {
            cin >> a[i][j];
            b[i][j] = false;
        }
    }

    int n;
    cin >> n;
    REP(k, n)
    {
        int c;
        cin >> c;
        REP(i, 3)
        REP(j, 3)
        if (a[i][j] == c) {
            b[i][j] = true;
        }
    }
    if((b[0][0]&&b[0][1]&&b[0][2])||
    (b[1][0]&&b[1][1]&&b[1][2])||
    (b[2][0]&&b[2][1]&&b[2][2])||
    (b[0][0]&&b[1][0]&&b[2][0])||
    (b[0][1]&&b[1][1]&&b[2][1])||
    (b[0][2]&&b[1][2]&&b[2][2])||
    (b[0][0]&&b[1][1]&&b[2][2])||
    (b[0][2]&&b[1][1]&&b[2][2]))
    cout<<"Yes"<<endl;
    else
    cout<<"No"<<endl;

}


#include <bits/stdc++.h>
using namespace std;
#define SZ(v) int((v).size())
#define ALL(vec) begin(vec), end(vec)
typedef long long i64;
template<typename T> inline bool uax(T &x, T y) {return (y > x) ? x = y, true : false;}
template<typename T> inline bool uin(T &x, T y) {return (y < x) ? x = y, true : false;}
template<typename T> void kek(T ans) {cout << ans << endl; exit(0);}
#define Luv(...) [&] (auto &&u, auto &&v) { return __VA_ARGS__; }
const int MOD = (int) 1e9 + 7;
const i64 INF = (i64) 1e18 + 42;

int solve(){
  int a[9];
  for(int i=0; i<9; i++){
    cin>>a[i];
  }
  int n; cin>>n;
  for(int i=0; i<n; i++){
    int x; cin>>x;
    for(int j=0; j<9; j++){
      if(a[j] == x){
        a[j]= -1;
        break;
      }
    }
  }
  for(int i=0; i<3; i++){
    if(a[i] + a[i+3] + a[i+6] == -3){
      return 2;
    }else if(a[i] + a[i+1] + a[i+2] == -3){
      return 2;
    }
  }
  if(a[0] + a[4] + a[8] == -3) return 2;
  if(a[2] + a[4] + a[6] == -3) return 2;

  return 1;

}

int main() {
  cin.tie(nullptr) -> sync_with_stdio(false);
  int s = solve();
  if(s == 1){
    cout<<"No";
  }else{
    cout<<"Yes";
  }
}


#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<(n);++i)
#define ll long long
const long long INF = 1LL<<60;
const long long mod = 1e9 + 7;
using Graph = vector<vector<int>>;

int main(){
    int A[3][3];
    bool Bingo = false;
    bool field[3][3];
    REP(i,3){
        REP(j,3) cin >> A[i][j];
    }
    int N;
    cin >> N;
    int b[N];
    REP(i,N) cin >> b[i];
    REP(i,3){
        REP(j,3){
            field[i][j] = false;
            REP(k,N){
                if(b[k] == A[i][j]) field[i][j] = true;
            }
        }
    }

    if(field[0][0]&&field[0][1]&&field[0][2]) Bingo = true;
    if(field[1][0]&&field[1][1]&&field[1][2]) Bingo = true;
    if(field[2][0]&&field[2][1]&&field[2][2]) Bingo = true;
    if(field[0][0]&&field[1][0]&&field[2][0]) Bingo = true;
    if(field[0][1]&&field[1][1]&&field[2][1]) Bingo = true;
    if(field[0][2]&&field[1][1]&&field[2][2]) Bingo = true;
    if(field[0][0]&&field[1][1]&&field[2][2]) Bingo = true;
    if(field[0][2]&&field[1][1]&&field[2][0]) Bingo = true;
    if(Bingo) cout << "Yes" << endl;
    else cout << "No" << endl;
}


#include <stdio.h>
int main(void){
	int i,j,N;
  	int A[3][3];
  	int c[3][3];
 	 	for(i=0;i<3;i++)
  		for(j=0;j<3;j++)
          c[i][j]=0;
  scanf("%d %d %d",&A[0][0],&A[0][1],&A[0][2]);
  scanf("%d %d %d",&A[1][0],&A[1][1],&A[1][2]);
  scanf("%d %d %d",&A[2][0],&A[2][1],&A[2][2]);
  scanf("%d",&N);
  int num[N];
  for(i=0;i<N;i++){
  	scanf("%d",&num[i]);
  }
  for(int k=0;k<N;k++){
  	for(i=0;i<3;i++){
  		for(j=0;j<3;j++){
  			if(c[i][j]==0 && A[i][j]==num[k]){
            	c[i][j]=1;
            }
  		}
  		}
    if(c[0][0]==1&&c[0][1]==1&&c[0][2]==1){
    	printf("Yes");
      return 0;
    }
        if(c[1][0]==1&&c[1][1]==1&&c[1][2]==1){
    	printf("Yes");
          return 0;
    }    if(c[2][0]==1&&c[2][1]==1&&c[2][2]==1){
    	printf("Yes");
          return 0;
    }    if(c[0][0]==1&&c[1][0]==1&&c[2][0]==1){
    	printf("Yes");
          return 0;
    }    if(c[0][1]==1&&c[1][1]==1&&c[2][1]==1){
    	printf("Yes");
          return 0;
    }    if(c[0][2]==1&&c[1][2]==1&&c[2][2]==1){
    	printf("Yes");
          return 0;
    }    if(c[0][0]==1&&c[1][1]==1&&c[2][2]==1){
    	printf("Yes");
          return 0;
    }if(c[0][2]==1&&c[1][1]==1&&c[2][0]==1){
    	printf("Yes");
          return 0;
    }
  }
  printf("No");
  return 0;
}


#include <stdio.h>

int main(void)
{
	int a[3][3];
	int b, n;
	int i, j, k;

	/* ビンゴカードに数字を書く */
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 3; j++)
		{
			scanf("%d", &a[i][j]);
		}
	}

	/* n個の数を選ぶ */
	scanf("%d", &n);

	for (k = 0; k < n; k++)
	{
		scanf("%d", &b);
		/* 選ばれた数に印を付ける */
		for (i = 0; i < 3; i++)
		{
			for (j = 0; j < 3; j++)
			{
				if (b == a[i][j]) {
					a[i][j] = -1;
				}
			}
		}
	}

	/* 横列のビンゴを確認する */
	for (i = 0; i < 3; i++)
	{
		if (a[i][0] == a[i][1] && a[i][1] == a[i][2])
		{
			printf("Yes\n");
			return 0;
		}
	}

	/* 縦列のビンゴを確認する */
	for (i = 0; i < 3; i++)
	{
		if (a[0][i] == a[1][i] && a[1][i] == a[2][i])
		{
			printf("Yes\n");
			return 0;
		}
	}

	/* 斜めのビンゴを2通り確認する */
	if (a[0][0] == a[1][1] && a[1][1] == a[2][2])
	{
		printf("Yes\n");
		return 0;
	}

	if (a[0][2] == a[1][1] && a[1][1] == a[2][0])
	{
		printf("Yes\n");
		return 0;
	}

	printf("No\n");

	return 0;
}


#include<stdio.h>
int main()
{
  int N[3][3];
  int B[3][3];
  int nb, n;
  int i, j, k;
  i = 0;
  j = 0;
  while (j < 3)
  {
  	k = 0;
  	while (k < 3)
  	{
      B[j][k] = 0;
      k++;
     }
     j++;
  }
  while (i < 3)
  {
    scanf("%d %d %d", &N[i][0], &N[i][1], &N[i][2]);
    i++;
  }
  scanf("%d", &nb);
  i = 0;
  while (i < nb)
  {
    scanf("%d", &n);
    j = 0;
    while (j < 3)
    {
      k = 0;
      while (k < 3)
      {
        if (n == N[j][k])
        {
          B[j][k] = 1;
        }
        k++;
      }
      j++;
    }
    i++;
  }
  //行
  i = 0;
  while (i < 3)
  {
    if (B[i][0] + B[i][1] + B[i][2] == 3)
    {
      printf("Yes");
      return (0);
    }
    i++;
  }
  //列
  i = 0;
  while (i < 3)
  {
    if (B[0][i] + B[1][i] + B[2][i] == 3)
    {
      printf("Yes");
      return (0);
    }
    i++;
  }
  //斜め
  if (B[0][0] + B[1][1] + B[2][2] == 3)
    {
      printf("Yes");
      return (0);
    }
  else if (B[2][0] + B[1][1] + B[0][2] == 3)
    {
      printf("Yes");
      return (0);
    }
  printf("No");
  return (0);
}


#include <stdio.h>

int main(void){

  int a[3][3];
  int ans[3][3];
  int n;
  int b[105];

  for(int i=0;i<3;i++){
    scanf("%d %d %d", &a[i][0], &a[i][1], &a[i][2]);
  }
  scanf("%d", &n);

  for(int i=0;i<n;i++){
    scanf("%d", &b[i]);
  }

  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      ans[i][j]=0;
      for(int k=0;k<n;k++){
        if(a[i][j]==b[k]){
          ans[i][j]=1;
        }
      }
    }
  }

  int hantei=0;

  for(int i=0;i<3;i++){
    if(ans[i][0]==1&&ans[i][1]==1&&ans[i][2]==1){
      hantei =1;
    }
    else if(ans[0][i]==1&&ans[1][i]==1&&ans[2][i]==1){
      hantei =1;
    }
  }
   if(ans[0][0]==1&&ans[1][1]==1&&ans[2][2]==1){
      hantei =1;
     //return 0;
    }
  if(hantei==1){
  printf("Yes\n");
  }
  else{
    printf("No\n");
  }
  return 0;
}


#include <stdio.h>

int main(void){

  int a[3][3];
  int ans[3][3];
  int n;
  int b[15];

  for(int i=0;i<3;i++){
    scanf("%d %d %d", &a[i][0], &a[i][1], &a[i][2]);
  }
  scanf("%d", &n);

  for(int i=0;i<n;i++){
    scanf("%d", &b[i]);
  }
  /*
    for(int j=0;j<n;j++){
      ans[i][j]=0;
      for(int k=0;k<n;k++){
        if(a[i][j]==b[k]){
          ans[i][j]=1;
        }
      }
    }
  }
*/

  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      ans[i][j]=0;
      for(int k=0;k<n;k++){
        if(a[i][j]==b[k]){
          ans[i][j]=1;
        }
      }
    }
  }

  int hantei=0;

  for(int i=0;i<3;i++){
    if(ans[i][0]==1&&ans[i][1]==1&&ans[i][2]==1){
      hantei =1;
    }
    else if(ans[0][i]==1&&ans[1][i]==1&&ans[2][i]==1){
      hantei =1;
    }
  }
   if(ans[0][0]==1&&ans[1][1]==1&&ans[2][2]==1){
      hantei =1;
     //return 0;
    }
  if(hantei==1){
  printf("Yes\n");
  }
  else{
    printf("No\n");
  }
  return 0;
}


#include <stdio.h>

int main(void){

  int a[3][3];
  int ans[3][3];
  int n;
  int b[15];

  for(int i=0;i<3;i++){
    scanf("%d %d %d", &a[i][0], &a[i][1], &a[i][2]);
  }
  scanf("%d", &n);

  for(int i=0;i<n;i++){
    scanf("%d", &b[i]);
  }

  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      ans[i][j]=0;
      for(int k=0;k<n;k++){
        if(a[i][j]==b[k]){
          ans[i][j]=1;
        }
      }
    }
  }

  int hantei=0;

  for(int i=0;i<3;i++){
    if(ans[i][0]==1&&ans[i][1]==1&&ans[i][2]==1){
      hantei =1;
    }
    else if(ans[0][i]==1&&ans[1][i]==1&&ans[2][i]==1){
      hantei =1;
    }
  }
   if(ans[0][0]==1&&ans[1][1]==1&&ans[2][2]==1){
      hantei =1;
     //return 0;
    }
  if(hantei==1){
  printf("Yes\n");
  }
  else{
    printf("No\n");
  }
  return 0;
}


function Main(input){
	input = input.split("\n");
	var bin_arr = [];
	for(var i = 0;i<3;i++){
		var temp = input[i].split(" ");
		for(var j = 0;j<3;j++)bin_arr[i*3+j] = parseInt(temp[j],10);
	}
	var N = parseInt(input[3],10);
	var b =[];
	for(var i = 0;i<N;i++)b.push(parseInt(input[i+4],10));
	for(var i= 0;i<9;i++){
		for(var j = 0;j<N;j++){
			if(bin_arr[i] === b[j])bin_arr[i] = 0;
		}
	}
	var result = false;
	for(var i= 0; i<7;i++){
		switch(i){
			case 0:
			if(bin_arr[i] == bin_arr[i+1] && bin_arr[i] == bin_arr[i+2]){
				result = true;
			}else if(bin_arr[i] == bin_arr[i+4] && bin_arr[i] == bin_arr[i+8]){
				result = true;
			}else if(bin_arr[i] == bin_arr[i+3] && bin_arr[i] ==bin_arr[i + 6]){
				result = true;
			}
			break;
			case 1:
			if(bin_arr[i] == bin_arr[i+3] && bin_arr[i]== bin_arr[i+6])result = true;
			break;
			case 2:
			if(bin_arr[i] == bin_arr[i+2] && bin_arr[i] == bin_arr[i+4]){
				result = true;
			}else if(bin_arr[i] == bin_arr[i+3] && bin_arr[i]== bin_arr[i+6]){
				result = true;
			}
			break;
			case 3:
			if(bin_arr[i] == bin_arr[i+1] && bin_arr[i] == bin_arr[i+2])result = true;
			break;
			case 6:
			if(bin_arr[i] == bin_arr[i+1] && bin_arr[i] == bin_arr[i+2])result = true;
			break;
		}//switch
	}
	console.log(result ? "Yes":"No");
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));


(function Main(input){
	var input = input.split('\n'),
		bingo = input.slice(0,3).join(' ').split(' ');

	input.splice(0, 4);

	for(var i=input.length; i--;){
		for(var j=bingo.length; j--;){
			if(input[i] === bingo[j]){
				bingo[j] = 'bingo';
				break;
			}
		}
	}

	function check(){
		if(bingo[0] == 'bingo' && bingo[1] == 'bingo' && bingo[2] == 'bingo'){ return true; }
		if(bingo[3] == 'bingo' && bingo[4] == 'bingo' && bingo[5] == 'bingo'){ return true; }
		if(bingo[6] == 'bingo' && bingo[7] == 'bingo' && bingo[8] == 'bingo'){ return true; }
		if(bingo[0] == 'bingo' && bingo[3] == 'bingo' && bingo[6] == 'bingo'){ return true; }
		if(bingo[1] == 'bingo' && bingo[4] == 'bingo' && bingo[7] == 'bingo'){ return true; }
		if(bingo[2] == 'bingo' && bingo[5] == 'bingo' && bingo[8] == 'bingo'){ return true; }
		if(bingo[0] == 'bingo' && bingo[4] == 'bingo' && bingo[8] == 'bingo'){ return true; }
		if(bingo[2] == 'bingo' && bingo[4] == 'bingo' && bingo[6] == 'bingo'){ return true; }
		return false;
	}

	console.log(check() ? 'Yes': 'No');

})(require("fs").readFileSync("/dev/stdin","utf8"));


function Main(input) {
    var A1 = input.slice(0, 3).map(a => parseInt(a, 10));
    var A2 = input.slice(3, 6).map(a => parseInt(a, 10));
    var A3 = input.slice(6, 9).map(a => parseInt(a, 10));
    var N = parseInt(input[9], 10);
    var b = input.slice(10).map(a => parseInt(a, 10));

    for (var i = 0; i < N; i++) {
        for (var j = 0; j < 3; j++) {
            if (A1[j] === b[i]) {
                A1[j] = 0;
            }
        }
        for (var j = 0; j < 3; j++) {
            if (A2[j] === b[i]) {
                A2[j] = 0;
            }
        }
        for (var j = 0; j < 3; j++) {
            if (A3[j] === b[i]) {
                A3[j] = 0;
            }
        }
    }

    for (var i = 0; i < 3; i++) {
        if (A1[i] === 0 && A2[i] === 0 && A3[i] === 0) {
            return console.log('Yes');
        }
    }
    if (A1[0] === 0 && A1[1] === 0 && A1[2] === 0) {
        return console.log('Yes');
    }
    if (A2[0] === 0 && A2[1] === 0 && A2[2] === 0) {
        return console.log('Yes');
    }
    if (A3[0] === 0 && A3[1] === 0 && A3[2] === 0) {
        return console.log('Yes');
    }
    if (A1[0] === 0 && A2[1] === 0 && A3[2] === 0) {
        return console.log('Yes');
    }
    if (A1[2] === 0 && A2[1] === 0 && A3[0] === 0) {
        return console.log('Yes');
    }
    return console.log('No');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));


const input = require("fs").readFileSync("/dev/stdin", "utf8")
const lines = input.split('\n')

const A = []
A.push(...lines[0].split(' ').map(Number))
A.push(...lines[1].split(' ').map(Number))
A.push(...lines[2].split(' ').map(Number))

const N = lines[3] - 0
const b = []
for (let i = 0; i < N; i++) {
  b[i] = lines[i + 4] - 0
}

for (let i = 0; i < N; i++) {
  for (let j = 0; j < A.length; j++) {
    if (A[j] === b[i]) {
      A[j] = 'b'
    }
  }
}

let ans = 'No'
if (A[0] === 'b' && A[4] === 'b' && A[8] === 'b') {
  ans = 'Yes'
} else if (A[2] === 'b' && A[4] === 'b' && A[6] === 'b') {
  ans = 'Yes'
} else if (A[0] === 'b' && A[1] === 'b' && A[2] === 'b') {
  ans = 'Yes'
} else if (A[3] === 'b' && A[4] === 'b' && A[5] === 'b') {
  ans = 'Yes'
} else if (A[6] === 'b' && A[7] === 'b' && A[8] === 'b') {
  ans = 'Yes'
} else if (A[0] === 'b' && A[3] === 'b' && A[6] === 'b') {
  ans = 'Yes'
} else if (A[1] === 'b' && A[4] === 'b' && A[7] === 'b') {
  ans = 'Yes'
} else if (A[2] === 'b' && A[6] === 'b' && A[8] === 'b') {
  ans = 'Yes'
}
console.log(ans)


"use strict";

const main = arg => {
    const input = arg.trim().split("\n");
    let card = []
    for(let i = 0; i<3; i++){
        let tmp = input[i].split(" ").map(el => parseInt(el))
        card.push(tmp)
    }
    const N = parseInt(input[3]);
    let nums = []
    for(let i = 4; i<3+1+N;i++){
        let b = parseInt(input[i])
        for(let i = 0; i<3; i++){
            for(let j=0; j<3; j++){
                if(card[i][j] == b) card[i][j] = true
            }
        }
    }
    // raw
    for(let j = 0;j<3;j++){
        let r0 = true
        let r1 = true
        let r2 = true
        r0 = r0 && (card[0][j] == true)
        r1 = r1 && (card[1][j] == true)
        r2 = r2 && (card[2][j] == true)
        if(r0||r1||r2){
            console.log('Yes')
            return
        }
    }
    // column
    for(let i = 0;i<3;i++){
        let c0 = true
        let c1 = true
        let c2 = true
        c0 = c0 && (card[i][0] == true)
        c1 = c1 && (card[i][1] == true)
        c2 = c2 && (card[i][2] == true)
        if(c0||c1||c2){
            console.log('Yes')
            return
        }
    }
    // cross
    if(card[0][0] == true && card[1][1] == true && card[2][2] == true){
        console.log("Yes")
        return
    }
    if(card[2][0] == true && card[1][1] == true && card[0][2] == true){
        console.log("Yes")
        return
    }
    console.log("No")
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


'use strict';
function main(input) {
  const arr = input.trim().split('\n');
  const head = arr[0].split(' ').map(x => Number(x));
  const body = arr[1].split(' ').map(x => Number(x));
  const foot = arr[2].split(' ').map(x => Number(x));
  const n = arr[3];
  const num = [];
  let isBingo = false;

  for (let i = 0; i < n; i ++) {
    num[i] = arr[i + 4];
    for (let j = 0; j < a.length; j ++) {
      if (head[j] === num[i]) {
        head[j] = 0;
      }
      if (body[j] === num[i]) {
        body[j] = 0;
      }
      if (foot[j] === num[i]) {
        foot[j] = 0;
      }

    }
  }

  lowBingo(head);
  lowBingo(body);
  lowBingo(foot);

  rowBingo();

  console.log(isBingo ? 'Yes' : 'No');
}

function lowBingo(low) { //横の検証
  if (low[0] === 0 && low[1] === 0 && low[2] === 0) {
    return isBingo = true;
  }
}

function rowBingo() {
  for (let i = 0; i < head.length; i ++) {
    if (head[i] === 0 && body[i] === 0 && foot[i] === 0) {
      return isBingo = true;
    }
  }
  if ((body[1] === 0) &&
      ((head[0] === 0 && foot[2] === 0 )||
      (head[2] === 0 && foot[0] === 0))) {
    return isBingo = true;
  }
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import (
	"bufio"
	"fmt"
	"io"
	"log"
	"os"
	"strconv"
)

func bingo(a []int) bool {
	for i := range a {
		if a[i] != -1 {
			return false
		}
	}
	return true
}

func main() {
	a := make([]int, 9)
	for i := range a {
		a[i] = readInt()
	}

	n := readInt()
	b := make(map[int]bool)
	for i := 0; i < n; i++ {
		b[readInt()] = true
	}

	for i := range a {
		if b[a[i]] {
			a[i] = -1
		}
	}

	if bingo(a[0:3]) || bingo(a[3:6]) || bingo(a[6:9]) ||
		bingo([]int{a[0], a[3], a[6]}) || bingo([]int{a[1], a[4], a[7]}) || bingo([]int{a[2], a[5], a[8]}) ||
		bingo([]int{a[0], a[4], a[8]}) || bingo([]int{a[2], a[4], a[6]}) {
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")
}

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	log.SetFlags(log.Lshortfile)
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readInt() int {
	return int(readInt64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}