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

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.s: D = None
        self.t: D = None
        self.txt = txt

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

a = A("a")
m = B("m")
d = C("d")
h = D("h")
k = E("k")
c = C("c")
g = A("g")
b = D("b")
l = D("l")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.s: D = None
        self.t: D = None
        self.txt = txt

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

a = A("a")
m = B("m")
d = C("d")
h = D("h")
k = E("k")
c = C("c")
g = A("g")
b = D("b")
l = D("l")

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