jiahuimbzuai/CoQuIR huggingface dataset:
//  [python]
from numba import njit
 
# @njit(cache=True)
@njit()
def convolve(a, b):
    def poww(aa, bb, mm):
        ss = 1
        tt = aa
        while bb:
            if bb % 2:
                ss = ss * tt % mm
                bb -= 1
            tt = tt * tt % mm
            bb //= 2
        return ss
    def fft(n, p, g, w, invw, f):
        d = n // 2
        v = w
        while d >= 1:
            u = 1
            for i in range(d):
                for j in range(i, n, 2*d):
                    f[j], f[j+d] = (f[j] + f[j+d]) % p, u * (f[j] - f[j+d]) % p
                u = u * v % p
            v = v * v % p
            d //= 2
 
    def ifft(n, p, g, w, invw, f):
        d = 1
        while d < n:
            v = poww(invw, n // (2 * d), p)
            u = 1
            for i in range(d):
                for j in range(i, n, 2*d):
                    f[j+d] *= u
                    f[j], f[j+d] = (f[j] + f[j+d]) % p, (f[j] - f[j+d]) % p
                u = u * v % p
            d *= 2
 
    p = 1107296257
    g = 5
    n0, n1 = len(a), len(b)
    n = 1
    while n < max(n0, n1) * 2:
        n *= 2
    a = a + [0] * (n-n0)
    b = b + [0] * (n-n1)

    w = poww(g, (p - 1) // n, p)
    invw = poww(w, p-2, p)
    fft(n, p, g, w, invw, a), fft(n, p, g, w, invw, b)
    for i in range(n):
        a[i] = a[i] * b[i] % p
    ifft(n, p, g, w, invw, a)
    invn = poww(n, p - 2, p)
    for i in range(n0 + n1 - 1):
        a[i] = a[i] * invn % p
    return a[:n0 + n1 - 1]

N = 100000
A = []
B = []
s = 0
for i in range(N):
    s = (s * 3 + i * 7) % 100
    a = s
    b = (s * 3 + a * 11) % 100
    A.append(a)
    B.append(b)

AB = convolve(A, B)


#####
A, B, C, K = map(int, input().split())
if K <= A + B:
    print(min(A, K))
else:
    print(A - (K - A - B))
//  [python]
"""
https://atcoder.jp/contests/abc167/tasks/abc167_b
"""
import numpy as np
from numba import jit


@jit(nopython=True, parallel=False)
def calc(A: int, B: int, C: int, K: int) -> int:
    if A >= K:
        return K
    if A + B >= K:
        return A
    return A - (K - (A + B))


def load_input_as_int_array() -> np.ndarray:
    return np.array([int(v) for v in input().split(" ")])


def main() -> None:
    A, B, C, K = load_input_as_int_array()
    result = calc(A, B, C, K)
    print(result)
    # print("Yes" if result else "No")


main()
//  [java]
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();	
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		int value = 0;
		while (k > 0) {
			if (a!=0) {
				a--;
				k--; 
				value+=1;
			} else if (b != 0) {
				b--; k--; ;
			} else if (c != 0) {
				c--; k--; value-=1;
			} else {
				break;
			}
		}

		System.out.println(value);
	}
}
//  [java]
import java.util.Scanner;

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

		int A = sc.nextInt();
		int B = sc.nextInt();
      	int C = sc.nextInt();
        int K = sc.nextInt();

      	int ans = 0;
      	for(int i = 0; i < K ; i++){
        	if(A != 0){
              	A--;
            	ans++;
            }else if(B != 0){
              	B--;
            }else if(C != 0){
              	C--;
            	ans--;
            }
        }
			System.out.println(ans);
		
	}
}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		int tmp_a = a;
		int tmp_b = b;
		int tmp_c = c;

		int ans = 0;
		sc.close();

		for (int i = 0; i < tmp_a; i++) {
			if (k == 0 || a == 0) {
				break;
			} else {
				ans ++;
				k --;
				a --;
			}
		}


		for (int i = 0; i < tmp_b; i++) {
			if (k == 0 || b == 0) {
				break;
			} else {
				k --;
				b --;
			}
		}


		for (int i = 0; i < tmp_c; i++) {
			if (k == 0 || c == 0) {
				break;
			} else {
				ans --;
				k --;
				c --;
			}
		}
		System.out.println(ans);


	}

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

int main(){
  
  int a,b,c,k,max=0;
  cin>>a>>b>>c>>k;
  for(int n=1;n<=k;n++){
    if(n<=a) max+=1;
    else if(n-a<=b);
    else if(n-a-b<=c) max-=1;
  }
  cout<<max<<endl;
  return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
int main(){
  int A,B,C,K;
  cin>>A>>B>>C>>K;
  int cnt=0;
  int ans=0;
  while(true){
    if(cnt==K)break;
    if(A>0){
      A--;
      ans++;
    }
    else if(A==0&&B>0){
      B--;
    }
    else if(A==0&&B==0&&C>0){
      ans--;
    }
  cnt++;

//  cout<<cnt<<" "<<ans<<endl;
  }
  cout<<ans<<endl;

}
//  [c]
#include<stdio.h>
#include<math.h>
#include<string.h>

int main(void) {
	int a, b, c, k, i;
	int ans = 0;
	scanf("%d%d%d%d", &a, &b, &c, &k);
	for (i = 1; i <= k; i++) {
		if (a > 0) {
			ans = ans + 1;
			a = a - 1;
		}
		else if (b > 0) {
			b = b - 1;
		}
		else if (c > 0) {
			ans = ans - 1;
			c = c - 1;
		}
	}
	printf("%d", ans);
	return 0;
}
//  [c]
#include<stdio.h>
int main(){
int a,b,c,k,max=0,i;
scanf("%d %d %d %d",&a,&b,&c,&k);
for(i=1;i<k+1;i++){
    if (a>0){
        max+=1;
        a = a-1;}
    else if (b>0){
        max+=0;
        b = b-1;}
    else if (c>0){
        max = max-1;
        c = c-1;
}
}
printf("%d",max);
return 0;
}
//  [c]
#include <stdio.h>

int main() {
    int A, B, C, K;
    scanf("%d %d %d %d", &A, &B, &C, &K);

    int ans = 0;
    for(int i = 0; i < K; i++) {
        if(A != 0) {
            A--;
            ans++;
        }else if(B != 0) {
            B--;
        }else if(C != 0) {
            C--;
            ans--;
        }
    }

    printf("%d\n", ans);
}
//  [javascript]
"use strict";

function main(input) {
  input = input.split(" ");
  input[0] = parseInt(input[0]);
  input[1] = parseInt(input[1]);
  input[2] = parseInt(input[2]);
  let num = parseInt(input[3]);
  let result = 0;

  for (let i = 0; i < 3; i++) {
    let num2 = num;
    num = num - input[i];
    if (num > 0) {
      // 継続
      if (i === 0) {
        result = result + input[i];
      } else if (i === 1) {
        //何もしない
      } else if (i === 2) {
        result = result - input[2];
      }
    } else {
      if (i === 0) {
        result = result + num2;
      } else if (i === 1) {
        //何もしない
      } else if (i === 2) {
        result = result - num2;
      }
      console.log(result);
      return;
    }
  }
}

main(require("fs").readFileSync("/dev/stdin", "utf-8"));
//  [javascript]
function Main(input){
  
  input = input.split(" ");
  const A = parseInt(input[0],10);
  const B = parseInt(input[1],10);
  let K = parseInt(input[3],10);
  
  if( A >= K ){
  	console.log(K);
  }else if( A + B >= K){
  	console.log(A);
  }else{
  	K = K - A - B;
    console.log(A - K);
  }
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  input = input.split(" ");
  const A = Number.parseInt(input[0]);  //1
  const B = Number.parseInt(input[1]);  //0
  const C = Number.parseInt(input[2]);  //-1
  const K = Number.parseInt(input[3]);

  if (A >= K) {
    console.log(K);
  } else if (A + B >= K) {
    console.log(A);
  } else {
    console.log(A - (K - A - B));
  }

}

// デバッグ用
function debug() {
  var input = document.getElementById("input").value;
  Main(input);
}

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

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

// https://atcoder.jp/contests/abc167/tasks/abc167_b
func main() {
	var lines []string
	stdin := bufio.NewScanner(os.Stdin)
	for stdin.Scan() {
		lines = append(lines, stdin.Text())
	}
	// A B C K (1 0 -1 K枚）の最大をとる
	cards := strings.Split(lines[0], " ")
	one, _ := strconv.Atoi(cards[0])
	zero, _ := strconv.Atoi(cards[1])
	minus, _ := strconv.Atoi(cards[2])
	count, _ := strconv.Atoi(cards[3])
	result := 0;

	for i := 0; i < count; i++ {
		if one > 0 {
			result++
			one--
		} else if zero > 0 {
			zero--
		} else {
			result--
			minus--
		}
	}

	fmt.Println(result)

}
//  [go]
package main

import (
	"fmt"
)

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

	var ans int
	for i := 1; i <= k; i++ {
		if i <= a {
			ans++
		} else if i > a+b {
			ans--
		}
	}

	fmt.Println(ans)
}
//  [go]
package main

import "fmt"

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

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

if k <= a
  puts k
elsif k <= a + b
  puts a
else
  puts a - (k - a - b)
end
//  [ruby]
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

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

A,B,C,K = gets_i_list

if A >= K
  puts K
elsif A + B >= K
  puts A
else
  c = K - A - B
  puts A - c
end
//  [ruby]
A, B, C, K = gets.split.map(&:to_i)

sum = 0
k = K

d = [A, k].min
k -= d
sum += 1 * d
(puts sum; exit) if k == 0

d = [B, k].min
k -= d
sum += 0 * d
(puts sum; exit) if k == 0

d = [C, k].min
k -= d
sum += -1 * d
(puts sum; exit) if k == 0
//  [rust]
use proconio::*;
fn main() {
    input! {
        mut a: usize, mut b: usize, mut c: usize, k: usize
    }
    let mut count = 0;
    let mut score = 0;
    while count != k {
        score += if a > 0 {
            a -= 1;
            1
        } else if b > 0 {
            b -= 1;
            0
        } else {
            c -= 1;
            -1
        };
        count += 1;
    }
    println!("{}", score);
}
//  [rust]
use proconio::{input, fastout};

#[fastout]
fn main() {
    input!{
        a: i32,
        b: i32,
        c: i32,
        k: i32,
    }

    let mut total = 0;
    let mut a_cnt = a;
    let mut b_cnt = b;
    let mut c_cnt = c;
    let mut took = 0;

    for _ in 0..k {
        if a_cnt != 0 && took != k{ 
            total += 1;
            a_cnt -= 1;
            took += 1;
            continue;
        }
        break;
    }
    for _ in 0..k - took {
        if b_cnt != 0 && took != k{
            b_cnt -= 1;
            took += 1;
            continue;
        }
        break;
    }
    for _ in 0..k - took{
        if c_cnt != 0 && took != k{
            total -= 1;
            c_cnt -= 1;
            took += 1;
            continue;
        }
        break;
    }
    println!("{}", total);
}
//  [swift]
import Foundation

let values = readLine()!.components(separatedBy: " ")

let A = Int(values[0])!
let B = Int(values[1])!
let C = Int(values[2])!
let K = Int(values[3])!

var a = 0
var b = 0
var c = 0
var k = K

a = min(A, K)
k -= a
if k > 0 {
    b = min(B, k)
    k -= b
    if k > 0 {
        c = min(C, k)
    }
}

var total = a + (-1 * c)
print(total)
//  [swift]
import Foundation
let arr=readLine()!.split{$0==" "}.map{Int(String($0))!}
var a=arr[0]
var b=arr[1]
var c=arr[2]
var k=arr[3]
var max = 0

if k >= a {
    max += a
    k -= a
    if k > 0 {
        k -= b
        if  k > 0  {
           max -= k
        }
    }
}else{
    max = k
}
print(max)
//  [swift]
import Foundation

let input = readLine()!
let inputArray = input.components(separatedBy: " ")
let A = Int(inputArray[0])!
let B = Int(inputArray[1])!
let C = Int(inputArray[2])!
let K = Int(inputArray[3])!
var max = 0

if A > K {
    print(K)
} else {
    max = A
    var remain = K - A
    if B > K {
        print(max)
    } else {
        remain -= B
        max -= remain
        print(max)
    }
    
}
//  [typescript]
const lines: string[] = [];
const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
reader.on("line", function (line: string) {
  lines.push(line);
});

reader.on("close", function () {
  const rule = lines.shift().split(" ").map(Number);
  const one = rule[0];
  const zero = rule[1];
  const minus = rule[2];
  let num = rule[3];

  let res = 0;
  num = num - one;

  if (num <= 0) {
    console.log(rule[3]);
    return;
  }

  num -= zero;
  if (num <= 0) {
    console.log(one);
    return;
  }

  console.log(one - num);
});
//  [typescript]
import { count } from 'console';

process.stdin.resume();
process.stdin.setEncoding('utf8');

// 標準入力取込
let gInput = '';
process.stdin.on('data', (chunk) => (gInput += chunk));
process.stdin.on('end', () => main(gInput.split(/\r?\n/)));

// 解答
function main(inputs: string[]): void {
  const card = inputs[0].split(' ').map(Number);
  let k = card[3];
  let num = 1;
  let max = 0;

  for (let i = 0; i < 3; i++) {
    if (k <= 0) break;

    if (card[i] > k) {
      max += num * k;
    } else {
      max += num * card[i];
    }
    num--;
    k -= card[i];
  }

  console.log(max);
}
//  [python]
from collections import Counter
import bisect

N = int(input())
S = [input() for _ in range(N)] ## 縦一列


cnt = list(Counter(S).items())
cnt = sorted(cnt, key=lambda x: (-x[1], x[0]))

max_cnt = cnt[0][1]

lst = [cnt[i][1] for i in range(len(cnt))][::-1]
n_print = len(cnt) - bisect.bisect_left(lst, max_cnt)

for i in range(n_print):
  print(cnt[i][0])
//  [python]
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]

c = Counter(s)

max_count = c.most_common()[0][1]

c = sorted(c.items())

for i in range(len(c)):
    if max_count == c[i][1]:
        print(c[i][0])
//  [python]
from collections import OrderedDict
import sys
input = sys.stdin.readline

def resolve():
    n = int(input())

    count = OrderedDict()
    for _ in range(n):
        name = input()
        if name not in count.keys():
            count[name] = 1

        else:
            count[name] += 1

    count = OrderedDict(
        sorted(count.items(), key=lambda x: x[0])
    )
    max_polls = max(count.values())

    for k, v in count.items():
        if v == max_polls:
            print(k)
            
resolve()
//  [java]
import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s[] = new String[n];
		int data[] = new int [n];
		int count = 0;
		int max = 0;
		String ans[] = new String[n];
		int precount = 0;

		for (int i = 0;i<n ;i++ ) {
			s[i] = sc.next();
			ans[i] = s[i];
		}

		Arrays.sort(s);
		Arrays.sort(ans);

		for (int i = 0;i<n-1 ;i++ ) {
			if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		}
		max = Math.max(max,data[count]);
		if (n-1==precount) {
			System.out.println(ans[0]);
			System.exit(0);
		}

		for (int i = 0;i<n ;i++ ) {
			if (max==data[i]) {
				System.out.println(ans[i]);
			}
		}




	}
}
//  [java]
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		Arrays.sort(s);
		String name = s[0];
		int count = 0;
		int max = 0;
		Map<String, Integer> lists = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		}
		lists.put(name, count);
		List<String> ans = new ArrayList<String>();
		for (String key : lists.keySet()) {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for(int i=0;i<ans.size();i++) {
			System.out.println(ans.get(i));
		}
	}
}
//  [java]
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] array = new String[n];
		int[] iarray = new int[n];
		sc.nextLine();
		for(int i = 0;i < n;i++){
			array[i] = sc.nextLine();
		}
		Arrays.sort(array);
int count = 0;
int max = 0;
		for(int i = 0;i < n-1;i++){
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		}

		for(int i = 0;i < n;i++){
			if(iarray[i] == max){
				System.out.println(array[i]);
			}
		}

		}
}
//  [cpp]
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstdlib>

using namespace std;
//DP用
template<class T> inline bool chmin(T& a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
const long long INF = 1LL << 60;

int main() {
    int n;
    cin >> n;
    string s[n];
    map<string,int> t;
    set<string> u,v;
    set<string>::iterator itr;
    for(int i = 0; i < n; i++) {
        cin >> s[i];
        v.insert(s[i]);
    }
    for(itr = v.begin(); itr != v.end(); itr++) {
        t[*itr] = 0;
    }
    for(int i = 0; i < n; i++) {
        t[s[i]] += 1;
    }
    
    int max = 0;
    for(int i = 0; i < n; i++) {
        if(max <= t[s[i]]) {
            max = t[s[i]];
        }
    }
    for(int i = 0; i < n; i++) {
        if(max == t[s[i]]){
            u.insert(s[i]);
        }
    }
    for(itr = u.begin(); itr != u.end(); itr++) {
        cout << *itr << endl;
    }
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i,n) for (int i =0;i<n;i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(){
  int n;
  cin >> n;
  vector<string> s(n);
  map<string,int> m;
  int cnt=0;
  vector <string> ans;
  map <string,int> m2;
  rep(i,n){
    cin >> s[i];
    m[s[i]]+=1;
    m2[s[i]]=0;
  }
  rep(i,n){
    if(cnt<=m[s[i]])cnt=m[s[i]];
    }
  rep(i,n){
    if(cnt==m[s[i]]){
      if(m2[s[i]]==0){
	ans.push_back(s[i]);
	m2[s[i]]+=1;
      }
    }
  }
  sort(ans.begin(), ans.end());
  for(string i: ans){
    cout << i << endl;
  }
  return 0;
}
//  [cpp]
#define _GLIBCXX_DEBUG//TLEの原因になるので注意！！！！！！！！！！！
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.xise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//#define int long long

//cerrはコメントアウトしなくても通る//ただしTLEを引き起こすことがある

ll N,M,H,W,K,Q,A,B;
string S;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
//const ll INF = 1LL << 60;
//typedef pair<ll,ll> P;
typedef pair<int, int> P;
bool chmx(int &a, int b) {
	if (b > a) {
		a = b;
		return true;
	}
	return false;
}

bool chmn(int &a, int b) {
	if (b < a) {
		a = b;
		return true;
	}
	return false;
}


vector<string> SS;

int main(){
    int n;
    cin >> n;
    string s[n];
    rep(i,n){
        cin >> s[i];
        SS.push_back(s[i]);
    }
    sort(SS.begin(),SS.end());
    cerr<<endl;
    /*
    rep(i,n){
        cerr<<SS[i]<<endl;
    }
    */
    ll k=0;
    string kk="-1";
    vector<pair<ll,string>> PP;
    rep(i,n){
        if(SS[i]==kk){
            k++;
            if(i==n-1){
                PP.push_back(mp(k,kk));
            }
        }else{
            PP.push_back(mp(k,kk));
            cerr<<k<<' '<<kk<<endl;
            k=1;
            kk=SS[i];
            if(i==n-1){
                PP.push_back(mp(k,kk));
            }
        }
    }
    sort(PP.begin(),PP.end(),greater<pair<ll,string>>());
    ll kkk=PP[0].first;
    cerr<<kkk<<endl;
    ll i=0;
    cerr<<endl;
    vector<string> SSS;
    while(PP[i].first==kkk){
        SSS.push_back(PP[i].second);
        i++;
    }
    rep(j,SSS.size()){
        cout<<SSS[SSS.size()-j-1]<<endl;
    }
    /*
    pair<int,string> p[n];
    rep(i,SS.size()){
        p[i]=pair(SS[i].second,SS[i].first);
        PP.push_back(p[i]);
    }
    PP.sort();
    int k=PP[0].first;
    int i=0;
    while(PP[i].first==k){
        cout<<PP[i].second<<endl;
        i++;
    }
    */
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
char c[200002][11];
void merge(int i,int j,char s[][11]){
  if(i!=j){
    merge(i,(i+j)/2,s);
    merge((i+j)/2+1,j,s);
    int a=i,b=(i+j)/2+1;
    int d;
    for(d=i;d<=j;d++){
      if((i+j)/2<a){
        strcpy(c[d],s[b]);
        b++;
      }
      else if(j<b){
        strcpy(c[d],s[a]);
        a++;
      }
      else if(strcmp(s[a],s[b])<0){
        strcpy(c[d],s[a]);
        a++;
      }
      else{
        strcpy(c[d],s[b]);
        b++;
      }
    }
    for(d=i;d<=j;d++)
      strcpy(s[d],c[d]);
  }
}

int main(){
  int n,i,j=0,max=0;
  scanf("%d",&n);
  int count[n];
  char s[n][11];
  char t[n][11];
  for(i=0;i<n;i++){
    scanf("%s",s[i]);
    count[i]=0;
  }
  merge(0,n-1,s);
  for(i=0;i<n;i++){
    if(strcmp(s[i],s[i+1])==0)
      count[j]++;
    else{
      count[j]++;
      if(max<count[j])
        max=count[j];
      strcpy(t[j],s[i]);
      j++;
    }
  }
  for(i=0;i<j;i++)
    if(max==count[i])
      printf("%s\n",t[i]);
  return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
int R=1,C=1,H[2000010],N[2000010];
char S[200010][20];
//評価関数（いまはMIN）
int hyouka(int a,int b){
  if(C<b)return 1;
  if(C<a||b==0)return 0;
  return strcmp(S[N[H[a]]],S[N[H[b]]])<0?1:0;
}
//挿入関数
void hin(int a){
  int i=C++;
  for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//取り出す関数
int hout(){
  int rt=H[1],i,j=2,k=H[--C];
  for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
  H[j/2]=k;
  return rt;
}
int main(){
  int n,i,m=0,d[200010],b[200010]={1};
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",S[i]);
    hin(i);
  }
  for(i=0;i<n;i++)d[i]=N[hout()];
  //for(i=0;i<n;i++)printf("!!%s\n",S[d[i]]);
  for(i=1;i<n;i++){
    if(strcmp(S[d[i]],S[d[i-1]])==0)b[i]=b[i-1]+1;
    else                            b[i]=1;
    if(m<b[i])m=b[i];
  }
  //for(i=0;i<n;i++)printf("%d\n",b[i]);
  for(i=0;i<n;i++){
    if(b[i]==m)printf("%s\n",S[d[i]]);
  }
  return 0;
}
//  [c]
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>

#define P 1000000007

int comp(const void *a, const void *b){return *(int*)a-*(int*)b;}
int comps(const void *a, const void *b){return strcmp(a, b);}

int main(void){
	int n, i;
	char s[200000][11];
	int a[200000];
	scanf("%d", &n);
	for(i=0; i<n; i++){
		scanf("%s", s[i]);
		a[i]=0;
	}
	qsort(s, n, 11, comps);

	int max=0;
	for(i=0; i<n; i++){
		int l=0, r=n-1, m;
		while(l<=r){
			m=(l+r)/2;
			if(comps(s[m], s[i])>=0) r=m-1; else l=m+1;
		}
		a[l]++;
		if(a[l]>max) max=a[l];
	}
	for(i=0; i<n; i++){
		if(a[i]==max) printf("%s\n", s[i]);
	}
}
//  [javascript]
'use strict'

const Main = (input) => {
  const nr = input.split('\n')
  const N = parseInt(nr[0])
  let counts = {}
  let max = {name: [], value: 0}
  for (let i = 1; i < N + 1; i++) {
    const key = nr[i]
    counts[key] = (counts[key]) ? counts[key] + 1 : 1
    if (counts[key] > max.value) {
      max.name = [key]
      max.value = counts[key]
    } else if (counts[key] === max.value) {
      max.name.push(key)
    }
  }
  max.name = max.name.sort()
  for (let j = 0; j < max.name.length; j++) {
    console.log(max.name[j])
  }
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	//tmp = input[1].split(" ");
	//文字列から10進数に変換するときはparseIntを使います
    var n = parseInt(input[0], 10);
    var p = input;
    p.shift();
    var maps = {};
    var m = 1;
    var str1 = [];
    var str2 = "";


    for(var i =0; i<n; i++){
        var str = p[i];
        if(!maps[str]){
            maps[str] = {'str':str,'count':1};
        }
        if(maps[str]){
            maps[str]['count'] +=1;
            var k = maps[str]['count'];
            if(k>m){
                m=k;
            }

        }
    }

    for(var obj in maps){
        if(maps[obj]['count']==m){
            str1.push(maps[obj]['str']);
        }
    }
    
    if(str.length>1){
        str2 = str1.slice();
        str2.sort();
        for(var j=0;j<str2.length;j++){
            console.log(str2[j]);
        }

    }else{
        console.log(str1);
    }
    

    

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  var N = input[0].split(" ")[0]-0;
  var map = {};
  var max = 0;
  for(var i=1;i<=N;i++){
    map[input[i]] = (map[input[i]]||0)+1;
    max = Math.max(max, map[input[i]]);
  }
  Object.keys(map).filter(v=>map[v]==max).sort().forEach(v=>console.log(v));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').split("\n"))
//  [go]
package main

import (
	"fmt"
	"sort"
)


func main() {

	// input size
	var n int
	fmt.Scan(&n)
	slist := make([]string, n)

	// make input value list
	for i := 0; i < n; i++ {
		fmt.Scan(&slist[i])
	}

	// make word count map
	wcMap := make(map[string]int)
	for k := 0; k < len(slist); k++ {
		_, exists := wcMap[slist[k]]
		if exists {
			wcMap[slist[k]]++
		} else {
			wcMap[slist[k]] = 1
		}
	}

	// take countMax
	max := 0
	maxMap := make(map[string]int)
	for key, value := range wcMap {

		if value > max {
			max = value
			maxMap = make(map[string]int)
			maxMap[key] = value
		} else if value == max {
			maxMap[key] = value
		}
	}

	results := make([]string, len(maxMap))
	index := 0
	for key := range maxMap {
		results[index] = key
		index++
	}
	sort.Strings(results)

	for _, l := range results {
		fmt.Println(l)
	}
}
//  [go]
package main
 
import (
	"fmt"
	"sort"
)
 
func main() {
	var N int
	var S string
	fmt.Scan(&N)
	max := 0
	m := map[string]int {}
	for i := 0; i < N; i++ {
	    fmt.Scan(&S)
		m[S] = m[S] + 1
		max = calcmax(max, m[S])
	}
	l := []string {}
	for k, v := range m {
		if v == max {
			l = append(l, k)
		}
	}
	sort.Slice(l, func(i, j int) bool { return l[i] < l[j] })
	for _, v := range l {
		fmt.Println(v)
	}
}

func calcmax(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}
//  [go]
package main

import (
	"fmt"
	"sort"
)

func main() {
	var N int
	fmt.Scan(&N)

	S := make([]string, N)
	m := make(map[string]int)
	max := 0
	for i, _ := range S {
		fmt.Scan(&S[i])
		m[S[i]]++
		if max < m[S[i]] {
			max = m[S[i]]
		}
	}

	k := make([]string, 0)
	for key, _ := range m {
		k = append(k, key)
	}

	sort.Strings(k)

	for _, key := range k {
		if m[key] == max {
			fmt.Println(key)
		}
	}

}
//  [ruby]
#!/usr/bin/ruby

require 'pp'

N = gets.chomp.to_i


map = {}

1.upto(N){|i|
  s = gets.chomp
  if map[s] == nil
    map[s] = 1
  else
    map[s]+=1
  end
}


result = map.sort_by{|k,v| [-v, k]}

c = result[0][1]
result.each{|e|
  if c == e[1]
    puts e[0]
  else
    break
  end
}
//  [ruby]
n = gets.chomp.to_i
hash = {}

n.times{|i|
    word = gets.chomp
    hash[word] ||= 0
    hash[word] += 1
}

max_value = hash.values.max
result_hash = hash.select{|k, v| v == max_value}

result_hash.sort.each {|k,v|
    puts k
}
//  [ruby]
N = gets.to_i
S = readlines.map(&:chomp)
a = S.group_by(&:itself).map {|s,n| [n.size, s] }.sort
puts a.drop_while {|aa| aa[0] < a[-1][0] }.map(&:last).sort
//  [typescript]
class NormalInput{
  input: string[];
  pointer: number;
  constructor(raw:string){
    this.input=raw.split(/ |\n/);
    this.pointer=0;
  }
  int = ():number=>{
    const ret= parseInt(this.input[this.pointer], 10);
    this.pointer++;
    return ret;
  }
  str=():string=>{
    const ret= this.input[this.pointer];
    this.pointer++;
    return ret;
  }
  strs=(length:number):string[]=>{
    let ret:string[]=[];
    for(let i=0;i<length;i++){
      ret.push(this.str());
    }
    return ret;
  }
  ints=(length:number):number[]=>{
    let ret:number[]=[];
    for(let i=0;i<length;i++){
      ret.push(this.int());
    }
    return ret;
  }
}

function Main({int,str,strs,ints}:NormalInput) {
  const N = int();
  const S = strs(N);
  const count = new Map<string, number>();
  let max=0;
  S.forEach(element => {
    if(!(count.has(element)))count.set(element,1);
    else{
      count.set(element,count.get(element)+1)
    }
    max = Math.max(max,count.get(element))
  });
  // console.log(count);
  // console.log(max);
  const ans=[];
  count.forEach((value,key)=>{if(value==max){ans.push(key)}});
  ans.sort();
  ans.forEach(a=>console.log(a))
}

//DO NOT EDIT
Main(new NormalInput(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import * as fs from 'fs'

//in
// 7
// beat
// vet
// beet
// bed
// vet
// bet
// beet
//out
// beet
// vet

let input: string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
const n: number = parseInt(input[0]);
input.shift();
let s: string[] = input.sort();

const counts: any = {};
let maxCnt: number = 0;
for (let i: number = 0; i < n; i++) {
    let key = s[i];
    counts[key] = (counts[key]) ? counts[key] + 1 : 1;
    if (maxCnt < counts[key]) {
        maxCnt = counts[key];
    }
}

const key = Object.keys(counts);
const result = key.filter(key => counts[key] === maxCnt);
console.log(result.join('\n'))
//  [typescript]
import * as fs from 'fs'

//in
// 7
// beat
// vet
// beet
// bed
// vet
// bet
// beet
//out
// beet
// vet

let input: string[] = fs.readFileSync('/dev/stdin', 'utf8').split('\n');
const n: number = parseInt(input[0]);
input.shift();
let s:string[] = input.sort();

const counts: any = {};
let maxCnt: number = 0;
for (let i: number = 0; i < s.length; i++) {
    let key = s[i];
    counts[key] = (counts[key]) ? counts[key] + 1 : 1;
    if (maxCnt < counts[key]) {
        maxCnt = counts[key];
    }
}

// console.log(counts)

// for (let i: number = 0; i < Object.keys(counts).length; i++) {
//     if (parseInt(counts[i]) === maxCnt) {
//
//     }
// }
const key = Object.keys(counts);
const result = key.filter(key =>counts[key]===maxCnt)

console.log(result.join('\n'))
//  [python]
a = 'FESTIVAL'
b = input()
print(b[:-len(a)])
//  [python]
a = input()
print(a[:-8])
//  [python]
inputs = input()

print(inputs[:-8])
//  [python]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import re
import string

S = input()
print(S[:-8])
//  [python]
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def main():
    s = S()

    return s[:-8]


print(main())
//  [python]
import sys
input = sys.stdin.readline
from collections import *

S = input()[:-1]
print(S[:-8])
//  [java]

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

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader( new InputStreamReader(System.in));
		
		String s=br.readLine();
		System.out.println(s.substring(0, s.length()-8));

	}

}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main {
	
	static class Scanner{
		BufferedReader br=null;
		StringTokenizer tk=null;
		public Scanner(){
			br=new BufferedReader(new InputStreamReader(System.in));
		}
		public String next() throws IOException{
			while(tk==null || !tk.hasMoreTokens()) {
				String cad = br.readLine();
				if (cad == null)
					return null;
				tk=new StringTokenizer(cad);
			}
			return tk.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException{
			return Integer.valueOf(next());
		}
		public long nextLong() throws NumberFormatException, IOException{
			return Long.valueOf(next());
		}
		public double nextDouble() throws NumberFormatException, IOException{
			return Double.valueOf(next());
		}
	}
	
	public static void main(String args[]) throws NumberFormatException, IOException {
		Scanner sc = new Scanner();
		String cad = sc.next();
		System.out.println(cad.substring(0, cad.length() - 8));
	}

}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.math.*;
 
public class Main {
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String s = br.readLine();
 
		s=s.substring(0,s.lastIndexOf("FESTIVAL"));
		System.out.println(s);
 
	}
}
//  [java]
import static java.lang.System.out;
import java.lang.Math;
import java.io.InputStream;
import java.io.IOException;
import java.util.NoSuchElementException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Collections;

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

    MyInput in = new MyInput();
    public void run() {
        String str = in.next();
        out.println(str.substring(0,str.lastIndexOf("FESTIVAL")));
    }
}

class MyInput {
	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;
	}

	public int readByte() { 
		if (hasNextByte()) return buffer[ptr++];
		else return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <=126;
	}

	private void skipUnprintable() {
		while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
	}

	public boolean hasNext() {
		skipUnprintable();
		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]
// package other2017.codefestival2017.qualb;

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

public class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String tk = in.nextToken();

        out.println(tk.substring(0, tk.length() - 8));
        out.flush();
    }

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

    public static class InputReader {
        private static final int BUFFER_LENGTH = 1 << 12;
        private InputStream stream;
        private byte[] buf = new byte[BUFFER_LENGTH];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int next() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public char nextChar() {
            return (char) skipWhileSpace();
        }

        public String nextToken() {
            int c = skipWhileSpace();
            StringBuilder res = new StringBuilder();
            do {
                res.append((char) c);
                c = next();
            } while (!isSpaceChar(c));
            return res.toString();
        }

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

        public long nextLong() {
            int c = skipWhileSpace();
            long sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = next();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = next();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public double nextDouble() {
            return Double.valueOf(nextToken());
        }

        int skipWhileSpace() {
            int c = next();
            while (isSpaceChar(c)) {
                c = next();
            }
            return c;
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    }
}
//  [java]
import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		String s = f.readLine();
		System.out.println(s.substring(0, s.length() - 8));
	}
}
//  [cpp]
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<stdlib.h>
#include<cassert>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=500000004;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
char in[110];
int main(){
	scanf("%s",in);
	int n=strlen(in);
	for(int i=0;i<n-8;i++)printf("%c",in[i]);
		printf("\n");
}
//  [cpp]
#include<cstdio>
#include<algorithm> 
#include<cstring>
#define LL long long
using namespace std;
const int inf=0x3f3f3f3f;
char s[55];
int read()
{
	int x=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	return x*f;
}
int main()
{
	scanf("%s",s+1);
	int n=strlen(s+1);
	for(int i=1;i<=n-8;i++)printf("%c",s[i]);
	return 0;
}
//  [cpp]
#include<cstdio>
#include<cstring>
char ch[55];
int main(){
	scanf("%s",ch+1);
	int len=strlen(ch+1);
	for(int i=1;i<=len-8;i++)printf("%c",ch[i]);
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplece_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second

//int dxy[5] = {0, 1, 0, -1, 0};
// assign avl ncm dijkstra geo2 kruskal graph uf lca BIT
// matrix dinic next_combination topcoder lcm

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

    string st;
    cin >> st;

    rep(i, st.size()-8) {
        cout << st[i];
    }
    cout << endl;


    return 0;
}
//  [cpp]
#include <iostream>
using namespace std;
 
int main(){
	string S;
	cin >> S;
	for(int i = 0; i < 8; i++){
		S.pop_back();
	}
	cout << S << endl;
}
//  [cpp]
#include<string>
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
	string S;
	cin>>S;
	int n=S.size();
	for(int i=0; i<n-8; i++){
		printf("%c", S[i]);
	}
	return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main(void){
    int i;
    char s[10000];
    scanf("%s",s);
    for(i=0;i<strlen(s)-8;i++){
        printf("%c",s[i]);
    }
    return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
 
#define sl(x) scanf("%ld", &x)
#define ss(x) scanf("%s", x)
#define pl(x) printf("%ld\n", x)
#define pd(x) printf("%lf\n", x)
#define ps(x) printf("%s\n", x)
 
#define INF 1000000000000000000
#define MOD 1000000007

#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))

int compare_long(const void *a, const void *b) {
  return *(long*)a - *(long*)b;
}

int main() {
  long N, C;
  long i, j;
  long tans = 0;
  char buf[201];
  long len;
  
  ss(buf);
  len = strlen(buf);
  for(i=0;i<len-8;i++) {
    printf("%c", buf[i]);
  }
  printf("\n");
  
  
  return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void){
  char s[50];
  int i, l;
  scanf("%s",s);
  l = strlen(s);
  for(i=0;i<l-8;i++) printf("%c",s[i]);
  printf("\n");
  return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main(){
  char S[52];
  scanf("%s",S);
  int l=strlen(S);
  for(int i=0;i<l-8;i++)
    printf("%c",S[i]);
  printf("\n");
  return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
int main (void)
{
  char str[50],name[50],set[9],fes[9]="FESTIVAL";
  int i,j;
  scanf("%s",str);
  for(i=0;i<50;i++)
  {
    for(j=0;j<9;j++)
    {
      set[j]=str[i+j];
    }
    if(strcmp(fes,set)==0)
    {
      for(j=0;j<i;j++)
      {
        name[j]=str[j];
      }
        name[i]='\0';
      break;
    }
  }
  printf("%s",name);
    putchar('\n');
  return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
int main(){
	char s[99];
	scanf("%s",s);
	int n=strlen(s);
	s[n-8]=0;
	puts(s);
}
//  [javascript]
function Main(input) {
console.log(input.slice(0,-8))
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function Main(input) {
console.log(input.slice(0,input.lastIndexOf("FESTIVAL")));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    
    S.splice(S.length - 8, 8, "");
    
    console.log(S.join(""));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

function Main(input) {

    console.log(input[0].slice(0, input[0].length - 'FESTIVAL'.length));

    return 0;
}
//  [javascript]
// input に入力データが全部入る
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    input = input.split("\n");
    
    var len = input[0].length;
    
    var ans = input[0].substr(0,len-8);
    // 出力
    console.log('%s', ans);
}

// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug(){
	var input = document.getElementById("input").value;
	Main(input);
}

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

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const S = args[0][0]
	const md = S.match(/^(.+)FESTIVAL$/)
	console.log(md[1])
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [go]
package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)

	fmt.Println(s[:len(s)-8])
}
//  [go]
// ProblemURL : https://atcoder.jp/contests/code-festival-2017-qualb/tasks/code_festival_2017_qualb_a
// ---------------------------------------------
package main

import (
	"fmt"
	"strings"
)

func main() {
	var s string
	fmt.Scan(&s)
	fmt.Println(strings.TrimSuffix(s, "FESTIVAL"))
}
//  [go]
package main

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

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	stdin.Scan()
	text := stdin.Text()
	fmt.Println(text[:len(text)-8])
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var s string
	fmt.Scan(&s)

	fmt.Println(s[:len(s)-8])

}
//  [ruby]
S = gets.chomp
puts S[0..S.length-9]
//  [ruby]
s = gets.chomp
puts s[0..s.size-9]
//  [ruby]
T = 'FESTIVAL'

def main(argv)
  s = gets.chomp

  puts s[0...(s.size - T.size)]
end

if self.to_s == 'main' then
  main(ARGV)
end
//  [ruby]
puts`dd`[..-10]
//  [ruby]
puts`dd`[..~9]
//  [ruby]
puts gets.chomp.chomp('FESTIVAL')
//  [rust]
use std::io::*;
use std::str::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}

fn main() {
    let s: String = read();
    let vec: Vec<char> = s.chars().collect();
    for i in 0..(s.len() - 8) {
        print!("{}", vec[i])
    }
}