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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.o: E = None
        self.p: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.o: E = None
        self.p: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

l.y = c
m.w = k
m.o = k
m.s = f
m.p = f
m.u = f
e.o = c
e.p = f
e.z = m
c.u = f
c.y = l
k.t = l
k.x = a
f.w = k
f.o = k
f.s = m
f.p = m
f.u = m
a.o = c
a.p = m
a.z = m
b.y = c
assert f.u.p.o.txt == "k"