✅ 정답 공개
class BankAccount:
def __init__(self, balance):
self.balance = balance
def deposit(self, amount):
self.balance += amount
def withdraw(self, amount):
if amount > self.balance:
print('잔액 부족')
else:
self.balance -= amount
account = BankAccount(int(input()))
while True:
line = input().strip()
if line == 'END':
break
parts = line.split()
op, amount = parts[0], int(parts[1])
if op == 'deposit':
account.deposit(amount)
else:
account.withdraw(amount)
print(account.balance)