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

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

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

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

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

d = A("d")
f = B("f")
k = C("k")
m = D("m")
g = E("g")
c = D("c")
j = C("j")
l = D("l")

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

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

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

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

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

d = A("d")
f = B("f")
k = C("k")
m = D("m")
g = E("g")
c = D("c")
j = C("j")
l = D("l")

d.q = k
f.t = m
f.y = g
f.w = g
f.q = d
k.z = d
k.y = d
k.t = d
k.s = j
k.q = g
m.x = d
m.t = c
m.s = g
m.r = j
g.u = k
c.x = d
c.t = m
c.s = g
c.r = k
j.z = d
j.y = d
j.t = d
j.s = k
j.q = g
l.x = d
l.t = c
l.s = g
l.r = j
assert j.s.q.u.z.q.txt == "k"