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

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

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

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

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

e = A("e")
c = B("c")
j = C("j")
b = D("b")
m = E("m")
i = C("i")

e.o = b
e.y = b
e.u = b
e.s = b
e.q = j
c.x = j
c.y = j
c.q = e
j.u = m
b.r = i
b.y = i
b.v = m
m.u = b
m.s = b
m.z = c
i.u = m
assert b.v.s.r.u.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: D = None
        self.u: D = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

e = A("e")
c = B("c")
j = C("j")
b = D("b")
m = E("m")
i = C("i")

e.o = b
e.y = b
e.u = b
e.s = b
e.q = j
c.x = j
c.y = j
c.q = e
j.u = m
b.r = i
b.y = i
b.v = m
m.u = b
m.s = b
m.z = c
i.u = m
assert b.v.s.r.u.s.y.txt == "i"