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

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

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

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

g = A("g")
e = B("e")
a = C("a")
f = D("f")
c = D("c")
n = D("n")

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

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

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

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

g = A("g")
e = B("e")
a = C("a")
f = D("f")
c = D("c")
n = D("n")

g.z = e
g.t = e
g.w = e
g.x = a
e.s = g
e.y = g
e.o = n
a.v = f
a.u = g
a.t = e
f.v = a
f.x = n
f.p = n
f.w = g
c.v = a
c.x = n
c.p = n
c.w = g
n.v = a
n.x = f
n.p = f
n.w = g
assert g.w.o.w.x.u.txt == "g"