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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

k = A("k")
m = B("m")
n = C("n")
a = D("a")
j = E("j")
d = A("d")

k.z = m
k.o = j
m.y = j
n.y = j
a.x = n
j.u = n
j.z = n
j.o = a
j.x = a
d.z = m
d.o = j
assert m.y.x.x.y.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

k = A("k")
m = B("m")
n = C("n")
a = D("a")
j = E("j")
d = A("d")

k.z = m
k.o = j
m.y = j
n.y = j
a.x = n
j.u = n
j.z = n
j.o = a
j.x = a
d.z = m
d.o = j
assert m.y.x.x.y.u.y.txt == "j"