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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: G = None
        self.r: B = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: G = None
        self.r: B = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

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