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

class B:
    def __init__(self, txt: str):
        self.z: A = 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.u: B = None
        self.z: A = None
        self.s: C = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = 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.u: B = None
        self.z: A = None
        self.s: C = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

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

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

n.s = b
n.z = f
n.w = g
n.y = c
f.z = g
b.q = d
a.u = e
a.z = n
a.x = n
a.s = b
a.o = c
m.q = d
m.x = b
m.y = b
e.z = n
g.s = b
g.z = f
g.w = n
g.y = a
c.u = f
c.z = g
c.x = g
c.s = b
c.o = a
d.q = m
d.x = b
d.y = b
assert a.o.s.q.x.q.q.q.q.x.txt == "b"