class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: B = None
        self.o: E = None
        self.w: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: B = None
        self.z: A = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.p: G = None
        self.u: D = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: G = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: I = None
        self.y: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: B = None
        self.z: A = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.p: G = None
        self.u: D = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: G = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: I = None
        self.y: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: G = None
        self.txt = txt

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

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