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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.txt = txt

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

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