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

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

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

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

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

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

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

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

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

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

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

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

i.w = l
i.s = l
i.v = h
i.y = c
i.r = k
m.p = g
m.v = f
m.w = i
c.o = f
c.s = f
c.x = l
c.z = d
c.r = a
g.p = a
g.z = k
l.p = m
l.q = i
f.o = c
f.s = c
f.x = l
f.z = d
f.r = g
k.p = g
k.z = g
h.p = k
h.v = f
h.w = i
a.p = k
a.z = k
d.p = a
d.v = c
d.w = i
assert k.p.p.p.txt == "k"