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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: B = None
        self.p: B = None
        self.o: I = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: B = None
        self.s: E = None
        self.y: E = None
        self.x: D = None
        self.r: E = None
        self.u: H = None
        self.o: B = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: E = None
        self.v: B = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: F = None
        self.w: G = None
        self.z: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: B = None
        self.p: B = None
        self.o: I = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: B = None
        self.s: E = None
        self.y: E = None
        self.x: D = None
        self.r: E = None
        self.u: H = None
        self.o: B = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: E = None
        self.v: B = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: F = None
        self.w: G = None
        self.z: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: B = None
        self.txt = txt

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

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

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