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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: C = None
        self.q: E = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: C = None
        self.q: E = None
        self.o: A = None
        self.txt = txt

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

i.w = l
d.z = i
d.r = f
d.o = h
m.y = j
m.z = h
m.w = i
f.t = l
f.q = m
l.y = f
l.v = m
l.q = h
l.o = i
j.z = i
j.r = f
j.o = h
h.y = f
h.v = n
h.q = l
h.o = i
n.y = d
n.z = h
n.w = i
assert l.q.o.w.v.z.o.txt == "i"