class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: D = None
        self.q: A = None
        self.v: B = None
        self.txt = txt

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

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

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

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

m = A("m")
a = B("a")
h = C("h")
i = D("i")
d = E("d")
l = A("l")
c = E("c")
j = E("j")
g = C("g")

m.o = l
m.q = l
m.x = i
m.v = a
a.w = i
h.q = c
i.z = l
i.q = a
i.x = a
i.w = m
i.t = h
d.v = m
d.w = m
d.u = m
d.y = l
d.q = j
l.o = m
l.q = m
l.x = i
l.v = a
c.v = m
c.w = l
c.u = l
c.y = l
c.q = d
j.v = l
j.w = l
j.y = l
j.u = m
j.q = c
g.q = d
assert m.v.w.t.q.q.q.u.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: D = None
        self.q: A = None
        self.v: B = None
        self.txt = txt

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

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

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

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

m = A("m")
a = B("a")
h = C("h")
i = D("i")
d = E("d")
l = A("l")
c = E("c")
j = E("j")
g = C("g")

m.o = l
m.q = l
m.x = i
m.v = a
a.w = i
h.q = c
i.z = l
i.q = a
i.x = a
i.w = m
i.t = h
d.v = m
d.w = m
d.u = m
d.y = l
d.q = j
l.o = m
l.q = m
l.x = i
l.v = a
c.v = m
c.w = l
c.u = l
c.y = l
c.q = d
j.v = l
j.w = l
j.y = l
j.u = m
j.q = c
g.q = d
assert m.v.w.t.q.q.q.u.o.v.txt == "a"