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

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

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

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

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

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

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

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

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

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

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

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

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