class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

k.o = i
k.w = a
c.x = f
c.q = f
c.v = m
c.t = i
c.s = k
a.p = j
a.r = k
h.s = k
h.t = m
h.z = a
j.q = m
n.x = a
n.q = a
n.v = j
n.t = i
n.s = k
m.q = j
f.p = m
f.r = k
i.s = k
i.t = m
i.z = f
assert c.t.z.p.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

k.o = i
k.w = a
c.x = f
c.q = f
c.v = m
c.t = i
c.s = k
a.p = j
a.r = k
h.s = k
h.t = m
h.z = a
j.q = m
n.x = a
n.q = a
n.v = j
n.t = i
n.s = k
m.q = j
f.p = m
f.r = k
i.s = k
i.t = m
i.z = f
assert c.t.z.p.q.q.txt == "m"