class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: E = None
        self.p: E = None
        self.u: H = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: H = None
        self.x: A = None
        self.p: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: G = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: A = None
        self.r: F = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.v: A = None
        self.u: D = None
        self.x: H = None
        self.t: E = None
        self.w: A = None
        self.s: C = None
        self.txt = txt

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

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

d = A("d")
k = B("k")
n = C("n")
a = D("a")
f = E("f")
b = F("b")
c = G("c")
m = H("m")
h = A("h")
l = B("l")

d.r = f
d.q = f
d.p = f
d.u = m
d.z = m
k.o = n
k.s = m
k.x = h
k.p = f
k.u = f
n.q = a
n.x = c
n.o = b
a.y = n
a.t = h
a.r = b
a.u = f
f.s = d
b.z = f
b.t = f
b.r = n
b.s = n
b.v = d
b.u = a
b.x = m
b.w = h
c.v = n
c.s = m
m.w = n
m.v = n
m.o = a
m.p = c
m.s = l
m.r = f
m.u = k
h.r = f
h.q = f
h.p = f
h.u = m
h.z = m
l.o = n
l.s = m
l.x = h
l.p = f
l.u = f
assert k.s.o.r.z.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: E = None
        self.p: E = None
        self.u: H = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: H = None
        self.x: A = None
        self.p: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: G = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: A = None
        self.r: F = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.v: A = None
        self.u: D = None
        self.x: H = None
        self.t: E = None
        self.w: A = None
        self.s: C = None
        self.txt = txt

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

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

d = A("d")
k = B("k")
n = C("n")
a = D("a")
f = E("f")
b = F("b")
c = G("c")
m = H("m")
h = A("h")
l = B("l")

d.r = f
d.q = f
d.p = f
d.u = m
d.z = m
k.o = n
k.s = m
k.x = h
k.p = f
k.u = f
n.q = a
n.x = c
n.o = b
a.y = n
a.t = h
a.r = b
a.u = f
f.s = d
b.z = f
b.t = f
b.r = n
b.s = n
b.v = d
b.u = a
b.x = m
b.w = h
c.v = n
c.s = m
m.w = n
m.v = n
m.o = a
m.p = c
m.s = l
m.r = f
m.u = k
h.r = f
h.q = f
h.p = f
h.u = m
h.z = m
l.o = n
l.s = m
l.x = h
l.p = f
l.u = f
assert k.s.o.r.z.s.z.txt == "m"