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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: H = None
        self.u: D = None
        self.p: A = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: F = None
        self.t: F = None
        self.p: A = None
        self.q: G = None
        self.x: G = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: C = None
        self.p: F = None
        self.s: C = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: H = None
        self.o: B = None
        self.t: B = None
        self.r: D = None
        self.txt = txt

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

h = A("h")
j = B("j")
m = C("m")
i = D("i")
l = E("l")
a = F("a")
f = G("f")
k = H("k")
d = H("d")
g = E("g")

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: H = None
        self.u: D = None
        self.p: A = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: F = None
        self.t: F = None
        self.p: A = None
        self.q: G = None
        self.x: G = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: C = None
        self.p: F = None
        self.s: C = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: H = None
        self.o: B = None
        self.t: B = None
        self.r: D = None
        self.txt = txt

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

h = A("h")
j = B("j")
m = C("m")
i = D("i")
l = E("l")
a = F("a")
f = G("f")
k = H("k")
d = H("d")
g = E("g")

h.z = f
j.z = h
m.w = f
m.q = f
m.z = k
m.u = i
m.p = h
i.s = k
i.y = a
i.t = a
i.p = h
i.q = f
i.x = f
i.r = j
l.y = f
l.r = m
l.s = m
l.p = a
l.o = h
a.z = i
f.p = i
f.r = i
f.w = d
f.o = j
f.t = j
k.p = g
d.p = g
g.y = f
g.r = m
g.s = m
g.p = a
g.o = h
assert j.z.z.p.p.z.txt == "f"