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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.s: A = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: A = None
        self.x: A = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.z: E = None
        self.u: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.s: A = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: A = None
        self.x: A = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.z: E = None
        self.u: B = None
        self.txt = txt

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

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