class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: F = None
        self.y: E = None
        self.r: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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