class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: G = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: G = None
        self.w: G = None
        self.q: F = None
        self.u: A = None
        self.p: F = None
        self.y: G = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: G = None
        self.u: A = None
        self.t: G = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: F = None
        self.z: B = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.q: E = None
        self.v: F = None
        self.s: F = None
        self.w: B = None
        self.txt = txt

n = A("n")
k = B("k")
m = C("m")
f = D("f")
j = E("j")
d = F("d")
e = G("e")
g = H("g")

n.o = m
n.p = e
n.t = e
k.s = m
k.z = e
k.w = e
k.y = e
k.t = e
k.q = d
k.p = d
k.u = n
m.q = g
m.w = e
m.t = e
m.u = n
m.r = j
f.o = n
j.p = d
j.x = f
j.v = f
j.z = m
j.s = m
j.w = g
d.s = m
d.p = j
e.u = d
e.w = d
e.z = k
e.y = k
e.t = f
g.p = j
g.q = j
g.z = k
g.w = k
g.v = d
g.s = d
assert n.t.z.t.t.o.p.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: G = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: G = None
        self.w: G = None
        self.q: F = None
        self.u: A = None
        self.p: F = None
        self.y: G = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: G = None
        self.u: A = None
        self.t: G = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: F = None
        self.z: B = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.q: E = None
        self.v: F = None
        self.s: F = None
        self.w: B = None
        self.txt = txt

n = A("n")
k = B("k")
m = C("m")
f = D("f")
j = E("j")
d = F("d")
e = G("e")
g = H("g")

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