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

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

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

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

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

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

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

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

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

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

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

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

c.q = n
c.p = l
c.t = m
i.v = n
i.t = k
i.x = b
i.z = g
i.p = d
m.v = h
m.o = d
m.q = n
m.s = n
b.x = d
b.z = d
b.w = m
h.q = l
g.v = c
g.t = l
g.x = b
g.z = i
g.p = d
d.q = l
l.x = d
l.w = m
l.z = h
n.q = c
n.p = k
n.t = m
k.x = d
k.z = d
k.w = m
assert c.q.p.w.o.q.z.q.txt == "l"