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

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

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

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

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

b = A("b")
g = B("g")
k = C("k")
h = D("h")
i = E("i")
l = E("l")
d = B("d")

b.u = l
b.y = l
b.z = h
b.w = k
g.r = l
g.w = l
g.o = k
g.t = k
g.q = b
k.p = h
k.o = h
h.z = b
h.r = g
h.s = l
h.u = k
h.v = d
i.s = d
i.w = k
i.p = k
i.o = l
l.s = g
l.w = k
l.p = k
l.o = i
d.r = i
d.o = k
d.t = k
d.w = l
d.q = b
assert k.p.u.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.y: E = None
        self.w: C = None
        self.txt = txt

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

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

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

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

b = A("b")
g = B("g")
k = C("k")
h = D("h")
i = E("i")
l = E("l")
d = B("d")

b.u = l
b.y = l
b.z = h
b.w = k
g.r = l
g.w = l
g.o = k
g.t = k
g.q = b
k.p = h
k.o = h
h.z = b
h.r = g
h.s = l
h.u = k
h.v = d
i.s = d
i.w = k
i.p = k
i.o = l
l.s = g
l.w = k
l.p = k
l.o = i
d.r = i
d.o = k
d.t = k
d.w = l
d.q = b
assert k.p.u.o.s.txt == "l"