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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: D = None
        self.z: A = None
        self.s: A = None
        self.txt = txt

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

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

e = A("e")
c = B("c")
g = C("g")
d = D("d")
m = E("m")
i = B("i")
l = E("l")
h = D("h")
n = E("n")

e.y = g
c.p = e
c.z = e
g.q = i
g.y = h
g.z = e
g.s = e
d.u = e
d.y = e
d.w = h
d.x = h
d.t = g
m.z = g
m.r = n
m.u = i
i.p = e
i.z = e
l.z = g
l.r = m
l.u = c
h.u = e
h.y = e
h.w = d
h.x = d
h.t = g
n.z = g
n.r = m
n.u = i
assert c.p.y.z.y.q.z.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: D = None
        self.z: A = None
        self.s: A = None
        self.txt = txt

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

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

e = A("e")
c = B("c")
g = C("g")
d = D("d")
m = E("m")
i = B("i")
l = E("l")
h = D("h")
n = E("n")

e.y = g
c.p = e
c.z = e
g.q = i
g.y = h
g.z = e
g.s = e
d.u = e
d.y = e
d.w = h
d.x = h
d.t = g
m.z = g
m.r = n
m.u = i
i.p = e
i.z = e
l.z = g
l.r = m
l.u = c
h.u = e
h.y = e
h.w = d
h.x = d
h.t = g
n.z = g
n.r = m
n.u = i
assert c.p.y.z.y.q.z.y.q.txt == "i"