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

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

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

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

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

f = A("f")
a = B("a")
c = C("c")
h = D("h")
e = E("e")
m = A("m")
n = D("n")
d = E("d")
g = E("g")
l = C("l")

f.y = n
f.w = a
f.q = d
a.w = c
c.o = n
h.z = a
h.t = l
h.o = g
e.v = n
e.p = h
e.q = h
e.w = c
m.y = n
m.w = a
m.q = g
n.z = a
n.t = l
n.o = e
d.v = n
d.q = n
d.p = h
d.w = c
g.v = h
g.p = h
g.q = h
g.w = l
l.o = h
assert l.o.t.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.q: E = None
        self.txt = txt

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

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

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

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

f = A("f")
a = B("a")
c = C("c")
h = D("h")
e = E("e")
m = A("m")
n = D("n")
d = E("d")
g = E("g")
l = C("l")

f.y = n
f.w = a
f.q = d
a.w = c
c.o = n
h.z = a
h.t = l
h.o = g
e.v = n
e.p = h
e.q = h
e.w = c
m.y = n
m.w = a
m.q = g
n.z = a
n.t = l
n.o = e
d.v = n
d.q = n
d.p = h
d.w = c
g.v = h
g.p = h
g.q = h
g.w = l
l.o = h
assert l.o.t.o.o.txt == "g"