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

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

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

e = A("e")
m = B("m")
d = C("d")
n = A("n")
g = B("g")
h = C("h")
k = B("k")
i = C("i")

e.x = n
e.y = n
e.t = n
m.y = k
m.p = h
d.z = n
d.x = n
d.v = g
n.x = e
n.y = e
n.t = e
g.y = k
g.p = h
h.z = n
h.x = n
h.v = m
k.y = m
k.p = i
i.z = e
i.x = n
i.v = g
assert m.y.p.z.y.y.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: A = None
        self.t: A = None
        self.txt = txt

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

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

e = A("e")
m = B("m")
d = C("d")
n = A("n")
g = B("g")
h = C("h")
k = B("k")
i = C("i")

e.x = n
e.y = n
e.t = n
m.y = k
m.p = h
d.z = n
d.x = n
d.v = g
n.x = e
n.y = e
n.t = e
g.y = k
g.p = h
h.z = n
h.x = n
h.v = m
k.y = m
k.p = i
i.z = e
i.x = n
i.v = g
assert m.y.p.z.y.y.x.x.x.txt == "n"