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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: H = None
        self.v: H = None
        self.y: D = None
        self.x: I = None
        self.q: D = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: H = None
        self.v: H = None
        self.y: D = None
        self.x: I = None
        self.q: D = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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