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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

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

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

c.w = a
g.v = f
g.s = f
g.t = c
l.y = k
l.p = k
l.z = c
e.x = c
e.u = m
k.x = c
k.u = f
m.v = a
m.t = c
m.s = f
a.v = g
a.t = c
a.s = m
f.v = a
f.s = a
f.t = c
i.y = k
i.p = k
i.z = c
assert a.s.s.t.w.s.v.txt == "a"