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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: B = None
        self.u: C = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

g = A("g")
b = B("b")
i = C("i")
m = D("m")
l = E("l")
k = E("k")
e = C("e")

g.w = e
g.s = l
b.y = k
b.w = m
i.y = e
i.u = e
i.t = e
i.v = g
i.q = g
m.z = k
m.y = g
m.q = g
m.o = g
m.t = b
l.p = g
l.w = b
l.u = e
l.x = k
l.t = k
k.p = g
k.w = b
k.u = i
k.x = l
k.t = l
e.y = i
e.u = i
e.t = i
e.v = g
e.q = g
assert m.t.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: B = None
        self.u: C = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

g = A("g")
b = B("b")
i = C("i")
m = D("m")
l = E("l")
k = E("k")
e = C("e")

g.w = e
g.s = l
b.y = k
b.w = m
i.y = e
i.u = e
i.t = e
i.v = g
i.q = g
m.z = k
m.y = g
m.q = g
m.o = g
m.t = b
l.p = g
l.w = b
l.u = e
l.x = k
l.t = k
k.p = g
k.w = b
k.u = i
k.x = l
k.t = l
e.y = i
e.u = i
e.t = i
e.v = g
e.q = g
assert m.t.w.q.txt == "g"