Harryxun/stf_run huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpl;
typedef vector<vi> vvi;
typedef vector<vll> vvll;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
void __print(vector<bool> v) {bool first = true; cerr << "{"; for (int i = 0; i < static_cast<int>(v.size()); i++) {if (!first) {cerr << ", ";} first = false; __print(v[i]);} cerr << "}";}
template <size_t N>
void __print(bitset<N> bs) {string res = "<"; for (size_t i = 0; i < N; i++) {res += static_cast<char>('0' + bs[i]);} res += '>'; cerr << res;}
template<typename T>
void __print(const T &x) {int j = 0; cerr << "{"; for (auto &i: x) cerr << (j++ ? ", " : ""), __print(i); cerr << "}";}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << "("; __print(x.first); cerr << ", "; __print(x.second); cerr << ")";}
template <typename A, typename B, typename C>
void __print(const tuple<A, B, C> t) {cerr << "("; __print(get<0>(t)); cerr << ", "; __print(get<1>(t)); cerr << ", "; __print(get<2>(t)); cerr << ")";}
template <typename A, typename B, typename C, typename D>
void __print(const tuple<A, B, C, D> t) {cerr << "("; __print(get<0>(t)); cerr << ", "; __print(get<1>(t)); cerr << ", "; __print(get<2>(t)); cerr << ", "; __print(get<3>(t)); cerr << ")";}
void _print() {cerr << " ]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}

#ifndef ONLINE_JUDGE
#define deb(...) cerr << "~ [ " << #__VA_ARGS__ << " ] => [ "; _print(__VA_ARGS__)
#define debn(...) cerr << "~ [ "; _print(__VA_ARGS__)
#else
#define deb(...)
#define debn(...)
#endif

#define ALL(DS) (DS).begin(), (DS).end()
#define PB push_back
#define EB emplace_back
#define SZ(DS) (int)((DS).size())
#define fo(ITER, LO, UP) for (ITER = (LO); ITER < (UP); ++ITER)
#define foi(ITER, LO, UP) for (int ITER = (LO); ITER < (UP); ++ITER)
#define foll(ITER, LO, UP) for (ITER = (ll)(LO); ITER < (ll)(UP); ++ITER)
#define folli(ITER, LO, UP) for (ll ITER = (ll)(LO); ITER < (ll)(UP); ++ITER)
#define iter(ITER, DS) for (auto &ITER: DS)

const int M = 1000000007;
const int INF = 1e9 + 5;

void init() {}

void solve() {
    int a, b, c, d; cin >> a >> b >> c >> d;
    
    cout << max({a*c, a*d, b*c, b*d}) << "\n";
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.setf(ios::fixed); cout.precision(20);
    init();
    solve();
}



### FIXED CODE ###

a, b, c, d = [int(x) for x in input().split()]
print(max(a*c, a*d, b*c, b*d))
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
n = int(input())
A = list(map(int, input().split()))
def left(i):
    if i < 1:
        return 0
    return gcd(left(i-1), A[i-1])
def right(i):
    if i+1 > n-1:
        return 0
    return gcd(right(i+1), A[i+1])
ans = 0
for i in range(n):
    ans = max(ans, gcd(left(i), right(i)))
print(ans)

### FIXED CODE ###

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
n = int(input())
A = list(map(int, input().split()))
L = [0]*n
R = [0]*n
for i in range(n-1):
    R [i+1] = gcd(R[i], A[i])
    L[i+1] = gcd(L[i], A[-i-1])
print(max(gcd(R[i], L[-i-1]) for i in range(n)))
a = input()


amari  = a % 1000
otsuri = 1000 - amari
print(otsuri)

### FIXED CODE ###

a = input()
amari = int(a)%1000
otsuri = 1000 - amari
if otsuri == 1000:
  otsuri = 0

print(otsuri)
def mcm(M):
  n = len(M)
  m = [[0 for i in range(n+1)] for j in range(n+1)]
  
  for l in range(2, n):
    for i in range(1, n-l+1):
      j = i + l - 1
      def cost(i, k ,j):
        return m[i][k] + m[k+1][j] + M[i][0]*M[k][1]*M[j][1]
      m[i][j] = min(cost(i, k, j) for k in range(i, j-1))
  
  return m[0][n-1]

n = input()
for i in range(n):
  M.append(map(int, raw_input().split()))
print mcm(M)

### FIXED CODE ###

def mcm(M):
  n = len(M)
  m = [[0 for i in range(n)] for j in range(n)]
  
  for l in range(2, n+1):
    for i in range(0, n-l+1):
      j = i + l - 1
      def cost(i, k ,j):
        return m[i][k] + m[k+1][j] + M[i][0]*M[k][1]*M[j][1]
      m[i][j] = min(cost(i, k, j) for k in range(i, j))
  
  return m[0][n-1]

n = input()
M = []

for i in range(n):
  M.append(map(int, raw_input().split()))
print mcm(M)
n, m = map(int, input().split())
bridges = []
island_connection = [[i] for i in range(n)]
unconfortable = (n * (n - 1)) // 2
unconfortable_list = [unconfortable]

for i in range(m):
    array = list(map(int, input().split()))
    array[0] -= 1
    array[1] -= 1
    bridges.append(array)

bridges = bridges[::-1]

for i, j in bridges:
    if unconfortable != 0:
        if len(island_connection[i]) == 1 and len(island_connection[j]) == 1:
            unconfortable -= 1
            island_connection[i].append(j)
            island_connection[j].append(i)
        else:
            unconfortable -= (len(island_connection[i]) * len(island_connection[j]))
            plus_list_1 = island_connection[i].copy()
            plus_list_2 = island_connection[j].copy()
            for island in plus_list_1:
                island_connection[island].extend(plus_list_2)
            for island in plus_list_2:
                island_connection[island].extend(plus_list_1)

    unconfortable_list.append(unconfortable)

for i in range(1, m+1):
    print(unconfortable_list[-1-i])



### FIXED CODE ###

n, m = map(int, input().split())
bridges = []
island_connection = [1] * n
unconfortable = (n * (n - 1)) // 2
unconfortable_list = [unconfortable]


class UnionFind():
    def __init__(self, n):
        self.parent = [-1 for _ in range(n)]
        # 正==子: 根の頂点番号 / 負==根: 連結頂点数

    def find(self, x):
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]

    def unite(self, x, y):
        x, y = self.find(x), self.find(y)
        if x == y:
            return False
        else:
            if self.size(x) < self.size(y):
                x, y = y, x
            self.parent[x] += self.parent[y]
            self.parent[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        x = self.find(x)
        return -self.parent[x]

    def is_root(self, x):
        return self.parent[x] < 0


connection = UnionFind(n)

for i in range(m):
    array = list(map(int, input().split()))
    array[0] -= 1
    array[1] -= 1
    bridges.append(array)

bridges = bridges[::-1]

for i, j in bridges:
    if connection.same(i,j) == 0:
        p = connection.size(i)
        q = connection.size(j)
        if p == 1 and q == 1:
            unconfortable -= 1
            connection.unite(i, j)
        else:
            unconfortable -= (p * q)
            connection.unite(i, j)
    unconfortable_list.append(unconfortable)

for i in range(1, m+1):
    print(unconfortable_list[-1-i])
H, W = map( int, input().split() )
abc = [ chr(i) for i in range( 65, 65+26 ) ]
for i in range(H) : 
    s = list( map( str, input().split() ) )
    for j in range(W) :
        if "snuke" in s : 
           w = abc[ s.index[ "snuke" ] ]
           h = i + 1
           exit()
print( w + str( h ) )

### FIXED CODE ###

H, W = map( int, input().split() )
s = [ list( map( str, input().split() ) ) for i in range(H) ] 
for i in range(H) : 
    for j in range(W) : 
       if s[i][j] == "snuke" : 
           w = chr( j + ord( "A" ) )
           h = i + 1
           print( w + str( h ) )
           exit()
moji=str(input()) #文字列の入力
ListNum=[] #suuの各値を入れる
suu=0
for i in range(0,len(moji),1):
  if moji[i]=="A":
    suu+=1
  elif moji[i]=="T":
    suu+=1
  elif moji[i]=="G":
    suu+=1
  elif moji[i]=="C":
    suu+=1
  else:
    ListNum.append(suu)
    suu=0
print(max(ListNum))


### FIXED CODE ###

S=str(input())  #文字列の入力
S=S.replace("A","x")
S=S.replace("T","x")
S=S.replace("G","x")
S=S.replace("C","x")
for i in range(0,2,1):
  if S.count("xxxxxxxxxx")!=0:
    print(10)
    break
  elif S.count("xxxxxxxxx")!=0:
    print(9)
    break
  elif S.count("xxxxxxxx")!=0:
    print(8)
    break
  elif S.count("xxxxxxx")!=0:
    print(7)
    break
  elif S.count("xxxxxx")!=0:
    print(6)
    break
  elif S.count("xxxxx")!=0:
    print(5)
    break
  elif S.count("xxxx")!=0:
    print(4)
    break
  elif S.count("xxx")!=0:
    print(3)
    break
  elif S.count("xx")!=0:
    print(2)
    break
  elif S.count("x")!=0:
    print(1)
    break
  else:
    print(0)
    break
num = [
    1,
    1,
    1,
    2,
    1,
    2,
    1,
    5,
    2,
    2,
    1,
    5,
    1,
    2,
    1,
    14,
    1,
    5,
    1,
    5,
    2,
    2,
    1,
    15,
    2,
    2,
    5,
    4,
    1,
    4,
    1,
    51,
]
input = int(input())
print(num[input])


### FIXED CODE ###

num = [
    1,
    1,
    1,
    2,
    1,
    2,
    1,
    5,
    2,
    2,
    1,
    5,
    1,
    2,
    1,
    14,
    1,
    5,
    1,
    5,
    2,
    2,
    1,
    15,
    2,
    2,
    5,
    4,
    1,
    4,
    1,
    51,
]
input = int(input())
print(num[input - 1])
from math import gcd

MOD = 10 ** 9 + 7

N = int(input())

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

B = [1] * (N + 1)

for index, a in enumerate(A):
    tmp = gcd(B[index], a)
    B[index + 1] = B[index] * a // tmp

C = [1] * (N + 1)
for i in range(N - 1, -1, -1):
    tmp =gcd(C[i + 1], A[i])
    C[i] = C[i + 1] * A[i] // tmp

# print (B)
# print (C)

ans = 0
for i in range(N):
    tmp1 = gcd(B[i], C[i + 1])
    tmp2 = B[i] * C[i + 1] // tmp1

    tmp3 = gcd(tmp2, A[i])
    tmp4 = tmp2 * A[i] // tmp3

    ans += (tmp4 // A[i] % MOD)
    ans %= MOD

    # print (ans)

print (ans)

### FIXED CODE ###

def main():
    from fractions import gcd

    N = int(input())
    A = list(map(int, input().split()))

    MOD = 10 ** 9 + 7

    tmp = 1
    for a in A:
        tmp *= a // gcd(tmp, a)

    ans = 0
    for a in A:
        ans += tmp // a
    ans %= MOD

    print (ans)

if __name__ == '__main__':
    main()
a, b = [int(x) for x in input().split(" ")]

print("{} {}".format(a * b, 2 * a + 2 * b))


### FIXED CODE ###

a, b = [int(x) for x in input().split()]

print("{} {}".format(a * b, 2 * a + 2 * b))
import collections

N = int(input())

c = collections.Counter(input())
for i in range(N-1):
    x = collections.Counter(input())
    ans=[]
    for j in c.keys():
        c[j] = min(c[j], x[j])
        ans.append(j*c[j])

print(*ans, sep="")

### FIXED CODE ###

import collections

N = int(input())

S = collections.Counter(list(input()))
for i in range(N-1):
    c = collections.Counter(list(input()))
    S &= c

ans = []
for i in S.items():
    ans += i[0]*i[1]
ans.sort()
print(*ans, sep="")
N,A,B = map(int,input().split)
a = N*A
print(min(a,B))

### FIXED CODE ###

N,A,B = map(int,input().split())
a = N*A
print(min(a,B))
N = 7
if N > = 100 and N <=999:
  print (Yes)
else:
  print (No)
    

### FIXED CODE ###

N = eval(input())
a = str(N)
k=[]
for i in a:
    if i == "7":
        k.append(i)
if len(k) > 0:
    print ("Yes")
else:
    print ("No")
n, m = map(int, input().split()) 
ab = []
for i in range(n):
  a, b = map(int, input().split()) 
  ab.append([a,b])

cd = []  
for i in range(n):
  c, d = map(int, input().split()) 
  cd.append([c,d])

for a, b in ab:
  distance = [abs(a-c) + abs(b-d) for c,d in cd]
  print(distance.index(min(distance))+1)

### FIXED CODE ###

n, m = map(int, input().split()) 

ab = [list(map(int,input().split()))for _ in range(n)]
cd = [list(map(int,input().split()))for _ in range(m)] 

for a, b in ab:
  distance = [abs(a-c) + abs(b-d) for c,d in cd]
  print(distance.index(min(distance))+1)
s=list(input())
k=int(input())
if s[0]=='1':
  print(s[1])
  
else:
  print(s[0])

### FIXED CODE ###

s = input()
k = int(input())
for i in range(k):
    if s[i]!='1':
        break
print(s[i])
import math
from decimal import Decimal
X = int(input())
now = Decimal(100)
year = 0

while True:
    if now >= X:
        break
    #王道
    #now += now // 100

    #Decimal型を経由する方法
    #now = int(now * Decimal("1.01"))
    #now = int(now * round(Decimal(1.01), 2))
    now = int(now * round(1.01, 2))
    #now = Decimal(math.floor(now * Decimal(1.01)))
    year += 1

print(year)


### FIXED CODE ###

import math
X = int(input())
now = 100

year = 0

while True:
    if now >= X:
        break
    now += now // 100
    year += 1

print(year)
from collections import defaultdict
import collections
N=int(input())
ss = []
for i in range(N):
  ss.append(input())
ss.sort()
#d = defaultdict(lambda: 0)
c = collections.Counter(ss)
d_=c.most_common()
mx = d_[0][1]
for i in range(N):
  if d_[i][1] == mx:
    print(d_[i][0])
  else:
    break

### FIXED CODE ###

from collections import defaultdict
import collections
N=int(input())
ss = []
for i in range(N):
  ss.append(input())
#d = defaultdict(lambda: 0)
c = collections.Counter(ss)
d_=c.most_common()
mx = d_[0][1]
d_.sort()
#print(d_)
m=len(d_)
for i in range(m):
  if d_[i][1] == mx:
    print(d_[i][0])
  else:
    pass
import sys
input=sys.stdin.readline
from operator import itemgetter
import numpy as np

N, M = [int(x) for x in input().split()]
A = {}
for _ in range(N):
    x, y = [int(x) for x in input().split()]
    if x  not in A:
       A[x] = []
    A[x].append(y)

for key in A:
    A[key].sort()


total = 0
for x in range(1, M + 1):
    max = 0
    max_index = -1
    for k, v in sorted(A.items()):
        if k > x:
            break
        if v[-1] > max:
            max = v[-1]
            max_index = k
    if max_index != -1:
        total += A[max_index].pop()
        if len(A[max_index]) == 0:
            A[max_index].append(-1)


print(total)





### FIXED CODE ###

from collections import defaultdict
import heapq

N, M = [int(x) for x in input().split()]

dict = defaultdict(list)
for _ in range(N):
    A, B = [int(x) for x in input().split()]
    dict[A].append(B)

h = []
total = 0
for x in range(1, M + 1):
    for y in dict[x]:
        heapq.heappush(h, -y)
    if h:
        total += heapq.heappop(h)

print(-total)
def gcd(a, b):
    return b 
  if a == 0 
  else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))

### FIXED CODE ###

def gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(n):
  while a[i] % 2 == 0:
    count += 1
    a[i] /= 2
print(count)

### FIXED CODE ###

a,b = list(map(int, input().split()))
if max(a,b) > 8:
  print(":(")
else:
  print("Yay!")
N = int(input())
A = list(map(int, input().split()))


# number_to_prime[i]: i の最小の素因数, iが素数ならば0
number_to_prime = [0] * (10**6 + 1)

# preprocess
for i in range(2, 10**6+1):
    if not number_to_prime[i]:
        j = 1
        while j*i <= 10**6:
            number_to_prime[j*i] = i
            j += 1

def is_pair_copr(A):
    U = 1 << 20
    div_p = np.arange(U)
    for p in range(2, U):
        if div_p[p] != p:
            continue
        div_p[p::p] = p
    used = np.zeros(U, np.bool_)
 
    for x in A:
        while x > 1:
            p = div_p[x]
            while x % p == 0:
                x //= p
            if used[p]:
                return False
            used[p] = True
    return True

def is_pairwise():
    used_primes = set()
    pairwise_flag = 1
    for a in A:
        curr_primes = set()
        while a > 1:
            prime = number_to_prime[a]
            curr_primes.add(prime)
            a //= prime
        if used_primes & curr_primes:
            pairwise_flag = 0
            break
        else:
            used_primes = used_primes | curr_primes
    return pairwise_flag

def is_setwise(*A):
    import math
    from functools import reduce

    return reduce(math.gcd, A) == 1

if is_pair_copr(A):
    print("pairwise coprime")
elif is_setwise(*A):
    print("setwise coprime")
else:
    print("not coprime")

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))


# number_to_prime[i]: i の最小の素因数, iが素数ならば0
number_to_prime = [0] * (10**6 + 1)

# preprocess
for i in range(2, 10**6+1):
    if not number_to_prime[i]:
        j = 1
        while j*i <= 10**6:
            number_to_prime[j*i] = i
            j += 1

def is_pair_copr(A):
    import numpy as np
    U = 1 << 20
    div_p = np.arange(U)
    for p in range(2, U):
        if div_p[p] != p:
            continue
        div_p[p::p] = p
    used = np.zeros(U, np.bool_)
 
    for x in A:
        while x > 1:
            p = div_p[x]
            while x % p == 0:
                x //= p
            if used[p]:
                return False
            used[p] = True
    return True

def is_pairwise():
    used_primes = set()
    pairwise_flag = 1
    for a in A:
        curr_primes = set()
        while a > 1:
            prime = number_to_prime[a]
            curr_primes.add(prime)
            a //= prime
        if used_primes & curr_primes:
            pairwise_flag = 0
            break
        else:
            used_primes = used_primes | curr_primes
    return pairwise_flag

def is_setwise(*A):
    import math
    from functools import reduce

    return reduce(math.gcd, A) == 1

if is_pair_copr(A):
    print("pairwise coprime")
elif is_setwise(*A):
    print("setwise coprime")
else:
    print("not coprime")
import sys
sys.setrecursionlimit(10000)

n, k = map(int,input().split())
nck = {}

def c(n,k):
    if k == 0 or n==k:
        return 1
    elif n<k:
        return 0
    elif k == 1:
        return n  
    elif (n,k) in nck:
        return nck[(n,k)]
    else:
        nck[n,k] = c(n-1,k-1)+c(n-1,k)
        return nck[n,k]

for j in range(1,k+1):
    r = (c(n-k+1,j)*c(k-1,j-1))%(10**9+7)
    print(r)

### FIXED CODE ###

s = input()


s1 = s[0]
if s.count(s1) == 2:
    s = s.replace(s1,"")
    s2 = s[0]
    if s.count(s2) == 2:
        print("Yes")
    else:
        print("No")
else:
    print("No")
import numpy

n = int(input())
a_list = [int(a) for a in input().split()]

left = [0]
right = [0]
for a in a_list:
    left.append(numpy.gcd(left[-1], a))
    
a_list.reverse()
for a in a_list:
    right.append(numpy.gcd(right[-1], a))

right.reverse()

m = []
for i in range(len(a_list)):
    m.append(numpy.gcd(left[i], right[i + 1]))
    
print(max(m))

### FIXED CODE ###

import fractions

n = int(input())
a_list = [int(a) for a in input().split()]

left = [0]
right = [0]
for a in a_list:
    left.append(fractions.gcd(left[-1], a))
    
a_list.reverse()
for a in a_list:
    right.append(fractions.gcd(right[-1], a))

right.reverse()

m = []
for i in range(len(a_list)):
    m.append(fractions.gcd(left[i], right[i + 1]))
    
print(max(m))
def main():
    N, M = map(int, input().split())

    A = list(map(int, input().split()))  # 使っていい数字

    match_dic = {9: 6, 8: 7, 7: 3, 6: 6, 5: 5, 4: 4, 3: 5, 2: 5, 1: 2}
    available_dic = {k: v for k, v in match_dic.items() if k in A }
    availables = sorted(available_dic.items(), key=lambda x: x[1])

    def dfs(cost, nums):
        if cost == 0:
            nums.sort(key=lambda x: -x)
            return int(''.join(map(str, nums)))

        candidates = [dfs(cost - avs[1], nums + [avs[0]]) for avs in availables if cost >= avs[1]]
        if len(candidates) == 0:
            return 0
        else:
            return max(candidates)

    print(dfs(N, []))


main()

### FIXED CODE ###

# https://atcoder.jp/contests/abc118/tasks/abc118_d


def main():
    N, M = map(int, input().split())

    A = list(map(int, input().split()))  # 使っていい数字

    costs = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]  # 各数字のマッチの数

    dp = [-1 for _ in range(N + 1)]
    dp[0] = 0
    for i in range(1, N + 1):
        for a in A:
            if i < costs[a]:
                continue
            dp[i] = max(dp[i], dp[i - costs[a]] * 10 + a)
    print(dp[N])


main()
a = input()
b = input()

if a * b % 2 == 0:
	print("even")
else:
	print("odd")


### FIXED CODE ###

a, b = map(int, input().split())

if a * b % 2 == 0:
    print('Even')
else:
    print('Odd')
N, A,B = map(int, input().split())
str = []

list_ab = []
list_b = ['b']*A
list_ab.append(list_b)
list_a = ['a']*B
list_ab.append(list_a)

str.append(list_ab*(N//(A+B)+1))


import itertools
str = list(itertools.chain.from_iterable(str))
str = list(itertools.chain.from_iterable(str))

str = str[:N]
print(str.count('b'))


### FIXED CODE ###

N,A,B = map(int, input().split())

count = N//(A+B)
if (N-count*(A+B))>A:
    print(count*A+A)
else:
    print(count*A+(N-count*(A+B)))
S=input()
m=0
count=0
for s in S:
    if(s=="A" OR s=="C" OR s=="G" OR s=="T"):count+=1
    else:count=0
    m=max(m,count)
print(m)

### FIXED CODE ###

S=input()
m=0
count=0
for s in S:
    if(s=="A" or s=="C" or s=="G" or s=="T"):count+=1
    else:count=0
    m=max(m,count)
print(m)
s = list(map(str,input().split()))
l = []
for i in s:
    if i == '0':
       l.append(i)
    elif i == '1':
       l.append(i)
    elif  i == 'B' and len(l) != 0:
        l.pop(-1)
print(int(''.join(l)))

### FIXED CODE ###

s = list(map(str,input()))
l = []
for i in s:
    if i == '0':
       l.append(i)
    elif i == '1':
       l.append(i)
    elif  i == 'B' and len(l) != 0:
        l.pop(-1)
print(''.join(l))
INF=100000000
def flog(i,h,dp):
    global INF
    if dp[i]!=INF:
        return dp[i]
    else:
        if i==1:
            dp[i]=0
            return dp[i]
        elif i==2:
            dp[i]=abs(h[1]-h[0])
            return dp[i]
        else:
            dp[i]=min(flog(i-2,h,dp)+abs(h[i-1]-h[i-3]),flog(i-1,h,dp)+abs(h[i-1]-h[i-2]))
            return dp[i]
N=int(input())
h=list(map(int,input().split()))
dp=[INF for i in range(N+1)]
print(flog(N,h,dp))


### FIXED CODE ###

import sys
INF=100000000
def frog(i,h,dp):
    global INF
    if dp[i]!=INF:
        return dp[i]
    else:
        if i==1:
            dp[i]=0
            return dp[i]
        elif i==2:
            dp[i]=abs(h[1]-h[0])
            return dp[i]
        else:
            dp[i]=min(frog(i-2,h,dp)+abs(h[i-1]-h[i-3]),frog(i-1,h,dp)+abs(h[i-1]-h[i-2]))
            return dp[i]
sys.setrecursionlimit(INF)
N=int(input())
h=list(map(int,input().split()))
dp=[INF for i in range(N+1)]
print(frog(N,h,dp))
import numpy as np

def main(N, K, A):
    for _ in range(min(K, 41)):
        ne = np.zeros_like(A)
        for i in range(N):
            ne[max(0, i-A[i])] += 1
            if i+A[i]+1 < N:
                ne[i+A[i]+1] -= 1
        A = ne.cumsum()
    return A


N, K = map(int, input().split())
A = np.array(input().split(), np.int64)
ans = main(N, K, A)
print(*ans)


### FIXED CODE ###

from numba import njit
import numpy as np


@njit
def main(N, K, A):
    for _ in range(min(K, 41)):
        ne = np.zeros_like(A)
        for i in range(N):
            ne[max(0, i-A[i])] += 1
            if i+A[i]+1 < N:
                ne[i+A[i]+1] -= 1
        A = ne.cumsum()
    return A


N, K = map(int, input().split())
A = np.array(input().split(), np.int64)
ans = main(N, K, A)
print(*ans)
a,b,c = map(int,input())
if a+b>=c:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b>=c:
  print('Yes')
else:
  print('No')
N,A = map(int,input().split())
X = sorted(map(int,input().split()))
Y = []
for x in X:
    Y.append(abs(A-x))
import math
minY = min(Y)
ans = 0
for i in range(len(Y)):
    ans = max(ans,math.gcd(minY,Y[i]))
print(ans)

### FIXED CODE ###

def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

N,A = map(int,input().split())
X = sorted(map(int,input().split()))
Y = []
for x in X:
    Y.append(abs(A-x))
ans = max(Y)
for y in Y:
    ans = gcd(y,ans)
print(ans)