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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: C = None
        self.q: H = None
        self.o: H = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: H = None
        self.z: I = None
        self.v: D = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: B = None
        self.v: C = None
        self.z: B = None
        self.p: I = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: A = None
        self.v: H = None
        self.y: B = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.t: I = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.r: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: C = None
        self.q: H = None
        self.o: H = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: H = None
        self.z: I = None
        self.v: D = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: B = None
        self.v: C = None
        self.z: B = None
        self.p: I = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: A = None
        self.v: H = None
        self.y: B = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.t: I = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.r: F = None
        self.txt = txt

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

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