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

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

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

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

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

h = A("h")
f = B("f")
i = C("i")
m = D("m")
k = E("k")
j = B("j")
b = A("b")

h.z = k
h.r = k
h.p = f
h.u = f
h.o = b
f.z = j
f.w = j
f.y = k
i.x = m
i.q = h
m.u = k
m.o = k
m.p = k
m.x = f
k.z = i
k.s = i
k.y = m
j.z = f
j.w = f
j.y = k
b.z = k
b.r = k
b.p = f
b.u = f
b.o = h
assert m.x.z.y.y.x.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.p: B = None
        self.o: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

h = A("h")
f = B("f")
i = C("i")
m = D("m")
k = E("k")
j = B("j")
b = A("b")

h.z = k
h.r = k
h.p = f
h.u = f
h.o = b
f.z = j
f.w = j
f.y = k
i.x = m
i.q = h
m.u = k
m.o = k
m.p = k
m.x = f
k.z = i
k.s = i
k.y = m
j.z = f
j.w = f
j.y = k
b.z = k
b.r = k
b.p = f
b.u = f
b.o = h
assert m.x.z.y.y.x.w.y.txt == "k"