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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: D = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.r: D = None
        self.x: F = None
        self.z: B = None
        self.y: D = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: C = None
        self.z: G = None
        self.t: G = None
        self.txt = txt

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

f = A("f")
i = B("i")
e = C("e")
a = D("a")
d = E("d")
h = F("h")
m = G("m")
n = A("n")
j = E("j")
k = D("k")

f.z = a
i.y = n
i.s = n
i.p = n
i.v = f
i.o = a
e.z = j
e.q = a
e.s = h
a.p = d
a.q = k
a.r = k
a.y = k
a.x = h
a.s = h
a.z = i
d.q = m
h.x = k
h.o = e
h.z = m
h.t = m
m.r = i
n.z = k
j.q = m
k.p = d
k.q = a
k.r = a
k.y = a
k.x = h
k.s = h
k.z = i
assert k.s.z.r.s.z.y.z.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: D = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.r: D = None
        self.x: F = None
        self.z: B = None
        self.y: D = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: C = None
        self.z: G = None
        self.t: G = None
        self.txt = txt

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

f = A("f")
i = B("i")
e = C("e")
a = D("a")
d = E("d")
h = F("h")
m = G("m")
n = A("n")
j = E("j")
k = D("k")

f.z = a
i.y = n
i.s = n
i.p = n
i.v = f
i.o = a
e.z = j
e.q = a
e.s = h
a.p = d
a.q = k
a.r = k
a.y = k
a.x = h
a.s = h
a.z = i
d.q = m
h.x = k
h.o = e
h.z = m
h.t = m
m.r = i
n.z = k
j.q = m
k.p = d
k.q = a
k.r = a
k.y = a
k.x = h
k.s = h
k.z = i
assert k.s.z.r.s.z.y.z.o.z.txt == "i"