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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: E = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: E = None
        self.z: F = None
        self.txt = txt

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

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

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