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

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

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

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

a = A("a")
c = B("c")
k = C("k")
l = D("l")
j = C("j")
h = B("h")
e = C("e")
g = B("g")
d = C("d")
b = A("b")

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

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

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

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

a = A("a")
c = B("c")
k = C("k")
l = D("l")
j = C("j")
h = B("h")
e = C("e")
g = B("g")
d = C("d")
b = A("b")

a.z = l
a.t = k
c.y = l
c.x = g
k.o = e
k.s = j
k.p = c
k.z = l
l.u = c
j.o = e
j.s = k
j.p = h
j.z = l
h.y = l
h.x = g
e.o = j
e.s = j
e.p = c
e.z = l
g.y = l
g.x = c
d.o = e
d.s = j
d.p = g
d.z = l
b.z = l
b.t = e
assert b.z.u.y.u.x.txt == "g"