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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: D = None
        self.u: F = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.s: D = None
        self.y: D = None
        self.q: F = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: E = None
        self.v: E = None
        self.z: C = None
        self.u: B = None
        self.t: H = None
        self.p: E = None
        self.o: I = None
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: D = None
        self.u: F = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.s: D = None
        self.y: D = None
        self.q: F = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: E = None
        self.v: E = None
        self.z: C = None
        self.u: B = None
        self.t: H = None
        self.p: E = None
        self.o: I = None
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

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

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

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