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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: D = None
        self.p: A = None
        self.txt = txt

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

a = A("a")
e = B("e")
j = C("j")
i = D("i")
f = B("f")
c = D("c")
l = A("l")
m = A("m")
n = B("n")

a.o = i
a.y = i
a.t = m
e.r = j
e.t = j
e.z = m
e.s = n
j.r = c
j.s = i
j.p = m
i.x = j
i.t = j
i.z = c
i.o = c
f.r = j
f.t = j
f.z = a
f.s = e
c.x = j
c.t = j
c.z = i
c.o = i
l.o = i
l.y = i
l.t = a
m.o = i
m.t = l
m.y = c
n.r = j
n.t = j
n.z = a
n.s = f
assert l.o.x.r.x.p.t.y.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: A = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: D = None
        self.p: A = None
        self.txt = txt

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

a = A("a")
e = B("e")
j = C("j")
i = D("i")
f = B("f")
c = D("c")
l = A("l")
m = A("m")
n = B("n")

a.o = i
a.y = i
a.t = m
e.r = j
e.t = j
e.z = m
e.s = n
j.r = c
j.s = i
j.p = m
i.x = j
i.t = j
i.z = c
i.o = c
f.r = j
f.t = j
f.z = a
f.s = e
c.x = j
c.t = j
c.z = i
c.o = i
l.o = i
l.y = i
l.t = a
m.o = i
m.t = l
m.y = c
n.r = j
n.t = j
n.z = a
n.s = f
assert l.o.x.r.x.p.t.y.z.x.txt == "j"