jiahuimbzuai/CoQuIR huggingface dataset:
//  [java]
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int tA = scan.nextInt();
		int tB = scan.nextInt();
		int aC = scan.nextInt();
		int aD = scan.nextInt();
		String ans = "Yes";
		
		while(tA>0 && aC>0){
          //高橋君の攻撃
          aC = aC - tB;
          if(aC <= 0){
            ans="Yes";
            break;
          }

          //青木君の攻撃
          tA = tA - aD;
          if(tA <= 0){
            ans = "No";
            break;
          }
        }
      
        //回答表示
        System.out.println(ans);
    }
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;
int main()
{
    int a,b,c,d,n,m,i;
    cin>>a>>b>>c>>d;
    while(d>0 && b>0)
    {
       if(a<=0 && c>0){
        cout<<"No"<<endl;
       break;
       }
       else if(a>=0 && c<=0)
       {
           cout<<"Yes"<<endl;
           break;
       }
       a-=d;
       c-=b;



    }

   return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main() {
   
 int A,B,C,D;
  cin>>A>>B>>C>>D;
 
  int i=1;
    while (true){
      
    
    if (C<=0 && A>=0){
      cout<<"Yes"<<endl;
      break;
    }
    
    else if (C>0 && A<=0){
      cout<<"No"<<endl;
      break;
    }
    
    C=C-B;
    A=A-D;
    
      i++;
  }
  
 

       
       

  // ここにプログラムを追記
}
//  [cpp]

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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);	
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll ,ll> 			pll;
typedef pair<ld,ld> 			pld;
typedef unordered_map<ll,ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5+7;
const ll 	MAX7 	= 	1e+7+7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9+7;

vll adj[MAXN];ll visit[MAXN]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

// <------------- Declare Variables Here ------------> //

ll t=1;
ll n,x;ld a,b,c,d;
string s;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	cin>>a>>b>>c>>d;

	if(ceil(a/d) >= ceil(c/b)) cout<<"Yes";
	else cout<<"No";
}

int main() {
	fastio;randomINT;
	//cin>>t;
	while(t--) {
		MAIN();
	}
	return 0;
}
//  [c]
#include<stdio.h>
 
int main(void){
  int a,b,c,d,turn=0;
  
  scanf("%d %d %d %d",&a,&b,&c,&d);
  
  while(a>0 && c>0){
    if(turn%2==0){
      c -= b;
    }
    else{
      a -= d;
    }
    turn++;
  }
  
  if(a>0)
    printf("Yes");
  else
    printf("No");
  
  return 0;
}
//  [c]
#include <stdio.h>

int main(void) {
	int A, B, C, D;
	int th, ta, ah, aa;
	if (scanf("%d%d%d%d", &A, &B, &C, &D) != 4) return 1;
	th = A;
	ta = B;
	ah = C;
	aa = D;
	for (;;) {
		ah -= ta;
		if (ah <= 0) {
			puts("Yes");
			return 0;
		}
		th -= aa;
		if (th <= 0) {
			puts("No");
			return 0;
		}
	}
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
  int A, B, C, D;

  scanf("%d %d %d %d", &A, &B, &C, &D);

  while (1)
  {
    C -= B;
    if (C <= 0)
    {
      printf("Yes");
      break;
    }

    A -= D;
    if (A <= 0)
    {
      printf("No");
      break;
    }
  }

  return 0;
}
//  [javascript]
function Main(input) {
  input = input.split(' ');
  const takahashi = {
    strength: parseInt(input[0]),
    attack: parseInt(input[1])
  };
  const aoki = {
    strength: parseInt(input[2]),
    attack: parseInt(input[3])
  };

  while(takahashi.strength > 0 && aoki.strength > 0) {
    aoki.strength -= takahashi.attack;
    if (aoki.strength <= 0) {
      console.log('%s', 'Yes');
      break;
    }
    takahashi.strength -= aoki.attack;
    if (takahashi.strength <= 0) console.log('%s', 'No');
  }
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]

function Main (input) {
  var t_life = parseInt(input.split(" ")[0]);
  var t_atk = parseInt(input.split(" ")[1]);
  var a_life = parseInt(input.split(" ")[2]);
  var a_atk = parseInt(input.split(" ")[3]);
  
  for (var counter = 0; a_life >= 0 && t_life >= 0; counter++) {
    if (counter % 2 === 0) {
        // 高橋君の番
        a_life = a_life - t_atk
        if (a_life <= 0) {
            console.log("Yes")
            break;
        }
    } else {
        // 青木君の番
        t_life = t_life - a_atk
        if (t_life <= 0) {
            console.log("No")
            break;
        }
    }
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(a){return a?cin[cid++]:+cin[cid++];}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(myOut);

function main(){
  var [a,b,c,d] = nexts(4);
  while(a > 0 && c > 0){
    c -= b;
    a -= d;
  }
  return c <= 0 ? "Yes" : "No";
}
//  [go]
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 10000000
)

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

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

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

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextFloat64s(n int) []float64 {
	slice := make([]float64, n)
	for i := 0; i < n; i++ {
		slice[i] = nextFloat64()
	}
	return slice
}

func putf(format string, a ...interface{}) {
	fmt.Fprintf(wt, format, a...)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, initialBufSize), maxBufSize)
	defer wt.Flush()

	a, b, c, d := nextInt(), nextInt(), nextInt(), nextInt()

	for t := true; ; t = !t {
		if t {
			c -= b
			if c <= 0 {
				puts("Yes")
				break
			}
		} else {
			a -= d
			if a <= 0 {
				puts("No")
				break
			}
		}
	}
}
//  [go]
// +build ignore
package main

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

func solve(sc *scanner, wr *bufio.Writer) int {
	A := sc.i()
	B := sc.i()
	C := sc.i()
	D := sc.i()

	for {
		C -= B
		if C <= 0 {
			fmt.Println("Yes")
			return 0
		}

		A -= D
		if A <= 0 {
			fmt.Println("No")
			return 0
		}
	}
	return 0
}

func main() {
	sc := newScanner(os.Stdin)
	wr := bufio.NewWriter(os.Stdout)
	ret := solve(sc, wr)
	wr.Flush()
	os.Exit(ret)
}

// I/O
type scanner struct {
	sc *bufio.Scanner
}

func newScanner(input io.Reader) *scanner {
	sc := bufio.NewScanner(input)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &scanner{sc}
}

func (s *scanner) s() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *scanner) i() int {
	i, e := strconv.Atoi(s.s())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *scanner) f() float64 {
	f, e := strconv.ParseFloat(s.s(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *scanner) bs() []byte {
	return []byte(s.s())
}

func (s *scanner) is(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.i()
	}
	return res
}

func (s *scanner) fs(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.f()
	}
	return res
}
//  [go]
package main

import (
	"fmt"
)

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

	for {
		c -= b
		if c <= 0 {
			fmt.Println("Yes")
			return
		}
		a -= d
		if a <= 0 {
			fmt.Println("No")
			return
		}
	}
}
//  [ruby]
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
a,b,c,d = gets.chomp.split.map(&:to_i)

while true
  c -= b
  if c <= 0
    puts 'Yes'
    exit
  end
  a -= d
  if a <= 0
    puts 'No'
    exit
  end

end
//  [ruby]
#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end

def big(a,b) return (a>b)? a:b end

def small(a,b) return (a<b)? a:b end

a,b,c,d = inp
1000000.times do
  c -= b
  if(c <= 0)
    puts "Yes"
    exit
  end
  a -= d
  if(a <= 0)
    puts "No"
    exit
  end
end
//  [ruby]
require 'pp'

# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
  gets.chomp.split(" ").map(&:to_i)
end

A, B, C, D = gets_i_list

tt, ta = A, B
at, aa = C, D

while true do
  at = at - ta
  if at <= 0
    puts "Yes"
    exit
  end
    
  tt = tt - aa
  if tt <= 0
    puts "No"
    exit
  end
end
//  [swift]
// Battle

func main() {
    let abcd = readLine()!.split(separator: " ").map{Int($0)!}
    var a = abcd[0]
    let b = abcd[1]
    var c = abcd[2]
    let d = abcd[3]

    while true {
        // 高橋くんの攻撃
        c -= b
        if c <= 0 {
            print("Yes")
            return
        }

        // 青木くんの攻撃
        a -= d
        if a <= 0 {
            print("No")
            return
        }
    }
}

main()
//  [swift]
import Foundation

let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ") //ブランクで区切られている場合

var a = Int(split[0])!
let b = Int(split[1])!
var c = Int(split[2])!
let d = Int(split[3])!


var ans = "Yes"

var ta = 0

while ta >= 0 {
    a -= d
  if a <= 0 { break }
    ta += 1
}

var ao = 0

while ao >= 0 {
    c -= b
  if  c <= 0 { break }
    ao += 1
}

if ao > ta {
    ans = "No"
}


print(ans)
//  [swift]
import Foundation

let inputs = readLine()!.components(separatedBy: " ").map{ Int($0)! }
let A = inputs[0]
let B = inputs[1]
let C = inputs[2]
let D = inputs[3]

var ARemain = A
var CRemain = C

for i in 1...100 {
    CRemain = CRemain - B
    
    if CRemain <= 0 {
        print("Yes")
        break
    }
    ARemain = ARemain - D
    
    if ARemain <= 0 {
        print("No")
        break
    }
    
}
//  [typescript]
import { readFileSync } from "fs";

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

const main = (input: string[][]) => {
  const [A, B, C, D] = input[0].map(Number);

  return Math.ceil(A / D) >= Math.ceil(C / B) ? "Yes" : "No";
};

console.log(main(read()));
//  [typescript]
import { readFileSync } from "fs";

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

const main = (input: string[][]) => {
  const [A, B, C, D] = input[0].map(Number);

  return Math.ceil(A / D) + 1 > Math.ceil(C / B) ? "Yes" : "No";
};

console.log(main(read()));
//  [python]
a,b=map(int,input().split())
if b==1:
  print(0)
if 1<b<=a:
  print(1)
for i in range(a):
  if (a-i+i*a)<b<=(a-(i+1)+(i+1)*a):
    print(1+(i+1))
for i in range(a**2):
  if ((a**2)-i+i*a)<b<=((a**2)-(i+1)+(i+1)*a):
    print(1+a+(i+1))
for i in range(a**3):
  if ((a**3)-i+i*a)<b<=((a**3)-(i+1)+(i+1)*a):
    print(1+a+(a**2)+(i+1))
for i in range(a**4):
  if ((a**4)-i+i*a)<b<=((a**4)-(i+1)+(i+1)*a):
    print(1+a+(a**2)+(a**3)+(i+1))
for i in range(a**5):
  if ((a**5)-i+i*a)<b<=((a**5)-(i+1)+(i+1)*a):
    print(1+a+(a**2)+(a**3)+(a**4)+(i+1))
//  [python]
import numpy as np
p, q = map(int, input().split())
t = (q - 1) / ( p - 1)
print(int(np.ceil(t)))
//  [python]
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

a,b=mp()
if b==1:
    print(0)
    exit()
for i in range(1,100):
    if 1+(a-1)*i>=b:
        print(i)
        exit()
//  [java]
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws IOException {
        int needStrip = 0;
        int startOutlet =1;
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int arr[] = Arrays.stream(in.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        while(startOutlet<arr[1]) {
            startOutlet--;
            startOutlet+=arr[0];
            needStrip++;
        }
        System.out.println(needStrip);                                     
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[] input = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();

        int count = 1;
        int tap = 0;


        while(count < input[1]) {
            count--;
            count+= input[0];
            tap++;
        }

        System.out.println(tap);
    }
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void){
	int a, b;
	scanf("%d %d", &a, &b);
	a--;b--;
	printf("%d\n", b / a + (b % a ? 1 : 0));
	return 0;
}
//  [c]
#include<stdio.h>
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	printf("%d\n",((b-1)+(a-2))/(a-1));
	return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int a,b;
  int n=0;
  scanf("%d%d",&a,&b);
  while((a+(a-1)*(n-1))<b){
    n++;
  }
  printf("%d",n);
}
//  [javascript]
'use strict'

function main(input) {
  input = input
    .trim()
    .split(' ')
    .map(v => Number(v))
  let cnt = 1
  const ans = Math.ceil((input[1] - 1) / (input[0] - 1))
  console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8'); 
var lines = [];
var reader = require('readline').createInterface({
	input: process.stdin,
	output: process.stdout
});
 
reader.on('line', (line) => {
	lines.push(line);
});

reader.on('close', () => {
	"use strict"
	const AB=lines[0].split(" ").map(Number);
	const A=AB[0];
	const B=AB[1];
	
	var ans=Math.ceil((B-1)/(A-1))
	console.log(ans);
});
//  [go]
package main
 
import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
)

func run() {
	
	a := nextInt()
	b := nextInt()
	ans := 0
	cur := 1
	for cur < b {
		cur = cur + a - 1
		ans++
	}
	Println(ans)
}
 
// --- template ---
// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
// Caution: You will get unexpected result if a single token is larger than this size.
const BufferSize = 64 * 1024 * 1024
 
func Print(a ...interface{}) (n int, err error) {
	return fmt.Fprint(out, a...)
}
 
func Printf(format string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, format, a...)
}
 
func Println(a ...interface{}) (n int, err error) {
	return fmt.Fprintln(out, a...)
}
 
func next() string {
	sc.Scan()
	return sc.Text()
}
 
func nextInt() int {
	a, err := strconv.Atoi(next())
	if err != nil {
		log.Fatal(err)
	}
	return a
}
 
func nextFloat() float64 {
	a, err := strconv.ParseFloat(next(), 64)
	if err != nil {
		log.Fatal(err)
	}
	return a
}
 
func main() {
	sc.Buffer(make([]byte, 0, BufferSize), BufferSize)
	sc.Split(bufio.ScanWords)
	run()
	out.Flush()
}
//  [go]
package main

import "fmt"

func main() {
	a, b := 0, 0
	fmt.Scanf("%d %d", &a, &b)
	if (b-1)%(a-1) == 0 {
		fmt.Println((b - 1) / (a - 1))
	} else {
		fmt.Println((b-1)/(a-1) + 1)
	}
}
//  [ruby]
#
a,b = gets.chomp.split(' ').map(&:to_i)
num_of_socket = 1
num_of_plug = 0
while num_of_socket < b
  num_of_socket += a - 1
  num_of_plug += 1
end
puts num_of_plug
//  [ruby]
a, b = gets.chomp.split(' ').map(&:to_i)
ans = 0
outlet = 1

while outlet < b
  outlet-=1
  outlet+=a
  ans+=1
end
puts ans
//  [ruby]
# 空白区切の入力を数値(整数)の配列で返す
def gets_i_list()
  gets.chomp.split(" ").map(&:to_i)
end

A, B = gets_i_list

if B == 1
  puts 0
else
  count = 1
  total = A
  while true
    break if total >= B
    count += 1
    total = (A * count) - (count - 1)
  end
  puts count
end
//  [rust]
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed 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 x:usize = read();
    let y:usize = read();
    let mut ans = 0;
    let mut outlet = 1;
    while outlet < y {
        outlet -= 1;
        outlet += x;
        ans += 1;
    }
    println!("{}", ans);
}
//  [swift]
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let ab=readInts()
let a=ab[0]
let b=ab[1]
var mouth=a
var ans=1

print(Int(ceil(Double(b-1)/Double(a-1))))
//  [swift]
func readTwoInts(separator: String.Element = " ") -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

func mainA() {
    let (A, B) = readTwoInts()

    if B == 1 {
        print(0)
        return
    }

    var count = 0
    while true {
        count += 1
        if count * (A - 1) + 1 >= B {
            print(count)
            return
        }
    }
}

mainA()
//  [swift]
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
let a = arr[0]
let b = arr[1]


var sockets = 1
var o = 0
while 1 == 1 {
  if( sockets >= b ) {
    break
  }
  
  sockets = sockets - 1 + a
  o += 1
  //print( sockets )
}

print( o )
//  [typescript]
const lines=[];
const reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});

reader.on('line', function (line) {
  lines.push(line);
});

//入力後の処理
reader.on('close', function () {
    const input = (lines[0] as string).split(" ");
    const a = +input[0];
    const b = +input[1];

    if (a == b) {
        console.log(1);
        return;
    } 
    let res = 0;
    let numSockets = 1;
    while(numSockets < b){
        numSockets =(numSockets - 1) + a;
        res++;
    }
    console.log(res);
});
//  [typescript]
((input: string): void => {
    const [a, b] = input.split(" ").map(Number)
    console.log(Math.ceil((b-1)/(a-1)))
})(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
import numpy as np

def luka(n):
    a,b=1,2
    if n==1:
        pass
    elif n>=1:
        for _ in range(n-1):
            a,b=a+b,a
    
    print(a)
    

def main():
    N=int(input())

    luka(N)

if __name__=="__main__":
    main()
//  [python]
import numpy as np
n = int(input())
init = np.expand_dims(np.array([2, 1]), 0)
to_next = np.array([
    [1, 1],
    [1, 2],
])
for i in range(n // 2):
    init = init.dot(to_next)
print(init[0][n & 1])
//  [python]
n = int(input())
ans = 0
l = [2, 1]

for i in range(n-1):
    l.append(l[i]+l[i+1])

print(l[n])
//  [java]

import java.text.DecimalFormat;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        AtCoder problem = new AtCoder(sc);
        problem.solve(out);

        out.flush();
    }

}

class AtCoder {

    final int N;
    Map<Integer, Long> memo;

    AtCoder(FastScanner sc) {
        N = sc.nextInt();
        memo = new HashMap<>();
    }

    void solve(PrintWriter out) {
        memo.put(0, 2L);
        memo.put(1, 1L);
        out.println(lucas(N));
    }

    long lucas(int n) {
        return memo.computeIfAbsent(n, i -> lucas(i - 1) + lucas(i - 2));
    }
}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
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());
    }
}
//  [java]

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] l = new long[n + 1];
		l[0] = 2;
		l[1] = 1;
		for(int i = 2 ; i <= n ; i++) {
			l[i] = l[i - 1] + l[i - 2];
		}
		System.out.println(l[n]);
	}
}
//  [java]
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			long[] l = new long[n + 1];
			l[0] = 2;
			l[1] = 1;
			IntStream.rangeClosed(2, n).forEach(i -> l[i] = l[i - 1] + l[i - 2]);
			System.out.println(l[n]);
		}
	}
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int64_t ryuka(int X){
  if(X==0){
    return 2;
  }
  if(X==1){
    return 1;
  }
  if(X==2){
    return 3;
  }
  if(X==3){
    return 4;
  }
  return 3*ryuka(X-3)+2*ryuka(X-4);
}

int main(){
  int N;
  cin >> N;
  cout << ryuka(N) << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

long long int lucas(int a){
  if(a==1){
    return 2;
  }
  if(a==2){
    return 1;
  }
  if(a==41){
    return 228826127;
  }
  if(a==42){
    return 370248451;
  }
  if(a==71){
    return 425730551631123;
  }
  if(a==72){
    return 688846502588399;
  }
  return lucas(a-1) + lucas(a-2);
}

int main(){
  int N;
  cin >> N;
  cout << lucas(N+1) << endl;
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

#define ALL(x) (x).begin(), (x).end()
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)((x).size()))

typedef long long ll;

const ll mod = 1000000007;
const double pi = 3.1415926535897932384626;

ll powmod(ll a, ll b) {ll res = 1; ll rem = a % mod; for (; b; b >>= 1) {if (b & 1) res = (res * rem) % mod; rem = (rem * rem) % mod;} return res;}

int main()
{	
#ifdef hannibal_08
	freopen("in", "r", stdin);
	freopen("out", "w", stdout);
#endif
    
	ll n = 0ll;
	scanf("%lld", &n);

	ll a = -1ll;
	ll b = 2ll;
	ll c = 0ll;
	ll ret = 0ll;

	for (int i = 1; i <= n; ++i) {
		c = a + b;
		ret = c;
		c = b;
		b = ret;
		a = c;
	}

	printf("%lld\n", ret);

	return 0;
}
//  [c]
#include<stdio.h>
long long int arr[10000000];
void lucas()
{
    long long int i,j;
    arr[0]=2;
    arr[1]=1;
    for(i=2;i<=10000000;i++)
    {
        arr[i]=arr[i-2]+arr[i-1];
    }
}
int main()
{
    lucas();
    long long int i,j,k,l,m;
    while(scanf("%lld",&m)==1)
    {
        printf("%lld\n",arr[m]);
    }
    return 0;
}
//  [c]
#include "stdio.h"

int main(){
    int N;
  	long L[100];
    scanf("%d",&N);
    L[0]=2;
    L[1]=1;
    for(int i=2;i<=N;i++){
        L[i]=L[i-1]+L[i-2];
    }
    printf("%ld",L[N]);
    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
	long long int n,a[87],i;
	scanf("%d",&n);
	a[0]=2;
	a[1]=1;
	for(i=2;i<=n;i++){
		a[i]=a[i-2]+a[i-1];
	}
	printf("%lld\n",a[n]);
	return 0;
}
//  [javascript]
function Main(input){
	function plus(a,b){
    a = a.split("").reverse().map(a=>~~a);
    b = b.split("").reverse().map(a=>~~a);
    var len = Math.max(a.length,b.length);
    var c = [];
    for(var i = 0; i < len;i++){
      c[i] = (a[i]||0) + (b[i]||0) + (c[i]||0);
      while(c[i] >= 10){
        c[i+1] = (c[i+1]||0) + 1;
        c[i] -= 10;
      }
    }
    return c.reverse().join("");
	}
  
  input = input.split("\n")[0]*1;
	var L = ["2","1"];
 	for(var i = 2; i <= input;i++){
  	L[i] = plus(L[i-2],L[i-1]);
  }
  return L[input];
}

console.log(Main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [javascript]
"use strict"

function main(input) {
  //一部の正解がjsで扱う最大値を越えるため、文字列として扱う。
  //計算は配列を使った筆算（上の配列と下の配列を計算、桁上がりも対応）にて行う

  const cal = (a, b) => {
    //左詰の配列だと計算しづらいのでreverse
    let aa = a
      .split("")
      .map(v => ~~v)
      .reverse()
    let bb = b
      .split("")
      .map(v => ~~v)
      .reverse()

    let cc = []
    let digit = 0
    //各配列の値についてaa[i] + bb[i]する=筆算 桁数の大きい方の回数
    for (let i = 0; i < bb.length; i++) {
      let tmp = Number(aa[i])
        ? Number(aa[i]) + Number(bb[i]) + digit
        : Number(bb[i]) + digit //
      digit = 0

      if (tmp >= 10) {
        digit = Math.floor(tmp / 10)
        tmp = tmp % 10
      } else {
        digit = 0
      }
      cc.push(tmp)
    }
    if (digit > 0) cc.push(digit)

    return cc.reverse().join("") //array -> recerse -> string
  } //end cal

  input = Number(input)

  let numbers = ["2", "1"]

  for (let i = 2; i <= input; i++) {
    let tmp = cal(numbers[i - 2], numbers[i - 1])
    numbers.push(tmp)
  }
  console.log(numbers.pop()) //string
}
main(require("fs").readFileSync("/dev/stdin", "utf8"))
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	n := iScan()
	if n == 1 {
		fmt.Println(1)
	} else {
		p, q := 2, 1
		for i := 2; i <= n; i++ {
			p, q = q, p+q
		}
		fmt.Println(q)
	}
}
//  [go]
package main

import "fmt"

func main() {
	// Code for B - Lucas Number
	var N int
	fmt.Scanf("%d", &N)
	L := make([]int, N+1)

	L[0] = 2
	L[1] = 1
	for i := 2; i <= N; i++ {
		L[i] = L[i-1] + L[i-2]

	}

	fmt.Println(L[N])

}
//  [ruby]
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 入力値を数値で返却する
def gets_i()
  gets.chomp.to_i
end
n = gets_i

l0 = 2
l1 = 1
l2 = l0 + l1

if n == 1
  puts l1
  return
end

2.upto(n) do
  l2 = l1 + l0
  l0 = l1
  l1 = l2
end

puts l2
//  [ruby]
N = gets.to_i
if N==1
    puts '1'
    exit
end
p2=2
p1=1
l=0
(N-1).times do |i|
    l=p1+p2
    p2=p1
    p1=l
end
puts l
//  [ruby]
n = gets.to_i
ary = []
ary[0] = 2
ary[1] = 1
for i in 2..86
  ary[i] = ary[i-1]+ary[i-2]
end
puts ary[n]
//  [rust]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use text_io::*;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let n: usize = read!();
    let mut l = vec![0u128; n + 1];
    l[0] = 2;
    l[1] = 1;
    for i in 2..=n {
        l[i] = l[i - 1] + l[i - 2];
    }

    println!("{}", l[n]);
}
//  [rust]
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		n: usize,
	}

	let mut l: Vec<usize> = vec![0; 87];
	l[0] = 2;
	l[1] = 1;

	let mut i = 2usize;
	loop {
		if i > n {
			break;
		}
		l[i] = l[i-1] + l[i-2];
		i += 1;
	}
	println!("{}", l[n]);
}
//  [rust]
fn main() {
    proconio::input! {
    a:usize,
    }
    let mut v:Vec<usize>=Vec::new();
    v.push(2);
    v.push(1);
    for i in 0..a {
        v.push(v[i]+v[i+1]);
    }
    println!("{}",v[a])
}
//  [typescript]
import * as readline from "readline";

/* ここに処理を書く */
const sumStrInt = (a: string, b: string): string => {
  let lArray: string[], sArray: string[];
  if (parseInt(a) >= parseInt(b)) {
    lArray = a.split("").reverse();
    sArray = b.split("").reverse();
  } else {
    lArray = b.split("").reverse();
    sArray = a.split("").reverse();
  }

  let resArray: string[] = ["0"];
  for (let i = 0; i < lArray.length; i++) {
    const li: number = parseInt(lArray[i]);
    const si: number = i < sArray.length ? parseInt(sArray[i]) : 0;
    const ri: number = parseInt(resArray[i]);

    const y: number = li + si + ri;
    resArray[i] = (y % 10).toString();
    resArray.push(10 <= y ? "1" : "0");
  }

  resArray = resArray.reverse();
  if (resArray[0] === "0") resArray = resArray.slice(1);
  const str: string = resArray.reduce((acc: string, cur: string) => acc + cur);

  return str;
};

const main = (args: any[]) => {
  const N = args[0];

  const list: string[] = ["2", "1"];
  for (let i = 2; i <= N; i++) {
    list.push(sumStrInt(list[i - 1], list[i - 2]));
    // console.log(list[i], list[i - 1], list[i - 2]);
  }
  console.log(list[N]);
  return;
};

/* 標準入力処理 */
const stdin = (main: Function) => {
  const args: any[] = [];
  const reader = readline.createInterface({
    input: process.stdin,
    output: process.stdout
  });
  reader.on("close", function() {
    main(args);
  });
  reader.on("line", function(line: any) {
    if (line === "") {
      reader.close();
    }
    line.split(" ").forEach((arg: any) => {
      args.push(isNaN(arg) ? arg : Number(arg));
    });
  });
};
/* 実行 */
stdin(main);
//  [typescript]
import { readFileSync } from "fs";

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

const main = (input: string[][]) => {
  const N = Number(input[0][0]);

  const L = [2n, 1n];

  for (let i = 2; i <= N; i++) {
    L[i] = L[i - 1] + L[i - 2];
  }

  return L[N].toString();
};

console.log(main(read()));
//  [python]
import numpy as np

h,w = list(map(int,input().split()))

def tra(a):
    b = []
    for ax in a:
        if ax == '#':
            b.append(1)
        else:
            b.append(0)
    b = np.array(b)
    return b

aa = []
for i in range(h):
    a = input()
    aa.append(tra(a))

aa_ori = np.vstack(aa)

while True:
    ind = np.sum(aa_ori,axis=0) > 0
    if np.sum(ind) == len(ind):
        break
    aa_ori = aa_ori[:,ind]

    ind = np.sum(aa_ori,axis=1) > 0
    if np.sum(ind) == len(ind):
        break
    aa_ori = aa_ori[ind,:]

for a in aa_ori:
    s = ''
    for b in a:
        if b == 1:
            s += '#'
        else:
            s += '.'
    print(s)
//  [python]
import numpy as np

H, W = map(int, input().split())
a = [list(input()) for _ in range(H)]

b = []
for i in range(H):
    if '#' in a[i]:
        b.append(a[i])
b = np.array(b)

c = []
for i in range(W):
    if '#' not in b[:, i]:
        c.append(i)

b = np.delete(b, c, axis=1)

for i in range(len(b)):
    print(*b[i], sep='')
//  [python]
import numpy as np

def main():
    h, w = map(int,input().split())
    arr = [0 for i in range(h)]

    for i in range(h):
        arr[i] = list(input())

    arr = np.array(arr)
    yoko = []
    tate = []

    for i in range(h):
        if np.any(arr[i]=='#') == False:
            yoko.append(i)

    for i in range(w):
        if np.any(arr.transpose()[i]=="#") == False:
            tate.append(i)

    arr = np.delete(arr, yoko, 0)
    arr = np.delete(arr, tate, 1)

    for i in arr:
        print("".join(i))



if __name__ == "__main__":
        main()
//  [java]
import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class Main {



	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);


String[] S=sc.nextLine().split(" ");
int X=Integer.parseInt(S[0]);
int Y=Integer.parseInt(S[1]);
boolean[] goodx=new boolean[110];
boolean[] goody=new boolean[110];

String[] board=new String[110];

for(int i=0;i<X;i++){
board[i]=sc.nextLine();
}
for(int i=0;i<X;i++){
for(int j=0;j<Y;j++){
String[] temp=board[i].split("");
if(temp[j].equals("#")){
goodx[i]=true;
goody[j]=true;
}
}
}
for(int i=0;i<X;i++){
if(goodx[i]){
for(int j=0;j<Y;j++){
if(goody[j]){
String[] tem=board[i].split("");
System.out.print(tem[j]);
}
}
System.out.println();
}



}

}




}
//  [java]
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner stdIn = new Scanner(System.in);
        int H = stdIn.nextInt();
        int W = stdIn.nextInt();
        char[][] a = new char[H][W];
        int[] h = new int[W];
        int[] w = new int[H];
        int counth = W;
        int count= H;
        boolean[] trushW = new boolean[W];
        boolean[] trushH = new boolean[H];
        for(int i=0; i < H;i++){
            String s = stdIn.next();
            w[i]=0;
            trushH[i] = true;
            for(int j=0; j<W;j++){
                a[i][j] = s.charAt(j);
                if(a[i][j] == '#')w[i]+=1;
                else w[i] -= 1;
            }
            if(w[i] == -counth){
                trushH[i]=false;
            }
        }
        for(int i =0; i<W;i++){
            trushW[i] = true;
            h[i] = 0;
            for(int j=0; j<H;j++){
               if(a[j][i] == '#')h[i]+=1;
                else h[i] -= 1; 
            }
            if(h[i] == -count){
                trushW[i]=false;
            }
        }
        for(int i=0;i<H;i++){
            for(int j=0;j<W;j++){
                if(trushH[i]&&trushW[j])System.out.print(a[i][j]);
            }
            if(trushH[i])System.out.println();
        }
    }
}
//  [java]
 
import java.util.Scanner;

  class Main {
    public static void main(String[]args){
        Scanner scan= new Scanner(System.in);
        int h = scan.nextInt();
        int w = scan.nextInt();
        
        boolean H[] = new boolean[h];
        boolean W[] =new boolean[w];
        char arr[][] = new char[h][w] ;
         
        for(int  i = 0 ; i < h ; i++){
            
            String T = scan.next();
            
            for(int j = 0 ; j <w ;j++){
                arr[i][j] = T.charAt(j);
                
                if(arr[i][j] == '#'){
                    H[i] = true ;
                    W[j] = true ;
                }
            }          
        }
        
        for(int i = 0 ; i<h ; i++){
            boolean k = false; 
            for(int j = 0 ; j <w ; j++){
                if(H[i] && W[j]){
                     k = true ;
                    System.out.print(arr[i][j]);
                }
            }
            if(k){
                System.out.println("");
            }
        }
    }
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int h, w;
char grid[200][200];

int main(){
  cin >> h >> w;
  rep(i, h){
    rep(j, w){ 
      cin >> grid[i][j];
    }
  }
  rep(i, h){
    bool flag = true;
    rep(j, w){
      if(grid[i][j] == '#'){
        flag = false;
        break;
      }
    }
    if(flag){
      for(int k = i; k < h; k++){
        rep(l, w){
          grid[k][l] = grid[k + 1][l];
          cerr << k <<" "<< l;
        }
      }
      i--; h--;
    }
  }
  rep(i, w){
    bool flag = true;
    rep(j, h){
      if(grid[j][i] == '#'){
        flag = false;
        break;
      }
    }
    if(flag){
      for(int k = i; k < w; k++){
        rep(l, h){
          grid[l][k] = grid[l][k + 1];
        }
      }
      i--; w--;
    }
  }
  rep(i, h){
    rep(j, w){
      cout << grid[i][j];
    }
    cout << endl;
  }
  return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int b,c,d,cb,cc;
char a[5000][5000];
int main(){
    cin>>b>>c;
    cb=b;
    cc=c;
    for(int i=0;i<b;i++){
        for(int u=0;u<c;u++){
            cin>>a[i][u];
        }
    }
    for(int rp=0;rp<12000;rp++){
            int ad=0;
        for(int i=0;i<b;i++){
            int ccc=0;
            for(int u=0;u<c;u++){
                if(a[i][u]=='#')ccc++;
            }
            if(ccc==0){
                for(int u=0;u<c;u++){
                    a[i][u]=a[i+1][u];
                    a[i+1][u]='.';
                }
            }
        }


        for(int i=0;i<c;i++){
            int ccc=0;
            for(int u=0;u<b;u++){
                if(a[u][i]=='#')ccc++;
            }
            if(ccc==0){
                for(int u=0;u<b;u++){
                    a[u][i]=a[u][i+1];
                    a[u][i+1]='.';
                }

            }
        }


    }
    int maxx=0,maxy=0;
    for(int i=0;i<b;i++){
        for(int u=0;u<c;u++){
            if(a[i][u]=='#'){
                maxx=max(maxx,i);
                maxy=max(maxy,u);
            }
        }
    }


    for(int i=0;i<maxx+1;i++){
        for(int u=0;u<maxy+1;u++){
            cout<<a[i][u];
        }cout<<endl;
    }





}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

bool isRow(vector<vector<char>> r, int i)
{
	for (int j = 0; j < r[0].size(); ++j)
	{
		if (r[i][j] != '.')
		{
			return false;
			break;
		}
	}
	return true;
}

bool isColumn(vector<vector<char>> r, int j)
{
	for (int i = 0; i < r.size(); ++i)
	{
		if (r[i][j] != '.')
		{
			return false;
			break;
		}
	}
	return true;
}

int main()
{
	int H, W;
	cin >> H >> W;
	vector<vector<char>> T(H, vector<char>(W));
	for (int i = 0; i < H; ++i)
		for (int j = 0; j < W; ++j)
			cin >> T[i][j];

	for (int i = 0; i < H; ++i)
	{
		for (int j = 0; j < W; ++j)
		{
			if (isColumn(T, j))
				continue;
			else if (isRow(T, i)) 
				goto skip;	
			else
				cout << T[i][j];
		}
		cout << endl;
        skip:{} 
	}
}
//  [c]
#include <unistd.h>
#include <stdlib.h>

char    *create_array(char *s, char *new_arr, char *t, int size)
{
	int i;
	int j;

	i = -1;
	while (s[++i])
		new_arr[i] = s[i];
	free(s);
	j = 0;
	while (j < size)
		new_arr[i++] = t[j++];   
	new_arr[i] = 0;
	return (new_arr);
}

char    *get_data(char *s)
{
	int     size;
	int     sum_size;
	char    t[1000];
	char    *new_arr;

	sum_size = 0;
	while ((size = read(0, t, 1000)))
	{
		if (size == -1)
			return (0);
		sum_size += size;
		if (!(new_arr = (char*)malloc(sum_size + 1)))
			return (0);
		s = create_array(s, new_arr, t, size);
	}
	return (s);
}

void    get_nums(int *array, char *s, int count)
{
	int num;
	int i;

	i = 0;
	while (s[i] && s[i] != 10)
	{
	    if (s[i] != 32)
	    {
	        num = 0;
	        while ('0' <= s[i] && s[i] <= '9')
	            num = num * 10 + s[i++] - '0';
	        array[count++] = num;
	        continue;
	    }
	    i++;
	}
}

char    *get_string(char *tmp, int pass_flag)
{
	int     i;
	int     j;
	int     k;
	int     count;
	char    *new_arr;

    count = 0;
	i = 0;
	while (count++ < pass_flag)
		while (tmp[i++] != 10)
			;
	j = 0;
	while (31 < tmp[i + j] && tmp[i + j] < 127)
		j++;
	if (!(new_arr = (char*)malloc(j + 1)))
	    return (0);
	k = -1;
	while (++k < j)
		new_arr[k] = tmp[i + k];
	new_arr[k] = 0;
	return (new_arr);
}

char    **get_strings(char *tmp, int pass_flag, int size)
{
	int     i;
	int     j;
	int     count;
	char    **new_arr;

	if (!(new_arr = (char**)malloc(sizeof(char*) * (size + 1))))
	    return (0);
	count = 0;
	i = 0;
	while (count++ < pass_flag)
		while (tmp[i++] != 10)
			;
	j = -1;
	while (++j < size)
		if(!(new_arr[j] = get_string(&tmp[i], j)))
		    return (0);
	new_arr[j] = 0;
	return (new_arr);
}

void get_ans(int *nums, char **arr, int i, int *y)
{
    int x[nums[0]];
    int j;

    while (++i < nums[0] && !(x[i] = 0))
    {
        j = -1;
        while (++j < nums[1])
            if (arr[i][j] == '.')
                arr[i][j] == '.' ? x[i]++, y[j]++ : 0;
    }
    i = -1;
    while (++i < nums[0])
    {
        if (x[i] == nums[1])
            continue;
        j = -1;
        while (++j < nums[1])
        {
            if (y[j] == nums[0])
                continue;
            write(1, &arr[i][j], 1);
        }
        write(1, "\n", 1);
    }
}

int     main(void)
{
	char    *s;
	int     nums[2];
	char    **arr;
	int     i;
	int     *y;
	
	s = malloc(1);
	if (!(s = get_data(s)))
	    return (-1);
	get_nums(nums, s, 0);
	arr = get_strings(s, 1, nums[0]);
	if (!(y = (int*) malloc(sizeof(int) * nums[1])))
	    return (-1);
	i = -1;
	while (++i < nums[1])
        y[i] = 0;
	get_ans(nums, arr, -1 , y);
	free(s);
	i = -1;
	while (++i < nums[0])
	    free(arr[i]);
	free(arr);
	free(y);
	return (0);
}
//  [c]
#include <unistd.h>
#include <stdlib.h>

void    get_nums(int *array, char *s, int count)
{
	int num;
	int i;

	i = 0;
	while (s[i] && s[i] != 10)
	{
	    if (s[i] != 32)
	    {
	        num = 0;
	        while ('0' <= s[i] && s[i] <= '9')
	            num = num * 10 + s[i++] - '0';
	        array[count++] = num;
	        continue;
	    }
	    i++;
	}
}

char    *get_string(char *tmp, int pass_flag)
{
	int     i;
	int     j;
	int     k;
	int     count;
	char    *new_arr;

    count = 0;
	i = 0;
	while (count++ < pass_flag)
		while (tmp[i++] != 10)
			;
	j = 0;
	while (31 < tmp[i + j] && tmp[i + j] < 127)
		j++;
	if (!(new_arr = (char*)malloc(j + 1)))
	    return (0);
	k = -1;
	while (++k < j)
		new_arr[k] = tmp[i + k];
	new_arr[k] = 0;
	return (new_arr);
}

char    **get_strings(char *tmp, int pass_flag, int size)
{
	int     i;
	int     j;
	int     count;
	char    **new_arr;

	if (!(new_arr = (char**)malloc(sizeof(char*) * (size + 1))))
	    return (0);
	count = 0;
	i = 0;
	while (count++ < pass_flag)
		while (tmp[i++] != 10)
			;
	j = -1;
	while (++j < size)
		if(!(new_arr[j] = get_string(&tmp[i], j)))
		    return (0);
	new_arr[j] = 0;
	return (new_arr);
}

void get_ans(int *nums, char **arr, int i, int *y)
{
    int x[nums[0]];
    int j;

    while (++i < nums[0] && !(x[i] = 0))
    {
        j = -1;
        while (++j < nums[1])
            if (arr[i][j] == '.')
                arr[i][j] == '.' ? x[i]++, y[j]++ : 0;
    }
    i = -1;
    while (++i < nums[0])
    {
        if (x[i] == nums[1])
            continue;
        j = -1;
        while (++j < nums[1])
        {
            if (y[j] == nums[0])
                continue;
            write(1, &arr[i][j], 1);
        }
        write(1, "\n", 1);
    }
}

int     main(void)
{
	char    s[10200];
	int     nums[2];
	char    **arr;
	int     i;
	int     *y;
	
	if ((i = read(0, s, 10200)) == -1)
	    return (-1);
	s[i] = 0;
	get_nums(nums, s, 0);
	arr = get_strings(s, 1, nums[0]);
	if (!(y = (int*) malloc(sizeof(int) * nums[1])))
	    return (-1);
	i = -1;
	while (++i < nums[1])
        y[i] = 0;
	get_ans(nums, arr, -1 , y);
	i = -1;
	while (++i < nums[0])
	    free(arr[i]);
	free(arr);
	free(y);
	return (0);
}
//  [c]
/* ex 7_3
   アカウント名 */

#include <stdio.h>
#include <stdlib.h>


int main(void){
    int i, j, k, row, column;
    char tmp;
    char **ptr;
    scanf("%d %d\n", &row, &column);
    int row_flag[row], column_flag[column];
    ptr = (char**)calloc(row, sizeof(char*));
    if(ptr == NULL){
        fprintf(stderr, "calloc error.\n");
        exit(1);
    }
    for(i = 0; i < row; i++){
        ptr[i] = (char*)calloc(column, sizeof(char));
        if(ptr[i] == NULL){
            fprintf(stderr, "calloc error.\n");
            exit(1);
        }
    }
    for(i = 0; i < row; i++){
        row_flag[i] = 0;
    }
    for(i = 0; i < column; i++){
        column_flag[i] = 0;
    }
    for(i = 0; i < row; i++){
        for(j = 0; j < column; j++){
            scanf(" %c", &ptr[i][j]);
            if(ptr[i][j] == '#'){
                row_flag[i] = 1;
                column_flag[j] = 1;
            }
        }
    }

    for(i = 0; i < row; i++){
        k = 0;
        for(j = 0; j < column; j++){
            if(row_flag[i] == 1 && column_flag[j] == 1){
                printf("%c", ptr[i][j]);
                k = 1;
            }
        }
        if(k == 1){
            printf("\n");
        }
    }

    for(i = 0; i < row; i++){
        free(ptr[i]);
    }
    free(ptr);

    return 0;
}
//  [javascript]
var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<val)val = rest[i];return val}
function max(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>val)val = rest[i];return val}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var input = input.split('\n');
	var hw = toIntArr(input[0].split(' '));
	var h = hw[0];
	var w = hw[1];
	var as = [];
	for(var i = 0; i < h; i++){
		as[i] = input[i+1];
	}

	var hs = [];
	var ws = [];

	var temp;
	for(var i = 0; i < h; i++){
		temp = true;
		for(var j = 0; j < w; j++){
			if(as[i][j] === '#'){
				temp = false;
				break;
			}
		}
		if(!temp) hs.push(i);
	}
	for(var j = 0; j < w; j++){
		temp = true;
		for(var i = 0; i < h; i++){
			if(as[i][j] === '#'){
				temp = false;
				break;
			}
		}
		if(!temp) ws.push(j);
	}

	for(var i = 0; i < hs.length; i++){
		temp = '';
		for(var j = 0; j < ws.length; j++){
			temp += as[hs[i]][ws[j]];
		}
		console.log(temp);
	}
}