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

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

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

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

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

i = A("i")
k = B("k")
f = C("f")
l = D("l")
c = E("c")
m = C("m")
g = A("g")

i.z = g
i.r = k
i.u = c
i.y = c
k.x = c
k.w = i
f.q = l
f.s = m
l.w = c
l.p = f
c.y = f
c.t = k
m.q = l
m.s = f
g.z = i
g.r = k
g.u = c
g.y = c
assert m.q.w.t.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: B = None
        self.u: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

i = A("i")
k = B("k")
f = C("f")
l = D("l")
c = E("c")
m = C("m")
g = A("g")

i.z = g
i.r = k
i.u = c
i.y = c
k.x = c
k.w = i
f.q = l
f.s = m
l.w = c
l.p = f
c.y = f
c.t = k
m.q = l
m.s = f
g.z = i
g.r = k
g.u = c
g.y = c
assert m.q.w.t.w.z.txt == "g"