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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: D = None
        self.r: F = None
        self.p: F = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.s: A = None
        self.u: G = None
        self.z: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: A = None
        self.v: G = None
        self.p: A = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: D = None
        self.r: F = None
        self.p: F = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.s: A = None
        self.u: G = None
        self.z: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: A = None
        self.v: G = None
        self.p: A = None
        self.u: G = None
        self.txt = txt

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

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

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