class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

c = A("c")
e = B("e")
f = A("f")
l = B("l")
i = A("i")
n = A("n")
m = A("m")

c.q = l
e.v = l
f.q = l
l.v = e
i.q = l
n.q = e
m.q = e
assert e.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

c = A("c")
e = B("e")
f = A("f")
l = B("l")
i = A("i")
n = A("n")
m = A("m")

c.q = l
e.v = l
f.q = l
l.v = e
i.q = l
n.q = e
m.q = e
assert e.v.v.v.v.txt == "e"