class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: H = None
        self.x: I = None
        self.w: I = None
        self.t: G = None
        self.v: G = None
        self.s: B = None
        self.o: H = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.u: E = None
        self.v: F = None
        self.x: G = None
        self.w: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: H = None
        self.x: I = None
        self.w: I = None
        self.t: G = None
        self.v: G = None
        self.s: B = None
        self.o: H = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.u: E = None
        self.v: F = None
        self.x: G = None
        self.w: H = None
        self.txt = txt

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

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