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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: D = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

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

b = A("b")
c = B("c")
i = C("i")
l = D("l")
m = B("m")
g = C("g")
e = D("e")
a = C("a")

b.w = e
c.t = b
c.y = a
i.t = b
i.u = b
i.y = l
i.s = l
l.t = c
l.o = m
l.z = a
l.r = e
m.t = b
m.y = g
g.t = b
g.u = b
g.y = l
g.s = e
e.t = m
e.o = c
e.z = i
e.r = l
a.t = b
a.u = b
a.y = e
a.s = l
assert g.s.r.t.t.w.z.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: D = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

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

b = A("b")
c = B("c")
i = C("i")
l = D("l")
m = B("m")
g = C("g")
e = D("e")
a = C("a")

b.w = e
c.t = b
c.y = a
i.t = b
i.u = b
i.y = l
i.s = l
l.t = c
l.o = m
l.z = a
l.r = e
m.t = b
m.y = g
g.t = b
g.u = b
g.y = l
g.s = e
e.t = m
e.o = c
e.z = i
e.r = l
a.t = b
a.u = b
a.y = e
a.s = l
assert g.s.r.t.t.w.z.u.w.txt == "e"