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

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

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

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

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

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

c.w = i
c.p = h
c.z = a
c.q = l
c.t = g
i.s = a
i.r = l
i.w = l
i.p = l
i.t = g
h.p = l
h.q = c
h.s = g
l.w = g
l.p = h
l.v = h
l.s = i
l.t = c
g.z = h
g.s = i
g.o = c
f.s = a
f.r = l
f.w = l
f.p = l
f.t = g
a.w = f
a.p = h
a.z = c
a.q = l
a.t = g
assert c.w.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: C = None
        self.z: A = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

c.w = i
c.p = h
c.z = a
c.q = l
c.t = g
i.s = a
i.r = l
i.w = l
i.p = l
i.t = g
h.p = l
h.q = c
h.s = g
l.w = g
l.p = h
l.v = h
l.s = i
l.t = c
g.z = h
g.s = i
g.o = c
f.s = a
f.r = l
f.w = l
f.p = l
f.t = g
a.w = f
a.p = h
a.z = c
a.q = l
a.t = g
assert c.w.s.w.txt == "f"