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

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

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

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

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

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

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

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

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

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

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

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

c.s = e
c.y = b
c.q = g
b.y = d
b.s = c
b.p = h
b.v = g
b.u = m
e.v = d
e.t = d
e.y = b
e.z = n
e.w = g
g.q = h
d.q = g
d.x = g
d.w = g
d.u = b
d.y = b
n.q = h
h.q = g
h.x = g
h.w = g
h.u = b
h.y = b
m.q = g
m.x = g
m.w = g
m.u = b
m.y = b
assert b.p.y.y.q.q.txt == "h"