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

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

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

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

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

k = A("k")
a = B("a")
j = C("j")
b = D("b")
m = E("m")
l = C("l")
e = D("e")
d = A("d")
c = E("c")
n = A("n")

k.t = n
k.s = n
k.x = d
k.z = a
a.y = b
j.t = m
j.o = a
j.s = n
b.v = m
b.y = m
b.s = a
m.o = j
m.z = j
m.p = l
l.t = c
l.o = a
l.s = n
e.v = c
e.y = c
e.s = a
d.t = k
d.x = n
d.s = n
d.z = a
c.o = l
c.p = l
c.z = j
n.t = k
n.x = d
n.s = d
n.z = a
assert k.s.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: A = None
        self.z: B = None
        self.s: A = None
        self.txt = txt

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

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

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

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

k = A("k")
a = B("a")
j = C("j")
b = D("b")
m = E("m")
l = C("l")
e = D("e")
d = A("d")
c = E("c")
n = A("n")

k.t = n
k.s = n
k.x = d
k.z = a
a.y = b
j.t = m
j.o = a
j.s = n
b.v = m
b.y = m
b.s = a
m.o = j
m.z = j
m.p = l
l.t = c
l.o = a
l.s = n
e.v = c
e.y = c
e.s = a
d.t = k
d.x = n
d.s = n
d.z = a
c.o = l
c.p = l
c.z = j
n.t = k
n.x = d
n.s = d
n.z = a
assert k.s.x.t.txt == "k"