
class stack:
    def __init__(self):
        self.body = []

    def push(self, data):
        self.body.append(data)

    def pop(self):
        if (len(self.body) == 0):
            return None
        else:
            return self.body.pop()

    def isEmpty(self):
        return True if len(self.body) == 0 else False

class queue:
    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if (self.stackA.isEmpty()):
            return None

        while(not self.stackA.isEmpty()):
            v = self.stackA.pop()
            self.stackB.push(v)

        result = self.stackB.pop()
        while(not self.stackB.isEmpty()):
            v = self.stackB.pop()
            self.stackA.push(v)

        return result

class queueNew:
    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if (self.stackB.isEmpty() == False):
            return self.stackB.pop()

        if (self.stackA.isEmpty()):
            return None

        while(not self.stackA.isEmpty()):
            v = self.stackA.pop()
            self.stackB.push(v)

        return self.stackB.pop()


values = [ 3, 5, 2, 1, 4 ]
#myqueue = queue()
myqueue = queueNew()
for i in range(len(values)):
    myqueue.put(values[i])
    print("after put {0}".format(values[i]))

for i in range(len(values)):
    v = myqueue.get()
    print("after get {0}".format(v))


0c4d4fb34149a52597962e0c6fbb4df23b9b7fdb
<mask token>


class queue:

    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)
    <mask token>


class queueNew:

    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if self.stackB.isEmpty() == False:
            return self.stackB.pop()
        if self.stackA.isEmpty():
            return None
        while not self.stackA.isEmpty():
            v = self.stackA.pop()
            self.stackB.push(v)
        return self.stackB.pop()


<mask token>

class stack:
    <mask token>
    <mask token>

    def pop(self):
        if len(self.body) == 0:
            return None
        else:
            return self.body.pop()

    def isEmpty(self):
        return True if len(self.body) == 0 else False


class queue:

    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if self.stackA.isEmpty():
            return None
        while not self.stackA.isEmpty():
            v = self.stackA.pop()
            self.stackB.push(v)
        result = self.stackB.pop()
        while not self.stackB.isEmpty():
            v = self.stackB.pop()
            self.stackA.push(v)
        return result


class queueNew:

    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if self.stackB.isEmpty() == False:
            return self.stackB.pop()
        if self.stackA.isEmpty():
            return None
        while not self.stackA.isEmpty():
            v = self.stackA.pop()
            self.stackB.push(v)
        return self.stackB.pop()


<mask token>

class stack:
    <mask token>

    def push(self, data):
        self.body.append(data)

    def pop(self):
        if len(self.body) == 0:
            return None
        else:
            return self.body.pop()

    def isEmpty(self):
        return True if len(self.body) == 0 else False


class queue:

    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if self.stackA.isEmpty():
            return None
        while not self.stackA.isEmpty():
            v = self.stackA.pop()
            self.stackB.push(v)
        result = self.stackB.pop()
        while not self.stackB.isEmpty():
            v = self.stackB.pop()
            self.stackA.push(v)
        return result


class queueNew:

    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if self.stackB.isEmpty() == False:
            return self.stackB.pop()
        if self.stackA.isEmpty():
            return None
        while not self.stackA.isEmpty():
            v = self.stackA.pop()
            self.stackB.push(v)
        return self.stackB.pop()


<mask token>

class stack:

    def __init__(self):
        self.body = []

    def push(self, data):
        self.body.append(data)

    def pop(self):
        if len(self.body) == 0:
            return None
        else:
            return self.body.pop()

    def isEmpty(self):
        return True if len(self.body) == 0 else False


class queue:

    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if self.stackA.isEmpty():
            return None
        while not self.stackA.isEmpty():
            v = self.stackA.pop()
            self.stackB.push(v)
        result = self.stackB.pop()
        while not self.stackB.isEmpty():
            v = self.stackB.pop()
            self.stackA.push(v)
        return result


class queueNew:

    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if self.stackB.isEmpty() == False:
            return self.stackB.pop()
        if self.stackA.isEmpty():
            return None
        while not self.stackA.isEmpty():
            v = self.stackA.pop()
            self.stackB.push(v)
        return self.stackB.pop()


<mask token>
for i in range(len(values)):
    myqueue.put(values[i])
    print('after put {0}'.format(values[i]))
for i in range(len(values)):
    v = myqueue.get()
    print('after get {0}'.format(v))


class stack:
    def __init__(self):
        self.body = []

    def push(self, data):
        self.body.append(data)

    def pop(self):
        if (len(self.body) == 0):
            return None
        else:
            return self.body.pop()

    def isEmpty(self):
        return True if len(self.body) == 0 else False

class queue:
    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if (self.stackA.isEmpty()):
            return None

        while(not self.stackA.isEmpty()):
            v = self.stackA.pop()
            self.stackB.push(v)

        result = self.stackB.pop()
        while(not self.stackB.isEmpty()):
            v = self.stackB.pop()
            self.stackA.push(v)

        return result

class queueNew:
    def __init__(self):
        self.stackA = stack()
        self.stackB = stack()

    def put(self, data):
        self.stackA.push(data)

    def get(self):
        if (self.stackB.isEmpty() == False):
            return self.stackB.pop()

        if (self.stackA.isEmpty()):
            return None

        while(not self.stackA.isEmpty()):
            v = self.stackA.pop()
            self.stackB.push(v)

        return self.stackB.pop()


values = [ 3, 5, 2, 1, 4 ]
#myqueue = queue()
myqueue = queueNew()
for i in range(len(values)):
    myqueue.put(values[i])
    print("after put {0}".format(values[i]))

for i in range(len(values)):
    v = myqueue.get()
    print("after get {0}".format(v))

