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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: C = None
        self.x: I = None
        self.u: B = None
        self.z: D = None
        self.y: D = None
        self.w: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.t: G = None
        self.w: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: C = None
        self.x: I = None
        self.u: B = None
        self.z: D = None
        self.y: D = None
        self.w: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.t: G = None
        self.w: H = None
        self.txt = txt

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

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