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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: G = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: B = None
        self.z: B = None
        self.v: G = None
        self.w: B = None
        self.p: G = None
        self.u: G = None
        self.q: H = None
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: G = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: B = None
        self.z: B = None
        self.v: G = None
        self.w: B = None
        self.p: G = None
        self.u: G = None
        self.q: H = None
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: E = None
        self.txt = txt

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

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

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

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