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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: F = None
        self.o: A = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: B = None
        self.x: A = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

m = A("m")
d = B("d")
c = C("c")
g = D("g")
i = E("i")
e = F("e")
k = D("k")
a = A("a")

m.w = e
m.u = e
d.w = k
d.p = e
d.o = m
d.s = c
c.z = a
g.o = c
g.t = e
i.r = d
i.o = e
e.w = g
e.t = d
e.x = a
e.o = a
e.z = m
k.o = c
k.t = e
a.w = e
a.u = e
assert g.o.z.w.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: F = None
        self.o: A = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: B = None
        self.x: A = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

m = A("m")
d = B("d")
c = C("c")
g = D("g")
i = E("i")
e = F("e")
k = D("k")
a = A("a")

m.w = e
m.u = e
d.w = k
d.p = e
d.o = m
d.s = c
c.z = a
g.o = c
g.t = e
i.r = d
i.o = e
e.w = g
e.t = d
e.x = a
e.o = a
e.z = m
k.o = c
k.t = e
a.w = e
a.u = e
assert g.o.z.w.x.u.txt == "e"