//
//  main.swift
//  Atcoder
//
//  Created by Louis Joe Shen on 2020/9/26.
//  Copyright © 2020 Louise Joe Shen. All rights reserved.
//

import Foundation

var input = readLine()!

var ans = ""

for i in input{
    if i == "B"{
        if ans.isEmpty{
            //doing nothing
        }else{
            ans.removeLast()
        }
    }else{
        ans += String(i)
    }
}

print(ans)

; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/Swift/Source_2454/llvm_O3.ll'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/Swift/Source_2454/llvm_O3.ll"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%TSS = type <{ %Ts11_StringGutsV }>
%Ts11_StringGutsV = type <{ %Ts13_StringObjectV }>
%Ts13_StringObjectV = type <{ %Ts6UInt64V, %swift.bridge* }>
%Ts6UInt64V = type <{ i64 }>
%swift.bridge = type opaque
%swift.type_descriptor = type opaque
%swift.type = type { i64 }
%TSS8IteratorV = type <{ %Ts11_StringGutsV, %TSi, %TSi }>
%TSi = type <{ i64 }>
%swift.refcounted = type { %swift.type*, i64 }
%Ts28__ContiguousArrayStorageBaseC = type <{ %swift.refcounted, %Ts10_ArrayBodyV }>
%Ts10_ArrayBodyV = type <{ %TSo22_SwiftArrayBodyStorageV }>
%TSo22_SwiftArrayBodyStorageV = type <{ %TSi, %TSu }>
%TSu = type <{ i64 }>

@"$s7llvm_O35inputSSvp" = hidden global %TSS zeroinitializer, align 8
@"$s7llvm_O33ansSSvp" = hidden global %TSS zeroinitializer, align 8
@"$ss23_ContiguousArrayStorageCMn" = external global %swift.type_descriptor, align 4
@"got.$ss23_ContiguousArrayStorageCMn" = private unnamed_addr constant %swift.type_descriptor* @"$ss23_ContiguousArrayStorageCMn"
@"symbolic _____yypG s23_ContiguousArrayStorageC" = linkonce_odr hidden constant <{ i8, i32, [4 x i8], i8 }> <{ i8 2, i32 trunc (i64 sub (i64 ptrtoint (%swift.type_descriptor** @"got.$ss23_ContiguousArrayStorageCMn" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i8, i32, [4 x i8], i8 }>, <{ i8, i32, [4 x i8], i8 }>* @"symbolic _____yypG s23_ContiguousArrayStorageC", i32 0, i32 1) to i64)) to i32), [4 x i8] c"yypG", i8 0 }>, section "swift5_typeref", no_sanitize_address, align 2
@"$ss23_ContiguousArrayStorageCyypGMD" = linkonce_odr hidden global { i32, i32 } { i32 trunc (i64 sub (i64 ptrtoint (<{ i8, i32, [4 x i8], i8 }>* @"symbolic _____yypG s23_ContiguousArrayStorageC" to i64), i64 ptrtoint ({ i32, i32 }* @"$ss23_ContiguousArrayStorageCyypGMD" to i64)) to i32), i32 -9 }, align 8
@"$sSSN" = external global %swift.type, align 8
@"\01l_entry_point" = private constant { i32, i32 } { i32 trunc (i64 sub (i64 ptrtoint (i32 (i32, i8**)* @main to i64), i64 ptrtoint ({ i32, i32 }* @"\01l_entry_point" to i64)) to i32), i32 0 }, section "swift5_entry", align 4
@__swift_reflection_version = linkonce_odr hidden constant i16 3
@_swift1_autolink_entries = private constant [172 x i8] c"-lFoundation\00-lswiftCore\00-lswift_StringProcessing\00-lswift_RegexParser\00-lswift_Concurrency\00-lswiftGlibc\00-lm\00-lpthread\00-lutil\00-ldl\00-lswiftDispatch\00-ldispatch\00-lBlocksRuntime\00", section ".swift1_autolink_entries", no_sanitize_address, align 8
@llvm.compiler.used = appending global [4 x i8*] [i8* bitcast ({ i32, i32 }* @"\01l_entry_point" to i8*), i8* bitcast (i16* @__swift_reflection_version to i8*), i8* getelementptr inbounds ([172 x i8], [172 x i8]* @_swift1_autolink_entries, i32 0, i32 0), i8* bitcast (i32 (i32, i8**)* @main to i8*)], section "llvm.metadata"

define protected i32 @main(i32 %0, i8** nocapture readnone %1) #0 {
entry:
  %2 = alloca %TSS8IteratorV, align 8
  %access-scratch = alloca [24 x i8], align 8
  %access-scratch5 = alloca [24 x i8], align 8
  %access-scratch10 = alloca [24 x i8], align 8
  %access-scratch13 = alloca [24 x i8], align 8
  %3 = tail call swiftcc { i64, i64 } @"$ss8readLine16strippingNewlineSSSgSb_tF"(i1 true)
  %4 = extractvalue { i64, i64 } %3, 1
  %5 = icmp eq i64 %4, 0
  br i1 %5, label %86, label %6

6:                                                ; preds = %entry
  %7 = extractvalue { i64, i64 } %3, 0
  %8 = inttoptr i64 %4 to %swift.bridge*
  store i64 %7, i64* getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O35inputSSvp", i64 0, i32 0, i32 0, i32 0, i32 0), align 8
  store %swift.bridge* %8, %swift.bridge** getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O35inputSSvp", i64 0, i32 0, i32 0, i32 1), align 8
  store i64 0, i64* getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O33ansSSvp", i64 0, i32 0, i32 0, i32 0, i32 0), align 8
  store %swift.bridge* inttoptr (i64 -2305843009213693952 to %swift.bridge*), %swift.bridge** getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O33ansSSvp", i64 0, i32 0, i32 0, i32 1), align 8
  %9 = bitcast %TSS8IteratorV* %2 to i8*
  call void @llvm.lifetime.start.p0i8(i64 32, i8* nonnull %9)
  %10 = getelementptr inbounds [24 x i8], [24 x i8]* %access-scratch, i64 0, i64 0
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %10)
  call void @swift_beginAccess(i8* nonnull bitcast (%TSS* @"$s7llvm_O35inputSSvp" to i8*), [24 x i8]* nonnull %access-scratch, i64 0, i8* null) #3
  %11 = load i64, i64* getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O35inputSSvp", i64 0, i32 0, i32 0, i32 0, i32 0), align 8
  %12 = load %swift.bridge*, %swift.bridge** getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O35inputSSvp", i64 0, i32 0, i32 0, i32 1), align 8
  %13 = ptrtoint %swift.bridge* %12 to i64
  %14 = and i64 %13, 2305843009213693952
  %15 = icmp eq i64 %14, 0
  %16 = lshr i64 %13, 56
  %17 = and i64 %16, 15
  %18 = and i64 %11, 281474976710655
  %19 = select i1 %15, i64 %18, i64 %17
  %._guts._object._countAndFlagsBits._value = getelementptr inbounds %TSS8IteratorV, %TSS8IteratorV* %2, i64 0, i32 0, i32 0, i32 0, i32 0
  store i64 %11, i64* %._guts._object._countAndFlagsBits._value, align 8
  %._guts._object._object = getelementptr inbounds %TSS8IteratorV, %TSS8IteratorV* %2, i64 0, i32 0, i32 0, i32 1
  store %swift.bridge* %12, %swift.bridge** %._guts._object._object, align 8
  %._position._value = getelementptr inbounds %TSS8IteratorV, %TSS8IteratorV* %2, i64 0, i32 1, i32 0
  store i64 0, i64* %._position._value, align 8
  %._end._value = getelementptr inbounds %TSS8IteratorV, %TSS8IteratorV* %2, i64 0, i32 2, i32 0
  store i64 %19, i64* %._end._value, align 8
  %20 = getelementptr inbounds [24 x i8], [24 x i8]* %access-scratch5, i64 0, i64 0
  %21 = call %swift.bridge* @swift_bridgeObjectRetain(%swift.bridge* returned %12) #3
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %20)
  call void @swift_beginAccess(i8* nonnull bitcast (%TSS* @"$s7llvm_O33ansSSvp" to i8*), [24 x i8]* nonnull %access-scratch5, i64 0, i8* null) #3
  %22 = call swiftcc { i64, i64 } @"$sSS8IteratorV4nextSJSgyF"(%TSS8IteratorV* nocapture nonnull swiftself dereferenceable(32) %2)
  %23 = extractvalue { i64, i64 } %22, 1
  %24 = icmp eq i64 %23, 0
  br i1 %24, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %6
  %25 = getelementptr inbounds [24 x i8], [24 x i8]* %access-scratch10, i64 0, i64 0
  %26 = getelementptr inbounds [24 x i8], [24 x i8]* %access-scratch13, i64 0, i64 0
  br label %27

27:                                               ; preds = %.lr.ph, %.backedge
  %28 = phi i64 [ %23, %.lr.ph ], [ %84, %.backedge ]
  %.pn = phi { i64, i64 } [ %22, %.lr.ph ], [ %83, %.backedge ]
  %29 = extractvalue { i64, i64 } %.pn, 0
  %30 = inttoptr i64 %28 to %swift.bridge*
  %31 = icmp eq i64 %29, 66
  %32 = icmp eq i64 %28, -2233785415175766016
  %or.cond34 = select i1 %31, i1 %32, i1 false
  br i1 %or.cond34, label %47, label %45

._crit_edge:                                      ; preds = %.backedge, %6
  %33 = load %swift.bridge*, %swift.bridge** %._guts._object._object, align 8
  call void @swift_bridgeObjectRelease(%swift.bridge* %33) #3
  call void @llvm.lifetime.end.p0i8(i64 32, i8* nonnull %9)
  %34 = call %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* nonnull @"$ss23_ContiguousArrayStorageCyypGMD") #6
  %35 = call noalias %swift.refcounted* @swift_allocObject(%swift.type* %34, i64 64, i64 7) #3
  %36 = bitcast %swift.refcounted* %35 to %Ts28__ContiguousArrayStorageBaseC*
  %37 = getelementptr inbounds %swift.refcounted, %swift.refcounted* %35, i64 1
  %._storage.count._value = bitcast %swift.refcounted* %37 to i64*
  store i64 1, i64* %._storage.count._value, align 8
  %._storage._capacityAndFlags = getelementptr inbounds %swift.refcounted, %swift.refcounted* %35, i64 1, i32 1
  store i64 2, i64* %._storage._capacityAndFlags, align 8
  %38 = getelementptr inbounds %swift.refcounted, %swift.refcounted* %35, i64 2
  %39 = load i64, i64* getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O33ansSSvp", i64 0, i32 0, i32 0, i32 0, i32 0), align 8
  %40 = load %swift.bridge*, %swift.bridge** getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O33ansSSvp", i64 0, i32 0, i32 0, i32 1), align 8
  %41 = getelementptr inbounds %swift.refcounted, %swift.refcounted* %35, i64 3, i32 1
  %42 = bitcast i64* %41 to %swift.type**
  store %swift.type* @"$sSSN", %swift.type** %42, align 8
  %._guts7._object._countAndFlagsBits._value = bitcast %swift.refcounted* %38 to i64*
  store i64 %39, i64* %._guts7._object._countAndFlagsBits._value, align 8
  %._guts7._object._object = getelementptr inbounds %swift.refcounted, %swift.refcounted* %35, i64 2, i32 1
  %43 = bitcast i64* %._guts7._object._object to %swift.bridge**
  store %swift.bridge* %40, %swift.bridge** %43, align 8
  %44 = call %swift.bridge* @swift_bridgeObjectRetain(%swift.bridge* returned %40) #3
  call swiftcc void @"$ss5print_9separator10terminatoryypd_S2StF"(%Ts28__ContiguousArrayStorageBaseC* %36, i64 32, %swift.bridge* nonnull inttoptr (i64 -2233785415175766016 to %swift.bridge*), i64 10, %swift.bridge* nonnull inttoptr (i64 -2233785415175766016 to %swift.bridge*))
  call void @swift_release(%swift.refcounted* %35) #3
  ret i32 0

45:                                               ; preds = %27
  %46 = call swiftcc i1 @"$ss27_stringCompareWithSmolCheck__9expectingSbs11_StringGutsV_ADs01_G16ComparisonResultOtF"(i64 %29, %swift.bridge* nonnull %30, i64 66, %swift.bridge* nonnull inttoptr (i64 -2233785415175766016 to %swift.bridge*), i8 0)
  br i1 %46, label %47, label %82

47:                                               ; preds = %27, %45
  %48 = load i64, i64* getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O33ansSSvp", i64 0, i32 0, i32 0, i32 0, i32 0), align 8
  %49 = load %swift.bridge*, %swift.bridge** getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O33ansSSvp", i64 0, i32 0, i32 0, i32 1), align 8
  %50 = ptrtoint %swift.bridge* %49 to i64
  %51 = and i64 %50, 2305843009213693952
  %52 = icmp eq i64 %51, 0
  %53 = lshr i64 %50, 56
  %54 = and i64 %53, 15
  %55 = and i64 %48, 281474976710655
  %56 = select i1 %52, i64 %55, i64 %54
  %57 = icmp eq i64 %56, 0
  br i1 %57, label %.backedge, label %58

58:                                               ; preds = %47
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %26)
  call void @swift_beginAccess(i8* nonnull bitcast (%TSS* @"$s7llvm_O33ansSSvp" to i8*), [24 x i8]* nonnull %access-scratch13, i64 33, i8* null) #3
  %59 = load i64, i64* getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O33ansSSvp", i64 0, i32 0, i32 0, i32 0, i32 0), align 8
  %60 = load %swift.bridge*, %swift.bridge** getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O33ansSSvp", i64 0, i32 0, i32 0, i32 1), align 8
  %61 = ptrtoint %swift.bridge* %60 to i64
  %62 = and i64 %61, 2305843009213693952
  %63 = icmp eq i64 %62, 0
  br i1 %63, label %64, label %67

64:                                               ; preds = %58
  %65 = and i64 %59, 281474976710655
  %66 = icmp eq i64 %65, 0
  br i1 %66, label %88, label %71, !prof !6

67:                                               ; preds = %58
  %68 = lshr i64 %61, 56
  %69 = and i64 %68, 15
  %70 = icmp eq i64 %69, 0
  br i1 %70, label %87, label %71, !prof !6

71:                                               ; preds = %67, %64
  %72 = phi i64 [ %65, %64 ], [ %69, %67 ]
  %73 = shl nuw i64 %72, 16
  %74 = and i64 %61, 1152921504606846976
  %75 = icmp ne i64 %74, 0
  %76 = and i64 %59, 576460752303423488
  %77 = icmp eq i64 %76, 0
  %or.cond = select i1 %75, i1 %77, i1 false
  %.v = select i1 %or.cond, i64 11, i64 7
  %78 = or i64 %73, %.v
  %79 = call swiftcc i64 @"$sSS5index6beforeSS5IndexVAD_tF"(i64 %78, i64 %59, %swift.bridge* %60)
  %80 = call swiftcc { i64, %swift.bridge* } @"$sSS6remove2atSJSS5IndexV_tF"(i64 %79, %TSS* nocapture nonnull swiftself dereferenceable(16) @"$s7llvm_O33ansSSvp")
  %81 = extractvalue { i64, %swift.bridge* } %80, 1
  call void @swift_endAccess([24 x i8]* nonnull %access-scratch13) #3
  call void @llvm.lifetime.end.p0i8(i64 -1, i8* nonnull %26)
  call void @swift_bridgeObjectRelease(%swift.bridge* %81) #3
  br label %.backedge

82:                                               ; preds = %45
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %25)
  call void @swift_beginAccess(i8* nonnull bitcast (%TSS* @"$s7llvm_O33ansSSvp" to i8*), [24 x i8]* nonnull %access-scratch10, i64 33, i8* null) #3
  call swiftcc void @"$sSS6appendyySSF"(i64 %29, %swift.bridge* nonnull %30, %TSS* nocapture nonnull swiftself dereferenceable(16) @"$s7llvm_O33ansSSvp")
  call void @swift_endAccess([24 x i8]* nonnull %access-scratch10) #3
  call void @llvm.lifetime.end.p0i8(i64 -1, i8* nonnull %25)
  br label %.backedge

.backedge:                                        ; preds = %47, %82, %71
  call void @swift_bridgeObjectRelease(%swift.bridge* nonnull %30) #3
  %83 = call swiftcc { i64, i64 } @"$sSS8IteratorV4nextSJSgyF"(%TSS8IteratorV* nocapture nonnull swiftself dereferenceable(32) %2)
  %84 = extractvalue { i64, i64 } %83, 1
  %85 = icmp eq i64 %84, 0
  br i1 %85, label %._crit_edge, label %27

86:                                               ; preds = %entry
  tail call void asm sideeffect "", "n"(i32 0) #3
  tail call void @llvm.trap()
  unreachable

87:                                               ; preds = %67
  call void asm sideeffect "", "n"(i32 1) #3
  call void @llvm.trap()
  unreachable

88:                                               ; preds = %64
  call void asm sideeffect "", "n"(i32 2) #3
  call void @llvm.trap()
  unreachable
}

declare swiftcc { i64, i64 } @"$ss8readLine16strippingNewlineSSSgSb_tF"(i1) local_unnamed_addr #0

; Function Attrs: cold noreturn nounwind
declare void @llvm.trap() #1

; Function Attrs: argmemonly mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2

; Function Attrs: argmemonly mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2

; Function Attrs: nounwind
declare void @swift_beginAccess(i8*, [24 x i8]*, i64, i8*) local_unnamed_addr #3

declare swiftcc { i64, i64 } @"$sSS8IteratorV4nextSJSgyF"(%TSS8IteratorV* nocapture swiftself dereferenceable(32)) local_unnamed_addr #0

; Function Attrs: nounwind
declare %swift.bridge* @swift_bridgeObjectRetain(%swift.bridge* returned) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @swift_bridgeObjectRelease(%swift.bridge*) local_unnamed_addr #3

; Function Attrs: mustprogress nofree noinline nounwind readonly willreturn
define linkonce_odr hidden %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* %0) local_unnamed_addr #4 {
entry:
  %1 = bitcast { i32, i32 }* %0 to i64*
  %2 = load atomic i64, i64* %1 monotonic, align 8
  %3 = icmp slt i64 %2, 0
  br i1 %3, label %7, label %4, !prof !6

4:                                                ; preds = %7, %entry
  %5 = phi i64 [ %2, %entry ], [ %15, %7 ]
  %6 = inttoptr i64 %5 to %swift.type*
  ret %swift.type* %6

7:                                                ; preds = %entry
  %8 = ashr i64 %2, 32
  %9 = sub nsw i64 0, %8
  %sext = shl i64 %2, 32
  %10 = ashr exact i64 %sext, 32
  %11 = ptrtoint { i32, i32 }* %0 to i64
  %12 = add i64 %10, %11
  %13 = inttoptr i64 %12 to i8*
  %14 = tail call swiftcc %swift.type* @swift_getTypeByMangledNameInContext2(i8* %13, i64 %9, %swift.type_descriptor* null, i8** null) #7
  %15 = ptrtoint %swift.type* %14 to i64
  store atomic i64 %15, i64* %1 monotonic, align 8
  br label %4
}

; Function Attrs: argmemonly nounwind
declare swiftcc %swift.type* @swift_getTypeByMangledNameInContext2(i8*, i64, %swift.type_descriptor*, i8**) local_unnamed_addr #5

; Function Attrs: nounwind
declare %swift.refcounted* @swift_allocObject(%swift.type*, i64, i64) local_unnamed_addr #3

declare swiftcc void @"$ss5print_9separator10terminatoryypd_S2StF"(%Ts28__ContiguousArrayStorageBaseC*, i64, %swift.bridge*, i64, %swift.bridge*) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @swift_release(%swift.refcounted*) local_unnamed_addr #3

declare swiftcc i1 @"$ss27_stringCompareWithSmolCheck__9expectingSbs11_StringGutsV_ADs01_G16ComparisonResultOtF"(i64, %swift.bridge*, i64, %swift.bridge*, i8) local_unnamed_addr #0

declare swiftcc void @"$sSS6appendyySSF"(i64, %swift.bridge*, %TSS* nocapture swiftself dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @swift_endAccess([24 x i8]*) local_unnamed_addr #3

declare swiftcc i64 @"$sSS5index6beforeSS5IndexVAD_tF"(i64, i64, %swift.bridge*) local_unnamed_addr #0

declare swiftcc { i64, %swift.bridge* } @"$sSS6remove2atSJSS5IndexV_tF"(i64, %TSS* nocapture swiftself dereferenceable(16)) local_unnamed_addr #0

attributes #0 = { "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { cold noreturn nounwind }
attributes #2 = { argmemonly mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { nounwind }
attributes #4 = { mustprogress nofree noinline nounwind readonly willreturn "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { argmemonly nounwind }
attributes #6 = { nounwind readonly }
attributes #7 = { argmemonly nounwind readonly }

!swift.module.flags = !{!0}
!llvm.linker.options = !{}
!llvm.module.flags = !{!1, !2, !3, !4, !5}

!0 = !{!"standard-library", i1 false}
!1 = !{i32 1, !"wchar_size", i32 4}
!2 = !{i32 8, !"PIC Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{i32 4, !"Objective-C Garbage Collection", i32 84477696}
!5 = !{i32 1, !"Swift Version", i32 7}
!6 = !{!"branch_weights", i32 1, i32 2000}
