class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.w: E = None
        self.y: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

h.q = m
h.r = m
h.w = m
h.y = j
h.t = i
j.w = m
j.t = h
i.z = h
f.u = h
f.x = h
f.z = h
f.y = i
f.o = l
m.t = f
m.y = f
m.u = h
m.o = j
l.u = h
l.x = h
l.z = h
l.y = i
l.o = f
assert l.u.y.t.t.z.txt == "h"