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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.u: D = None
        self.txt = txt

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

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

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

k = A("k")
e = B("e")
c = C("c")
l = D("l")
a = E("a")
f = C("f")

k.p = a
k.q = a
k.s = e
k.o = c
k.x = l
e.r = c
e.z = c
e.u = l
c.y = a
c.q = e
l.s = k
l.y = f
a.y = c
a.r = l
a.z = l
a.o = e
f.y = a
f.q = e
assert e.u.s.q.y.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: B = None
        self.o: C = None
        self.x: D = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.u: D = None
        self.txt = txt

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

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

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

k = A("k")
e = B("e")
c = C("c")
l = D("l")
a = E("a")
f = C("f")

k.p = a
k.q = a
k.s = e
k.o = c
k.x = l
e.r = c
e.z = c
e.u = l
c.y = a
c.q = e
l.s = k
l.y = f
a.y = c
a.r = l
a.z = l
a.o = e
f.y = a
f.q = e
assert e.u.s.q.y.y.r.txt == "l"