class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: D = None
        self.w: E = None
        self.r: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

n.o = e
n.w = e
n.x = m
n.r = c
n.t = c
b.t = e
b.v = f
f.q = i
m.o = b
e.z = b
e.t = c
e.w = f
e.x = f
e.s = m
c.o = b
k.o = e
k.w = e
k.x = c
k.r = c
k.t = c
i.t = e
i.v = f
g.z = b
g.t = m
g.w = f
g.x = f
g.s = c
l.o = e
l.x = c
l.r = c
l.t = c
l.w = g
assert k.w.s.o.txt == "b"