a = 'NEW'
print(a)
def Admitted(x):
global a
if x == 'NEW':
a = 'READY'
print(a)
def Dispatch(x):
global a
if x == 'READY':
a == 'RUNNING'
print(a)
def Input(x):
global a
if x == 'RUNNING':
a == 'WAITING'
print(a)
if x == 'WAITING':
a = 'READY'
print(a)
def Interrupt(x):
global a
if x == 'RUNNING':
a = 'READY'
print(a)
def Exit(x):
global a
if x == 'RUNNING':
a = 'TERMINATED'
print(a)
print(Admitted(a))
print(Dispatch(a))
print(Interrupt(a))
print(Dispatch(a))
print(Input(a))
print(Input(a))
print(Dispatch(a))
print(Exit(a))