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

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

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

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

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

a = A("a")
m = B("m")
h = C("h")
n = D("n")
k = E("k")
j = A("j")
g = B("g")
l = D("l")

a.q = j
a.r = j
a.y = h
a.u = k
a.t = g
m.s = h
m.z = h
m.w = k
m.y = k
h.q = k
h.z = l
n.x = j
n.w = k
n.q = k
k.r = m
k.s = h
j.q = a
j.r = a
j.y = h
j.u = k
j.t = g
g.s = h
g.z = h
g.w = k
g.y = k
l.x = j
l.w = k
l.q = k
assert k.s.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: A = None
        self.y: C = None
        self.u: E = None
        self.t: B = None
        self.txt = txt

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

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

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

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

a = A("a")
m = B("m")
h = C("h")
n = D("n")
k = E("k")
j = A("j")
g = B("g")
l = D("l")

a.q = j
a.r = j
a.y = h
a.u = k
a.t = g
m.s = h
m.z = h
m.w = k
m.y = k
h.q = k
h.z = l
n.x = j
n.w = k
n.q = k
k.r = m
k.s = h
j.q = a
j.r = a
j.y = h
j.u = k
j.t = g
g.s = h
g.z = h
g.w = k
g.y = k
l.x = j
l.w = k
l.q = k
assert k.s.z.q.txt == "k"