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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: E = None
        self.y: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: B = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: G = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: B = None
        self.t: G = None
        self.y: H = None
        self.txt = txt

m = A("m")
f = B("f")
h = C("h")
n = D("n")
e = E("e")
j = F("j")
k = G("k")
l = H("l")
c = I("c")
b = H("b")

m.y = h
m.w = k
f.q = n
f.w = e
f.y = l
h.y = k
n.r = c
e.w = k
e.r = f
e.z = m
e.p = h
j.w = l
j.o = k
j.v = m
j.p = n
k.s = n
k.x = f
k.t = f
k.v = f
k.y = e
k.u = h
k.r = b
k.p = c
l.o = m
l.t = m
l.y = c
l.z = f
l.p = n
l.q = j
c.w = n
c.v = f
c.t = k
c.y = b
b.o = m
b.t = m
b.y = c
b.z = f
b.p = n
b.q = j
assert k.s.r.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: E = None
        self.y: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: B = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: G = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: B = None
        self.t: G = None
        self.y: H = None
        self.txt = txt

m = A("m")
f = B("f")
h = C("h")
n = D("n")
e = E("e")
j = F("j")
k = G("k")
l = H("l")
c = I("c")
b = H("b")

m.y = h
m.w = k
f.q = n
f.w = e
f.y = l
h.y = k
n.r = c
e.w = k
e.r = f
e.z = m
e.p = h
j.w = l
j.o = k
j.v = m
j.p = n
k.s = n
k.x = f
k.t = f
k.v = f
k.y = e
k.u = h
k.r = b
k.p = c
l.o = m
l.t = m
l.y = c
l.z = f
l.p = n
l.q = j
c.w = n
c.v = f
c.t = k
c.y = b
b.o = m
b.t = m
b.y = c
b.z = f
b.p = n
b.q = j
assert k.s.r.y.z.txt == "f"