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

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

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

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

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

c = A("c")
m = B("m")
h = C("h")
a = D("a")
j = E("j")
i = A("i")

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

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

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

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

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

c = A("c")
m = B("m")
h = C("h")
a = D("a")
j = E("j")
i = A("i")

c.w = i
c.p = m
c.s = h
c.z = a
c.q = a
m.w = h
m.q = h
m.t = a
h.x = m
h.t = m
h.q = j
a.p = h
a.s = j
a.r = m
j.p = c
j.y = h
j.u = a
i.w = c
i.p = m
i.s = h
i.z = a
i.q = a
assert c.z.s.y.t.t.txt == "a"