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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

m.v = b
m.w = c
m.u = l
m.t = l
l.y = c
c.u = k
c.r = b
c.s = l
g.o = l
k.w = g
b.w = g
h.v = b
h.w = c
h.u = l
h.t = l
assert m.v.w.o.y.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: C = None
        self.u: B = None
        self.t: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

m.v = b
m.w = c
m.u = l
m.t = l
l.y = c
c.u = k
c.r = b
c.s = l
g.o = l
k.w = g
b.w = g
h.v = b
h.w = c
h.u = l
h.t = l
assert m.v.w.o.y.r.w.txt == "g"