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

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

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

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

f = A("f")
e = B("e")
a = C("a")
k = D("k")
j = B("j")
h = D("h")
i = B("i")
c = D("c")
b = B("b")

f.x = a
f.r = b
f.t = b
f.o = j
e.w = a
e.z = a
e.t = a
e.x = j
a.u = k
a.y = f
a.x = f
k.o = h
k.z = a
k.y = a
k.x = e
j.w = a
j.z = a
j.t = a
j.x = e
h.o = k
h.z = a
h.y = a
h.x = i
i.w = a
i.z = a
i.t = a
i.x = e
c.o = k
c.z = a
c.y = a
c.x = b
b.w = a
b.z = a
b.t = a
b.x = j
assert b.x.x.x.z.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.t: B = None
        self.o: B = None
        self.txt = txt

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

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

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

f = A("f")
e = B("e")
a = C("a")
k = D("k")
j = B("j")
h = D("h")
i = B("i")
c = D("c")
b = B("b")

f.x = a
f.r = b
f.t = b
f.o = j
e.w = a
e.z = a
e.t = a
e.x = j
a.u = k
a.y = f
a.x = f
k.o = h
k.z = a
k.y = a
k.x = e
j.w = a
j.z = a
j.t = a
j.x = e
h.o = k
h.z = a
h.y = a
h.x = i
i.w = a
i.z = a
i.t = a
i.x = e
c.o = k
c.z = a
c.y = a
c.x = b
b.w = a
b.z = a
b.t = a
b.x = j
assert b.x.x.x.z.u.y.txt == "a"