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

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

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

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

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

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

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

e.w = a
a.z = e
i.w = e
n.z = d
n.o = a
d.w = i
d.z = a
d.v = n
f.t = a
f.u = a
f.q = d
assert n.z.w.w.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

e.w = a
a.z = e
i.w = e
n.z = d
n.o = a
d.w = i
d.z = a
d.v = n
f.t = a
f.u = a
f.q = d
assert n.z.w.w.w.z.txt == "e"