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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: D = None
        self.y: D = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

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

c.z = b
k.u = b
k.t = b
k.v = b
k.x = c
b.u = k
b.s = h
b.y = a
b.v = c
a.q = b
a.o = c
a.v = c
l.o = c
l.p = c
l.x = b
l.y = b
l.z = k
h.q = b
h.o = c
h.v = c
assert h.o.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: D = None
        self.y: D = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

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

c.z = b
k.u = b
k.t = b
k.v = b
k.x = c
b.u = k
b.s = h
b.y = a
b.v = c
a.q = b
a.o = c
a.v = c
l.o = c
l.p = c
l.x = b
l.y = b
l.z = k
h.q = b
h.o = c
h.v = c
assert h.o.z.v.txt == "c"