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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: B = None
        self.r: D = None
        self.txt = txt

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

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

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

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

n.r = h
n.u = g
n.t = b
n.v = b
h.p = f
h.u = d
h.r = b
g.s = b
g.z = b
f.s = k
f.w = m
f.v = g
f.o = i
f.u = d
e.q = g
e.o = m
d.p = b
d.r = b
d.u = h
b.s = n
b.w = e
b.v = g
b.o = g
b.u = d
m.q = g
m.o = e
k.r = d
k.u = g
k.t = f
k.v = f
i.s = b
i.z = f
assert e.q.s.s.u.s.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: C = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: B = None
        self.r: D = None
        self.txt = txt

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

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

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

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

n.r = h
n.u = g
n.t = b
n.v = b
h.p = f
h.u = d
h.r = b
g.s = b
g.z = b
f.s = k
f.w = m
f.v = g
f.o = i
f.u = d
e.q = g
e.o = m
d.p = b
d.r = b
d.u = h
b.s = n
b.w = e
b.v = g
b.o = g
b.u = d
m.q = g
m.o = e
k.r = d
k.u = g
k.t = f
k.v = f
i.s = b
i.z = f
assert e.q.s.s.u.s.o.s.txt == "b"