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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: A = None
        self.o: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: A = None
        self.o: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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