class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

l = A("l")
a = B("a")
e = C("e")
h = D("h")
c = E("c")
k = F("k")

l.o = c
a.u = e
e.p = h
e.z = h
e.w = c
h.p = e
c.r = e
c.z = k
c.x = h
k.v = h
assert c.x.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

l = A("l")
a = B("a")
e = C("e")
h = D("h")
c = E("c")
k = F("k")

l.o = c
a.u = e
e.p = h
e.z = h
e.w = c
h.p = e
c.r = e
c.z = k
c.x = h
k.v = h
assert c.x.p.p.txt == "h"