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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

h = A("h")
c = B("c")
b = C("b")
j = D("j")
n = E("n")
k = F("k")
a = G("a")
f = C("f")
l = D("l")

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

h = A("h")
c = B("c")
b = C("b")
j = D("j")
n = E("n")
k = F("k")
a = G("a")
f = C("f")
l = D("l")

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