class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: E = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.txt = txt

b = A("b")
e = B("e")
i = C("i")
d = D("d")
n = E("n")
m = F("m")
a = F("a")

b.q = d
b.w = n
b.z = i
e.z = i
e.o = n
i.v = e
d.x = e
n.x = d
m.t = n
m.w = n
a.t = n
a.w = n
assert i.v.o.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: E = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.txt = txt

b = A("b")
e = B("e")
i = C("i")
d = D("d")
n = E("n")
m = F("m")
a = F("a")

b.q = d
b.w = n
b.z = i
e.z = i
e.o = n
i.v = e
d.x = e
n.x = d
m.t = n
m.w = n
a.t = n
a.w = n
assert i.v.o.x.x.txt == "e"