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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: B = None
        self.r: B = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

k = A("k")
e = B("e")
b = C("b")
f = D("f")
a = C("a")
h = C("h")
l = A("l")

k.w = f
e.z = k
e.w = b
e.t = f
b.q = e
b.p = e
b.r = e
b.o = l
f.y = h
f.t = h
f.x = l
a.q = e
a.p = e
a.r = e
a.o = k
h.q = e
h.p = e
h.r = e
h.o = k
l.w = f
assert h.p.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: B = None
        self.r: B = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

k = A("k")
e = B("e")
b = C("b")
f = D("f")
a = C("a")
h = C("h")
l = A("l")

k.w = f
e.z = k
e.w = b
e.t = f
b.q = e
b.p = e
b.r = e
b.o = l
f.y = h
f.t = h
f.x = l
a.q = e
a.p = e
a.r = e
a.o = k
h.q = e
h.p = e
h.r = e
h.o = k
l.w = f
assert h.p.t.y.txt == "h"