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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: A = None
        self.r: F = None
        self.u: C = None
        self.t: D = None
        self.x: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: A = None
        self.r: F = None
        self.u: C = None
        self.t: D = None
        self.x: C = None
        self.z: E = None
        self.txt = txt

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

b.z = k
m.u = h
h.u = m
h.x = d
d.x = h
d.p = b
k.s = b
k.u = n
n.x = g
n.z = a
n.p = a
n.t = m
n.o = i
n.v = k
a.y = d
a.t = d
a.v = b
a.r = n
a.u = h
a.x = h
a.z = k
c.u = h
g.x = h
g.p = b
i.u = h
assert m.u.u.u.x.p.z.txt == "k"