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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

f = A("f")
b = B("b")
i = C("i")
j = D("j")
c = D("c")
m = A("m")
k = D("k")

f.x = i
f.w = k
f.u = k
b.p = m
b.x = m
b.o = c
i.y = c
i.o = c
i.x = c
i.u = b
j.t = b
j.y = c
j.z = k
j.q = k
c.t = b
c.y = j
c.q = j
c.z = k
m.x = i
m.w = j
m.u = c
k.t = b
k.y = c
k.q = c
k.z = j
assert f.x.u.o.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: D = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

f = A("f")
b = B("b")
i = C("i")
j = D("j")
c = D("c")
m = A("m")
k = D("k")

f.x = i
f.w = k
f.u = k
b.p = m
b.x = m
b.o = c
i.y = c
i.o = c
i.x = c
i.u = b
j.t = b
j.y = c
j.z = k
j.q = k
c.t = b
c.y = j
c.q = j
c.z = k
m.x = i
m.w = j
m.u = c
k.t = b
k.y = c
k.q = c
k.z = j
assert f.x.u.o.z.t.txt == "b"