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

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

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

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

e = A("e")
g = B("g")
h = C("h")
l = D("l")
a = D("a")
n = C("n")
d = B("d")
j = C("j")

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

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

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

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

e = A("e")
g = B("g")
h = C("h")
l = D("l")
a = D("a")
n = C("n")
d = B("d")
j = C("j")

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