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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: B = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

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

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

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

g.s = m
g.y = l
g.o = c
g.w = c
e.z = c
e.u = c
e.y = c
e.v = f
m.w = g
m.o = c
c.p = b
c.t = m
c.o = m
b.w = g
b.o = c
f.z = c
f.u = c
f.y = c
f.v = l
l.z = c
l.u = c
l.y = c
l.v = e
assert e.v.v.z.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.o: D = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: B = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

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

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

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

g.s = m
g.y = l
g.o = c
g.w = c
e.z = c
e.u = c
e.y = c
e.v = f
m.w = g
m.o = c
c.p = b
c.t = m
c.o = m
b.w = g
b.o = c
f.z = c
f.u = c
f.y = c
f.v = l
l.z = c
l.u = c
l.y = c
l.v = e
assert e.v.v.z.p.w.txt == "g"