class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: B = None
        self.s: D = None
        self.v: D = None
        self.w: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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