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

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

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

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

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

i = A("i")
e = B("e")
c = C("c")
l = D("l")
f = E("f")
j = B("j")
h = E("h")
d = D("d")

i.y = c
e.q = d
e.x = d
e.v = d
e.s = j
e.u = h
c.y = i
c.x = i
c.t = j
c.q = f
c.z = d
l.r = i
l.z = i
l.u = e
f.y = d
f.w = e
f.r = c
f.x = j
j.q = d
j.s = e
j.u = h
j.x = l
j.v = l
h.y = d
h.w = e
h.x = e
h.r = c
d.r = i
d.z = i
d.u = j
assert l.u.q.u.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

i = A("i")
e = B("e")
c = C("c")
l = D("l")
f = E("f")
j = B("j")
h = E("h")
d = D("d")

i.y = c
e.q = d
e.x = d
e.v = d
e.s = j
e.u = h
c.y = i
c.x = i
c.t = j
c.q = f
c.z = d
l.r = i
l.z = i
l.u = e
f.y = d
f.w = e
f.r = c
f.x = j
j.q = d
j.s = e
j.u = h
j.x = l
j.v = l
h.y = d
h.w = e
h.x = e
h.r = c
d.r = i
d.z = i
d.u = j
assert l.u.q.u.x.r.txt == "i"