class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: B = None
        self.u: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: E = None
        self.v: C = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

c.o = f
c.t = g
c.s = g
c.u = a
g.q = a
g.o = m
g.x = m
g.v = n
g.z = n
n.w = f
n.t = g
n.p = g
n.y = l
f.p = m
f.o = m
m.w = l
a.w = f
a.t = g
a.p = g
a.y = l
l.w = m
b.o = f
b.t = g
b.s = g
b.u = a
assert b.o.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: B = None
        self.u: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: E = None
        self.v: C = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

c.o = f
c.t = g
c.s = g
c.u = a
g.q = a
g.o = m
g.x = m
g.v = n
g.z = n
n.w = f
n.t = g
n.p = g
n.y = l
f.p = m
f.o = m
m.w = l
a.w = f
a.t = g
a.p = g
a.y = l
l.w = m
b.o = f
b.t = g
b.s = g
b.u = a
assert b.o.o.w.txt == "l"