class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: E = None
        self.s: E = None
        self.o: C = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.r: D = None
        self.w: H = None
        self.x: A = None
        self.q: F = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: B = None
        self.r: H = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: D = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: C = None
        self.z: C = None
        self.s: E = None
        self.r: E = None
        self.u: B = None
        self.x: A = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: E = None
        self.s: E = None
        self.o: C = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.r: D = None
        self.w: H = None
        self.x: A = None
        self.q: F = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: B = None
        self.r: H = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: D = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: C = None
        self.z: C = None
        self.s: E = None
        self.r: E = None
        self.u: B = None
        self.x: A = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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