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

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

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

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

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

l = A("l")
d = B("d")
k = C("k")
c = D("c")
i = E("i")
g = D("g")
b = E("b")
e = C("e")
n = B("n")

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

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

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

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

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

l = A("l")
d = B("d")
k = C("k")
c = D("c")
i = E("i")
g = D("g")
b = E("b")
e = C("e")
n = B("n")

l.u = b
l.z = e
l.q = c
d.q = b
d.s = b
d.u = e
d.y = l
k.q = n
k.u = g
k.w = b
c.t = n
c.u = n
c.z = l
i.t = e
i.r = e
i.w = d
i.s = c
g.t = n
g.u = n
g.z = l
b.t = k
b.r = k
b.w = d
b.s = c
e.q = n
e.u = c
e.w = i
n.q = i
n.s = i
n.u = e
n.y = l
assert c.u.y.q.u.txt == "n"