jiahuimbzuai/CoQuIR huggingface dataset:
//  [cpp]
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで
// g++ hoge.cpp -std=c++17 -I . でコンパイルできる
// -fsanitize=undefinedでオーバーフロー検出
#include <bits/stdc++.h>
//#include <atcoder/all>
#define mod 1000000007
#define INF LLONG_MAX
#define ll int
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
//using namespace atcoder;
typedef pair<ll,ll> P;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};


int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);

    ll a,b,c,d,m,n,k,x,y,maxi=0,f=0,sum=0;
    string str2,str1;
    int hoge=0;
    cin>>n>>m;
    string s1[n];
    string s2[m];
    rep(i,n) cin>>s1[i];
    rep(i,m) cin>>s2[i];
    for(ll i=0;i<n-m;i++){
        for(ll j=0;j<n-m;j++){
            f=0;
            for(ll k=0;k<m;k++){
                for(ll l=0;l<m;l++){
                    if(s1[i+k][j+l]!=s2[k][l])f=1;
                }
            }
            if(!f){
                Yes;
                return 0;
            }
        }
    }
No;


    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main()
{
	int i, N, M;
	char A[52][52] = {}, B[52][52] = {};
	scanf("%d %d", &N, &M);
	for (i = 1; i <= N; i++) scanf("%s", &(A[i][1]));
	for (i = 1; i <= M; i++) scanf("%s", &(B[i][1]));
	
	int j, k, l, flag = 0;
	for (i = 0; i <= N - M; i++) {
		for (j = 0; j <= N - M; j++) {
			for (k = 1; k <= M; k++) {
				for (l = 1; l <= M; l++) {
					if (A[i+k][j+l] != B[k][l]) break;
				}
				if (l <= M) break;
			}
			if (k > M) flag = 1;
		}
	}
	
	if (flag == 1) printf("Yes\n");
	else printf("No\n");
	fflush(stdout);
	return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
typedef const void cv;
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define per(i,n) for((i)=(n)-1;(i)>=0;(i)--)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1;if(n<r) return 0;rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define nHr(n,r) nCr((int)((n)+(r)+1),(int)(r))
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1){
            res *= a; if(mod>=1) res %= mod;
        }
        a *= a; if(mod>=1) a %= mod;
        n >>= 1;
    }
    return res;
}
void initialize(){
    
}
int main(void){
  initialize();
  ll n,m,i,j,x,y,result=0,ng=0;
  char a[100][100],b[100][100];
  
  scanf("%lld %lld",&n,&m);
  rep(i,n) scanf("%s",a[i]);
  rep(i,m) scanf("%s",b[i]);
  
  rep(x,n-m+1){
    rep(y,n-m+1){
      ng=0;
      rep(i,m){
        rep(j,m){
          if(a[y+j][x+i]!=b[j][i]){
            ng=1;
            break;
          }
        }
        if(ng==1) break;
      }
      if(ng==0){
        result=1;
        break;
      }
    }
    if(result==1) break;
  }
  if(result==1) printf("Yes\n");
  else printf("No\n");
  return 0;
}
//  [c]
#include <stdio.h>

int main(void){

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

  int match = 0;
  int flag;
  for (int i = 0; i < n-m+1; i++) {
    for (int j = 0; j < n-m+1; j++) {
      flag = 0;
      for (int row = 0; row < m; row++) {
        for (int column = 0; column < m; column++) {
          if (a[i+row][j+column] != b[row][column]) {
            flag = 1;
            break;
          }
        }
        if (flag == 1) {
          break;
        }
      }
      if (flag == 0) {
        match = 1;
      }
      if (match == 1) {
        break;
      }
    }
    if (match == 1) {
      break;
    }
  }
  if (match == 1) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}
//  [c]
#include<stdio.h>

int main(){
    int n,m;
    scanf("%d%d",&n,&m);

    int a[n][n],b[m][m];
    for(int i=0;i<n;i++){
        char temp[n];
        scanf("%s",temp);
        for(int j=0;j<n;j++){
            if(temp[j]=='#'){
                a[i][j]=0;
            }else{
                a[i][j]=1;
            }
        }
    }
    for(int i=0;i<m;i++){
        char temp[n];
        scanf("%s",temp);
        for(int j=0;j<m;j++){
            if(temp[j]=='#'){
                b[i][j]=0;
            }else{
                b[i][j]=1;
            }
        }
    }

    int judge;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(a[i][j]==b[0][0]){
                judge=0;
                for(int k=0;k<m;k++){
                    for(int l=0;l<m;l++){
                        if(a[i+k][j+l]!=b[k][l]){
                            judge++;
                        }
                    }
                }
                if(judge==0){
                    break;
                }
            }
        }
        if(judge==0){
            break;
        }
    }

    if(judge==0){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

    int N, M;

    scanf("%d%d", &N, &M);

    char A[N][N+1], B[M][M+1];

    for(int i = 0; i < N; i++){
        scanf("%s", A[i]);
    }
    for(int i = 0; i < M; i++){
        scanf("%s", B[i]);
    }

    int t = 0;

    for(int i = 0; i <= N-M; i++){
        if(t == 1){
            break;
        }
        for(int j = 0; j <= N-M; j++){
            if(t == 1){
                break;
            }
            for(int k = 0; k < M; k++){
                if(t == 1){
                    break;
                }
                int f = 0;
                for(int l = 0; l < M; l++){
                    if(B[k][l] != A[i+k][j+l]){
                        f = 1;
                        break;
                    }
                }
                if(f == 0){
                    t = 1;
                }
            }
        }
    }

    if(t == 1){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    

    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
int main(void){
    int N, M, b_fase=0;
    char A[50][50], B[50][50];
    scanf("%d%d", &N, &M);
    for (int i=0; i<N; i++) scanf("%s", A[i]);
    for (int i=0; i<M; i++) scanf("%s", B[i]);

    for(int i=0; i<N; i++){
        for(int j=0; j<=N-M; j++){
            if(strcmp(A[i]+j, B[0])==0){
                for(int k=0; k<M; k++){
                    if(strcmp(A[i+k]+j, B[k])!=0) break;
                    if(k==M-1){
                        printf("Yes");
                        return 0;
                    }
                }
            }
        }
    }
    printf("No");
    return 0;
}
//  [javascript]
'use strict'
function main(input) {
  input = input.trim().split('\n')
  let size = input.shift().split(' ').map(val => Number(val))
  let sizeDiff = size[0] - size[1]
  let N = []
  let M = []
  let result = 0

  for (let i = 0; i < size[0]; i++) {
    N.push(input.shift())
  }
  for (let i = 0; i < size[1]; i++) {
    M.push(input.shift())
  }

  for (let i = 0; i <= sizeDiff; i++) {
    while (result !== -1) {
      result = N[i].indexOf(M[0], result)
      if (result !== -1) {
        let check = true
        for (let j = 1; j < size[1]; j++) {
          if (check) {
            check = N[i+j].indexOf(M[j], result) === result
          }
        }
        if (check) {
          console.log('Yes')
          return
        }
      }
      if (result !== -1) result++
    }
    result = 0
  }
  console.log('No')
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";var n=r(1);r(2)(n.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,r){"use strict";var n=r(3),i=r(5);t.exports=function(t){var e=new n(t);i(e)}},function(t,e,r){"use strict";var n=r(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new n(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,r){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,r){"use strict";t.exports=function(t){for(var e=t.in(),r=t.in(),n=new Array(e),i=0;i<e;i++)n[i]=t.inr();for(var o=new Array(r),s=0;s<r;s++)o[s]=t.inr();for(var u=0;u<e-r+1;u++)for(var c=0;c<e-r+1;c++){for(var f=!0,a=0;a<r;a++){for(var l=0;l<r;l++)if(o[a][l]!=n[u+a][c+l]){f=!1;break}if(!f)break}if(f)return void console.log("Yes")}console.log("No")}}]);
//  [javascript]
'use strict';
const input = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');
const info = input.splice('\n');
const N = info[0].split(' ')[0];
const M = info[0].split(' ')[1];
const As = info.splice(1 , N);
const Bs = info.splice(1 , M);
let isMatch = "";

// 4重for文でぶん回していく
for(let ax = 0; ax < N - M + 1; ax++){
  for(let ay = 0; ay < N - M + 1; ay++){
    // マッチするかのフラグを用意
    isMatch = true;
   	// ループぬけ用のラベル
    // labelは繰り返しの手前につけないといけないらしい
    loopReset:
    // 小さい方の四角形の1つずつ吟味するfor文
    for(let bx = 0; bx < M; bx++){
	  for(let by = 0; by < M; by++){
        if(As[ax + bx][ay + by] == Bs[bx][by]){
        	continue;
        } else {
        	isMatch = false;
            break loopReset;
        }
      }
    }
    if(isMatch){
    	console.log("Yes");
      	return;
    }
  }
}
console.log("No");
//  [javascript]
function main(input) {
  const args = input.split('\n');
  let ans = 'No';
  const ary1 = args[0].split(' ').map(n => parseInt(n, 10));
  const A = ary1[0];
  const B = ary1[1];
  const loop = (A >= B) ? B : A; //横回しで使う
  let aryA = [];
  let aryB = [];
  
  //必要文字のみの配列作成
  for (let i = 1; i <= A; i++) {
    aryA.push(args[i].split('').slice(0, loop));
  }
  
  for (let i = 1; i <= loop; i++) {
    aryB.push(args[A + i].split(''));
  }
  
  //重複削除
  let aryUA = uniqueAry(aryA);
  let aryUB = uniqueAry(aryB);
  
  //一致するか確認
  for (let i = 0; i < aryUB.length; i++) {
    for (let j = 0; j < aryUA.length; j++) {
      for(let k = 0; k < loop; k++) {
        if (aryUB[i][k] === aryUA[j][k]) {
          ans = 'Yes';
        }
      }
    }
  }
  
  console.log(ans);
}

function uniqueAry(ary) {
  unique_ary = ary.filter((e, index) => {
    return !ary.some((e2, index2) => {
      return index > index2 && e[0] == e2[0] && e[1] == e2[1];
    });
  });
  return unique_ary;
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(input) {
  const args = input.split('\n');
  let ans = 'Yes';
  const ary1 = args[0].split(' ').map(n => parseInt(n, 10));
  const A = ary1[0];
  const B = ary1[1];
  const loop = (A >= B) ? B : A;
  
  //小さい方で回す
  for (let i = 1; i <= (loop); i++) {
    aryA = args[i].split(''); //A
    aryB = args[i + A].split(''); //B
    
    for(let j = 0; j <= (loop - 1); j++) {
      if (aryA[j] !== aryB[j]) ans = 'No';
    }
  }
  
  console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
!function(t){var r={};function n(e){if(r[e])return r[e].exports;var o=r[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=r,n.d=function(t,r,e){n.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:e})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,r){if(1&r&&(t=n(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)n.d(e,o,function(r){return t[r]}.bind(null,o));return e},n.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(r,"a",r),r},n.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},n.p="",n(n.s=0)}([function(t,r,n){"use strict";function e(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],e=!0,o=!1,i=void 0;try{for(var u,l=t[Symbol.iterator]();!(e=(u=l.next()).done)&&(n.push(u.value),!r||n.length!==r);e=!0);}catch(t){o=!0,i=t}finally{try{e||null==l.return||l.return()}finally{if(o)throw i}}return n}(t,r)||function(t,r){if(!t)return;if("string"==typeof t)return o(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,r)}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function i(t){var r=t.split("\n");""==r[r.length-1]&&r.pop(),this.l=r,this.y=0}i.prototype.ints=function(){return this.l[this.y++].split(" ").map((function(t){return+t}))},i.prototype.intv=function(){var t=this.y;return this.y=this.l.length,this.l.slice(t).map((function(t){return+t}))},i.prototype.strv=function(){var t=this.y;return this.y=this.l.length,this.l.slice(t)},i.prototype.strn=function(t){var r=this.y;return this.y+=t,this.l.slice(r,r+t)};var u=new i(n(1).readFileSync("/dev/stdin","utf8"));!function(){var t,r,n=e(u.ints(),2);t=n[0],r=n[1];for(var o=u.strn(t),i=u.strn(r),l=0;l<t-r;++l)for(var f=0;f<t-r;++f){for(var a=!0,c=0;c<r&&a;c++)for(var s=0;s<r&&a;s++)a=a&&o[l+c][f+s]==i[c][s];if(a)return console.log("Yes"),0}console.log("No")}()},function(t,r){t.exports=require("fs")}]);
//  [go]
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 1
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	m := getNextInt(scanner)

	a := make([]string, n)
	b := make([]string, m)
	for i := 0; i < n; i++ {
		a[i] = getNextString(scanner)
	}
	for i := 0; i < m; i++ {
		b[i] = getNextString(scanner)
	}
	for i := 0; i+m <= n; i++ {
		for j := 0; j+m <= n; j++ {
			if equal(i, j, a, b) {
				fmt.Fprintln(writer, "Yes")
				return
			}
		}
	}

	fmt.Fprintln(writer, "No")
}

func equal(i, j int, a, b []string) bool {
	m := len(b)
	for k := 0; k < m; k++ {
		for l := 0; l < m; l++ {
			if a[i+k][j+l] != b[k][l] {
				return false
			}
		}
	}
	return true
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	iv, _ := strconv.Atoi(scanString())
	return iv
}

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

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 100001), 100001*100)
}

func main() {
	n, m := scanInt(), scanInt()
	a := make([]string, n)
	for i := range a {
		a[i] = scanString()
	}
	b := make([]string, m)
	for i := range b {
		b[i] = scanString()
	}

	for ai := 0; ai < n-m+1; ai++ {
		for aj := 0; aj < n-m+1; aj++ {
		L:
			for bi := 0; bi < m; bi++ {
				for bj := 0; bj < m; bj++ {
					if a[ai+bi][aj+bj] != b[bi][bj] {
						break L
					}
					if bi == m-1 && bj == m-1 {
						fmt.Println("Yes")
						return
					}
				}
			}
		}
	}
	fmt.Println("No")
}
//  [go]
package main

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

var sc = bufio.NewScanner((os.Stdin))

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

func nextInt() int {
	l := nextLine()
	i, e := strconv.Atoi(l)
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	N, M, A, B := nextInt(), nextInt(), []string{}, []string{}

	for i := 0; i < N; i++ {
		A = append(A, nextLine())
	}
	for i := 0; i < M; i++ {
		B = append(B, nextLine())
	}

	fmt.Printf("%s\n", ABC054B(A, B))
}

// ABC054B ...
func ABC054B(A, B []string) string {
	for i := 0; i < len(A)-len(B); i++ {
		for j := 0; j < len(A[i])-len(B); j++ {
			if A[i][j:j+len(B)] == B[0] {
				if checkUnderRect(A, B, i, j) {
					return "Yes"
				}
			}
		}
	}

	return "No"
}

func checkUnderRect(A, B []string, i, j int) bool {
	for k := 1; k < len(B); k++ {
		ak := k + i
		if A[ak][j:j+len(B)] != B[k] {
			return false
		}
	}

	return true
}
//  [go]
package main

import "fmt"

func main() {
	// Code for B - Template Matching
	var N, M int
	fmt.Scanf("%d %d", &N, &M)

	A := make([]string, N)
	B := make([]string, M)

	for i := 0; i < N; i++ {
		fmt.Scanf("%s", &A[i])
	}

	for i := 0; i < M; i++ {
		fmt.Scanf("%s", &B[i])
	}

	var flag1, flag2 int
	for i := 0; i < (N - M + 1); i++ {
		for j := 0; j < (N - M + 1); j++ {
			flag1 = 0
			for k := 1; k <= M; k++ {
				if A[i][j:j+k] != B[0][0:k] {
					flag1 = 1
				}
			}
			if flag1 == 0 {
				flag2 = 1
				break
			}
		}
	}

	if flag2 == 0 {
		fmt.Println("No")
	} else {
		fmt.Println("Yes")
	}
}
//  [go]
// やるだけだがこれ緑difなんすね
package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	N, M := nextInt(), nextInt()
	A, T := make([][]string, N), make([][]string, M)
	for i := 0; i < N; i++ {
		A[i] = chars(next())
	}
	for i := 0; i < M; i++ {
		T[i] = chars(next())
	}
	for i := 0; i < N-M; i++ {
		for j := 0; j < N-M; j++ {
			flag := true
			for y := 0; y < M; y++ {
				for x := 0; x < M; x++ {
					if A[i+y][j+x] != T[y][x] {
						flag = false
					}
				}
			}
			if flag {
				fmt.Fprintln(out, "Yes")
				return
			}
		}
	}
	fmt.Fprintln(out, "No")
}

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

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}
//  [ruby]
n,m=gets.split.map(&:to_i)
N=[]
n.times{N<<gets.chomp}
m.times{|i|!N[i].index(gets.chomp)?(puts :No;exit):m+=1}
puts:Yes
//  [ruby]
# frozen_string_literal: true

def select_index(str, substr)
  i = 0
  indexs = []
  loop do
    index = str.index(substr, i)
    return indexs unless index

    indexs << index
    i = index + 1
  end

  indexs
end

n, m = gets.split(' ').map!(&:to_i)

a = []
b = []
n.times { a << gets.chomp! }
m.times { b << gets.chomp! }

ans = 'No'

first_line = b.shift
a.each.with_index do |a_s, i|
  select_index(a_s, first_line).each do |index|
    match = true
    b.each.with_index(1) do |b_s, j|
      if a[i + j].nil? || b_s != a[i + j].slice(index, m)
        match = false
        break
      end
    end
    if match
      ans = 'Yes'
      break
    end
  end
  break if ans == 'Yes'
end

puts ans
//  [ruby]
n,m=gets.split.map(&:to_i);N=[]
n.times{N<<gets.chomp}
m.times{|i|!N[i].index(gets.chomp)?(puts :No;exit):m}
puts:Yes
//  [ruby]
nm = gets.chomp.split
n = nm[0].to_i
m = nm[1].to_i

a = []
n.times do
    a << gets.chomp
end

b = []
m.times do
    b << gets.chomp
end

result = false
n.times do |i|
    result = false
    if a[i].include?(b[0])
        result = true
        first = 0
        n.times do |j|
            if a[i].slice(j, m) == b[0]
                first = j
            end
        end

        (m - 1).times do |j|
            if !a[i + j + 1] || a[i + j + 1].slice(j, m) != b[j + 1]
                result = false
                break
            end
        end
    end
    break if result
end

puts result ? "Yes" : "No"
//  [ruby]
nm = gets.chomp.split
n = nm[0].to_i
m = nm[1].to_i

a = []
n.times do
    a << gets.chomp
end

b = []
m.times do
    b << gets.chomp
end

result = false
n.times do |i|
    result = false
    if a[i].include?(b[0])
        result = true
        first = 0
        n.times do |j|
            if a[i].slice(j, m) == b[0]
                first = j
            end
        end

        (m - 1).times do |j|
            if a[i + j + 1].slice(j, m) != b[j + 1]
                result = false
                break
            end
        end
    end
    break if result
end

puts result ? "Yes" : "No"
//  [ruby]
nm = gets.chomp.split
n = nm[0].to_i
m = nm[1].to_i

a = []
n.times do
    a << gets.chomp
end

b = []
m.times do
    b << gets.chomp
end

result = false
n.times do |i|
    result = false
    if a[i].include?(b[0])
        result = true
        first = 0
        n.times do |j|
            if a[i].slice(j, m) == b[0]
                first = j
            end
        end

        (m - 1).times do |j|
            if a[i + j + 1].slice(j, m) == b[j + 1]
                result = false
                break
            end
        end
    end
    break if result
end

puts result ? "Yes" : "No"
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊

    let (n,m) = (io.read::<usize>(),io.read::<usize>());
    let mut A = Vec::new();
    let mut B = Vec::new();
    for _ in 0..n {
        let s = io.chars();
        A.push(s);
    }
    for _ in 0..m {
        let s = io.chars();
        B.push(s);}

    for i in 0..n-m+1 {
        for j in 0..n-m+1 {
            let mut ok = true;
            for ii in 0..m {
                for jj in 0..m {
                    if A[i+ii][j+jj] != B[ii][jj]{
                        ok=false;break;
                    }
                }
            }
            if ok {
                io.writeln("Yes");
                return;
            }
        }}
    
        io.writeln("No");

}

static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).ok();
    let mut it = buf.split_whitespace();
    let n = it.next().unwrap().parse::<usize>().unwrap();
    let m = it.next().unwrap().parse::<usize>().unwrap();
    let a = (0..n).map(|_| it.next().unwrap()).collect::<Vec<_>>();
    let b = (0..m).map(|_| it.next().unwrap()).collect::<Vec<_>>();
    let mut valid = false;
    for i in 0..n-m+1 {
        for j in 0..n-m+1 {
            let mut eq = true;
            for k in 0..m {
                if &a[i+k][j..j+m] != b[k] { eq = false; }
            }
            if eq { valid = true; }
        }
    }
    println!("{}", if valid { "Yes" } else { "No" });
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        n: usize,
        m: usize,
        a: [Chars;n],
        b: [Chars;m],
    }

    let mut ok: bool = true;
    for i in 0..n-m {
        for j in 0..n-m {
            debug!(i);
            for k in i..i+m {
                for l in j..j+m {
                    debug!(k);
                    debug!(a[k][l]);
                    // debug!(b[k][l]);
                    if a[k][l]==b[k-i][l-j] {
                        continue;
                    } else {
                        ok = false;
                        // break;
                    }
                }
            }
            debug!(ok);
            if ok {
                println!("Yes");
                return;
            }
            ok = true;
        }
    }
    println!("No");
}
//  [rust]
use proconio::{fastout, input};
#[allow(unused_mut)]
#[fastout]
fn main() {
    input! {
        n: usize, m: usize,
        a: [String; n],
        b: [String; m]
    }
    let a = a.iter().map(|s| s.chars().collect()).collect();
    let b = b.iter().map(|s| s.chars().collect()).collect();
    let mut res = false;
    let diff = n - m;
    for x in 0..diff {
        for y in 0..diff {
            if check(x, y, &a, &b) {
                res = true;
            }
        }
    }
    println!("{}", if res { "Yes" } else { "No" })
}

fn check(sx: usize, sy: usize, a: &Vec<Vec<char>>, b: &Vec<Vec<char>>) -> bool {
    let m = b.len();
    for x in sx..sx + m {
        for y in sy..sy + m {
            if a[y][x] != b[y - sy][x - sx] {
                return false;
            }
        }
    }
    true
}
//  [rust]
use proconio::input;
use proconio::marker::Chars;

fn main() {
    input! {
        n: usize,
        m: usize,
        a: [Chars; n],
        b: [Chars; m],
    }

    let mut exist = false;
    for ax in 0..n - m {
        for ay in 0..n - m {
            for bx in 0..m {
                let mut same = true;
                for by in 0..m {
                    if a[ax + bx][ay + by] != b[bx][by] {
                        same = false;
                    }
                }
                if same {
                    exist = true;
                }
            }
        }
    }
    if exist {
        println!("Yes");
    } else {
        println!("No");
    }
}
//  [swift]
let input = readLine()!.split(separator: " ").map{ Int($0)! }
let N = input[0]
let M = input[1]

enum Color: Character {
    case white = "."
    case black = "#"
}

var A = [[Color]]()
var B = [[Color]]()

for _ in stride(from: 0, to: N, by: 1) {
    A.append(Array(readLine()!).map { Color(rawValue: $0)! })
}
for _ in stride(from: 0, to: M, by: 1) {
    B.append(Array(readLine()!).map { Color(rawValue: $0)! })
}

func solveB() -> Bool {
    for ix in stride(from: 0, through: N - M, by: 1) {
        for iy in stride(from: 0, through: N - M, by: 1) {
            var containsB = true
            B: for jx in stride(from: 0, to: M, by: 1) {
                for jy in stride(from: 0, to: M, by: 1) {
                    if A[ix + jx][iy + jy] != B[jx][jy] {
                        containsB = false
                        break B
                    }
                }
            }
            if containsB {
                return true
            }
        }
    }
    return false
}

print(solveB() ? "Yes" : "No")
//  [swift]
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/



/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (N, M) = (input[0], input[1])
let A = (0..<N).map{_ in readLine()!.toArray()}
let B = (0..<M).map{_ in readLine()!.toArray()}
var ans = "No"
loop1: for i in 0...N-M {
    for j in 0...N-M {
        var flag = true
        loop2: for y in 0..<M {
            for x in 0..<M {
                if B[y][x] != A[y+i][x+j] {
                    flag = false
                    break loop2
                }
            }
        }
        if flag {
            ans = "Yes"
            break loop1
        }
    }
}
print(ans)
//  [swift]
#!/usr/bin/swift

import Foundation

let input = readLine()!.components(separatedBy: " ")
let N = Int(input[0])!
let M = Int(input[1])!

let A: [[String]] = (0..<N).map {
     _ in readLine()!.map { String($0) }
}
let B: [[String]] = (0..<M).map {
     _ in readLine()!.map { String($0) }
}

var isContained = false

for i in 0..<(N-M+1) {
    for j in 0..<(N-M+1) {
        var same = true
        for y in 0..<M {
            for x in 0..<M {
                if A[j+y][i+x] != B[y][x] {
                    same = false
                }
            }
        }

        if same == true {
            isContained = true
            break
        }
    }
}

if isContained {
    print("Yes")
} else {
    print("No")
}
//  [typescript]
import * as fs from "fs";
const input = fs.readFileSync("/dev/stdin", "utf-8");

const main = (input: string): void => {
  const [nm, ...ab] = input.split("\n");
  const [n, m] = nm.split(" ");
  const N = parseInt(n, 10);
  const M = parseInt(m, 10);
  const A = ab.slice(0, N);
  const B = ab.slice(N, -1);
  let flag = false;
  let flag2 = false;

  A.forEach((a, i) => {
    const index = a.indexOf(B[0]);
    if (index !== -1) {
      if (N - i >= M) {
        for (let j = 1; j < M; j++) {
          const index2 = A[i + j].indexOf(B[j]);
          if (index === index2) flag = true;
          else flag = false;
        }
        if (flag || M === 1) flag2 = true;
      }
    }
  });

  if (flag2) console.log("Yes");
  else console.log("No");
};

main(input);
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);let input_i=-1;const tn=():number=>{input_i++;return Number(input[input_i])};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{input_i++;return String(input[input_i])};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{const t=[...ar];return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{const t=[...ar];return t.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1]}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const deduplicate=(a:any[]):any[]=>{return Array.from(new Set(a))}
const main=()=>{
  let n=tn(),m=tn(),a=[],b=[],bb=[]
  for(let i=0;i<n;i++)a.push(ts().split(''))
  for(let i=0;i<m;i++)b.push(ts())
  let f=true
  for(let i=0;i<=n-m;i++){
    for(let j=0;j<=n-m;j++){
      let f=true
      for(let k=0;k<m;k++){
        if(a[i+k].slice(j,j+m).join('')!=b[k])f=false
      }
      if(f){
        to('Yes')
        return
      }
    }
  }
  to('No')
}
main()
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [N, M] = input[0].map(Number);
  const A = input.slice(1, N + 1).map((line) => line[0]);
  const B = input.slice(N + 1, -1).map((line) => line[0]);

  for (let x = 0; x <= N - M; x++) {
    for (let y = 0; y <= N - M; y++) {
      let isMatched = true;

      for (let i = 0; i < M; i++) {
        if (B[i] !== A[y + i].slice(x, x + M)) {
          isMatched = false;
        }
      }

      if (isMatched) {
        return "Yes";
      }
    }
  }

  return "No";
};

console.log(main(read()));
//  [typescript]
import * as fs from "fs";
const input = fs.readFileSync("/dev/stdin", "utf-8");

const main = (input: string): void => {
  const [nm, ...ab] = input.split("\n");
  const [n, m] = nm.split(" ");
  const N = parseInt(n, 10);
  const M = parseInt(m, 10);
  const A = ab.slice(0, N);
  const B = ab.slice(N, -1);
  let flag = false;
  let flag2 = false;

  console.log(N, M, A, B);

  A.forEach((a, i) => {
    const index = a.indexOf(B[0]);
    if (index !== -1) {
      if (N - i >= M) {
        for (let j = 1; j < M; j++) {
          const index2 = A[i + j].indexOf(B[j]);
          if (index === index2) flag = true;
          else flag = false;
        }
        if (flag || M === 1) flag2 = true;
      }
    }
  });

  if (flag2) console.log("Yes");
  else console.log("No");
};

main(input);
//  [typescript]
import * as fs from "fs";
const input = fs.readFileSync("/dev/stdin", "utf-8");

const main = (input: string): void => {
  const [nm, ...ab] = input.split("\n");
  const [n, m] = nm.split(" ");
  const N = parseInt(n, 10);
  const M = parseInt(m, 10);
  const A = ab.slice(0, N);
  const B = ab.slice(N, -1);
  let flag = false;
  let flag2 = false;

  A.forEach((a, i) => {
    const index = a.indexOf(B[0]);
    if (index !== -1) {
      if (N - i - 1 >= M) {
        for (let j = 1; j < M; j++) {
          const index2 = A[i + j].indexOf(B[j]);
          if (index === index2) flag = true;
          else flag = false;
        }
        if (flag) flag2 = true;
      }
    }
  });

  if (flag2) console.log("Yes");
  else console.log("No");
};

main(input);
//  [typescript]
import * as fs from "fs";
const input = fs.readFileSync("/dev/stdin", "utf-8");

const main = (input: string): void => {
  const [nm, ...ab] = input.split("\n");
  const [n, m] = nm.split(" ");
  const N = parseInt(n, 10);
  const M = parseInt(m, 10);
  const A = ab.slice(0, N);
  const B = ab.slice(N, -1);
  let flag = false;
  let flag2 = false;

  A.forEach((a, i) => {
    const index = a.indexOf(B[0]);
    if (index !== -1) {
      if (N - i >= M) {
        for (let j = 1; j < M; j++) {
          const index2 = A[i + j].indexOf(B[j]);
          if (index === index2) flag = true;
          else flag = false;
        }
        if (flag) flag2 = true;
      }
    }
  });

  if (flag2) console.log("Yes");
  else console.log("No");
};

main(input);
//  [python]
import sys
N = input()
for i in reversed(range(N + 1)):
    for j in reversed(range(7 + 1)):
        if i== 2 ** j:
            print i
            sys.exit(0)
//  [python]
import sys
N = input()
for i in reversed(range(7 + 1)):
    if 2 ** i <= N:
        print 2 ** i
        break
//  [python]
N = input()
print max ([2 ** i for i in range(8) if 2 ** i <= N])
//  [python]
N = int(input())
l = [1,2,4,8,16,32,64]{[::-1]
for i in l:
  if N >= i:
    print(i)
    break
//  [python]
n = int(input())
s = [i for i in range(1,n+1)]
counter = 0
while(True):
    if len([i for i in s if i % 2 == 0])==1:
        s = [i for i in s if i % 2 == 0]
        print(int(s[-1] * (2 ** counter)))
        break
    else:
        s = [i/2 for i in s]
        counter += 1
//  [python]
n = int(input())
ans = 0

for i in range(1, 7):
  if 2**i <= n:
    ans = 2**i

print(ans)
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int line = Integer.parseInt(br.readLine());

        if(line == 1){
            System.out.println(line);
        }
        else{
            int x = 1;
            for(; x <= line;){
                x = x * 2;            
            }
            
            x = x / 2;
            System.out.println(x);
        }
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    BufferedReader rd;

    Main() throws IOException {
        rd = new BufferedReader(new InputStreamReader(System.in));
        compute();
    }

    private void compute() throws IOException {
        out(Integer.highestOneBit(pint()));
    }

    private int pint() throws IOException {
        return pint(rd.readLine());
    }

    private int pint(String s) {
        return Integer.parseInt(s);
    }

    private static void out(Object x) {
        System.out.println(x);
    }

    public static void main(String[] args) throws IOException {
        new Main();
    }
}
//  [java]
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int cnt = 0;
        while(n >= 2){
            n/=2;
            cnt++;
        }
        System.out.println((int)Math.pow(2,cnt));
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

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

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}
//  [java]
    import java.util.*;
     
    public class Main {
        public static void main(String[] args){
            // Your code here!
            Scanner sc = new Scanner(System.in);
            
            int N = sc.nextInt();
            
            int result = 0;
            int maxCount = 0;
            
            for(int i = 1; i <= N; i++){
                
                int count = 0;
                int num = i;
                
                while((num % 2) == 0){
                    count++;
                    num = num/2;
                }
                if(count > maxCount){
                    maxCount = count;
                    result = i;
                }
            }
            
            System.out.println(result);
            
        }
        
    }
//  [java]
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static PrintWriter out;

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

    private static void run() {
        out = new PrintWriter(new BufferedOutputStream(System.out));
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        out.println(count(n));
        out.close();
        sc.close();
    }

    private static int count(int pnum) {
        int result = 0;
        for (int i = 0; (int) Math.pow(2, i) <= pnum; i++) {
            result = (int) Math.pow(2, i);
            System.out.println(result);
        }
        return result;
    }
}
//  [java]
package pracltice;

import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static PrintWriter out;

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

    private static void run() {
        out = new PrintWriter(new BufferedOutputStream(System.out));
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        out.println(count(n));
        out.close();
        sc.close();
    }

    private static int count(int pnum) {
        int result = 0;
        for (int i = 0; (int) Math.pow(2, i) <= pnum; i++) {
            result = (int) Math.pow(2, i);
            System.out.println(result);
        }
        return result;
    }
}
//  [cpp]
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
typedef long long LL;
const int Max = 1e5;
const int MOD = 1e9 + 7;

int n;
int main()
{
	scanf("%d", &n);
	int sum = 1;
	for(int i = 1; i <= n; i++) {
		int ans = i;
		while(ans % 2 == 0 && ans != 1)
		{
			ans /= 2;
		}
		if(ans == 1) sum = max(i, sum);
	}
	printf("%d\n", sum);
	return 0;
}
//  [cpp]
#include<stdio.h>
int main(){
	
	int x;
scanf("%d",&x);
int s=1;
while(x>=s)
{s=s*2;
}
printf("%d\n",s/2);	
	
	
	
}
//  [cpp]
#include<cstdio>
long long num[1001];
int main()
{
	int i=2;
	num[0]=2;
	for(i=1;i<=10;i++)
	{
		num[i]=num[i-1]*2;
	}
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		for(i=0;i<=10;i++)
		{
			if(num[i]>n) break;
		}
		if(n!=1) printf("%d\n",num[i-1]);
		else printf("1\n");
	}
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n ; cin>> n;
    if(n<=1) cout << 1 << endl;
    else if(n<=2) cout << 2 << endl;
    else if(n<=7) cout << 4 << endl;
    else if (n<=15) cout << 8 << endl;
    else if (n<=31) cout << 16 << endl;
    else if (n<=63) cout << 32 << endl;
    else cout << 64 << endl;
    return 0 ;
}
//  [cpp]
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

#define printl(s) cout << s << endl;
#define rep(i,n) for(int i=0;i<(n);i++)
using ll = long long;

const ll modSeed = pow(10,9) + 7;
const int INF = 1'000'000'000;

template <typename T>
vector<T> getVector(ll num){
    vector<T> values(num);
    for(ll i=0;i<num;i++){
        cin >> values.at(i);
    }
    return values;
}

string S;
ll N,ans;

int main(){
  cin >> N;
  int maxCount = 0;
  for(int i=1;i<=N;i++){
    int val = i;
    int count =0;
    while(val%2==0){
      val /=2;
      count++;
    }
    if(count>maxCount){
      ans = i;
      maxCount = count;
    }
  }
  printl(ans);
}