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

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

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

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

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

b = A("b")
f = B("f")
k = C("k")
d = D("d")
a = E("a")
c = A("c")
l = C("l")
n = D("n")
m = A("m")

b.z = d
b.s = d
f.p = a
f.y = l
f.q = c
k.y = f
k.z = f
k.p = b
k.w = a
d.x = c
d.r = a
d.t = f
d.z = b
a.o = m
a.z = f
a.w = f
a.y = f
a.x = f
c.z = d
c.s = n
l.y = f
l.z = f
l.p = c
l.w = a
n.x = c
n.r = a
n.t = f
n.z = b
m.z = n
m.s = d
assert k.p.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

b = A("b")
f = B("f")
k = C("k")
d = D("d")
a = E("a")
c = A("c")
l = C("l")
n = D("n")
m = A("m")

b.z = d
b.s = d
f.p = a
f.y = l
f.q = c
k.y = f
k.z = f
k.p = b
k.w = a
d.x = c
d.r = a
d.t = f
d.z = b
a.o = m
a.z = f
a.w = f
a.y = f
a.x = f
c.z = d
c.s = n
l.y = f
l.z = f
l.p = c
l.w = a
n.x = c
n.r = a
n.t = f
n.z = b
m.z = n
m.s = d
assert k.p.s.t.txt == "f"