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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: A = None
        self.w: D = None
        self.t: D = None
        self.z: A = None
        self.txt = txt

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

i = A("i")
b = B("b")
c = C("c")
l = D("l")
m = E("m")
j = D("j")
k = B("k")
h = C("h")
n = B("n")

i.y = m
i.r = l
b.u = m
b.z = i
c.s = k
l.q = m
l.u = i
l.z = i
l.w = j
l.t = j
m.u = c
m.w = k
m.q = j
j.q = m
j.u = i
j.z = i
j.w = l
j.t = l
k.u = m
k.z = i
h.s = b
n.u = m
n.z = i
assert b.u.q.w.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: A = None
        self.w: D = None
        self.t: D = None
        self.z: A = None
        self.txt = txt

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

i = A("i")
b = B("b")
c = C("c")
l = D("l")
m = E("m")
j = D("j")
k = B("k")
h = C("h")
n = B("n")

i.y = m
i.r = l
b.u = m
b.z = i
c.s = k
l.q = m
l.u = i
l.z = i
l.w = j
l.t = j
m.u = c
m.w = k
m.q = j
j.q = m
j.u = i
j.z = i
j.w = l
j.t = l
k.u = m
k.z = i
h.s = b
n.u = m
n.z = i
assert b.u.q.w.u.r.txt == "l"