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

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

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

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

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

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

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

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

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

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

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

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

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