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

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

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

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

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

l.w = c
l.p = c
l.s = j
l.r = a
c.w = m
c.t = j
c.z = a
c.s = l
j.r = i
a.t = i
a.u = e
a.x = g
a.v = d
m.w = i
m.p = i
m.s = j
m.r = b
g.t = c
g.u = a
g.x = e
g.v = l
e.t = i
e.u = a
e.x = b
e.v = l
i.w = m
i.t = j
i.z = g
i.s = l
d.w = c
d.p = c
d.s = j
d.r = a
b.t = i
b.u = e
b.x = g
b.v = m
assert a.u.t.s.r.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.s: C = None
        self.r: D = None
        self.txt = txt

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

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

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

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

l.w = c
l.p = c
l.s = j
l.r = a
c.w = m
c.t = j
c.z = a
c.s = l
j.r = i
a.t = i
a.u = e
a.x = g
a.v = d
m.w = i
m.p = i
m.s = j
m.r = b
g.t = c
g.u = a
g.x = e
g.v = l
e.t = i
e.u = a
e.x = b
e.v = l
i.w = m
i.t = j
i.z = g
i.s = l
d.w = c
d.p = c
d.s = j
d.r = a
b.t = i
b.u = e
b.x = g
b.v = m
assert a.u.t.s.r.t.z.txt == "g"