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

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

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

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

e = A("e")
b = B("b")
a = C("a")
f = D("f")
n = B("n")
l = D("l")
h = D("h")
k = C("k")
m = C("m")
j = A("j")

e.t = l
b.p = e
b.x = e
b.w = m
b.t = l
a.z = n
a.x = n
f.t = m
f.v = l
f.q = n
f.s = j
n.p = j
n.x = j
n.w = m
n.t = h
l.t = a
l.v = f
l.q = n
l.s = e
h.t = k
h.v = l
h.q = b
h.s = e
k.z = b
k.x = n
m.z = b
m.x = b
j.t = h
assert a.z.t.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

e = A("e")
b = B("b")
a = C("a")
f = D("f")
n = B("n")
l = D("l")
h = D("h")
k = C("k")
m = C("m")
j = A("j")

e.t = l
b.p = e
b.x = e
b.w = m
b.t = l
a.z = n
a.x = n
f.t = m
f.v = l
f.q = n
f.s = j
n.p = j
n.x = j
n.w = m
n.t = h
l.t = a
l.v = f
l.q = n
l.s = e
h.t = k
h.v = l
h.q = b
h.s = e
k.z = b
k.x = n
m.z = b
m.x = b
j.t = h
assert a.z.t.s.t.txt == "l"