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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: F = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: A = None
        self.s: C = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: F = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: A = None
        self.s: C = None
        self.v: C = None
        self.txt = txt

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

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